A second pass that can afford to be slow
Retrieval has to score millions of documents, so it uses a model cheap enough to precompute. Reranking scores a hundred, so it can use one that is far better.
The query and the document are concatenated and read together by a transformer, so every query token can attend to every document token.
A bi-encoder compresses the document into a vector before it knows the query, which is what makes it indexable and what limits how well it can match.
The cross-encoder never compresses. That is the whole source of its accuracy and the whole reason it cannot be an index.
The cost, written plainly
Reranking 100 candidates costs 100 passes over a query-document pair, which is tens of milliseconds on a GPU and hundreds on a CPU.
Applied to the whole corpus that is impossible, which is why the two stages exist rather than one good model.
One pipeline, in order
- Retrieve candidates with a cheap method, usually hybrid.
- Pair the query with each candidate and score them with the cross-encoder.
- Sort by that score.
- Keep the top few for the context window.
- Drop anything below an absolute score threshold, not only below the cut.
Step five matters more than it looks. A reranker produces a calibrated relevance score, so it can say that nothing retrieved is relevant, which a rank alone cannot.
Choosing the candidate count
The reranker can only reorder what it is given, so the retrieval stage must have already found the answer somewhere in its .
Below 50 the recall ceiling usually binds. Above 200 the extra latency buys almost nothing, since the retriever's ranking below that depth is mostly noise.
The right way to set it is to measure retrieval recall at several depths and pick the point where the curve flattens.
The lighter alternatives
Late interaction models such as ColBERT keep one vector per token and compare them at query time, which lands between the two families in both cost and quality.
Using a general language model as the reranker works and costs an order of magnitude more per candidate, which limits it to small or to offline evaluation.
A dedicated cross-encoder of a few hundred million parameters beats a much larger general model at this specific task, and it is the standard choice for that reason.