agentleFS
Goodnight77Goodnight77/rag-skills/skills/evaluation-metrics/generation-evaluation-metrics/SKILL.md

generation-evaluation-metrics

Skill8 starsChanged 7 months agoMITView on GitHub

Score RAG answers for faithfulness, answer relevancy, and correctness using LLM-as-judge methods.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No reference answers or grounding context exist to judge against

    line 54

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Overview

Generation evaluation measures the answer itself: whether it is grounded in the retrieved context, addresses the question, and is factually correct. These metrics catch hallucination and drift that retrieval metrics cannot see.

Problem Statement

A pipeline can retrieve perfect context and still produce a wrong, unsupported, or off-topic answer. Exact-match and BLEU-style scores fail on open-ended answers, so teams need semantic and grounding-aware evaluation instead.

Key Concepts

  • Faithfulness: Whether every claim in the answer is supported by the retrieved context.
  • Answer relevancy: Whether the answer actually addresses the question asked.
  • Correctness: Whether the answer agrees with a reference or ground-truth answer.
  • LLM-as-judge: Using a strong model with a rubric to score answers at scale.
  • Hallucination rate: Share of answers containing claims not grounded in context.

Implementation Guide

Step 1: Separate Grounding from Correctness

Score faithfulness against the retrieved context and correctness against a reference answer as two different numbers.

Why: An answer can be faithful to bad context yet wrong, or correct yet unsupported; conflating them hides both failure modes.

Step 2: Use LLM-as-Judge with a Fixed Rubric

Define an explicit rubric and score with a strong judge model, requesting a short justification alongside each score.

Why: A fixed rubric and recorded rationale make LLM judgments repeatable and auditable instead of arbitrary.

Step 3: Calibrate the Judge Against Humans

Spot-check a sample of judge scores against human labels and adjust the rubric until they agree.

Why: An uncalibrated judge produces confident but misleading numbers; calibration keeps automated scores trustworthy.

For rubrics and implementations, see RAGAS generation metrics, DeepEval metrics, and the G-Eval paper.

When to Use This Skill

  • Detecting hallucination and ungrounded claims in answers
  • Comparing prompts, models, or generation settings on answer quality
  • Adding an answer-quality gate on top of retrieval metrics

When NOT to Use This Skill

  • The bottleneck is retrieval and context is already known to be poor
  • Answers are short exact facts where deterministic matching is enough
  • No reference answers or grounding context exist to judge against

Related Skills

  • Retrieval Evaluation Metrics - Score the context, not the answer
  • RAG Evaluation Frameworks - Tools that compute these metrics
  • Self-RAG - Self-assessed grounding at runtime
  • Explainable Retrieval with Citations - Traceable grounding

Metrics & Success Criteria

  • Faithfulness: High share of answer claims traceable to retrieved context
  • Answer Relevancy: Answers consistently address the question asked
  • Correctness: Strong agreement with reference answers on the golden set
  • Judge Calibration: LLM-as-judge scores align with sampled human labels

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.