top of page

Re-ranking in RAG: Was It Worth the Extra Latency?

1 hour ago
12 min read





A RAG system lives or dies on what it retrieves. If the right passage never reaches the language model, the answer will be wrong, however good the model is.


Re-ranking is a popular fix. The system retrieves a larger set of candidate passages, then a second model reads each one alongside the question and puts the best at the top. It often improves relevance. It also adds time to every request, and that time is paid by every user.


This blog explains what re-ranking does, what it costs, when it earns its place, and how to decide for your own system. It reflects the approach of the CodersArts when tuning retrieval for production RAG, and it avoids made-up numbers, because the right answer depends on your data, your questions, and your latency budget.






Re-ranking in RAG at a Glance




What Does a Re-ranker Do?


It takes the candidates found by the first retrieval step and scores each one against the question with a more careful model. The passages are then reordered, and only the top few go to the language model.




Why Does It Cost Extra Latency?


Because every candidate needs its own model pass. Scoring thirty passages takes longer than a single vector lookup, and the time grows with the number of candidates and the size of the model.




When Does It Pay Off?


When many passages look similar, when questions are ambiguous or specific, and when wrong context leads to costly mistakes. It matters less when the corpus is small and clean.




The Short Answer


Test it on your own questions. Keep it if the quality gain is real and the delay fits your users, and cut the cost with fewer candidates, smaller models, and smart skipping when it does not.






How Retrieval Works Without a Re-ranker


To judge the value of a second stage, it helps to see what the first stage does well and where it falls short.




Embedding Search Is Fast but Coarse


A vector search compares the question and each passage as separate points in space. This makes it very fast, even across millions of passages, but each passage is judged without ever seeing the exact question text.




Keyword Search Adds Precision


Keyword methods catch exact terms, such as product codes and names, that embeddings may blur. Many systems combine both in a hybrid search.




Top Results Are Not Always the Best Results


The first stage is tuned for speed and recall. It tends to find the right passage somewhere in the top twenty or fifty, but not always in the top three, which is all the model may see.




Why the Order Matters


Language models weigh the context they receive. Irrelevant or near-miss passages in the top slots can distract the model, waste tokens, and lead to confident wrong answers.






What Re-ranking Adds


A re-ranker reads the question and a passage together, which lets it judge relevance more precisely than a vector comparison can.




Cross-Encoders


The most common type feeds the question and passage into one model and outputs a relevance score. It is more accurate than embedding similarity and much slower.




Late-Interaction and Lightweight Rankers


Some models compare token-level representations or use small distilled networks. They sit between embedding search and full cross-encoders in cost and quality.




LLM-Based Re-ranking


A language model can be asked to order or score candidates. It handles subtle questions well, and it costs the most time and money.




Where It Sits in the Pipeline


Retrieve a wide set, for example the top fifty, re-rank, and pass the top few to the generator. The wider the first set, the more the re-ranker can rescue, and the more time it takes.






Where the Extra Latency Comes From


Latency is the main price of re-ranking, so it helps to see where it comes from.




One Model Pass per Candidate


Each candidate is scored separately. Fifty candidates mean fifty passes, though they can be batched on a GPU.




Passage Length


Longer passages need more computation. Splitting documents into sensible chunks keeps scoring fast.




Model Size


A large cross-encoder can be more accurate and noticeably slower than a small one. Hardware and batching change the picture a great deal.




Network and Queueing


If the re-ranker runs as a separate service or an external API, network time and queueing add to the total.




Impact on the User


A short delay in a background task is hardly noticed. In a live chat or voice assistant, extra seconds are felt immediately, and they affect satisfaction.






When Re-ranking Is Worth It


Re-ranking tends to help most in particular situations.




Large and Repetitive Corpora


When thousands of documents say similar things, such as policies, contracts, or manuals, the first stage often returns many near matches. A re-ranker separates them.




Specific or Multi-Part Questions


Questions that depend on exact conditions, dates, or exceptions need careful matching that embeddings may miss.




Costly Wrong Answers


