← All models · EmbeddingGemma

use case · multi-model

Multi-model: retrieve with EmbeddingGemma, then rerank

The standard production retrieval shape, running entirely on-device. Stage one: EmbeddingGemma embeds every passage and the query and pulls a shortlist by cosine — fast, because each passage was embedded once. Stage two: a BGE cross-encoder reranker reads the query and each shortlisted passage together and re-scores for precision. Watch the order change between the two stages.

1 · EmbeddingGemma (bi-encoder retrieval)

2 · BGE reranker (cross-encoder)

The reranker (~of order 300 MB) loads on demand when you first run the pipeline.

Stage 1 — retrieved by cosine

Stage 2 — reranked (cross-encoder)

Why two stages? The bi-encoder is cheap and scales to millions of passages (each embedded once, offline), but it scores query and passage independently. The cross-encoder is far more precise because it reads them together — but it's too slow to run over a whole corpus, so you only run it on the shortlist. EmbeddingGemma's small vectors make stage one especially cheap on-device.

← Wild · Back to EmbeddingGemma