Bi-Encoder

Also known as: Dual Encoder

Category: NLP / Language Processing

A model architecture that independently encodes queries and documents into dense vectors, enabling fast similarity search through pre-computed document embeddings.

Full Explanation

A bi-encoder (also called a dual encoder) uses two separate encoder networks (often sharing weights) to independently produce dense vector representations of queries and documents. Relevance is computed as the similarity (cosine or dot product) between these vectors. The key advantage is that document embeddings can be pre-computed and indexed, enabling sub-second retrieval over millions of documents using approximate nearest neighbor search. This makes bi-encoders practical for large-scale retrieval, unlike cross-encoders that require processing each pair jointly. Training uses contrastive learning with positive and hard negative examples. Bi-encoders are the foundation of dense retrieval systems and sentence embedding models like Sentence-BERT. While less accurate than cross-encoders for individual relevance judgments, their efficiency makes them essential for first-stage retrieval.

Related Terms

More in NLP / Language Processing

Explore More