In legal, medical, financial, and compliance work, a better top result reduces the risk of a harmful mistake.




Small Context Windows or Token Budgets


If only two or three passages can go to the model, the order matters a great deal.




Noisy or Mixed Content


When sources vary in quality, formatting, or language, a stronger relevance judgment filters out distractions.






When It Is Probably Not Worth It


Sometimes the extra stage adds delay without real benefit.




Small, Clean Knowledge Bases


With a few hundred well-structured documents, first-stage search is often good enough.




Strong Hybrid Search Already in Place


A well-tuned combination of keyword and vector search, with good chunking and metadata filters, may leave little for a re-ranker to fix.




Tight Latency Budgets


For real-time voice or very short interactions, even a modest delay can hurt more than slightly worse context.




Retrieval Is Not the Bottleneck


If errors come from poor chunking, missing documents, or weak prompts, re-ranking will not fix them. Look at the failures first.




Simple Lookup Queries


For short queries that match titles or exact terms, the first stage usually finds the answer without help.






How to Decide With Your Own Data


The honest answer to the title question comes from measurement, not opinion.




Build a Test Set of Real Questions


Collect questions from real users or realistic samples, and mark which passages answer them. Include easy, hard, and ambiguous cases.




Measure Retrieval Quality With and Without Re-ranking


Compare whether the right passage appears in the top results and how high it ranks. Our guide on how to measure RAG accuracy covers the methods.




Measure Answer Quality, Not Just Retrieval


Better ranking should lead to better answers. Check correctness, faithfulness to the sources, and refusal behavior when the answer is missing.




Measure Latency at the Percentiles That Matter


Average time hides slow outliers. Track the 95th and 99th percentile, because they define how the slowest requests feel.




Weigh the Gain Against the Cost


Compare the quality improvement with the added delay and compute cost for your use case. A small gain in a high-stakes system may justify more delay than a large gain in a casual one.






A Worked Example: A Policy Assistant


To make this concrete, imagine a hypothetical assistant that answers employee questions about internal policies. This example is illustrative, not a customer case.




The Setup


The knowledge base holds hundreds of policy documents with overlapping wording. The first retrieval step returns the top fifty passages from a hybrid search.




The Problem


For questions about exceptions, such as travel policy for contractors, the right passage often appears in the results but not in the top three. The model sometimes answers from the general rule instead.




The Test


The team builds a test set of real questions, adds a re-ranker on the top thirty candidates, and compares both versions on ranking, answer correctness, and delay.




The Decision


If the re-ranked version places the right passage in the top three much more often, and the added delay stays inside the target, the team keeps it. If the gain is small, they spend the effort on chunking and metadata instead.




The Follow-Up


They watch quality and latency after launch, and revisit the choice as the document set grows.






Ways to Reduce the Latency Cost


If re-ranking helps but slows things down, several techniques recover time.




Re-rank Fewer Candidates


Going from fifty to twenty or thirty often keeps most of the gain with much less time. Test the smallest set that still captures the right passage.




Use a Smaller or Distilled Model


A compact model fine-tuned for ranking can be fast enough for live use and close in quality to a larger one.




Batch and Run on Suitable Hardware


Scoring candidates in batches on a GPU, or with an optimized runtime, cuts per-candidate time.




Shorten Passages


Rank on the most relevant snippet or a trimmed chunk, then pass the full passage to the generator.




Cache Common Queries


Frequent questions can reuse earlier rankings, which removes the delay for the most common cases.




Skip Re-ranking When It Is Not Needed


If the first stage returns a very confident top result, or the query is a simple lookup, send it straight through. Apply the second stage only to uncertain cases.




Run Steps in Parallel


Start other work, such as preparing the prompt or fetching metadata, while the re-ranker runs.






Bringing Re-ranking Into Your RAG System


If your tests say yes, a careful rollout avoids surprises.




Start With a Strong First Stage


Fix chunking, add metadata filters, and tune hybrid search before adding a second stage. A better foundation makes any re-ranker more effective.




