Learn AI compute, then follow the market
← Back to Compute College

Compute College

Ranking, reranking, and retrieval quality

Learn how retrieval systems order candidate evidence and how to measure whether the right material reaches context.

Plain-English definition

Ranking orders retrieved candidates by estimated usefulness for a query. Initial retrieval may use keywords, embeddings, metadata, or a hybrid. Reranking applies a more expensive relevance check to a smaller candidate set before the final chunks enter context. Retrieval quality asks whether the evidence needed for a correct answer was found and placed high enough to use.

Memory trick: Rankers choose candidates. Rerankers spend more effort on fewer candidates. Evaluations decide whether the extra effort paid off.

Why it matters

A semantically similar passage can still be the wrong policy version, region, or exception. Reranking can improve relevance, but it adds compute and latency. The right system balances recall, precision, context size, and response requirements instead of maximizing one retrieval score.

  • Recall asks whether needed evidence was found at all; precision asks how much retrieved evidence was useful.
  • Metadata filters can remove wrong candidates before an expensive reranker runs.
  • Increasing top-k can improve recall while increasing context tokens, latency, and distraction.

Simple example

A policy assistant retrieves 20 candidates by hybrid search, filters them to the employee’s region and current policy version, reranks the remaining eight, and supplies the top four with citations. If a held-out exception question still misses the controlling clause, the team changes chunking or metadata rather than simply raising top-k forever.

  • Filter authority and scope before semantic similarity when the rules require it.
  • Use held-out questions with known supporting passages.
  • Compare answer grounding after changing retrieval, not only the ranker score.

Example figures are illustrative calculations, not current quoted market prices.

Current example

Retrieval quality reference

Google’s RAG material describes retrieval as a distinct stage in a grounded-generation system. This lesson extends that separation into an evaluation and workload view: a better ranker is useful only if it improves accepted answers at an acceptable cost.

Google Cloud RAG use case

Reference for the retrieval stage that supplies external information to a generative model.

Source discipline: the reference explains the concept or method; it is not a substitute for measuring a production workload under its actual provider, model, and data conditions.

Common mistake

A better retrieval metric does not guarantee a supported answer. A passage can rank highly and still fail to support the final claim, especially when the query requires an exception or multiple sources.

Practical takeaway

What you can do with this

Build a small labeled set with required evidence IDs. Compare initial retrieval and reranked results at several top-k values, then pass each result through the same generation and grounding review.

  • Evaluators: label required evidence and acceptable alternatives.
  • Builders: keep retrieval and generation metrics separate.
  • Operators: measure retrieval latency and compute as corpus and query volume grow.

Decision check: does the retrieval configuration improve grounded accepted answers enough to justify its added latency and context cost?

Compute College track

Prompt & Context Engineering

Step 14 of 18: Ranking reranking and retrieval quality