Building-block guide · Data and knowledge

Reranking

How to add a second-stage relevance model to the retrieval stack, how deep to rerank, what it costs in latency and money, and when to leave it out.

Draft for review · researched 30 Nov 2026

Contents
  1. At a glance
  2. Scope and where it sits
  3. When to use what
  4. Decision criteria
  5. Reference patterns
  6. Recommended defaults
  7. Anti-patterns
  8. Sizing and cost notes
  9. Security and compliance hooks
  10. Test and eval checklist
  11. Related plan sections and inventory
  12. Unverified or needs review
  13. Sources

At a glance

  • CoE decision (30 November 2026): reranking is required for regulated retrieval, and hosted rerankers may come only from approved vendors. Client-confidential data never goes to a hosted reranker; use a self-hosted one.
  • Rerank by default for knowledge agents. The evidence is consistent: in Microsoft's benchmark a semantic reranker lifted hybrid retrieval from 48.4 to 60.1 NDCG@3 [14], and in Anthropic's tests reranking cut top-20 retrieval failures from 2.9% to 1.9% on top of contextual embeddings and BM25 [15].
  • Start with a cross-encoder over the fused top 50 to 100 and keep the top 5 to 20 (practitioner default). Azure's semantic ranker reranks the top 50 [13]; Anthropic reranked 150 to keep 20 [15].
  • More candidates is not always better. Rerankers improve as they score more documents, then decline and can degrade quality past a point [16]. Plot the depth curve on your golden set and pick the knee.
  • Dedicated rankers are fast; LLM rerankers are slow. Google documents under 100 ms for its ranking API against 1 to 2 seconds for an LLM reranker [12]. Use LLM reranking only for low-volume, high-value or instruction-heavy relevance.
  • Use scores to order, and calibrate any threshold. Reranker scores are not ratios; Cohere advises setting a cut-off from 30 to 50 borderline query-document pairs from your domain [8]. A calibrated threshold is also how an agent says "I found nothing relevant".
  • Filter for permissions before reranking, never after. Anything sent to a hosted reranker has left your boundary, whether or not it is later dropped.
  • Check licences on open rerankers. Some strong open-weight rerankers are non-commercial (for example Jina's v3.5 under CC BY-NC 4.0 [5]); others are Apache 2.0 (BGE reranker v2 m3 [6], Qwen3 rerankers [7]).
  • Skip it when it cannot help: tiny corpora in full context, exact-identifier lookups, or latency budgets that cannot absorb it.

Scope and where it sits

This guide covers second-stage relevance scoring of candidates returned by first-stage retrieval: cross-encoders, hosted reranking APIs, LLM-as-reranker (pointwise and listwise), late-interaction scoring, candidate depth, latency budgets, score thresholds, evidence of quality gains, and when to skip the stage.

In the 10-layer reference architecture (plan section 4) reranking sits in layer 7, Memory and knowledge, between the index and layer 6, Context engineering, where it decides which few chunks earn a place in the context window. A hosted reranker is also an external model call, so it passes through layer 2, the agent gateway, and its model belongs on the layer 5 approved list. In the Anatomy crosswalk it belongs to The library (system 15).

What sits elsewhere:

When to use what

Option Use when Avoid when Cost and latency notes
No reranker Corpus fits in context; exact-identifier lookups; first stage already near-perfect on the golden set Natural-language questions over large corpora Zero added latency; precision rests on first stage
Hosted cross-encoder API Default for most teams; multilingual corpora; no GPU operations wanted Data cannot leave your boundary; extreme volumes Dedicated rankers under 100 ms in Google's documentation [12]; billed per search or per token [9][11]
Search-service built-in reranker You already use a search platform that offers one You need to tune or swap the model Azure reranks the top 50 and scores 0 to 4 [13]; premium, usage-billed
Self-hosted open cross-encoder Residency, high volume, predictable cost No team to run inference Examples: BGE reranker v2 m3 (0.6B, Apache 2.0) [6]; Qwen3 rerankers 0.6B to 8B (Apache 2.0) [7]. Cost is GPU or CPU time
Instruction-following reranker Relevance depends on rules ("prefer the latest policy", "only final contracts") Generic relevance Voyage reports instructions added 8 to 11% NDCG@10 on its tests [10] (vendor-reported)
Listwise small reranker You want cross-document comparison without an LLM Licence or context limits rule it out jina-reranker-v3 scores many documents in one context window, 0.6B parameters, 61.94 nDCG@10 on BEIR (vendor-reported) [4]
LLM pointwise reranker Low volume, high-value queries; graded relevance with reasons High QPS or tight latency One LLM call per candidate or batch; 1 to 2 s added in Google's guidance [12]
LLM listwise reranker (RankGPT style) Complex relevance judgements; small final sets Large candidate sets; strict cost limits Properly instructed LLMs matched or beat supervised rerankers on IR benchmarks; a 440M distilled model beat a 3B supervised model on BEIR [2]
Late-interaction scoring (ColBERT style) You already store token-level vectors; fast rescoring of many candidates Storage is constrained One vector per token; ColBERTv2 compression cuts space 6 to 10x [3]
Cascade (cross-encoder, then LLM on the top few) Mixed workloads with a few hard queries Simple FAQ-style retrieval Pays LLM cost only on 5 to 10 candidates (practitioner default)

Decision criteria

  1. Does the golden set show a gap between recall@50 and precision@5? If the right chunk is usually in the top 50 but not the top 5, a reranker is the fix. If it is not in the top 50 at all, fix chunking, embeddings or hybrid search first; no reranker can promote what was never retrieved.
  2. What is the latency budget per retrieval call? Under about 150 ms for reranking (practitioner default): a dedicated or self-hosted cross-encoder at modest depth. Seconds available (asynchronous research agents): LLM reranking becomes possible [12].
  3. Can query and candidate text leave your boundary? If not: self-hosted open-weight cross-encoder, or a reranker inside your search platform in a pinned region.
  4. Is relevance generic or rule-based? Generic: standard cross-encoder. Rule-based ("most recent version", "jurisdiction matches"): an instruction-following reranker [10], or metadata rules applied after scoring.
  5. How long are the candidates? Rerankers truncate. Cohere's v3.5 and earlier models work in 4,096-token windows, while its v4.0 and v5.0 models handle 32,768 tokens shared between query and document [8]. Chunk to fit, or the reranker scores only the start.
  6. How many languages? Use a reranker with documented multilingual support and test each major language [6][10].
  7. What volume? At millions of queries a month, per-search pricing, per-token pricing and self-hosted GPU cost diverge sharply; model all three (see sizing).
  8. Is the licence compatible with commercial use? Check the model card, not the blog post [5][6].

Reference patterns

1. Retrieve wide, rerank narrow

Problem. First-stage retrieval is tuned for recall and returns many loosely relevant chunks; the context window can hold only a few.

How it works. Hybrid retrieval returns 50 to 100 fused candidates; a cross-encoder reads each query-candidate pair together and scores it; the top 5 to 20 go into the prompt. This is the architecture behind both the Microsoft and Anthropic results [14][15], and it goes back to the first BERT passage reranker, which topped the MS MARCO leaderboard with a 27% relative gain in MRR@10 [1].

candidates = hybrid_search(q, filters=server_side_filters(user), k=100)   # permissions applied here
scored = reranker.score(query=q, documents=[c.text for c in candidates],
                        max_tokens_per_doc=1024)                          # truncate deliberately
top = [c for c, s in sorted(zip(candidates, scored), key=lambda x: -x[1])][:8]

When to use. The default for knowledge agents and RAG (plan section 4A).

Pitfalls. Reranking unauthorised candidates and filtering later; letting the reranker silently truncate long chunks; returning parent documents before reranking (rerank the child chunks, then expand).

2. Candidate depth tuning

Problem. Teams pick a depth (often 100 or 1,000) without measuring, and either waste latency or lose quality.

How it works. For depths of 10, 20, 50, 100 and 200, run the golden set and plot NDCG@10 and recall@5 after reranking against p95 latency and cost. The "Drowning in Documents" study found reranker quality improves with depth at first, then gradually declines and "can even degrade quality beyond a certain limit" [16], so the curve has a knee. Choose the smallest depth within noise of the best score. Anthropic notes that reranking more chunks improves results but adds latency and cost, and advises testing settings for your use case [15].

When to use. At design, after any change of reranker or first-stage retriever, and when the corpus grows substantially.

Pitfalls. Tuning on synthetic queries only; forgetting that billing may count chunks, so longer candidates cost more (Cohere counts a search as one query with up to 100 documents and splits documents over 500 tokens into chunks that count toward the total [9]).

3. Cascade reranking

Problem. A few hard queries need deeper judgement than a cross-encoder gives, but LLM reranking of every candidate on every query is too slow and costly.

How it works. Stage one: cross-encoder over 50 to 100 candidates. Stage two: an LLM reranks only the top 5 to 10, listwise (it sees all candidates together and returns an order, as in RankGPT [2]) or pointwise (graded relevance per candidate with a short reason). Trigger stage two only for queries that need it: low top-score margin, high-risk tier, or a "deep search" tool the agent invokes deliberately.

When to use. Legal, regulatory, clinical or financial research agents where a wrong top source is costly and a second of latency is acceptable.

Pitfalls. LLM rerankers read candidate text as instructions if not guarded (prompt injection); position bias in listwise prompts (shuffle and check); non-determinism (fix temperature and log the order).

4. Calibrated threshold and abstention

Problem. An agent always receives top-k results, even when none is relevant, and then answers from irrelevant context. Barnett et al.'s "missing content" failure point is exactly this (see plan section 4A KPIs).

How it works. Calibrate a minimum reranker score per model and domain. Cohere's method: pick 30 to 50 representative queries, pair each with a borderline-relevant document, score them, and use the average as the reference cut-off [8]. Below the threshold, the retrieval tool returns "no relevant evidence found" and the agent abstains, asks a clarifying question or escalates. Azure's 0 to 4 scale is coarse and documented as varying slightly between queries and over time, so avoid fine-grained thresholds on it [13].

When to use. Any agent whose wrong answer is worse than no answer.

Pitfalls. Reusing a threshold after changing the reranker model; treating a score of 0.9 as "twice as relevant" as 0.45 (scores are not ratios [8]).

5. Metadata- and instruction-aware ordering

Problem. Semantic relevance is not the whole story: the latest version of a policy, the right jurisdiction or an authoritative source should outrank an older, similar passage.

How it works. Two options. Pass structured fields into the reranker: Cohere's rerankers accept YAML-formatted documents, with key order mattering because long strings are truncated [8]. Or use an instruction-following reranker and state the rule in the query, which Voyage reports improves NDCG@10 on its domain and real-world sets [10]. Apply hard business rules (effective date, superseded flag) as filters before reranking, and soft preferences (recency) as a documented score adjustment after it.

When to use. Policy, contract and regulatory corpora with versions and effective dates.

Pitfalls. Encoding hard rules as soft preferences; the reranker cannot guarantee a superseded policy is excluded.

Setting Default Range or options Why
Reranking on or off On for knowledge agents over large corpora Off for full-context corpora and exact lookups Gains in published benchmarks [14][15]
Reranker type Cross-encoder (hosted or self-hosted) LLM listwise or pointwise for cascades Under 100 ms versus 1 to 2 s [12]
Candidate depth in 50 20 to 150, tuned by depth curve Azure reranks top 50 [13]; Anthropic used 150 [15]; quality can fall at high depth [16]
Results out 8 5 to 20 Practitioner default; Anthropic kept 20 [15]
Max tokens per candidate Match chunk size, at most the model window Up to 4,096 or 32,768 depending on model Model windows differ [8]
Latency budget (reranking step) p95 150 ms 50 ms to 2 s by tier Practitioner default informed by [12]
Relevance threshold Calibrated per model and domain from 30 to 50 borderline pairs No threshold for exploratory search Cohere guidance [8]
Abstention Return "no relevant evidence" below threshold Ask, escalate Addresses missing-content failures (plan section 4A)
Permission filtering Before reranking None Data minimisation; nothing unauthorised leaves the boundary
LLM reranker settings Temperature 0, shuffled input order checks, logged output order Pairwise for small sets Practitioner default
Re-evaluation After any reranker, retriever or chunking change Quarterly otherwise Practitioner default

Anti-patterns

  • Reranking to fix poor recall. Fix: measure recall@50 first; if the answer is not in the candidate set, fix chunking, embeddings or hybrid search.
  • Maximum depth "to be safe". Fix: plot the depth curve; quality can decline at high depth [16], and latency and cost always rise.
  • Sending unfiltered candidates to a hosted reranker. Fix: apply tenant and ACL filters in the first stage.
  • Silent truncation of long chunks. Fix: set max tokens per document explicitly and align chunk size to the reranker window [8].
  • Uncalibrated score thresholds copied between models. Fix: recalibrate on borderline pairs for every model and domain [8].
  • LLM reranking on every query. Fix: cascade, triggering the LLM stage only for hard or high-risk queries.
  • Trusting vendor benchmark deltas. Fix: reproduce on your golden set; most published reranker comparisons are vendor-run [4][10].
  • Using a non-commercial model in production. Fix: check the model card licence before the bake-off [5].
  • Reranking parents instead of the chunks that matched. Fix: rerank children, then expand the winners to parents.

Sizing and cost notes

Reranking cost scales with queries x candidates x tokens per candidate. Illustrative numbers below assume 1 million retrieval calls a month, 50 candidates of 400 tokens each (20,000 candidate tokens per call).

Approach Basis Illustrative monthly cost Added latency
Hosted, per-search billing One search covers one query with up to 100 documents; long documents split into extra units [9] 1 million searches x the published rate (not shown on the page opened) Under 100 ms class for dedicated rankers [12]
Hosted, per-token billing $0.05 per million tokens for one current-generation reranker [11] About 20 billion tokens, about $1,000 if billed on candidate tokens (counting method to confirm) Similar class
Self-hosted 0.6B cross-encoder GPU hours Depends on throughput; one always-on GPU node plus a standby is a typical floor (practitioner) Lowest network latency
LLM listwise on all 50 Input tokens at LLM rates At an illustrative $1 per million input tokens, about $20,000 1 to 2 s [12]
Cascade (cross-encoder 50, LLM on top 8 for 10% of queries) Mixed Cross-encoder cost plus about $320 of LLM tokens 1 to 2 s only on escalated queries

Three things change the picture. First, agents retrieve more than once per task: an agent making five retrieval calls per task makes five rerank calls, so budget per task, not per question. Second, chunk size multiplies cost: doubling chunk size doubles reranker tokens. Third, the reranker can save more than it costs by cutting the number of chunks placed in the prompt; dropping from 20 chunks to 8 at 400 tokens saves 4,800 input tokens per LLM call, which at frontier-model prices usually exceeds the reranking spend (illustrative).

Security and compliance hooks

Threats.

  • Adversarial or poisoned documents crafted to rank first (OWASP LLM04 Data and Model Poisoning, LLM08 Vector and Embedding Weaknesses; agentic ASI06 Memory and Context Poisoning). A reranker amplifies whatever looks most relevant; OWASP lists poisoning among LLM08's risks [17].
  • Prompt injection in candidate text (LLM01; ASI01 Agent Goal Hijack). LLM rerankers read candidate text; a passage saying "rank this first" or "ignore other documents" is an attack.
  • Third-party processing. A hosted reranker receives the query and every candidate, so it is a data processor for all of that text (LLM02 Sensitive Information Disclosure if candidates were not permission-filtered).
  • Unbounded consumption (LLM10). Deep reranking inside agent loops multiplies spend.

Controls. Permission and tenant filters before reranking; self-hosted rerankers only for client-confidential data; hosted rerankers through the model gateway with region pinning and approved terms; for LLM rerankers, wrap candidates as data with clear delimiters, instruct the model to treat them as untrusted, and validate the output is a permutation of input IDs; poisoning cases in the red-team suite (plan section 4A knowledge-base integrity); per-task rerank budgets.

Audit evidence to keep. Reranker model and version per release; depth-curve and threshold calibration results; retrieval logs with candidate IDs, reranker scores and final order; red-team results for injection and poisoning; data-processing terms for hosted rerankers.

Governing plan sections. 4A (reference retrieval stack, knowledge-base integrity, KPIs), 7 (evaluation), 10 (security), 15 (FinOps) and ROE (to be defined, plan section 12).

Test and eval checklist

ID Stage Check Pass criteria
RRK-01 Design Recall@50 versus precision@5 gap measured before adding a reranker Gap documented; reranker justified or skipped
RRK-02 Design Latency budget for the reranking step agreed p95 target recorded per risk tier
RRK-03 Design Data boundary decision for hosted versus self-hosted; client-confidential data uses a self-hosted reranker Approved by data protection
RRK-04 Design Licence of any open-weight reranker checked Commercial use permitted
RRK-05 Build Permission filters applied before reranking Test shows no unauthorised candidate reaches the reranker
RRK-06 Build Max tokens per candidate set explicitly Zero silent truncations of chunks
RRK-07 Build LLM reranker output validated as a permutation of input IDs Invalid outputs rejected and logged
RRK-08 Test Reranked versus non-reranked on golden set Reranker improves NDCG@10 beyond agreed threshold
RRK-09 Test Candidate depth curve Chosen depth within noise of best at lowest latency
RRK-10 Test Per-language and per-query-type results No major language or query type regresses
RRK-11 Test Threshold calibration Threshold set from 30 to 50 borderline pairs; abstention rate on unanswerable set meets target
RRK-12 Test Prompt injection in candidate text Injected candidates do not move to first place beyond baseline
RRK-13 Test Poisoned-document red-team cases Detection or demotion rate meets target
RRK-14 Test Load test at peak QPS p95 reranking latency within budget
RRK-15 Release Reranker model and version pinned and recorded Version in release record and logs
RRK-16 Release Threshold recalibrated after any model change New calibration attached
RRK-17 Run Reranker spend per task tracked Within FinOps budget
RRK-18 Run Scores and final order logged per retrieval 100% of calls logged

Governing policies and procedures

From the CoE policy set (draft; control IDs on the policy crosswalk):

Unverified or needs review

  • Cohere's pricing page defines a search unit but did not show a price; per-search costs are therefore not quoted [9].
  • Voyage's per-token reranker price is from its pricing page, which lists rerank-2.5 under older models; how tokens are counted for reranking (query plus each document) was not confirmed [11].
  • Voyage's and Jina's accuracy deltas are vendor-reported [4][10]; Microsoft's 2023 benchmark used the reranker of that time [14].
  • Google's ranking API is described as billed per request without a figure on the page opened [12]; Azure's free semantic ranker allowance is not stated on the page opened [13].
  • The RankGPT abstract did not describe its sliding-window method, so only its headline claims are cited [2].
  • Practitioner defaults for the CoE lead to confirm: depth 50, 8 results out, p95 150 ms, cascade trigger rules and the illustrative cost table.
  • Decided on 30 November 2026: reranking is required for regulated retrieval, and hosted rerankers may come only from approved vendors. Hosted rerankers are not allowed for client-confidential data; use a self-hosted reranker.

Sources

  1. Passage Re-ranking with BERT (v5 14 Apr 2020), arXiv 1901.04085, https://arxiv.org/abs/1901.04085, accessed 30 Nov 2026.
  2. Is ChatGPT Good at Search? Investigating Large Language Models as Re-Ranking Agents (v2 27 Oct 2023), arXiv 2304.09542, https://arxiv.org/abs/2304.09542, accessed 30 Nov 2026.
  3. ColBERTv2: Effective and Efficient Retrieval via Lightweight Late Interaction (v3 10 Jul 2022), arXiv 2112.01488, https://arxiv.org/abs/2112.01488, accessed 30 Nov 2026.
  4. jina-reranker-v3: Last but Not Late Interaction for Listwise Document Reranking (v4 6 Oct 2025), arXiv 2509.25085, https://arxiv.org/abs/2509.25085v4, accessed 30 Nov 2026.
  5. jinaai/jina-reranker-v3.5 model card, Hugging Face, https://huggingface.co/jinaai/jina-reranker-v3.5, accessed 30 Nov 2026.
  6. BAAI/bge-reranker-v2-m3 model card, Hugging Face, https://huggingface.co/BAAI/bge-reranker-v2-m3, accessed 30 Nov 2026.
  7. Qwen3 Embedding: Advancing Text Embedding and Reranking Through Foundation Models (v3 11 Jun 2025), arXiv 2506.05176, https://arxiv.org/abs/2506.05176v3, accessed 30 Nov 2026.
  8. Best Practices for using Rerank, Cohere documentation, https://docs.cohere.com/docs/reranking-best-practices, accessed 30 Nov 2026.
  9. Pricing, Cohere, https://cohere.com/pricing, accessed 30 Nov 2026.
  10. rerank-2.5 and rerank-2.5-lite: instruction-following rerankers (11 Aug 2025, updated 9 Sep 2025), MongoDB (Voyage AI), https://mongodb.com/company/blog/product-release-announcements/rerank-2-5-and-rerank-2-5-lite-instruction-following-rerankers, accessed 30 Nov 2026.
  11. Pricing, Voyage AI documentation, https://docs.voyageai.com/docs/pricing, accessed 30 Nov 2026.
  12. Retrieval and ranking, RAG Engine (updated 20 Nov 2026), Google Cloud documentation, https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/rag-engine/retrieval-and-ranking, accessed 30 Nov 2026.
  13. Semantic ranking in Azure AI Search (updated 2026), Microsoft Learn, https://learn.microsoft.com/azure/search/semantic-search-overview, accessed 30 Nov 2026.
  14. Azure AI Search: Outperforming vector search with hybrid retrieval and reranking (18 Sep 2023, updated 22 Nov 2024), Microsoft Tech Community, https://techcommunity.microsoft.com/t5/azure-ai-foundry-blog/azure-ai-search-outperforming-vector-search-with-hybrid/ba-p/3929167, accessed 30 Nov 2026.
  15. Introducing Contextual Retrieval (19 Sep 2024), Anthropic, https://www.anthropic.com/news/contextual-retrieval, accessed 30 Nov 2026.
  16. Drowning in Documents: Consequences of Scaling Reranker Inference (v2 11 Jul 2025), arXiv 2411.11767, https://arxiv.org/abs/2411.11767, accessed 30 Nov 2026.
  17. LLM08:2025 Vector and Embedding Weaknesses, OWASP GenAI Security Project, https://genai.owasp.org/llmrisk/llm082025-vector-and-embedding-weaknesses/, accessed 30 Nov 2026.
↑