Retrieval and RAG

RAG Reranking: Selecting Evidence Under a Context Budget

Design RAG reranking around candidate recall, evidence coverage, token budgets, diversity, latency, and clear rules for incomplete or conflicting sources.

· · 7 min read

Prepared with AI research assistance. Sources are linked throughout; worked examples are illustrative unless stated otherwise. Editorial approach.

RAG reranking solves a narrower problem than answer generation: given a query and a retrieved candidate pool, decide which evidence deserves the limited space in the model’s input. A useful pipeline must preserve the facts needed to answer, avoid spending the budget on duplicates, and recognize when the available evidence is insufficient.

The engineering target is therefore not “the highest-scoring five chunks.” It is a compact, authorized evidence set that supports the question’s required claims. The design below is illustrative; its candidate counts, budgets, and timing numbers are hypothetical rather than measured recommendations.

Separate candidate retrieval from final evidence selection

A first-stage retriever searches a large collection efficiently. A second-stage reranker examines a smaller candidate pool more closely. Sentence Transformers documents this retrieve-and-rerank pattern using a bi-encoder or lexical retriever followed by a cross-encoder that processes query–document pairs jointly. The additional comparison work is why the cross-encoder is applied to candidates rather than every document. Retrieve and Re-Rank documentation.

These stages have different failure ceilings. If retrieval omits the relevant exception clause, reranking cannot recover it. If retrieval finds the clause but selection drops it, a better first-stage recall score will not fix the final context. Instrument the boundary between the two.

Preserve candidate identifiers, document versions, section paths, access scope, and source offsets through every stage. Apply authorization before documents leave the trusted retrieval boundary, including before sending them to a hosted reranker. Relevance is never a substitute for permission.

A practical candidate pool can combine lexical and semantic results, deduplicate their identities, and retain retrieval provenance. The ranking-fusion details are covered in hybrid search for RAG agents. Reranking should receive the original question and useful metadata, rather than an unexplained bag of text fragments.

Choose candidate depth using the missing-evidence curve

Let N be the number of candidates scored and B the evidence-token allowance. Increasing N gives the reranker more opportunities to find useful material, but does not increase B. Candidate depth and context length are separate controls.

For an illustrative evaluation, compare N = 20, 50, and 100 while holding the final evidence budget constant. Label the passages necessary to answer each question, including secondary facts such as exceptions or effective dates. For each setting, record whether those passages entered the candidate pool, survived selection, and supported a correct answer.

Inspect where improvements flatten. If increasing N mostly introduces copies of the same policy paragraph, spend effort on retrieval coverage or ingestion structure. If a necessary clause repeatedly appears just outside the cutoff, a deeper pool may earn its latency. Segment the analysis by query type; a lookup and a cross-document comparison have different evidence needs.

Also measure candidate lengths. Fifty short passages and fifty entire manuals create very different scoring workloads. Set explicit limits on total reranker input and individual document size, and record truncation. Silent truncation can turn an apparently poor ranking into an input-processing defect.

Pack evidence for coverage, not only individual scores

Imagine a hypothetical service question: “Can an annual customer cancel after renewal, and which exceptions apply?” Its answer needs a standard rule, the effective policy version, and the exception conditions.

Suppose the evidence allowance is 1,800 tokens after reserving space for instructions, the user request, conversation state, and the answer. The reranked candidates include:

Candidate Tokens Contribution
A 700 Current standard cancellation rule
B 650 Near-duplicate of A from a help page
C 600 Current exceptions and eligibility conditions
D 350 Effective date and change notice
E 500 An older, conflicting policy

Blindly selecting A and B consumes 1,350 tokens while adding little coverage. Selecting A, C, and D uses 1,650 tokens and covers the three required facts. E should remain available for conflict investigation, but its age and authority must be resolved before it informs the answer. These decisions come from the scenario’s evidence requirements, not from fabricated relevance scores.

Implement a selection record that explains each inclusion: which required fact it supports, which source version it represents, and how many tokens it costs. A greedy selector can consider incremental coverage per token, but it should keep related evidence together when a definition, table heading, or exception is necessary to interpret another passage. This is a proposed heuristic, not an optimal-packing guarantee.

