CertSafari
    Databricks Certified Generative AI Engineer Associate· Lessons

    Domain 2 · Lesson 14/56

    Re-ranking in the retrieval pipeline

    Explain the role of re-ranking in the information retrieval process

    12 min read
    1.75% of exam
    4 sources
    Published 22 Oct 2026
    Docs as of 17 Oct 2026

    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?

    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?

    Sources123

    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.

    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?

    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?

    Sources23

    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.

    Retrieval strategies in AI Search and where the reranker fits
    StrategyHow it worksBest for
    ANNSearches vector embeddings for semantically similar documentsConceptual queries where meaning matters more than exact wording
    Full-textKeyword search that matches exact termsProduct IDs, proper nouns, error codes, jargon
    HybridCombines ANN and full-text results using Reciprocal Rank Fusion (RRF)General-purpose retrieval; the recommended starting point
    Hybrid + rerankerRuns hybrid search, then re-scores results with a cross-encoder reranker modelHigher 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.

    Sources241

    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.

    Built-in reranker fit by workload
    WorkloadLatency budgetBuilt-in reranker?
    RAG agent or chatbotTime to first token, for example under 2 sec; dominated by LLM generationYes — quality-first, low-to-moderate QPS (~5 QPS)
    Real-time search barEnd-to-end under 100 msecNo — use a lightweight cross-encoder on Model Serving instead
    High-QPS applicationMore than 5 QPSNo, 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?

    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?

    Sources32

    Sources

    (4)

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 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. 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. 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. 4.
      “Based on the literature, rrf_param is set to 60.”
      ↩︎ Rank fusion is not a reranker model

    Continue to part 2 of 2

    Configuring and verifying the AI Search reranker

    Spotted a mistake, or was something unclear? Tell us.