Reranker (RAG)
A first-pass retriever is built for speed: it casts a wide net over millions of passages and accepts that some of what it hauls in will be junk. A reranker is the second pass that reads the catch properly and decides what actually deserves to reach the model.
Why it scores better than the retrieverA dense retriever is a bi-encoder: it embeds the query and each document separately, so document vectors can be indexed in advance and compared in milliseconds — but the model never sees the question and the passage together. A reranker is a cross-encoder, which concatenates query and candidate into one input and runs a full transformer forward pass over the pair. That joint view catches what a vector dot product misses — a negation, a qualifier, which of two similar entities the question is about. It costs a forward pass per candidate, which is why it is applied to fifty or a hundred passages rather than to the whole index.
What it buys a RAG pipeline- Retrieve broadly, pass narrowly: fetch 100 candidates, rerank, send the top 5 — precision rises without the recall loss of a small top-k.
- Fewer distractor passages in the prompt, which directly reduces confidently wrong answers.
- Shorter context: less to pay for, faster to generate, and the strongest evidence sits where the model attends to it best.
In practice this is a small model you can host yourself — bge-reranker or an MS MARCO cross-encoder through sentence-transformers — or a hosted endpoint such as Cohere Rerank. Skip it and the retriever's ranking becomes the ceiling on answer quality, however capable the generator is.
A reranker is a second-stage scoring model that reorders the passages a retriever returned, keeping only the most relevant for the prompt. It is typically a cross-encoder, reading query and passage together in one forward pass, so it judges relevance far more precisely than the separate embedding comparison that produced the candidates. Retrieving broadly and reranking before generation raises answer accuracy and cuts context length — without one, retrieval ranking caps what the generator can do.
Think about how hiring works. A first pass skims hundreds of applications fast and pulls out thirty that look roughly right. Then someone actually reads those thirty properly and picks the best three. A reranker is that second reader. The quick search that found the candidate passages was built for speed, so it gets the general area right but the order wrong. The reranker is slower and much more careful, which is affordable because it only looks at the shortlist. It matters because an AI assistant can read only a small amount before answering — so what sits at the top of the pile decides the answer.