Reranking

13 min read

A fast search can find the right passage but rank it 9th. A reranker reads the question and each candidate passage together and scores them carefully. It moves the best ones to the top. So the LLM gets a few great chunks instead of many average ones.

New words

Reranker
A slower, more careful model that re-orders search results.
Recall
Did the candidate list include the good passages at all?
Precision
How many of the passages you keep are actually relevant.
Bi-encoder
Turns question and passage into vectors separately. Fast.
Cross-encoder
Reads question and passage together and gives one score. Accurate.
Candidate
A passage from the first search that might answer the question.

What you will learn

  1. The problem: the right answer is buried
  2. How it works: two-stage retrieval
  3. Try it: rerank the candidates
  4. Trade-offs and failure modes
  5. Production practices
  6. In code
  7. In a real system
  8. Interview tip
  9. Key takeaways

10 quiz questions at the end.

Start this lesson

The full lesson, with interactive demos and the quiz, opens after you sign in with Google. It is free.

All lessons · Back to the roadmap