AI engineering · 10 of 42

Reranking

Reorder candidates by relevance

Scroll

Reorder candidates by relevance

Retrieval happens in two stages for a reason. The first must be fast enough to run across everything you have, so it is necessarily crude. The second only sees a shortlist, so it can afford to be careful.

A reranker scores each candidate against the query properly — reading them together rather than comparing precomputed vectors — and reorders accordingly.

The gain is precision where it matters. Only a handful of documents will fit in the model's context, so what sits in positions one to three decides the answer. Reranking is also the cheapest place to remove near-misses, which otherwise arrive as confident, irrelevant evidence.

Retrieval
CHEAP AND WIDE FIRST, EXPENSIVE AND NARROW SECOND first search, top 4 1 general pricing page 2 token usage guide 3 billing incident 4 product overview reranker query + candidate scores each pair properly, which is too slow to do across the whole corpus reordered, top 3 kept 1 token usage guide 2 billing incident 3 general pricing page the weakest candidate is dropped The first stage optimizes for not missing anything. The second optimizes for what actually goes in the model's limited window.
Four candidates from a fast first search, rescored properly and reordered, with the weakest dropped.