Use diversity without discarding necessary agreement

Maximal Marginal Relevance combines query relevance with a penalty for similarity to material already selected. Its original paper develops diversity-aware reranking to reduce redundancy while retaining useful relevance. It provides a conceptual foundation for avoiding five nearly identical passages. Carbonell and Goldstein’s MMR paper.

For this pipeline, apply redundancy handling after basic eligibility and relevance checks. Otherwise, an unrelated document can look attractive merely because it differs from the selected set. Treat source diversity and semantic diversity separately: different URLs may syndicate the same content, while two sections in one authoritative document may cover genuinely different requirements.

Do not penalize all agreement. Two independent records may be necessary to verify a reconciliation, and a current rule plus its explicit exception can share many words. A similarity threshold cannot decide whether a second passage is redundant for the user’s task. Retain document structure and evidence roles alongside embeddings.

Keep compression faithful to the source

Extractive trimming can save context, but a sentence can become misleading when its condition or heading disappears. Keep citation offsets tied to the original document, record any expansion around the selected span, and preserve the document version used for scoring.

Cohere’s current Rerank documentation describes calibrated scores and an optional Context Focus feature that returns relevant spans with original-document offsets. It also notes that broad summaries need fuller document coverage and that tables, forms, and code are harder to split cleanly than prose. These are provider-specific capabilities and limitations, not a promise that extracted spans will preserve every dependency in your corpus. Cohere Rerank documentation.

For the hypothetical cancellation question, an extracted sentence saying “customers are eligible” is insufficient if the previous heading restricts eligibility to a specific plan. Expand the evidence unit or fetch its parent section. For tables, include the row label, column headers, units, and relevant footnotes. Validate this behavior during document ingestion and chunking, rather than relying on the generator to reconstruct missing structure.

Define abstention using answerability evidence

A high relevance score establishes neither completeness nor truth. Even when a provider describes scores as calibrated, validate the decision threshold on your own document distribution and required outcomes. A score about a passage’s usefulness is not automatically the probability that the complete answer is correct.

Use two checks: does the selected material address the question, and does it support every required answer component? In this illustrative system, a missing exception section triggers a bounded follow-up lookup. If the section remains unavailable, the response explains the verified standard rule and states that the exceptions could not be established. It does not convert incomplete retrieval into a universal claim.

Record abstention reasons separately: no relevant candidates, conflicting versions, missing prerequisite facts, or exhausted retrieval time. Each calls for a different fix. A single “low confidence” counter hides whether the problem is search, selection, freshness, or policy interpretation.

Evaluate context order and latency as part of the pipeline

The Lost in the Middle study found position-sensitive performance on its tested long-context retrieval and question-answering tasks. That result motivates testing evidence order; it does not prove the same magnitude of effect for every current model. Lost in the Middle.

Compare your selected set in relevance order, source order, and a task-oriented order that keeps conditions beside the claims they qualify. Keep the set identical when testing ordering, so the experiment isolates position rather than evidence quality.

Measure reranking latency separately from retrieval and generation, including queue time and length-dependent tails. An illustrative 150-millisecond scoring allowance does not help if the request spends 400 milliseconds awaiting admission. Set a shared deadline and a defined fallback: a validated first-stage subset, a narrower answer, or explicit retrieval failure. Never silently describe an unscored fallback as reranked.

Frequently asked questions

Can reranking fix a weak retriever?

Only when the necessary evidence reaches its candidate pool. Track candidate recall separately from final evidence coverage to identify which stage loses the answer.

Should I always select a fixed number of chunks?

A fixed count is easy to operate, but variable chunk lengths and multi-part questions make token and coverage limits more informative. Keep a maximum count as an operational bound alongside those controls.

Is a larger context window enough to remove selection?

It relaxes capacity, but does not establish source authority, remove duplicates, resolve conflicting versions, or guarantee that the generator uses every fact. Evaluate the complete answer pipeline rather than treating input capacity as evidence quality.

Source reference list

RAG
Reranking
Context Engineering
Information Retrieval