Why does a RAG system confidently answer with the wrong fact when the right passage was sitting in the database all along? Ask anyone who has shipped a retrieval-augmented generation pipeline and they will tell you the same story: the retriever found the answer, but it buried it at position 34, and the language model never saw it. Reranking is the fix. It is the unglamorous second stage that decides which of your candidate documents actually reach the prompt, and getting it right often matters more than swapping in a bigger embedding model. (What a model fallback should actually do)
What Reranking Actually Does in a RAG Pipeline
A typical RAG pipeline runs in two stages. The first stage is fast and cheap: a bi-encoder turns the query into a vector, compares it against pre-computed document vectors, and returns the top 50 to 1,000 candidates. This is approximate by design. The query and the document never “see” each other, so subtle signals like negation, entity mismatch, or a document that answers a slightly different question get missed.
The second stage is the reranker. It takes the query plus each candidate document and scores them together, then reorders the list so the best passages land in the top 3 to 10 that go into the context window. This retrieve-and-rerank pattern is the standard recipe described in the original dense retrieval work and in the Sentence-Transformers documentation on retrieve and rerank, which lays out the trade-off clearly: cross-encoders are slower but far more accurate than pure vector search.
The practical consequence is simple. If your first stage returns a candidate set that contains the right answer, a good reranker will surface it. If it does not, no reranker can save you. That is why teams tune recall at the candidate stage and precision at the rerank stage, not the other way around.
Cross-Encoders: The Workhorse Reranker

