Describe what a 'bi-encoder' is in embedding-based retrieval
A bi-encoder encodes query and document independently into vectors, allowing document vectors to be pre-computed and looked up at query time. This is the architecture that makes vector-DB retrieval possible.
Imagine a giant matchmaking party. The bi-encoder approach: every guest fills out their own profile card ahead of time, and at the party you just compare profile cards to find matches. Fast. The cross-encoder approach: every potential match requires the two people to sit down together, have a conversation, and then someone judges the chemistry. Much more accurate, but you can't pre-compute who you'll match with. Every comparison is its own meeting. Almost every search system you use online runs the first approach, because the second one doesn't scale to millions of guests.
Detailed answer & concept explanation~5 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
Define bi-encoder by independence. State the operational consequence (indexable docs). Contrast with cross-encoder cost model. Mention ColBERT-style late interaction as a middle ground. Close with the two-stage retrieval pattern that combines them.
Real products, models, and research that use this idea.
- OpenAI text-embedding-3-large is a bi-encoder; documents are encoded once and stored in vector DBs.
- Cohere embed-v4 ships symmetric bi-encoders plus a dedicated rerank-3.5 cross-encoder.
- BGE-M3 and Jina v3 are open-source bi-encoders with multilingual support.
- ColBERT and ColBERTv2 demonstrate the late-interaction middle ground: indexable but token-level.
- Production RAG stacks at Perplexity, Glean, and Notion use bi-encoder retrieval plus cross-encoder reranking.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhy are cross-encoders more accurate than bi-encoders despite the same model size?
QWhat does ColBERT change about the bi-encoder vs cross-encoder trade-off?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Defining bi-encoder by what it produces (a vector) without naming the structural property that matters: independent encoding of query and document.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.