Category · Data and retrieval-augmented generation
What is a reranker?
A reranker is a model that takes the results of a first search and sorts them by relevance. It reads the question with each passage, so it is slower but finer than vector search. Its score helps set the abstention threshold.
By Laurent Poupet, Claude trainer and artificial intelligence architect · Updated
How it works
- A reranker is a cross-encoder model, which reads the question and the passage together. Vector search compares two vectors computed separately, hence its speed and its lower precision.
- The semantic reranking of Azure AI Search only reprocesses the top results of the search, and scores each one on a scale from zero to four. Its models are adapted from Bing’s.
- A reranker’s score cannot be compared with that of another model. Changing rerankers therefore means recomputing the abstention threshold on the labelled questions.
- It adds latency and cost to every request. Keep it when the gain measured on the reference set justifies that delay, which is common with documentation written in prose.
Related terms
- Cosine similarityData and retrieval-augmented generation
- RAG (retrieval-augmented generation)Data and retrieval-augmented generation
- EmbeddingData and retrieval-augmented generation
Where this is taught
This idea comes up throughout the lessons; we work on it with your own examples during a lesson.
Lesson content (step-by-step instructions, exercises with solutions, quizzes) is for students only, with an access code received after the first lesson.