AI Glossary Term

What does “Bi-Encoder” mean?

Definition

A model that encodes queries and documents into separate vectors so they can be compared quickly at scale.

How Bi-Encoder works

Diagram for Bi-Encoder, steps in order: Documents embedded once, stored; then Query embedded at search time; then Compare vectors quickly; then Nearest documents returned.Documents embedded once, storedQuery embedded at search timeCompare vectors quicklyNearest documents returned

Example

A company embeds every document once overnight. When a user types a query, only the query is embedded and compared against the stored vectors, so results arrive in milliseconds.

Why it matters

Bi-encoders make first-stage retrieval fast at scale. They give up some precision compared with cross-encoders.

Common questions

Why 'bi'?

Query and document are encoded separately, often by the same model.

How is it paired with a cross-encoder?

A bi-encoder fetches candidates quickly and a cross-encoder reranks the short list.

Can I precompute everything?

Yes for documents, which is a main advantage.

Learn more in our free guides

Test yourself

See also