Input search string
AI Models & Assistants / Knowledge library
Reranking
Rescoring retrieved candidates with a more precise relevance model
Why learn Reranking?
Reranking improves the ordering of plausible candidates without scoring the entire corpus expensively. It cannot recover a relevant document omitted by first-stage retrieval.
Where it came from
Two-stage retrieval first gathers candidates quickly, then applies a costlier reranker to a smaller set. Cross-encoders can jointly inspect query and document tokens for more precise relevance scoring.
Build your understanding
Work through these exercises in order. Try the task before opening a reference.
- Locate reranking in retrieval: When does a reranker normally run?
- Contrast a cross-encoder: Why can a cross-encoder reranker be more accurate than independent embeddings?
- Recognize the ceiling: The correct document is absent from the top 100 retrieved candidates. Can a reranker place it first?
- Set candidate depth: What is the main tradeoff when increasing reranker candidate depth?
- Measure ordering quality: Which metric rewards putting highly relevant results near the top with graded judgments?
Documentation and sources
- Passage Re-ranking with BERT (arxiv.org)
Connect the ideas
Explore next
Real World Example
Precision Enhancement for Legal Discovery Systems
Corporate legal departments managing massive document repositories for litigation discovery.
The business problem
Initial keyword-based retrieval often returns large sets of documents that are topically relevant but contextually misaligned with the specific legal query, forcing attorneys to manually filter through irrelevant noise.
How this topic solves it
Implementing a two-stage retrieval pipeline where a high-recall initial search retrieves a broad candidate set, followed by a BERT-based reranker that evaluates the semantic relationship between the query and each candidate document to assign a precise relevance score.
- Execute an initial retrieval query using traditional BM25 or vector search to fetch the top 100 candidate documents.
- Pass the original user query and each candidate document text as a concatenated input pair into a pre-trained BERT model.
- Compute a relevance score for each pair using the model's classification head.
- Sort the candidate list in descending order based on these refined scores.
- Return the top-ranked subset to the user interface for review.
The flow from user query to final ranked results.
High-recall search engine
Set of 100 documents
Semantic scoring model
Sorted document list
- User Query → initiates → Initial Retrieval
- Initial Retrieval → populates → Candidate Pool
- Candidate Pool → scores pairs → BERT Reranker
- BERT Reranker → sorts → Final Results
Expected business outcome
Users receive a highly curated list of documents where the most contextually significant information appears at the top, significantly reducing the time spent on manual document review.
Limitations and checks
The primary limitation is computational latency; because the reranker processes every candidate document individually, it is significantly slower than the initial retrieval stage. To check for this, monitor the p99 latency of the request-response cycle as the candidate pool size increases.