Real Studios

Reranking for RAG: How It Works and When It Pays Off

Watercolor frame surrounding the article title

Reranking is a second pass over the passages your retriever has already found. A fast first stage pulls a wide shortlist, then a slower and more accurate model reorders it so the best passages reach the language model first. Done well, it is one of the cheapest ways to improve a RAG system. Done carelessly, it adds latency and cost for no measurable gain. This guide covers how it works, which type of reranker to choose, and how to prove it helps on your own data.

TL;DR

  • Reranking reorders retrieved chunks by true relevance to the query before generation. It cannot find documents the retriever missed.
  • Cross-encoders are the dependable default. LLM-based rerankers are powerful but not a magic bullet, and they cost more per query.
  • Measure Recall@k for the retriever and NDCG@k or MRR for the reranker separately, on 30 to 100 real, anonymised queries.
  • Always track latency next to quality. A small ranking gain rarely justifies a slow, expensive step.
  • In the UK, remove personal data from pipelines unless a signed-off DPIA covers it.

Table of Contents

What reranking does in a RAG pipeline

A RAG system answers a question in two broad steps. It retrieves passages from your own content, then asks a language model to answer using those passages. The UK Government's AI Insights note on RAG describes RAG as a pattern that grounds model responses in verifiable, organisation-specific data, which reduces hallucination.

The quality of the answer depends on the quality of the passages. First-stage retrieval is built for speed. It compares a query with thousands or millions of chunks using vector similarity, keyword scoring such as BM25, or both. That speed has a price: the query and each chunk are scored separately, so subtle relevance is missed. A chunk that mentions all the right terms but answers a different question can outrank the one that actually answers it.

Reranking fixes this with two stages:

  1. Retrieve wide. Return a generous shortlist, for example the top 50 chunks.
  2. Rerank narrow. Score each chunk against the query with a more precise model, then pass only the best 3 to 8 to the language model.

The second stage is affordable because it runs on 50 candidates, not 5 million. It also helps the generation step. Fewer, better passages mean fewer tokens in the prompt, less noise for the model to be distracted by, and lower generation cost.

The limit you must understand first: bounded recall

A reranker can only reorder what it is given. If the right chunk never makes it into the shortlist, no reranker can recover it. Practitioner guidance on evaluating rerankers puts the threshold in practical terms: if the relevant chunk is not in the top 50 from the first stage, the reranker cannot save you.

This changes how you debug a weak RAG system. Before adding a reranker, check two things separately:

  • Recall@k: is the correct document inside the shortlist at all?
  • Ranking quality: once it is in the shortlist, does it end up near the top?

If Recall@50 is low, the problem is chunking, embeddings, query handling or the index. A reranker will not help. If Recall@50 is high but the answer still lands at position 20, reranking is exactly the right fix. Teams that skip this diagnosis often buy a reranker to solve a retrieval problem.

Types of reranker

There are three families worth considering. Which one you choose depends on your data, your latency budget and how much engineering you want to own.

Cross-encoders

A cross-encoder reads the query and one candidate passage together and outputs a relevance score. Because the model sees both at once, it captures interactions between the words that a vector comparison misses. This is the standard approach and the usual starting point.

Query and passage scored for reranking

The evidence is encouraging. A 2024 industrial benchmarking study on fine-tuning and deploying rerankers for RAG found that adding a cross-encoder reranker, the NV-RerankQA-Mistral-4B-v3, improved ranking accuracy by around 14% over a pipeline using initial retrieval alone. That is one model on one set of benchmarks, so treat it as an indication of the scale of gain, not a promise for your content.

Cross-encoders can also be tuned. Research on multi-stage fine-tuning of cross-encoder re-rankers from the University of Glasgow shows that these models can be adapted to a task, which matters if your documents use specialist vocabulary.

LLM-based rerankers

Here a general-purpose large language model is prompted to judge or order the candidates. Listwise approaches show the model several passages at once and ask for a ranking. They need little task-specific training and can follow nuanced instructions, such as preferring the most recent policy over an older one.

