Мазмұнға өту
Мақала Kazakh тілінде әлі жарияланбаған. English нұсқасы көрсетілуде.

Evaluating RAG Answers: Faithfulness, Groundedness, and Answer Relevancy (RAGAS)

2 мин оқу

High retrieval recall does not guarantee a truthful answer. An LLM can ignore retrieved constraints, blend training-data assumptions into company policies, or dodge the user's question with generic filler. End-to-end RAG evaluation separates groundedness from usefulness.

The RAG Evaluation Triad

DimensionCore QuestionFailure Example
Context PrecisionAre the retrieved passages actually useful and ranked high?Relevant pricing paragraph sits at rank 7 behind 6 unrelated chunks
Faithfulness (Groundedness)Is every factual claim in the answer supported by retrieved context?Answer promises "30-day free returns" when the policy states "14 days"
Answer RelevancyDoes the answer directly address what the user asked?Factually true paragraph about shipping when the user asked about warranty
Abstention AccuracyDoes the model refuse cleanly when evidence is missing?Fabricates a phone number instead of escalating to a human

Claim-Level Faithfulness Verification

Rather than asking a judge model "rate this answer 1 to 5" (which produces noisy, uncalibrated scores), decompose faithfulness into atomic claim verification:

  1. Extract every factual claim made in the assistant's response.
  2. For each claim, check whether it is supported, contradicted, or not mentioned in the retrieved context.
  3. Compute faithfulness = supported_claims / total_claims and fail CI immediately on any contradicted claim.
json
{
  "claims": [
    {
      "statement": "Refunds are processed within 5 business days.",
      "verdict": "supported",
      "evidenceSourceId": "src-2"
    },
    {
      "statement": "Express shipping fees are refunded automatically.",
      "verdict": "contradicted",
      "evidenceSourceId": "src-2"
    }
  ],
  "faithfulnessScore": 0.5,
  "hasContradiction": true
}

Avoiding Judge Bias in Automated Evals

  • Never use the exact same prompt and model family uncalibrated without checking agreement against human labels on a 30-example calibration slice.
  • Pin judge model versions and temperature 0 so weekly trend lines reflect real pipeline changes rather than model drift.
  • Track tail failures alongside averages: an average faithfulness of 0.96 can still hide a 4 percent rate of critical pricing or policy contradictions.

Next: keep the underlying knowledge base fresh without burning embedding budgets in Incremental Knowledge Indexing.

Бұл пайдалы болды ма?