What you will be able to do
- Explain what a re-ranking step does to the candidate set that retrieval returns before it reaches the LLM
- Size the first retrieval stage so the reranker has more candidates than the final top-k
- Distinguish Reciprocal Rank Fusion in hybrid search from a cross-encoder reranker
- Decide whether a reranker fits a workload from its latency target and query volume
Key concept
Re-ranking — A second pass after retrieval. A slower, more accurate model re-scores each candidate chunk against the query and reorders the list, so the best passages are at the top when the context goes to the LLM.
1.What a reranker does to retrieved chunks
A RAG chain is only as good as the chunks it puts in front of the LLM. Retrieval in Databricks AI Search (formerly Vector Search) finds candidates quickly. It does this by comparing a query embedding with the stored embeddings, by matching keywords, or by doing both. That speed has a cost: the order it produces is approximate. A chunk that answers the question exactly can come back seventh, below chunks that only share vocabulary with it.
Re-ranking fixes the order, not the content. Once the first stage has returned its candidates, the reranker looks at each one again against the query and assigns a new relevance score. It then reorders the list, so the most relevant passages go to the top. The ranking criterion can be simple, such as sorting by time. In most RAG systems it is a reranker model that judges each query–chunk pair directly.
The things a reranker does not do matter just as much on the exam. It does not replace or retrain the embedding model, because the index and its vectors stay as they are. It does not deduplicate rows in the Delta table behind the index. It also does not widen the candidate set. Finding more documents is a recall technique, such as query expansion, which runs several variations of a query. Reranking only works on the candidates the first stage already returned.
Checkpoint 1 of 7· Check yourself
A RAG chain on Databricks AI Search does return the chunk that answers the user's question, but it comes back seventh. The chunks above it only share vocabulary with the query. The team adds a reranking stage after retrieval. What does that stage do?
Re-ranking is a second pass over the candidates that were already retrieved. It assigns each one a new relevance score against the query and reorders the list. It does not widen the candidate set (that is query expansion), change the embeddings or index, or deduplicate the stored data.
“After retrieving an initial set of chunks, apply additional ranking criteria (for example, sort by time) or a reranker model to re-order the results.”Source: docs.databricks.com
Checkpoint 2 of 7· Exam question
In a two-stage retrieval pipeline for a RAG application, what is the primary role of a re-ranking step?
Correct answer: A — Scoring the top results from the first-stage vector search against the query again, so the strongest matches come first in the LLM prompt
- A. The second stage takes the candidates the vector index has already returned and scores them against the query again, typically with a model that reads query and passage together. The best passages end up at the top of the short list that goes into the LLM prompt, which raises precision.
- B. Changing the embedding model is an indexing decision that requires re-embedding the corpus and rebuilding the index. A re-ranking step does not touch the index or its embeddings. It runs after the first-stage search and only reorders the results that search returned, so it cannot improve first-stage recall.
- C. Merging duplicate chunks is a data preparation task on the source table, done before or during indexing. A re-ranking step works at query time on one request's retrieved results and leaves the stored table and index entries unchanged. It does not reduce the number of embeddings in the index.
- D. A re-ranking step narrows the candidate set. The usual pattern is to retrieve a generous set cheaply, then keep only the best-scoring subset for generation. Widening the candidate list is a first-stage retrieval setting, and it would send more passages onward, not fewer and better ones.
2.Retrieve many, rerank, keep the top k
A reranker earns its keep only when it has more candidates than you plan to keep. Suppose ANN returns exactly the 5 chunks the prompt can hold. The reranker can then only shuffle those 5, and the LLM gets the same context in a different order. Now suppose ANN returns 50. A chunk that ANN ranked 30th, but that really answers the question, can move into the top 5, and the other 45 are dropped. The first stage aims for recall, which means not missing the right chunk. The reranker supplies the precision, so only the best few chunks reach the prompt.
AI Search builds this split into the query. num_results sets how many results you get back after reranking. It does not set how many candidates the reranker scores. A query that asks for num_results = 10 with the reranker enabled therefore returns the top 10 from a larger reranked pool, not 10 ANN hits that have been reordered. The cost is reasonable for chatbot-style workloads: reranking 50 results typically takes under a second, and with short chunks it can take as little as about 250 msec.
The first stage still casts a wide net, so recall comes from the candidate pool. The reranker then decides which few of those candidates are kept, and the small set it passes on is the most relevant part of that pool.
Checkpoint 3 of 7· Check yourself
An engineer queries an AI Search index with the reranker enabled and sets num_results = 10. They expect the reranker to see only 10 ANN hits. What actually happens?
num_results sets only how many results come back after reranking. The reranker scores a larger pool, so a relevant chunk that ANN ranked low can still reach the top 10.
“num_results is the final number of results to return. This does not affect the number of results used for reranking.”Source: docs.databricks.com
Checkpoint 4 of 7· Exam question
A team builds a RAG pipeline where the AI Search index performs ANN retrieval and a reranker narrows the results before they reach the LLM. To get the benefit of the reranker, how should the initial ANN retrieval step be configured relative to the final number of chunks sent to the LLM?
Correct answer: A — Set the ANN top-k to several times the LLM's chunk count, then have the reranker score those results and pass on only the highest-ranked ones
- A. A reranker can only improve precision if it has more candidates than the final prompt needs. A wide ANN top-k gives high recall, and the reranker then scores each candidate against the query and passes on only the best few. This is the standard two-stage retrieve-then-rerank pattern.
- B. When ANN returns exactly as many chunks as the LLM will receive, the reranker has nothing to cut. It can only change the order, so the weakly relevant chunks that ANN ranked too high still reach the prompt. Reordering alone does not narrow the results.
- C. A reranker re-scores the candidates that retrieval hands it. It does not query the index or add chunks. If ANN returns fewer chunks than the LLM needs, the reranker has too small a pool to choose from and cannot make up the shortfall.
- D. A large ANN top-k is the right start, but the reranker's job is to narrow that pool to the few chunks the LLM will get. Sending the full ranked list passes along the same large, noisy set, adding prompt cost and irrelevant context. The final chunk count stays far too high.
3.Rank fusion is not a reranker model
Two different mechanisms both get called re-ranking, and they do different jobs. Hybrid search runs an ANN search and a keyword search side by side. That gives it two ranked lists, and it has to combine them into one. AI Search combines them with Reciprocal Rank Fusion (RRF), which scores each document by its position in each list. RRF never reads the text, and its rrf_param constant is set to 60. A cross-encoder reranker does read the text. It takes the query and one candidate together, judges how relevant that candidate is, and does this once for every candidate.
| Strategy | How it works | Best for |
|---|---|---|
| ANN | Searches vector embeddings for semantically similar documents | Conceptual queries where meaning matters more than exact wording |
| Full-text | Keyword search that matches exact terms | Product IDs, proper nouns, error codes, jargon |
| Hybrid | Combines ANN and full-text results using Reciprocal Rank Fusion (RRF) | General-purpose retrieval; the recommended starting point |
| Hybrid + reranker | Runs hybrid search, then re-scores results with a cross-encoder reranker model | Higher precision when latency allows (typically under 1 second extra per query) |
The reranker is an optional second pass, and you can put it on top of ANN, full-text or hybrid results. RRF only merges rank positions, so it adds almost no work. A cross-encoder runs a model on every query–candidate pair, which is why it costs latency. It is also why it can tell the difference between a chunk that answers the question and one that only mentions the topic. Open models such as mxbai-rerank and ColBERTv2 are examples of the cross-encoder approach, and they can improve retrieval performance.
Checkpoint 5 of 7· Match them up
Match each retrieval mechanism in AI Search to how it ranks or scores documents.
Tap a term, then the definition that fits it.
Hybrid search only merges two ranked lists with Reciprocal Rank Fusion, using rank positions. The cross-encoder reranker is a separate optional pass that re-scores each candidate against the query. That is why turning it on adds precision, and also latency, on top of hybrid.
“Hybrid search runs both ANN and full-text searches in parallel, then merges the results using Reciprocal Rank Fusion (RRF).”Source: docs.databricks.com
4.The quality–latency trade-off
The reranker usually improves quality by about 10%, and it always adds latency. Whether that trade is worth making depends on what else the request spends its time on. In a RAG agent, most of the time goes into LLM generation. One more second of reranking against a time-to-first-token target of about 2 seconds is often an acceptable cost for better context. That is why Databricks recommends trying the reranker for any RAG agent use case.
A search bar is a different situation. It has to show results in about 100 msec, and nothing slow runs after retrieval to hide the reranker's cost. The built-in reranker handles about 5 QPS out of the box. Once you need more than that, or sub-100 msec responses, it is the wrong tool. Reranking can still help those applications if the model is faster. One option is to deploy a lightweight cross-encoder such as cross-encoder/ms-marco-TinyBERT-L-2-v2 as a custom model on Databricks Model Serving, which can rerank in under 100 msec.
| Workload | Latency budget | Built-in reranker? |
|---|---|---|
| RAG agent or chatbot | Time to first token, for example under 2 sec; dominated by LLM generation | Yes — quality-first, low-to-moderate QPS (~5 QPS) |
| Real-time search bar | End-to-end under 100 msec | No — use a lightweight cross-encoder on Model Serving instead |
| High-QPS application | More than 5 QPS | No, unless you scale it further or switch to a faster custom reranker |
Checkpoint 6 of 7· Check yourself
A product-catalog search bar must show results end to end in under 100 msec. The team wants the quality gain that reranking gives. Which approach fits that budget?
The built-in reranker is not suitable for search bars that need sub-100 msec responses, because reranking adds a scoring step to every query. Lowering num_results does not shrink the reranked pool. RRF only merges rank positions. A lightweight cross-encoder on Model Serving can rerank in under 100 msec.
“Consider deploying a lightweight reranking model (for example, cross-encoder/ms-marco-TinyBERT-L-2-v2) as a custom model on Databricks Model Serving for sub-100 msec reranking.”Source: docs.databricks.com
Checkpoint 7 of 7· Exam question
An engineering team is building a real-time product search bar that must return results in under 100 milliseconds and serves more than 5 queries per second at peak. Should they enable a cross-encoder-style reranker on top of ANN retrieval?
Correct answer: A — No, a cross-encoder runs a separate model pass for each query-candidate pair, adding inference time and compute that this search bar cannot afford
- A. A cross-encoder reads the query and each candidate together in a separate model pass, which adds inference time and compute on top of ANN retrieval. With a response budget under 100 milliseconds and traffic above 5 queries per second at peak, that extra stage does not fit, so the reranker should stay off.
- B. Reranking is an additional scoring stage, so it adds time to the request rather than recovering it. A search bar returns the ranked list directly, so passing fewer chunks onward saves nothing. The extra model inference stays on the critical path of a response limited to under 100 milliseconds.
- C. A reranker does not replace ANN retrieval. It rescores only the short candidate list that ANN returns, so its cost follows the number of candidates, not the catalog size. The real objection is the per-candidate model inference added to each request, which this latency budget cannot absorb.
- D. A cross-encoder does not reuse stored index vectors. It runs the query and each candidate through a transformer together to produce a relevance score. That inference is the reason it adds meaningful latency, and a lookup into the index does not replace it. A response under 100 milliseconds leaves no room for it.
Sources
(4)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“After retrieving an initial set of chunks, apply additional ranking criteria (for example, sort by time) or a reranker model to re-order the results.”
↩︎ What a reranker does to retrieved chunks“Reranking with cross-encoder models such as mxbai-rerank and ColBERTv2 can yield an uplift in retrieval performance.”
↩︎ Rank fusion is not a reranker model - 2.
“Reranking is a technique that improves retrieval quality by evaluating the retrieved documents to identify the ones that are semantically most relevant.”
↩︎ What a reranker does to retrieved chunks“num_results is the final number of results to return. This does not affect the number of results used for reranking.”
↩︎ Retrieve many, rerank, keep the top k“The reranker is an optional second pass applied on top of any strategy.”
↩︎ Rank fusion is not a reranker model“Databricks recommends trying out reranking for any RAG agent use case.”
↩︎ The quality–latency trade-off“a cross-encoder model re-evaluates each result in the context of the query, producing more accurate relevance ordering.”
↩︎ Key concept“num_results is the final number of results to return. This does not affect the number of results used for reranking.”
↩︎ Exam trap 1“Runs hybrid search, then re-scores results with a cross-encoder reranker model.”
↩︎ Exam trap 2“The reranker typically improves quality by approximately 10% but adds latency.”
↩︎ Exam trap 3“Hybrid search runs both ANN and full-text searches in parallel, then merges the results using Reciprocal Rank Fusion (RRF).”
↩︎ Checkpoint - 3.
“Generate multiple query variations to improve recall.”
↩︎ What a reranker does to retrieved chunks“Boosts precision by achieving high recall with fewer candidates.”
↩︎ Retrieve many, rerank, keep the top k“As fast as ~250 msec for shorter chunks.”
↩︎ Retrieve many, rerank, keep the top k“RAG agents (latency is dominated by LLM generation).”
↩︎ The quality–latency trade-off“Real-time search bars requiring <100 msec latency.”
↩︎ The quality–latency trade-off“Consider deploying a lightweight reranking model (for example, cross-encoder/ms-marco-TinyBERT-L-2-v2) as a custom model on Databricks Model Serving for sub-100 msec reranking.”
↩︎ The quality–latency trade-off“Reranks 50 results in under 1 second in typical workloads.”
↩︎ Prediction - 4.
“Based on the literature, rrf_param is set to 60.”
↩︎ Rank fusion is not a reranker model