Research from Glasgow on guiding retrieval with LLM-based listwise rankers reports that an adaptive listwise strategy can improve nDCG@10 by up to 13.23% and recall by 28.02% compared with standard independent reranking, while keeping inference cost consistent. Those are best-case figures from a specific experimental setup.

The caveat is just as important. Recent research from the University of Liverpool on lexical retrieval with cross-encoder reranking notes that LLM reranking is not a magic bullet: fine-tuned ranking models such as RoBERTa-based rerankers often perform more reliably on specific domain tasks. A larger model is not automatically a better ranker for your documents.

LLM-based rerankers — overview diagram

Hosted rerank APIs and open models

You can call a hosted reranking endpoint or run an open model yourself. The trade-off is operational, not conceptual. A hosted endpoint is quick to adopt but sends your passages to a third party, which has data protection consequences covered below. A self-hosted model keeps content in your environment but needs infrastructure, monitoring and updates.

Cross-encoder or LLM reranker: a practical comparison

CriterionCross-encoderLLM-based reranker
Latency per queryLow to moderate, scales with shortlist sizeModerate to high, depends on prompt length and model
Cost to runPredictable, can be self-hostedPer-token cost, grows with shortlist and passage length
Domain adaptationFine-tune on labelled pairsAdapt by prompting, no training needed
Handling instructionsLimitedStrong, for example prefer newer documents
ConsistencyHigh, deterministic scoringCan vary with prompt and model version
Best fitHigh-volume support, search, internal knowledge basesLow-volume, high-value queries needing nuanced judgement

For most UK businesses building a customer or staff-facing assistant, we start with a cross-encoder and only move to an LLM reranker if testing shows a clear gain on real queries.

A lightweight option for small, curated content

Not every RAG system needs a vector database. If your corpus is compact and curated, such as a product manual set, a policy library or a few thousand support articles, the Liverpool study shows a simpler stack can compete. It retrieves candidates with field-weighted BM25 (BM25F), then applies a cross-encoder reranker, and can match the performance of more complex dense-vector setups at a fraction of the computational and architectural cost.

This is worth knowing because it removes an embedding model, a vector store and nearest-neighbour infrastructure from the bill. The reranker does the work of recovering semantic relevance after a cheap keyword stage. It is a good fit when your documents have clear fields such as title, section heading and body, and when users search with terms that appear in the text.

How to add reranking: a step-by-step approach

  1. Build a test set. Collect 30 to 100 real queries from support tickets, search logs or staff questions, with personal data removed. For each, mark which chunks answer it.
  2. Measure the baseline. Record Recall@50 and your current top-5 quality without a reranker.
  3. Widen the first stage. Increase the shortlist to 30 to 100 candidates so the reranker has something to work with.
  4. Add a reranker. Start with an off-the-shelf cross-encoder. Keep the top 3 to 8 results.
  5. Measure again. Compare NDCG@k and MRR before and after, plus end-to-end answer quality.
  6. Record latency and cost. Note the added milliseconds and the cost per thousand queries.
  7. Iterate. Try a different model, a different shortlist size, or fine-tuning only if the first result justifies it.

Keep the steps in this order. Teams that jump to step 4 usually cannot tell whether it worked.

How to evaluate a reranker honestly

Public leaderboard scores are a starting point, not a verdict. The reranker.uk guide on evaluating rerankers with NDCG, MRR and labelled queries makes the case that a model which wins on English news may perform badly on support tickets. The metric that matters is the relative lift against your own data.

Two metrics cover most needs:

  • NDCG@k measures how well the whole ranked list is ordered, rewarding relevant results near the top.
  • MRR measures how high the first correct answer appears. It suits question answering, where one good passage is often enough.

Then add the cost side. The same guidance stresses tracking latency alongside quality, since a minor NDCG gain often fails to justify the extra latency and compute of a complex reranking step in production. A reranker that adds 400 milliseconds to a voice agent is a different proposition from one that adds 400 milliseconds to an overnight report.

For continuing production monitoring, go beyond ranking metrics. The Liverpool paper points to frameworks such as the TRACe metrics for judging whether answers are relevant to the context and grounded in it. The RAGBench benchmark, published as an explainable benchmark for RAG, is the source of that style of evaluation.