Choose a Model Fit for Your Domain


General rankers work well for general text. Specialist content, such as legal or medical text, may benefit from a model tuned on similar material.




Set a Latency Budget


Decide how much time the whole pipeline may take and divide it among stages. The re-ranker must fit inside its share.




Roll Out Gradually


Test on a share of traffic, compare results, and expand when quality and speed hold.




Monitor Continuously


Track ranking quality, answer quality, and latency over time. Content and questions change, and so does the value of the re-ranker.






Common Mistakes With Re-ranking




Adding It Without Measuring


Many teams add a re-ranker because it is popular, and never check whether it helped. The delay is certain, and the benefit is not.




Re-ranking Too Many Candidates


Scoring hundreds of passages multiplies latency for little extra gain.




Ignoring Tail Latency


Average time looks fine while the slowest requests frustrate users.




Fixing the Wrong Problem


If the answer is missing from the knowledge base or poorly chunked, no ranking will find it.




Forgetting to Re-test


A choice that made sense on last year's documents may not fit this year's. Review it as your data changes.






Advantages and Limitations of Re-ranking




Where Re-ranking Delivers the Most Value


Advantage

Details

Better top results

The most relevant passages move to the top of the list.

Cleaner context

Fewer distracting passages reach the language model.

Token savings

Fewer, better passages can replace many weak ones.

Higher trust

More grounded answers reduce visible mistakes.

Flexible tuning

The number of candidates and model size can be adjusted to fit the budget.




What Are the Trade-Offs of Re-ranking?


Limitation

Details

Added latency

Every request pays for the extra model pass.

More infrastructure

A new model or service must be hosted, monitored, and paid for.

Limited by the first stage

It can only reorder what was retrieved. Missing passages stay missing.

Domain mismatch

A general model may rank specialist content poorly.

Extra complexity

Another component means another place for things to break.






How Much Does Re-ranking Cost?


The cost has two parts: compute and effort. Compute depends on the model size, the number of candidates, the traffic volume, and the hardware or API pricing. A small ranker on shared hardware costs little. A large model scoring many candidates for every request adds up quickly at scale.


Effort covers testing, tuning, integration, and monitoring. The most valuable spend is on a good test set, because it shows whether the extra stage earns its keep.


A practical approach is to measure the quality gain and the added cost per thousand requests, then decide whether the trade fits your use case.






Re-ranking Approaches Compared


Teams usually choose among a few options.




No Re-ranker, Better First Stage


Improve chunking, metadata, and hybrid search. This adds no latency and often delivers most of the gain.




A Lightweight Re-ranker


A small, fast model on a modest candidate set. It is a good default for live applications.




A Cross-Encoder Re-ranker


Higher accuracy at higher delay. It suits assistants where quality matters more than speed.




An LLM-Based Re-ranker


Handles subtle questions best and costs the most. It suits low-volume, high-stakes work.




Which Teams Get the Most Value From Re-ranking?


Re-ranking helps teams that:


  • Have large or repetitive document collections

  • Answer specific, high-stakes questions

  • Can afford a small delay in return for quality

  • Already have a solid first stage and a test set

  • Monitor quality and latency in production






Was Re-ranking Actually Worth the Extra Latency?


Sometimes yes, sometimes no, and the only reliable way to know is to test on your own questions. For many systems with large, similar documents and high-stakes answers, a re-ranker improves results enough to justify a modest delay. For small, clean corpora and real-time use, the same stage may add cost without much benefit.


The lesson is to treat re-ranking as a measured decision, not a default. Our RAG development team can test it against your data and recommend the setup that fits your quality and speed targets.






How CodersArts Helps You Tune Retrieval for Production RAG


CodersArts helps businesses build RAG systems that retrieve the right context quickly and reliably.




Retrieval Audits


We review chunking, indexing, and search settings and identify where answers are going wrong.




Test Sets and Evaluation


We build question sets from your real use cases and compare options on quality and latency.




Re-ranker Selection and Tuning


We choose and tune models, candidate counts, and skip rules to fit your budget.




