deep · 5 min
Reranking
A second, slower model that reads the query and each top result together and re-orders them before they reach the LLM.
updated 27 Sept 2026
Someone searches "John Lennon Yoko Ono album Starting Over". There's a clear right answer: the page for "(Just Like) Starting Over", which has every one of those words in its first two sentences. Vector search ranked it 35th. Keyword search ranked it 45th, behind pages whose titles named both Lennon and Ono. Merged with hybrid search, it sat at 49th out of 200.
So the right page was found. It was just buried. If we only send the top 20 to the model, it never sees it. How does a page that obvious end up at 49?
What the first search can't see
The vector half of the first search uses what's called a bi-encoder. The model turns each document into a vector on its own, ahead of time, and stores it. At query time it embeds the query and finds the nearest stored vectors. That's what makes it fast over millions of documents.
The weak spot is "on its own". Each document's vector was made before anyone asked anything, and the query's vector is made without looking at any document. The model never sees the two side by side, so it can't check how a particular word in the query relates to a particular passage. BM25 has the opposite blind spot: it knows which words match, but not what they mean in the query.
Reading them together
A reranker is usually a cross-encoder. Instead of encoding query and document separately, it feeds both into one model as a single input and gets back one number: how relevant this document is to this query. Since it sees both at once, it can check how the words relate. On the Lennon query, a cross-encoder read the query and the page together and moved it from 49th to first.
The catch is that nothing can be done ahead of time. A cross-encoder makes no vector to store, so every query-document pair needs its own pass through the model, at query time. To feel the difference: comparing every pair among 10,000 sentences with a cross-encoder takes about 50 million passes and roughly 65 hours. A bi-encoder embeds the same 10,000 in about 5 seconds.
So we use both. The cheap search narrows millions of documents down to a candidate list, and the expensive reranker only reads that list. This shape goes back at least to 2019, when a BERT model reranking BM25's top 1,000 results beat the previous best system on a big benchmark by 27%. Anthropic's version in 2024 pulled 150 candidates and kept the top 20. Sending 20 good chunks instead of 150 so-so ones also means the LLM reads less, which saves time and money on the answer.
One thing a reranker can't do: find what isn't in the list. If the right page wasn't among the 200, that's a first-stage problem.
So it always helps?
That's the obvious conclusion, and it's where things get more honest. Anthropic found reranking helped across every domain they tried. In their tests, the share of relevant chunks missing from the top 20 went from 2.9% to 1.9% once a reranker was added.
Qdrant ran a more careful test: four open cross-encoders, five public datasets. The trick was the baseline. Against hybrid search with its default merge settings, the best reranker gained on all five. But against hybrid search with its merge tuned on labelled queries, the picture changed:
Two big gains held up on fresh queries that weren't used to pick the setup. Two small gains didn't. And on one dataset the reranker lost to tuned merging, at every candidate count.
What decided it was fit between the model and the data. Three of the four models cut each query-plus-document at 512 tokens and weren't trained on code. The one that won both real cases reads 1,024 tokens and was trained on a mix that includes code, and it turned a loss on code search into the biggest win in the table. On a dataset whose queries averaged 168 words, the 512-token models lost, because a long query leaves little room for the document. Choosing the model moved results more than any other setting.
So do the two studies disagree? Not really. They had different setups: Anthropic used a hosted reranker and doesn't describe tuning its first stage, while Qdrant used open models against a tuned baseline. Both are real. Together they say: test on your own data.
Testing it before you trust it
Here's a nice move from the Qdrant work. Before trying any reranker, measure the most one could ever help. Take your labelled queries, sort each candidate list perfectly (relevant ones first), and score it. The gap between that and your current order is everything a better ordering could win back. On their datasets, at 200 candidates, the gap was large, but real rerankers only closed part of it.
Then tune the first stage properly (reciprocal rank fusion or your score weights) and make the reranker beat that, not the defaults. A gain over defaults can be one that tuning would have given you for free.
Start with 10 candidates. In their tests, a reranker that lost at 10 still lost at 200, so going deeper doesn't rescue a bad fit. And deeper can hurt: on one dataset, going from 25 to 200 candidates got the answer into the list for more queries but turned the gain into a loss, because the extras pushed good ones out of the top 10. On another, 96% of the gain came by 50 candidates. Go deeper only while it keeps paying.
Check it on queries you didn't tune on, too. A gain on 200 queries can vanish on the next 200, which is exactly what happened to two of the five results above. (Getting labelled queries in the first place is retrieval evaluation.)
And measure the speed on your own hardware. On an Apple M5 Pro CPU, the smallest model Qdrant tried scored 64 to 212 documents a second, depending on length. For 100 candidates, the three smaller models took half a second to five seconds per query. The second search in hybrid search, for comparison, added under 2 ms. A hosted reranker moves that work off your machines; Voyage's current ones, for instance, read up to 32,000 tokens and take up to 1,000 documents per request.
The Lennon page went from 49th to first, and that's real. But it happened on one of the two datasets where reranking clearly won. On your data, you won't know which kind you have until you run the test. What you put in the prompt after that, and in what order, is context engineering.
Further reading
- Passage Re-ranking with BERT, Rodrigo Nogueira and Kyunghyun Cho, 2019. Where the retrieve-then-rerank shape took off. Short and readable.
- Cross-Encoders, Sentence Transformers docs. The clearest explanation of bi-encoders versus cross-encoders, with the 65-hours example.
- When Is a Reranker Worth It?, Dylan Couzon (Qdrant), 2026. The careful test against a tuned baseline, and the Lennon query. Read this before you add one.
- Introducing Contextual Retrieval, Anthropic, 2024. Reranking as one step in a full pipeline, with the latency trade-off.
- Rerankers, Voyage AI docs, updated 2026-09-01. What a hosted reranker offers today.