When would you reach for a cross-encoder over a bi-encoder?
A cross-encoder scores (query, doc) jointly in one transformer pass; you use it to rerank a small candidate set, never to search the full corpus.
Think of dating apps. The bi-encoder is like writing a one-page profile for every person on the planet, then sorting profiles by how well yours matches at a glance. That is fast but shallow. The cross-encoder is the actual first date: you sit across from one person and pay full attention to the back and forth. Way more accurate, but you only have time for a handful of dates. So you screen with profiles first (bi-encoder retrieves top 50), then go on dates with just the finalists (cross-encoder reranks). The cross-encoder never meets the whole planet.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Embedding-based retrieval is dominant in 2026 because it is fast, indexable, and cheap. But it has a ceiling: the bi-encoder representation compresses everything about a document into a single fixed vector, and that compression loses information. Cross-encoders are the standard remedy.
This deep dive covers what a cross-encoder is at the model level, why it cannot replace a bi-encoder as the first-stage retriever, the two-stage pattern that combines both, the decision rule for when to add one, and the production reranker landscape as of 2026.
Mental model: bi-encoders precompute, cross-encoders interact. You use the first to find the right neighborhood, the second to find the right house.
What a cross-encoder actually is at the model level
The architecture in one paragraph
A cross-encoder is a transformer (typically BERT-family or a distilled variant) that takes the query and a candidate document concatenated as one input, runs full bidirectional self-attention across all tokens of both, and outputs a single scalar relevance score from the CLS position (or a pooling of the final layer).
What it does NOT do
Crucially, the model never produces a separate query vector and a separate document vector. There is no embedding space, no cosine similarity, no ANN index. The score is a learned function of the full token-level interaction between the two texts.
Why that interaction is powerful
With bidirectional attention, every query token can directly attend to every document token. The model sees, for example, that the word 'Java' in the query disambiguates which sense of 'language' in the document is relevant. A bi-encoder cannot do this, because by the time it computes cosine similarity between vectors, the cross-text disambiguation chance has already been compressed away.
This is the source of the quality gap. On hard retrieval benchmarks (BEIR, MTEB reranking), cross-encoders consistently beat bi-encoders by 5 to 20 percent NDCG@10.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
Real products, models, and research that use this idea.
- Cohere rerank-3.5 (2025) is the managed-API default for production reranking in 2026.
- Voyage rerank-2.5 pairs naturally with voyage-3-large embeddings in Anthropic-aligned stacks.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow would you choose between Cohere rerank-3.5, Voyage rerank-2.5, and BGE-reranker-v2-m3 for a new project?
Trade off three axes: latency and cost (self-hosted vs API), multilingual needs (M3 and Cohere lead), and integration with existing embedding choice (Voyage pairs with voyage-3-large).
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Saying you could use a cross-encoder as a first-stage retriever if you precompute scores. You cannot, the query is new at search time, so every pair must be scored fresh.
60 second bullets to scan on the way to the call.
Architectural difference between a bi-encoder and a cross-encoder
Why cross-encoders cannot be first-stage retrievers
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.