Course contentsShow
← Machine Learning and Deep Learning
Lesson 2031 of 3,53843. Retrieval-Augmented Generation: Advanced TechniquesFree lesson

Context Precision and Context Recall

Measuring whether retrieved chunks contain necessary information and exclude irrelevant content for RAG tasks.

Context Precision and Context Recall

What you'll learn: How to measure whether your RAG system retrieves chunks that contain all necessary information while excluding irrelevant content.

Beyond General Retrieval Metrics

You've learned about Precision, Recall, MAP, and NDCG for evaluating retrieval systems. But in RAG, we care about something more specific: does the retrieved context actually support answering the query? Context Precision and Context Recall go beyond "was this document relevant?" to ask "does this specific text provide what the LLM needs?"

Context Recall: Did We Get Everything?

Context Recall measures whether all information required to answer the query appears somewhere in your retrieved chunks. Even if you retrieve 10 relevant documents, if a critical fact is missing, your LLM will hallucinate or answer incorrectly.

Think of it like packing for a trip: Context Recall asks "did I pack everything I need?" You might retrieve 20 items, but if you forgot your passport, the trip fails.

Formula intuition: What fraction of ground-truth answer elements can be found in retrieved context?

Context Precision: Did We Avoid Noise?

Context Precision measures whether retrieved chunks contain only relevant information. Extra noise forces the LLM to sift through distractions, wasting tokens and potentially confusing the generation.

Using the packing analogy: Context Precision asks "did I pack only what I need, or is my suitcase full of junk?"

Formula intuition: What fraction of retrieved content is actually useful for the answer?

Why Both Matter

High Context Recall with low Context Precision means retrieving huge dumps of text (includes the answer, but buried in noise). High Context Precision with low Context Recall means tight, focused chunks that miss key facts. You need both.

Key Takeaway: Context Precision and Context Recall specifically evaluate whether retrieved text gives your LLM exactly what it needs—all necessary information, minimal distractions—making them essential RAG-specific metrics beyond traditional retrieval measures.