Define cross-encoder reranking and when it's used
A precision-focused second stage that rescores the first-stage's top-K with a cross-encoder, picking the sharpest top-10 for the LLM consumer.
Picture finding the best lawyer for a case. First you skim a hundred profiles fast, narrow down to the twenty that look promising, and only then do real interviews with those twenty. The skim is cheap and lets you cover everyone. The interview is expensive but tells you who is actually a fit. Reversing the order, doing real interviews with everyone before any skim, would take forever. Retrieval works the same way. A cheap first stage looks at the whole corpus and shortlists the top hundred. A more expensive cross-encoder then reads each shortlisted document together with the query and gives a sharp relevance score. The top ten by that score is what you actually use.
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.
Modern production RAG runs retrieval as a two-stage funnel. The first stage is a bi-encoder that hands back a wide candidate set quickly; the second stage is a cross-encoder reranker that sharpens the ranking on a small number of survivors. The split exists because of a fundamental tradeoff between recall and precision that single-stage retrieval cannot resolve cleanly.
The flashcard's two-line answer captures the mechanics: cross-encoder rescores the bi-encoder's top-K to pick the sharper top-10. The deeper question is why the architecture has this shape and what each stage is doing that the other cannot.
The answer reduces to the difference between independent encoding (bi-encoder) and joint encoding (cross-encoder). Both are transformer models, but they consume the (query, document) pair differently, and that consumption difference is what creates the quality vs latency tradeoff that motivates the two-stage architecture.
What 'cross-encoder' actually means
A bi-encoder takes the query and the document as separate inputs and runs each through the encoder independently. The output is two vectors, one for the query and one for the document, and the relevance score is a similarity function (cosine, dot product) between them. The two sides of the pair never see each other inside the model.
A cross-encoder takes the pair as a single concatenated input, usually with a separator token between query and document. The whole concatenation runs through the transformer in one forward pass, and the relevance score is read from a special token (often [CLS]). Critically, the attention mechanism inside the cross-encoder lets every query token attend to every document token, and vice versa. The model can do explicit term-level comparison rather than relying on whatever similarity falls out of independent embeddings.
This joint encoding is what makes cross-encoders much sharper at fine-grained relevance. They can spot negations (not recommended), scope qualifiers (only for enterprise plans), numeric constraints (over $1M revenue): anything where the relevance signal depends on a specific interaction between a query token and a document token. Bi-encoders frequently miss these because the signal gets averaged into a fixed-dim vector before any comparison happens.
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 is the most-used reranker API in 2026 production RAG, paired with Cohere embed-v4 as the canonical bi-encoder.
- Voyage rerank-2.5 sits behind Anthropic's contextual retrieval recipe, rescoring Voyage v3 embedding results from the top-100 to the top-10.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhy is the cross-encoder typically too expensive to use as the first-stage retriever?
Every (query, doc) pair needs a fresh transformer forward pass with no precomputation possible, because the joint input is unique per query. Over a million-document corpus that is a million forward passes per query, far beyond any production latency budget. Bi-encoders precompute document embeddings at index time, which is what makes them fast at query time.
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.
Confusing a cross-encoder with a bi-encoder. A bi-encoder embeds query and doc separately and compares with cosine. A cross-encoder reads both together in one forward pass.
60 second bullets to scan on the way to the call.
Define the architectural difference between a bi-encoder and a cross-encoder.
Explain the cost asymmetry that justifies running them in two stages.
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.