Reranking for RAG: what a cross-encoder fixes, and what it can't
Reranking for RAG adds a second pass that reads the question and each retrieved passage together and rescores them, so the best few reach the model; it improves the order of what the first search found, but it cannot recover a passage that search missed or that chunking cut away from its context.
Do I need a reranker for RAG?
Often it helps, and it is cheap to test. Reranking for RAG rescores the candidates your first search returned, and published tests found fewer retrieval failures with it. It cannot add a passage the first search missed, so pull a wider candidate set, chunk on structure, and measure on your own questions.
Two passes: find candidates, then judge them
A vector search embeds the question and every passage separately, then compares the vectors. That is what makes it fast enough for a whole corpus, and also why it is rough: each passage was encoded before anyone asked anything. The Sentence Transformers guide to retrieve and re-rank describes the usual fix. Retrieve a larger list, for example 100 candidates, with keyword or vector search, then pass each candidate and the question through a cross-encoder that reads both at once and returns one relevance score.
The idea is older than most RAG stacks. Nogueira and Cho's Passage Re-ranking with BERT set out the same three stages in 2019: retrieve about a thousand candidates with BM25, rescore them with a heavier model, then hand the top ten or fifty to the answer step. A cross-encoder is too slow to score a whole corpus. Scoring a short list is the job it was built for.
What the published numbers say, and what they don't
Anthropic's Contextual Retrieval write-up is the most cited example of reranking for RAG. The team retrieved the top 150 chunks, reranked them with Cohere's reranker and kept the top 20. Combined with contextual embeddings and contextual BM25, the top-20 retrieval failure rate fell from 5.7% to 1.9% on their datasets. Their conclusion is plain: reranking beat no reranking, the gains stacked with the other techniques, and it adds latency and cost that grow with the number of chunks you rerank.
Model size matters less than people assume. The model card for ms-marco-MiniLM-L6-v2, a 22.7M-parameter cross-encoder, lists 74.30 NDCG@10 on TREC Deep Learning 2019 at about 1,800 documents per second on a V100 GPU. The 12-layer version lists 74.31 at about 960. Those are the publisher's numbers on web-search passages. They are a reason to try the small model first, not a promise about your documents.
A reranker cannot rescue a passage the first pass missed
A reranker only reorders the list it is given. If the right passage is not among the candidates, it will not reach the answer, so recall at the first stage is the ceiling. That is why the examples above pull 100 or 150 candidates to keep 5 or 20.
It also cannot repair a bad cut. In the Beyond Top-K paper, on a 780-page financial report where figures sit well below the headers that give them their units, a hybrid of dense and BM25 search with that same MiniLM cross-encoder reranking the fused list answered 29.4% of questions, behind plain BM25 at 51.0%. That is one document and one benchmark, so don't read it as a rule. Read it as a reminder that when a chunk boundary separates a number from its unit, every candidate is incomplete, and rescoring incomplete passages gives you a well-ordered list of incomplete passages. Chunking strategies and RAG for tables are where that gets fixed.
Give the reranker passages that make sense alone
A cross-encoder scores the text it receives, so each passage has to carry its own meaning. RAG Converter cuts windows of about 256 tokens on paragraph and sentence boundaries, closes a chunk at each heading, and never merges a table with prose. That chunker lives in rusty_rag, part of the pure-Rust stack published by Remade with Rust, so it runs in the tab with no server involved. Each row of `chunks.jsonl` also carries `heading_path` and `section_title` in its metadata. Putting the section title in front of the passage text you send the reranker is a cheap way to give back the context the cut removed, in the same spirit as Anthropic's contextual chunks. It is an option to test, not something we have measured.
Know what your first pass is, too. The free tier's default vectors are a bag-of-words hash: they rank by keyword overlap, not meaning, and the manifest says so. The opt-in semantic model is all-MiniLM-L6-v2. If your candidates come from the hash, the reranker is the first step in the pipeline that reads for meaning, so pull a wider list. Hybrid search covers combining keyword and vector results before any reranking.
Measure it before you keep it
A reranker adds a model call to every question, and where it runs matters. A hosted reranking API receives the question and every candidate passage as readable text, the same exposure covered in zero data retention for RAG. A small cross-encoder like the one above can run on hardware you control instead.
Before you keep it, run a fixed set of questions with known answer passages through the pipeline with and without the reranker, at two or three candidate counts. Record whether the right passage reached the final top-k, and how long each question took. That check is a retrieval evaluation, not a speed benchmark, the difference set out in vector microbenchmarks are not retrieval evals. RAG Converter does not rerank. It gives you the passages, in reading order and labelled with their source and section, that a reranker needs to do its job well, and the browser converter makes them for free without uploading a file.