ModelRefs / Bi-Encoder — AI Glossary
Bi-Encoder — AI Glossary
A retrieval architecture encoding query and document independently into dense vectors, enabling efficient ANN index pre-computation.
Overview
Bi-encoders (Sentence-BERT, E5, GTE, Nomic Embed) independently encode each document and the query with the same encoder, computing similarity by dot product or cosine similarity. Documents are encoded offline and indexed; queries are encoded at search time in milliseconds. The dominant architecture for scalable dense retrieval.
Reference details
| Topic | rag |
|---|---|
| Also known as | dual encoder, sentence encoder |
| Last reviewed | 2026-06-24 |
Related terms
Example: Why the work happens before the query arrives
A bi-encoder embeds each document once, offline. A million documents means a million forward passes done ahead of time, and at query time exactly one more — encode the query, then compare vectors, which is arithmetic rather than inference. A cross-encoder cannot do this: it reads query and document together, so scoring a million documents means a million forward passes *per query*. That is the whole reason retrieval is two stages. The bi-encoder is not more accurate; it is the only one of the two that can be precomputed.
Commonly confused with
Bi-encoder and cross-encoder are architectures, not quality tiers. The cross-encoder wins on accuracy because it can attend across the pair; the bi-encoder wins on cost because it never has to see the pair. Reranker is the role a cross-encoder plays in a pipeline, and embedding model is the product form of a bi-encoder.
When to use it
Reach for it when:
- First-stage retrieval over any corpus large enough that per-query scoring is impossible
- Clustering, deduplication and classification, where reusable vectors are the point
- Where documents change rarely and queries are frequent — the precompute amortises
Reach for something else when:
- Final ordering of a small candidate set, where a cross-encoder is affordable and better
- Corpora that churn constantly, since every change means re-encoding and re-indexing
- Comparing vectors from two different bi-encoders — separate models, separate spaces
Continue your research
Use these connected ModelRefs sections to compare alternatives, inspect implementation paths, and review the evidence and governance boundaries relevant to Bi-Encoder — AI Glossary.
Frequently asked questions
What is Bi-Encoder?
A retrieval architecture encoding query and document independently into dense vectors, enabling efficient ANN index pre-computation.
Is Bi-Encoder the same as dual encoder?
Yes — dual encoder, sentence encoder are common aliases for Bi-Encoder.
What concepts are related to Bi-Encoder?
Closely related concepts include dense retrieval, late interaction, embedding model.