What does context precision measure in RAG evaluation and what does low context precision indicate?
Context precision is the fraction of retrieved chunks that are relevant, weighted so relevant chunks should rank high. Low precision means the retriever returns noise that distracts the generator.
Imagine you ask a research assistant for the most useful pages on a topic, and they hand you a stack. Context precision asks: of the pages they actually gave you, how many were genuinely relevant, and did they put the good ones on top? If they hand you ten pages but only three matter, precision is low. Worse, if the three good pages are buried at the bottom, the score drops further, because a smart reader skims the top first. The danger of a low score is not just wasted reading. The model that writes your final answer reads those pages too, and the junk ones can distract it into a wrong or muddled response. High precision means a clean, mostly relevant stack with the best pages up front.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Context precision is one of the four core RAGAS retrieval metrics, and it answers a deceptively simple question: of the chunks your retriever returned, what fraction were actually relevant to answering the user's question? It is the retrieval-stage analogue of classic information-retrieval precision, where relevant chunks are true positives and off-topic chunks are false positives.
The reason it earns a dedicated metric is that retrieval and generation fail in different ways, and you cannot debug a RAG pipeline if you collapse both stages into a single end to end quality number. A bad final answer might mean the retriever fetched garbage, or it might mean the retriever fetched gold and the generator ignored it. Context precision isolates one specific retrieval failure: noise. It tells you, independent of how the answer turned out, how clean the material handed to the generator was.
The question asks both what the metric measures and what a low value indicates. The correct option captures both halves: precision is the relevant fraction of retrieved context, and low precision means the retriever is pulling in noise that crowds the generator's context window. This deep dive defines the metric precisely, derives the rank-aware RAGAS formulation, separates precision from its frequently-confused sibling recall, walks the top-k tradeoff that ties them together, and traces the concrete path from low precision to a degraded answer in production.
The definition and why it is a retrieval metric
Context precision lives at the retrieval stage of a RAG pipeline, before the generator ever runs. Your retriever fetches some number of chunks for a query. Some of those chunks contain information that helps answer the question; the rest are off-topic. Context precision is the fraction that helps.
Map this onto standard precision. The positive class is 'relevant chunk'. A relevant chunk that you retrieved is a true positive. An irrelevant chunk that you retrieved is a false positive. Precision is true positives over all retrieved chunks, which is true positives divided by true positives plus false positives.
A practical wrinkle is how relevance gets judged in the first place. In a RAGAS-style setup, an LLM judge labels each retrieved chunk as relevant or not, sometimes by checking whether the chunk supports the reference answer or whether it could plausibly help answer the question. That judgment is itself a measurement with some noise, which is why teams often sample and spot-check the judge against human labels rather than trusting raw per-chunk verdicts blindly.
This is why precision is a retrieval-quality signal and not a generation-quality signal. It says nothing about what the model wrote. It only scores the cleanliness of the material you handed the model. A retriever can have perfect precision while the generator still produces a bad answer for other reasons, and a generator can write a great answer despite mediocre precision if it happens to lean on the few relevant chunks. Keeping the stages separate is the whole point.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
Real products, models, and research that use this idea.
- RAGAS computes context precision@k as a rank-aware metric and pairs it with context recall in its standard RAG report.
- TruLens exposes a context relevance score that plays the same diagnostic role as precision for retrieved chunks.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhy does RAGAS make context precision rank-aware instead of a simple relevant over total ratio?
Tie it to how generators attend across long context. Relevant chunks near the top get more attention, so rank carries real signal. Explain context precision@k as a weighted mean of precision at each relevant rank.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Confusing context precision with context recall. Precision asks how many retrieved chunks are relevant; recall asks how much of the needed information was retrieved at all. They diagnose opposite retrieval failures.
60 second bullets to scan on the way to the call.
What context precision measures over the retrieved chunks
Why the RAGAS version is rank aware, not a flat ratio
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.