What is reranking?
Reranking is a RAG step that uses a second model to reorder the candidate results of an initial search by their relevance to the query. The first search is fast but coarse. The right passage is often in the list, just not at the top. Reranking moves it up, so the language model receives less context, but more relevant context, and answers improve.
Definition
Reranking is a RAG step that uses a second model to reorder the candidate results of an initial search by their relevance to the query.
How does reranking work?
Search runs in two stages. In the first, semantic search, keyword search or both return a broad list of candidates. In the second, a reranker model reads each candidate together with the query and gives it a relevance score. The candidates are reordered by that score. Only the top few passages are sent to the language model.
When should you use reranking?
When your RAG system finds the right document but cannot bring it to the top. To see this, evaluate retrieval separately from the final answer. Documents that look very similar, such as different versions of the same procedure, are a typical sign that reranking will help.
Unrelated passages in the context raise the risk of hallucination. Reranking reduces that noise. It cannot repair badly split documents, though. Review your chunking first.
What should you watch for?
Not every reranker supports every language. A model trained only on English data can make the ordering worse for German, Arabic or Turkish queries. Choose a multilingual model and test it with questions in each language you serve.
If the reranker is an external API, queries and passages are sent to that service. Where passages contain personal data, assess the transfer under GDPR, or under KVKK, Türkiye’s data protection law, for data processed in Türkiye, together with your legal counsel. Running the model on your own infrastructure is also an option.
Further reading
How to evaluate a RAG systemTest sets, metric choice, LLM-as-judge and live monitoring for measuring retrieval and generation quality in RAG systems.
RAG for WordPressHow retrieval-augmented generation works on WordPress sites for search, support and content discovery, and which build decisions matter.
What drives the cost of a RAG project?One-off and running cost drivers of a RAG knowledge assistant, the choices that raise or lower them, and what to prepare before a quote.Related terms
- RAG (Retrieval-Augmented Generation)RAG (Retrieval-Augmented Generation) is an AI architecture that lets a language model retrieve relevant passages from a chosen document collection, such as a company's own documents, and use them as context before it writes an answer.
- Semantic SearchSemantic search is a search method that finds the most relevant content by comparing the meaning of the query and the text rather than matching exact words.
- EmbeddingAn embedding is a fixed-length array of numbers (a vector) that represents the meaning of a word, sentence, document or image, so that similar content ends up close together.
- ChunkingChunking is a RAG preparation step that splits long documents into smaller, self-contained passages for embedding and retrieval.
- AI hallucinationAn AI hallucination is output in which a language model presents information, a source or a figure that does not exist, fluently and confidently, as if it were true.
Frequently asked questions
Does every RAG system need reranking?
No. For a small, well-organised document set the first search may be enough. Reranking is worth adding when the right passage appears in the results but does not reach the top. Decide by measuring with your own test questions.
Does reranking slow the system down?
Yes, somewhat. A reranker reads every candidate together with the query, which adds time and compute cost. That is why it is applied to a limited number of candidates. That number sets the balance between quality and speed.
What is the difference between a reranker and an embedding model?
An embedding model turns the query and the document into vectors separately, which makes it fast. A reranker reads the query and the passage together and returns one relevance score. It is more precise but too slow to run over a whole index.
Let’s talk about your transformation
Tell us which work repeats every week. We will tell you honestly whether it is worth automating.
How we start
- A free first callWe pin down the problem and the goal together.
- A 2-week discovery sprintWe look at the data, the process and the tools, and decide where to start.
- A written proposalScope, architecture and timeline, in writing.