Common mistakes

  • Reranking a poor shortlist. Fix retrieval first, as the bounded recall point above shows.
  • Reranking too many candidates. Cost and latency grow with the shortlist. Find the smallest shortlist that keeps Recall high.
  • Passing too many results onward. Sending 20 reranked chunks to the model undoes the benefit. Fewer, better chunks give cleaner answers.
  • Trusting leaderboard scores. Test on your own queries.
  • Ignoring stale content. A reranker will faithfully promote an outdated document if it is the best match. Content governance matters as much as ranking. Training and knowledge teams, for example, can look at tools for detecting content drift in large training libraries so that the sources a RAG system retrieves from stay current and traceable.

Data protection when you rerank in the UK

Reranking sends your passages and users' queries through another model, so it sits inside your data protection scope. The Generative AI Framework for HMG sets out that generative AI must be used lawfully, ethically and responsibly. It is written for government, but it is a sensible benchmark for any UK organisation handling personal data under UK GDPR and the Data Protection Act 2018.

In practice:

  • Remove personal data from the content you index unless the system is designed to process it and a Data Protection Impact Assessment has been signed off.
  • Check where a hosted reranking service processes data and whether your content is used to train its models. The GOV.UK RAG note asks that proprietary or sensitive data is not exposed or used to train public models without consent.
  • Apply the same discipline to test sets. Defra's guidance on keeping data safe is blunt that personal data must be removed from anything put into an AI tool.

For regulated or sensitive material, ask your data protection officer or legal adviser to review the design before launch. Self-hosting an open reranker is often the simplest route to keeping content inside your own environment.

Our perspective

We build RAG systems, voice, chat and email agents for UK businesses, and reranking comes up in almost every engagement. Our view is plain: reranking is worth adding when the evidence says so, and not before.

Most weak assistants we see have a retrieval or content problem, not a ranking problem. Chunks are too large, documents are out of date, or the shortlist is too narrow. We diagnose that first, then add a cross-encoder when Recall is healthy but the right passage sits too low. We only move to an LLM reranker when a test on the client's own queries shows it earns its latency.

We also care about what happens after launch. Query patterns change, documents change, and models change. That is why we build the evaluation set with the client, keep it, and re-run it as part of ongoing support. Working demos in days let you see real numbers on your own content early, before committing to a larger build. You own what we deliver, and we design for GDPR compliance from the first architecture decision.

— Oded

Getting a reranked RAG system built

If you want a RAG agent that answers customers or staff from your own content, we can scope, prototype and deploy it, including the retrieval, reranking and evaluation layers. Our AI agent and integration services cover RAG, voice, chat and email agents. If you want to test the idea quickly, our Rapid MVPs route gets a working demo in front of you in days. Where the assistant has to connect to your CRM, helpdesk or document stores, our AI integrations and enablement work covers that connection and your team's training.

FAQ

Why is reranking needed in RAG?

First-stage retrieval is fast but approximate, so relevant passages often sit below less useful ones. Reranking rescoring the shortlist with a more precise model puts the best evidence in front of the language model. That usually means better answers, a shorter prompt and lower generation cost.

How many documents should I rerank?

There is no universal number. A shortlist of around 50 is a common starting point, and the guidance above notes that a chunk outside the top 50 is beyond rescue. Test smaller and larger shortlists on your own queries, and choose the smallest one that keeps Recall@k high at an acceptable latency.

Is an LLM reranker better than a cross-encoder?

Not necessarily. LLM rerankers can follow nuanced instructions and have shown strong gains in research, but fine-tuned ranking models often prove more reliable on specific domain tasks. They also cost more per query. Compare both on your own labelled queries before deciding.

How do I know if reranking improved my system?

Build a set of 30 to 100 real, anonymised queries with known good passages. Measure Recall@k, NDCG@k and MRR with and without the reranker, and record latency and cost alongside. If the lift is small and the added delay is noticeable, the reranker is not worth keeping.

Can I use reranking with personal data in the UK?

Only with care. Remove personal data from indexed content and test sets unless a signed-off DPIA covers a system designed to process it, and check how any hosted reranker handles your data. Speak to your data protection officer before launch.

Sources

Recommended

All guides