Context precision
A RAG retrieval metric: whether the passages relevant to the question are ranked at the top of what was retrieved.
Each retrieved chunk is judged relevant or not, by comparison with a reference answer or by a judge model, and the score rewards relevant chunks appearing early in the list. A low score means the model gets noise mixed in with, or ahead of, the useful text, which costs tokens and can pull the answer off course. It is a property of the retriever and the reranker, not of the language model.
Related terms
- Context recall: A RAG retrieval metric: how much of the information needed for the correct answer was actually retrieved.
- Precision (AI metric): The share of returned results that are actually correct: of everything the system flagged or retrieved, how much was right.
- Reranker: A model that rescores the top search results against the query, so the most relevant ones go to the language model first.
- Ragas: An open-source Python library for evaluating RAG systems with metrics such as faithfulness, answer relevancy, context precision and context recall.
- Top-k (retrieval): The number of highest-ranked search results passed on to the next step; in RAG, how many passages go into the prompt.