The dominant reranking architecture is the cross-encoder. Instead of embedding query and document separately, a cross-encoder concatenates them into a single input and runs a transformer over the pair. Every query token can attend to every document token, which lets the model judge relevance directly rather than inferring it from two distant vectors.
The foundational result here is monoBERT, which showed that a BERT model scoring query-passage pairs substantially outperformed BM25 on passage ranking. That finding launched an entire family of neural rerankers, and cross-encoders remain the default choice for teams that need predictable latency and strong accuracy.
The cost is real. A cross-encoder runs one forward pass per candidate, so reranking 100 documents means 100 forward passes. That is why production systems batch aggressively, truncate documents to a few hundred tokens, and rerank a candidate set in the dozens rather than the thousands.
Where Cross-Encoders Break Down
Two failure modes show up again and again in practice. First, long documents get truncated, and the relevant sentence gets cut. Teams that dump entire PDFs into the reranker often see worse results than teams that chunk carefully. Second, domain drift: a reranker trained on web search data may underperform on legal contracts or clinical notes until it is fine-tuned or replaced with a domain-tuned model.
Bi-Encoders, Late Interaction, and the Middle Ground
Not every reranker is a cross-encoder. The design space runs from cheap and approximate to expensive and precise.
| Approach | How it scores | Relative cost | Best fit |
|---|---|---|---|
| Bi-encoder dot product | Separate embeddings, cosine similarity | Very low | First-stage retrieval over millions of docs |
| Late interaction (ColBERT) | Token-level vectors compared after encoding | Medium | Large candidate sets needing finer ranking |
| Cross-encoder | Joint encoding of query and document | High | Final reranking of 20 to 100 candidates |
| Listwise LLM reranker | LLM reads a list and outputs an order | Very high | Small candidate sets, high-stakes queries |
Late interaction, introduced with ColBERT, sits in the middle. It encodes query and document separately but keeps a vector per token, then computes a fine-grained matching score. That gives much of the precision of a cross-encoder at a fraction of the cost, which makes it viable as a first-stage retriever or as a mid-tier reranker over a few hundred candidates.
LLM Rerankers: Powerful, Expensive, and Easy to Misuse
The newest entrants are listwise LLM rerankers. Instead of scoring each document independently, the model reads a list of passages and outputs a permutation. RankGPT popularized this approach, and later work refined the prompting and sliding-window strategies needed to handle lists longer than the context window.
These models can capture nuanced relevance judgments that cross-encoders miss, especially for complex or multi-hop questions. But the costs stack up quickly: token usage scales with candidate count times document length, latency is measured in seconds rather than milliseconds, and results are sensitive to prompt phrasing and position bias within the list.
A common mistake is reaching for an LLM reranker as a first fix. In most systems, a well-tuned cross-encoder gets 80 to 90 percent of the accuracy gain at a tiny fraction of the cost. LLM reranking earns its place when the queries are genuinely complex or when the candidate set is already small and the stakes are high.
How to Evaluate a Reranker Before You Ship It
Benchmarks are a starting point, not a verdict. MS MARCO Passage Ranking is the long-standing leaderboard for passage reranking, and BEIR tests zero-shot generalization across diverse retrieval tasks. Both are useful for shortlisting models, but neither tells you how a reranker will behave on your documents.
The evaluation that matters is your own. Build a set of 100 to 300 real queries with labeled relevant passages, then measure nDCG@10 and recall@k before and after reranking. If recall@50 is already low, fix retrieval first. If recall@50 is high but nDCG@10 is poor, the reranker is your lever. (Learning to rank)
A few habits that separate teams who get this right from teams who do not:
- Log the rank position of the gold passage before and after reranking. This tells you exactly how much the reranker is contributing.
- Test with the same chunking strategy you use in production. Reranker quality collapses when chunk sizes shift.
- Measure end-to-end latency, not just model latency. Batching, network hops, and tokenization often dominate.
- Keep a no-rerank baseline running in shadow mode so you can catch regressions when you change models.
Teams that treat model rollout as a process rather than an event tend to avoid the worst surprises; the same discipline applies when deciding when a model release matters to enterprise teams, since a reranker swap is a model change with real downstream effects.
Practical Tuning: What Actually Works
After the architecture decision, most of the wins come from operational details.
Candidate depth. Reranking 50 candidates is usually enough. Pushing to 200 adds latency with diminishing returns unless your first stage is weak. Measure nDCG as you increase depth and stop where the curve flattens.
Document truncation. Most cross-encoders cap input at 512 tokens. Chunk to 200 to 300 tokens with overlap so the reranker sees complete thoughts rather than fragments.
Score calibration. Reranker scores are not probabilities. Do not threshold them as if they were. If you need a cutoff, calibrate on labeled data or use relative ranking instead.
Distillation. If latency is tight, distill a large cross-encoder into a smaller one or into a bi-encoder. You lose some accuracy but often keep most of it.
Fallbacks. Rerankers fail: the model times out, the service degrades, the batch is malformed. A sensible fallback returns the first-stage order rather than an empty result. It is worth thinking through what a model fallback should actually do before you need it at 2 a.m.
One more thing that surprises people: reranking quality often improves more from better chunking than from a better model. A mediocre reranker over clean, self-contained passages beats a state-of-the-art reranker over 2,000-token blobs.
Common Mistakes and How to Avoid Them
The same errors show up across teams. Reranking the wrong candidate set is the most common: if recall@100 is 60 percent, the reranker can only ever see 60 percent of the right answers. Fix retrieval first.
The second is measuring only the final answer. End-to-end accuracy is noisy and slow to evaluate. Track retrieval metrics separately so you know which stage is failing.
The third is ignoring cost per query. A cross-encoder reranking 100 documents at 512 tokens each can add hundreds of milliseconds and real GPU spend. Model the cost at your expected query volume before committing.
The fourth is treating the reranker as static. Query distributions drift, documents change, and a model that worked in January may underperform in June. Schedule periodic re-evaluation, and watch the news for shifts in the retrieval stack that affect your assumptions. (News)
Conclusion
Reranking is where RAG systems earn their accuracy. The first stage casts a wide net; the second stage decides what the language model actually reads. Cross-encoders remain the pragmatic default, late-interaction models offer a useful middle ground, and LLM rerankers are a powerful but costly tool for hard queries. The teams that win are not the ones with the fanciest reranker. They are the ones who measure recall and precision separately, chunk carefully, tune candidate depth to their latency budget, and re-evaluate on a schedule. Start with a strong first stage, add a cross-encoder, measure nDCG@10 on your own queries, and only then consider the expensive options.
Frequently Asked Questions
What is a reranking model in RAG?
A reranking model is a second-stage component that takes a query and a set of candidate documents from a fast retriever, scores each pair for relevance, and reorders the list so the best passages reach the language model’s context window. It trades speed for accuracy.
Do I always need a reranker in a RAG pipeline?
No. If your retrieval already returns the right passage in the top few results and your queries are simple, a reranker may add latency without much gain. Rerankers pay off when candidate sets are large, queries are nuanced, or precision at the top of the list matters.
What is the difference between a cross-encoder and a bi-encoder?
A bi-encoder embeds the query and document separately and compares vectors, which is fast enough for millions of documents. A cross-encoder encodes them jointly so every token can attend to every other token, which is more accurate but requires one forward pass per candidate.
Are LLM rerankers better than cross-encoders?
Not universally. LLM rerankers can capture nuanced relevance and handle complex queries, but they cost far more in tokens and latency and are sensitive to prompt design. For most production systems, a tuned cross-encoder delivers most of the gain at a fraction of the cost.
How many candidates should a reranker process?
Usually 20 to 100. Reranking more candidates improves accuracy only until the first-stage recall curve flattens, and each additional candidate adds latency. Measure nDCG at increasing depths and stop where gains become marginal.
Which metrics should I use to evaluate a reranker?
Track nDCG@10 for ranking quality and recall@k for whether the right passage is even in the candidate set. Evaluate on your own labeled queries rather than public benchmarks alone, since domain-specific performance often diverges sharply from leaderboard results.
Beyond that, track MRR when only the first correct hit matters, and latency percentiles (p50 and p95) so a model that looks cheap on average does not blow your tail budget under load. Pair every offline metric with an online signal such as click-through or answer acceptance, because relevance labels age and user behavior does not. Finally, version your evaluation set alongside the model, so a reranker swap can be compared against a frozen baseline rather than a moving target.







