Sobes.tech
Middle — Senior

What are the quality metrics for generation in RAG (faithfulness, answer relevancy, context precision/recall)?

sobes.tech AI

Answer from AI

In RAG (Retrieval-Augmented Generation), the following metrics are often used to evaluate the quality of generation:

  • Faithfulness — how well the generated answer corresponds to facts extracted from the context. Important for assessing truthfulness and absence of hallucinations.

  • Answer relevancy — how relevant the answer is to the given question, i.e., whether it answers it fully and substantively.

  • Context precision/recall — metrics that evaluate the quality of extracting relevant information from the knowledge base:

    • Precision — the proportion of retrieved documents that are truly relevant.
    • Recall — the proportion of relevant documents that were retrieved.

These metrics help understand how effectively the model uses external context and how accurately it formulates answers based on it.