There is a specific failure that makes a retrieval system feel unreliable, and almost every team misdiagnoses it. The answers are sometimes right and sometimes not, with no obvious pattern. The instinct is to blame the model, or to go shopping for a different vector database.
Run one check before doing either. Retrieve fifty results instead of five, and see whether the correct passage is in there. In most systems we are asked to look at, it is. It was retrieved. It was just not near the top, so the model never saw it.
That is not a retrieval problem. It is a ranking problem, and it has a well-understood fix that most teams have never implemented.
Why embeddings rank imprecisely
Standard vector search embeds your query and your documents separately, then compares the resulting vectors. The document was embedded weeks ago, in complete ignorance of the question you are about to ask.
That independence is what makes it fast. You precompute everything once and each query is a cheap similarity lookup across millions of items.
It is also what makes it blunt. A single vector has to compress everything a passage might ever be relevant to into a few hundred numbers. Fine distinctions get lost. Two passages about warranty periods look nearly identical in vector space even when one answers your question about replacement and the other does not.
So vector search is excellent at finding the roughly fifty passages that could be relevant, and mediocre at ordering them.
What a reranker does differently
A reranking model reads the query and a candidate passage together, as one input, and scores how well that passage answers that query.
Because it sees both at once, it can attend to the specific relationship between them. It notices that the question asked about replacement and the passage describes repair. A separately embedded vector cannot make that distinction reliably.
The cost of this is that it cannot be precomputed. You must run the model once per candidate, at query time. Running it across your whole corpus is impossible, which is exactly why it is used as a second stage.
The architecture is therefore simple and it has been the standard shape of serious search systems for years. Retrieve broadly and cheaply. Rank precisely and expensively, over a small set.
What it actually fixes
Three concrete symptoms, all common.
The answer is in the corpus but the system says it does not know. The passage was at position eighteen and you were sending the top five.
Answers drift onto an adjacent topic. The retrieved passages were all about the general subject and none specifically addressed the question, because similarity ranked by topic rather than by answer.
Quality is inconsistent in a way nobody can predict. Some questions happen to have their answer ranked first, others at position twelve, and the difference is invisible from outside.
If none of those describe your system, you may not need this. If the first one describes it, this is almost certainly your highest-return change.
The second benefit, which is about cost
Reranking lets you send less to the generator.
Without it, teams compensate for imprecise ordering by sending more context, on the reasoning that the answer is probably in there somewhere. Twenty passages instead of five. That costs tokens on every single request, and it introduces a second problem: a model given a large amount of context does not attend to all of it equally, and a relevant passage buried in the middle of a long input can be underweighted.
With reranking you can send five genuinely good passages instead of twenty mediocre ones. The answers improve, the cost per request falls, and the latency you added at the ranking stage is partly recovered at the generation stage because there is less to read.
For a system handling real volume, that arithmetic often makes reranking cheaper overall rather than more expensive.
The options, in increasing order of cost
- A small open cross-encoder you host yourself. Several are freely available and run acceptably on modest hardware, including on CPU for low volumes. This is the sensible first attempt and it costs nothing but deployment.
- A larger open reranker. Better quality, including multilingual options that matter if your content is not all in English. More memory, more latency.
- A hosted reranking service. An API call, no infrastructure, priced per request. Convenient, and it sends your content and queries to a third party, which is a decision to make deliberately rather than by default.
- A language model as the reranker. Ask a model to score each candidate’s relevance. Strong results and the most expensive and slowest option. Reasonable when your query volume is low and quality matters more than cost.
Start at the top of that list. The gap between no reranking and basic reranking is far larger than the gap between a small reranker and an expensive one.
How to wire it in
The shape is the same regardless of which model you choose.
- Retrieve a wider candidate set than you intend to use. Somewhere between twenty and a hundred, depending on your latency budget.
- Score every candidate against the query with the reranker.
- Sort by that score and keep the top few.
- Send those to the generator.
Two parameters to tune, and only two. How many candidates you retrieve, which trades latency for the chance that the right passage is in the set at all. And how many you keep, which trades cost and dilution against the risk of dropping something useful.
Tune them in that order, and measure after each change rather than both at once.
It pairs particularly well with hybrid retrieval
If you are combining keyword matching with vector search, you have two ranked lists that are not directly comparable, because their scores mean different things.
A reranker solves that cleanly. Take candidates from both lists, pool them, and let the reranker produce a single ordering based on actual relevance to the query rather than on reconciling two scoring systems.
This is especially useful where exact terms matter alongside meaning: product codes, names, technical terminology. The retrieval side of that is covered in hybrid search with PostgreSQL.
Measure it properly or you will not know
Use the same evaluation set you should already have: real questions with the passage that should be retrieved.
Measure two things separately, because they tell you different things.
Whether the right passage is in the candidate set at all. If it is not, reranking cannot help you and your problem is retrieval, chunking or embeddings.
Where it ranks after reranking. This is what the reranker is for, and the improvement here is usually obvious rather than marginal.
Also record the latency you added. A reranker that improves ordering and makes the system feel slow has traded one complaint for another, and the users will be clearer about the second one.
What is a waste of effort
Reranking before you have fixed chunking. If your passages are cut badly, a reranker is choosing between poor options more carefully. Chunking comes first.
Reranking a candidate set of five. There is nothing to reorder. The point is to look wider and then choose well.
Benchmarking rerankers against published leaderboards. Same objection as with embedding models. Test on your own evaluation set.
Fine-tuning a reranker as a first move. Occasionally worth it eventually. Never worth it before you have measured what an off-the-shelf one does.
Adding a reranker when your actual problem is that the content does not contain the answer. No amount of ranking creates information that is not there.
A sensible sequence
- Check whether the correct passage appears in your top fifty. This single diagnostic tells you whether to read the rest of this.
- Fix chunking first if the passage is not there at all.
- Add a small open cross-encoder over a candidate set of fifty.
- Measure ranking quality and added latency against your evaluation set.
- Reduce how many passages you send to the generator, and check whether answer quality holds or improves.
- Tune the candidate count, then the kept count.
- Only consider a larger or hosted reranker once the cheap one is measured and its limits are known.
The implementation context for all of this is in building a RAG chatbot on your own content, and the prior question of whether retrieval is the right approach at all is in fine-tuning or RAG.
If your system retrieves the right thing and still answers badly, that is a ranking problem and we are happy to look at it. Get in touch, or see what our AI development work covers.