Production Integration


We connect retrieval changes to your pipeline with monitoring and gradual rollout.




Ongoing Support and Maintenance


We watch quality and speed over time and adjust as your content grows.






How Does a CodersArts Retrieval Tuning Engagement Work?


Most engagements follow four stages. A discovery session covers your documents, users, and goals. A baseline stage builds a test set and measures current retrieval quality and latency.


An experiment stage compares options such as hybrid search settings, re-rankers, and candidate counts. A rollout stage ships the best configuration with monitoring. Each stage ends with measured results, so you can decide whether to continue.


Start with a conversation. Email contact@codersarts.com with a short description of your RAG system, and we will suggest where to begin.






Frequently Asked Questions




What Is a Re-ranker in RAG?


A model that reads the question together with each retrieved passage and scores how well it answers the question, so the best passages can be placed first.




How Much Latency Does Re-ranking Add?


It depends on the model size, the number of candidates, passage length, and hardware. Measure it on your own system at the 95th and 99th percentile.




Does Re-ranking Always Improve RAG Answers?


No. It helps when the right passage is retrieved but ranked too low. It cannot fix missing documents, poor chunking, or weak prompts.




How Many Candidates Should I Re-rank?


Start with a modest number, such as twenty to fifty, and test smaller sets. Choose the smallest set that still captures the right passage.




Can I Skip Re-ranking for Some Queries?


Yes. Many systems skip it when the first stage is very confident or the query is a simple lookup, which saves time on easy cases.




What Is the Alternative to Re-ranking?


Improving the first stage with better chunking, metadata filters, and hybrid search often delivers much of the benefit with no added delay.




What Should a Business Evaluate Before Adding a Re-ranker?


Evaluate retrieval failures, the size and similarity of your documents, your latency budget, the stakes of wrong answers, and whether you have a test set to measure the change.






What Services Does CodersArts Offer?


Beyond RAG retrieval tuning and other AI and RAG specific delivery and partnership work, CodersArts offers a wider range of services that agencies, businesses, and individual developers regularly rely on, whether as part of a partnership or on their own.




AI and RAG Development


Custom AI and RAG development, starting from proof of concept through to full production builds, along with broader LLM and generative AI development for businesses building AI-powered products and internal tools.




Consultation


Project consultation for businesses and agencies evaluating an AI or machine learning initiative, helping assess feasibility, recommend the right technical approach, and scope a project before committing to full development.




One-on-One Mentorship


Personalized, expert-led mentorship for developers and teams looking to build hands-on AI, machine learning, or AI engineering skills, with guidance tailored to individual or team goals and current experience level.




Dedicated Team and Team Augmentation


Dedicated AI and machine learning engineering teams, or engineers who work as an extension of an existing in-house or agency team, scaling up or down based on project needs.




Ongoing Support and Maintenance


Post-launch monitoring, optimization, and maintenance for AI and machine learning systems already in production, helping ensure performance and reliability do not degrade over time.




Job Support Services


Remote job support for developers and engineers working on live AI, machine learning, or LLM projects, including pair programming, code reviews, workflow setup, debugging, and help meeting sprint deadlines under expert guidance.




Corporate and Team Training


Structured training and workshops for teams looking to build internal AI and machine learning capability, covering hands-on implementation as well as best practices for evaluation and production readiness.




White-Label and Partnership Delivery


CodersArts also partners with agencies, consultancies, and technology companies to deliver AI and machine learning development on their behalf, whether white-label, co-branded, or embedded alongside an existing team.


Whether you are a business building a RAG assistant, an agency looking for a delivery partner, or a developer seeking hands-on mentorship, CodersArts offers services to support your AI journey.


Reach out at contact@codersarts.com or visit www.codersarts.com to discuss your RAG retrieval tuning or broader AI project.






Continue Exploring Enterprise Resources


If you found this blog helpful, explore more AI, RAG, and enterprise AI resources from CodersArts AI to see how organizations are applying these systems to real world applications.











Comments


bottom of page