StudyVisuallyStart studying
Part 05 · Embeddings + RAG · Card 13 of 14

Re-ranking

A second model re-orders the top 20 results by relevance, then you keep the best few.

Last updated

Analogy

A quick first-round screen, then a proper interview for the shortlist.

In an agent

Better precision for a small extra cost, so the agent reads fewer useless chunks.

Practice

Flashcards

  • What is re-ranking?A second pass that re-orders retrieved results by relevance.

Interview questions

  • Your RAG gives wrong answers. How do you debug it?
    • Check the trace: were the right chunks retrieved?
    • If not, fix retrieval: chunking, hybrid search, re-ranking, metadata filters.
    • If they were, fix the prompt or the model.
    • Then add the failing case to the eval set so it stays fixed.

Questions people ask

What is re-ranking in RAG?

Re-ranking is a second pass over search results. You retrieve a wider set, for example the top 20 chunks, and a re-ranking model scores each one against the question more carefully. You keep only the best few. It improves precision for a small extra cost per query.

Is re-ranking worth the extra cost?

Often, yes, when answers suffer from irrelevant chunks. The first vector search is fast but rough; the re-ranker reads each candidate against the question. Sending fewer, better chunks to the model can save more tokens than the re-ranker costs. Measure it with retrieval evals before and after.