MMOOZZGG.com

Glossary

What is reranking

In short

Reranking is the second stage of a search, in which a separate model sorts the retrieved passages again by how precisely each one answers the question.

Search and RAG · reranking

MMOOZZGG.com editorsChecked: 1 min read

For a child

A teacher asks the class to bring drawings about summer. The children quickly bring a whole pile. Then she sits down and looks carefully at each drawing: which one is really summer, and which one shows winter by mistake. She puts the right ones on top and sets the others aside. Reranking works the same way: first collect a lot quickly, then calmly pick what you need.

In plain words

Search in a large database must be fast, so the first stage is rough: in a fraction of a second it returns several dozen similar passages. Some are exact answers, and some are random matches. In the second stage, a slower and more careful model, the reranker, steps in. It reads the question together with each passage and gives it a new score. The passages that really answer the question move to the top, and only the first few go to the neural network. So a customer who asked about free repairs gets the right clause of the rules, not an ad for paid service.

For business

A reranker is usually one of the first things added when an assistant finds almost the right thing but answers from a nearby document. The costs come from calls to the reranking model: cloud services charge for requests, or you can run your own model on a server next to the database. Response time also grows, especially if you sort hundreds of passages. The risk is language: a reranker trained mostly on English texts understands Russian documents and industry terms less well. Choose the model on your own questions and compare the share of correct passages before and after. A pilot is a convenient place to measure the effect of this step.

For a specialist

Reranking is the second stage of two-stage search: a fast retriever (BM25, dense or hybrid) selects candidates, and a precise model recalculates their order. The classic reranker is a cross-encoder: the query and the passage go into a transformer as one sequence, and the model gives a relevance score that accounts for the interaction of all tokens. In the work of Nogueira and Cho (2019), BERT in this role raised MRR@10 on MS MARCO by 27% over the previous result. A cross-encoder is expensive because it runs again for every pair. Late interaction in ColBERT (Khattab, Zaharia, 2020) offers a compromise: the query and the document are encoded separately and compared token by token. LLMs are also used as rerankers. In Anthropic’s measurements (2024), reranking 150 candidates down to 20 raised the reduction in failed retrievals from 49% to 67%.

Example

A search in an insurance company’s database returned twenty passages about “compensation”. The reranker put first the clause on payout times for compulsory motor insurance, which is what the customer had asked about.

Related terms

Questions and answers

What is a reranker? It is a model that takes a question and a list of retrieved passages and sorts them again by relevance. It is slower than the first search, so it works only with a short list of results.
Why do you need reranking in RAG? The first search is fast but imprecise, and random matches get to the top of the results. Reranking moves up the passages that really answer the question, and the model makes fewer mistakes.

Sources

Where companies use it

Not sure whether your company needs this?

AI solutions map
Contact us