Bottom line: A cross-encoder reranker on 100 candidates at 10k-document scale beats no reranker by 12–18 NDCG points on both local and API paths. The API version adds 180–400 ms of network round trip; the local version needs ~1.5 GB of VRAM to hit similar quality. Choose on infrastructure, not on the price per thousand reranks.

The setup

Corpus of 10,000 documents, 200 labelled queries with graded relevance, retrieve top-100 by BM25 then rerank. Metric is NDCG@10.

Path NDCG@10 p50 latency p99 latency
BM25 only, no rerank 0.412 8 ms 25 ms
Local MiniLM cross-encoder 0.561 62 ms 140 ms
Local bge-reranker-base 0.588 145 ms 310 ms
API reranker (hosted) 0.594 395 ms 980 ms
Local bge-reranker-large 0.607 340 ms 720 ms

The rerank gain is large and consistent. The differentiator is tail latency and where the GPU lives.

Reranking is O(n) in candidates

100 candidates × 512 tokens is 51k tokens of cross-encoder input per query. Cutting to 50 candidates halves latency and costs about 2 NDCG points. Cutting to 20 costs 6. Tune candidate count, not model size, when latency hurts.

1
scores = reranker.predict([(q, d.text) for d in candidates[:top_k]])

Batch the pairs — one call per candidate is 100 sequential matmuls and roughly 10× slower on CPU.

API trade-offs

Worth it when: the GPU is elsewhere, volume is bursty, and 400 ms is inside the budget. Not worth it when: you need p99 under 200 ms, the corpus is small enough that a local model fits, or per-query cost matters more than ops time.

The API also gives you a reranker you did not have to evaluate, host or patch — real value if the team has no ML ops.

CPU numbers

MiniLM cross-encoder, int8, 8 cores: 38 candidates/second. 100 candidates is 2.6 s — too slow for interactive, fine for nightly reindexing. At that rate, rerank only the nightly batch and serve the cached order.

What to log

Candidate count, chosen count, p50/p95 latency, and NDCG on a weekly labelled sample. A model swap that raises NDCG but triples p95 is usually a bad swap unless the product has slack.

The mistake to avoid

Reranking before you have fixed retrieval. A reranker on 100 candidates drawn by a bad first stage can only reorder bad options. Fix chunking and BM25/dense balance first, confirm baseline NDCG, then add reranking and measure the delta against that baseline.

Designing the measurement

Fix the candidate set first, then rerank it — otherwise you are measuring retrieval changes too. Log NDCG@10, p50 and p99 per configuration, 200 queries minimum, and hold the corpus constant across all runs.

1
2
3
4
for model in (None, mini_lm, bge_base, api):
for k in (20, 50, 100):
ndcg, lat = evaluate(model, k, queries)
print(model, k, ndcg, percentile(lat, 95))

Three candidate counts per model is twelve runs; that is the whole grid.

Boundary conditions

Cross-encoder cost is linear in candidates and quadratic in sequence length. Pairs longer than 512 tokens are re-truncated internally and lose the tail of the document — put the relevant paragraph first in the pair, not the document head.

CPU reranking at 38 pairs/second means 100 candidates is 2.6 s: fine for nightly, unusable interactively. Model size and hardware must be chosen together, not separately.

Failure triage

  1. NDCG rises, p99 doubles → candidate count too high, halve it before shrinking the model
  2. NDCG falls after a model change → check truncation, the pair may be longer than the window
  3. p99 spikes on a subset of queries → those queries retrieve garbage; fix retrieval, not the reranker
  4. API timeouts during peaks → no local fallback; add one, even a weak local model

Rollout

Shadow first: rerank, log the order, serve the old order. Compare for a week, then flip per endpoint behind a flag. Keep the flag for a month — a reranker that looks good on aggregate can regress long-tail queries badly, and the flag is the rollback.

FAQ

How much does reranking improve NDCG@10 at 10k documents?

A cross-encoder reranker on 100 candidates beats no reranker by 12–18 NDCG points, on both the local and API paths. BM25 alone scores 0.412 NDCG@10, while reranked configurations range from 0.561 to 0.607. The gain is described as large and consistent across paths.

What is the latency difference between a local and an API reranker?

The API version adds 180–400 ms of network round trip. The hosted API reranker has a p50 of 395 ms and p99 of 980 ms, while the local MiniLM cross-encoder runs at 62 ms p50 and 140 ms p99. The article frames the choice as infrastructure-driven, not price-driven.

How many candidates should I rerank to control latency?

Cutting from 100 to 50 candidates halves latency and costs about 2 NDCG points; cutting to 20 costs 6. The article recommends tuning candidate count rather than model size when latency hurts. Reranking cost is linear in candidates.

How fast is CPU reranking compared to GPU?

A MiniLM cross-encoder in int8 on 8 cores processes 38 candidates per second, so 100 candidates takes 2.6 seconds. That is too slow for interactive use but fine for nightly reindexing. At that rate, the article suggests reranking only the nightly batch and serving the cached order.

Why is my reranker not improving results?

A reranker can only reorder what the first stage retrieves, so reranking before fixing retrieval limits gains. The article advises fixing chunking and the BM25/dense balance first, confirming baseline NDCG, then adding reranking and measuring the delta. If p99 spikes on a subset of queries, those queries retrieve garbage and retrieval should be fixed, not the reranker.