Back to Home
Reranking: When the Extra Model Call Pays for Itself
Model selection8 min readSource: Admesh Engineering

Reranking: When the Extra Model Call Pays for Itself

How to measure whether a reranker earns its extra model call, size the candidate set, and cap latency and cost with guardrails.

What reranking fixes and what it cannot

A reranker is a second-stage model that takes the documents returned by first-stage retrieval and reorders them by relevance to the query. Cross-encoders score query and document jointly, which usually produces sharper ordering than the embedding similarity used in the first stage. LLM-based rerankers do the same job through a prompt, trading some determinism for flexibility.

The critical limit is that reranking is a reordering operation, not a retrieval operation. If the correct document is not in the candidate list, no reranker will surface it. This is why teams that add a reranker to fix missing-document complaints often see no improvement: their problem is recall in the first stage, not ordering. Diagnose which one you have before spending on a second model call.

Reranking also does not fix chunking mistakes, stale indexes, or queries that are ambiguous to a human reader. Those need upstream changes.

  • Fixes: relevant documents present but ranked below irrelevant ones.
  • Fixes: dense-only retrieval that ranks topically similar but non-answering chunks highly.
  • Does not fix: the right document absent from the candidate set.
  • Does not fix: bad chunk boundaries, stale content, or underspecified queries.

Measuring the gain with a retrieval evaluation set

You cannot argue about reranking in the abstract; you need a small labeled set. Build 50 to 200 queries that represent real traffic, including the ugly ones: multi-hop questions, queries with rare entities, and queries where the answer spans chunks. For each query, label which documents or chunks are relevant. This is tedious, but it is the only way to know whether the extra call earns its place.

Then measure two things separately. Recall@k on the first-stage candidate list tells you whether the right document is even available to rerank. Precision@k or mean reciprocal rank on the final ordering tells you whether reranking improved what the user sees. If recall@k is already low, fix retrieval first. If recall is high but the top position is often wrong, reranking is a plausible fix.

Run the comparison with the reranker on and off against the same candidate lists, so you isolate the reranker's effect from retrieval changes. Report the delta, not just the absolute score, and keep the evaluation set versioned so future model or prompt changes can be compared against the same baseline.

  1. Collect 50 to 200 representative queries from logs, including edge cases.
  2. Label relevant documents per query and store the labels in version control.
  3. Compute recall@k on first-stage results to confirm the right documents are retrievable.
  4. Compute precision@k and MRR on first-stage ordering as the baseline.
  5. Re-run the same candidate lists through the reranker and compare deltas.
  6. Keep the set fixed and re-run whenever you change the retriever, reranker, or prompt.

Sizing the candidate set

The candidate set is where reranking cost and latency are decided. Every additional candidate is another query-document pair to score, and with LLM rerankers it is another chunk of prompt tokens. Reranking the entire index is not viable; reranking the top 100 when your first stage is already good is often wasteful.

Start from your evaluation data. Plot precision at the final cutoff against candidate-set size. There is usually a point where adding more candidates stops improving the final top-k and only adds cost. That point is your candidate size. A common pattern is to retrieve a wider list than you display, rerank it, and show only the top few, but the exact numbers should come from your own measurements rather than a rule of thumb borrowed from a blog post.

Also consider truncating document text before scoring. Rerankers typically only need the passage that answers the query, and sending full documents inflates token cost without improving ordering.

Latency and cost guardrails

A reranker sits on the critical path of every query, so its failure modes become your failure modes. The most common production incident is a slow or unavailable reranker turning a fast search into a timeout. Treat it as an optional dependency: set an aggressive timeout, and on timeout or error fall back to the first-stage ordering rather than failing the request.

Cap the number of candidates per request in code, not in configuration alone, so a misconfigured retriever cannot silently send thousands of documents to the reranker. Log candidate counts, reranker latency, and fallback rates. A rising fallback rate means users are getting first-stage quality while you believe they are getting reranked quality.

For cost, track reranker calls per query and tokens per call separately from generation cost. If reranking spend grows faster than query volume, suspect candidate-set drift. For LLM rerankers, keep prompts short and deterministic, and cache results for repeated query-document pairs where your traffic allows it.

  • Hard timeout with fallback to first-stage order.
  • Per-request candidate cap enforced in application code.
  • Metrics for candidate count, reranker latency, and fallback rate.
  • Separate cost tracking for reranking versus generation.
  • Cache keyed on query and document hash for repeated pairs.

How to apply this with Admesh

Admesh gives you one API key and one balance across multiple model families, which is useful when you want to compare reranker options without standing up separate billing and credentials for each provider. Point an OpenAI-compatible client at https://api.admesh.ai/v1, or use the Anthropic-compatible endpoint at https://api.admesh.ai/v1/messages if your reranking prompt is written for that format.

Start by checking the live model catalog at https://admesh.ai/models for the model families available to you, and confirm current pricing at https://admesh.ai/pricing before you commit to a reranker in production. Do not assume a price or context limit from memory; the catalog is the source of truth.

Then run your evaluation set through two or three candidate rerankers behind the same interface, using the same candidate lists and the same labels. Because billing is unified, you can compare cost per query across families directly. Keep the winner behind a feature flag with the timeout and fallback described above.

Finally, wire the reranker into your pipeline as a swappable stage. The docs at https://docs.admesh.ai cover endpoint details, and the console at https://console.admesh.ai lets you monitor usage as you roll out.

  1. Create one Admesh API key and use it for all reranker candidates.
  2. Check https://admesh.ai/models and https://admesh.ai/pricing for available families and current rates.
  3. Run your labeled evaluation set through each candidate with identical candidate lists.
  4. Compare ranking deltas and cost per query, then ship the winner behind a flag with timeout and fallback.

When to skip reranking

Reranking is not a default. If your evaluation shows high recall and acceptable precision at the final cutoff, the second call is pure overhead. The same is true when your queries are simple keyword lookups, when latency budgets are tight, or when the corpus is small enough that first-stage ordering is already reliable.

It is also reasonable to defer reranking until you have an evaluation set at all. Adding a model call you cannot measure is how teams end up paying for a stage that may be doing nothing, or worse, masking a retrieval bug that will resurface later.

Admesh API docs →

FAQ

Can a reranker fix missing documents in my RAG pipeline?
No. A reranker only reorders candidates returned by first-stage retrieval. If the relevant document is not in the candidate list, measure recall@k on the first stage and fix retrieval, chunking, or indexing before adding a reranker.
How large should the candidate set be?
Large enough that the final top-k stops improving. Measure precision at your display cutoff against candidate-set size on a labeled evaluation set, and pick the point where more candidates add cost without changing the result. Enforce that number as a hard cap in code.
Should I use a cross-encoder or an LLM reranker?
Both reorder candidates; the tradeoff is control and cost versus flexibility. Cross-encoders are typically a fixed scoring call, while LLM rerankers let you express nuanced relevance criteria in a prompt at the cost of more tokens and variance. Compare them on your own evaluation set rather than choosing by reputation.
What happens if the reranker times out?
Fall back to the first-stage ordering and log the event. Treat the reranker as an optional dependency with a hard timeout, and alert on fallback rate so you notice when users are silently getting first-stage quality.

References

Call these models through one gateway

Admesh provides a unified OpenAI-compatible API: one Base URL and one key for Claude, GPT, DeepSeek and more. New accounts get trial credit that never expires.