Implementation playbook

LLM Evaluation Playbook

A pragmatic, six-phase playbook to move from ad-hoc "looks right" review to a CI-gated, continuously monitored LLM evaluation program. Aligned to the GenAI Maturity Framework's "Evaluation & Assurance" cross-cutting theme.

Step 1 — Match your use cases to task types

Pick the row that matches each of your LLM-powered features. Use the suggested metrics and tools as your starting point; refine per the charter you write in Phase 1.

Task typeMetricsToolsGolden set target

Question Answering

Support bots, internal knowledge assistants, structured Q&A.

  • Exact Match (EM)
  • F1
  • Answer Relevance (judge)
  • Refusal appropriateness
  • DeepEval
  • OpenAI Evals
  • Promptfoo
100–500 questions sampled from real user traffic, labeled with reference answers and acceptance criteria per question.

RAG / Retrieval-Augmented

Doc search, enterprise assistants, policy Q&A over private corpora.

  • Faithfulness / groundedness
  • Context precision
  • Context recall
  • Answer relevance
  • Hallucination rate
  • Ragas
  • TruLens
  • DeepEval
  • Langfuse
150–300 queries with reference answers AND expected retrieved chunks; refresh quarterly as the corpus changes.

Summarization

Meeting notes, ticket summaries, legal briefs, long-context digests.

  • Coherence (judge)
  • Consistency / factuality
  • Coverage
  • Conciseness ratio
  • DeepEval (G-Eval)
  • OpenAI Evals
  • MLflow LLM Evaluate
80–200 source docs paired with reference summaries and rubric-based quality labels.

Code Generation

Copilots, code-fix bots, test generators, migration assistants.

  • Execution correctness (pass@k)
  • Static-analysis clean
  • Security-scan clean
  • Style/idiomaticity (judge)
  • OpenAI Evals
  • DeepEval
  • Custom sandboxed harness
HumanEval / MBPP for foundation; augment with 50–150 in-repo tasks capturing your own frameworks and idioms.

Safety-Critical Output

Medical guidance, legal advice, financial recommendations, compliance responses.

  • Toxicity
  • Bias
  • PII leakage
  • Refusal-appropriate rate
  • Adversarial robustness
  • Giskard
  • Inspect AI
  • DeepEval
  • HELM (comparative)
200+ prompts including adversarial variants, rotated automatically; policy-aligned expected behaviors.

Agent / Tool-use

Autonomous workflows, browser agents, multi-step task solvers.

  • End-to-end task success rate
  • Tool-call accuracy
  • Trajectory quality (judge)
  • Cost per completion
  • Time-to-complete
  • Inspect AI
  • Langfuse (trace-level)
  • Custom simulator
50–200 scripted end-to-end scenarios with success criteria and simulated tool responses.

Step 2 — Work through the six phases in order

Each phase is a maturity step. Don't skip ahead: CI gates are worthless without stable golden sets; drift alerts are noisy without calibrated judges. Complete the success signals before moving on.

  1. 1

    Choose task types and metrics

    Goal. Match each production use case to a task family and pick the right metrics for that family.

    Actions

    • Inventory every LLM-powered feature and classify each by task type (QA, RAG, summarization, code, safety, agent).
    • For each, pick 2–4 metrics: at least one automated, one judge-based, and one safety-oriented where applicable.
    • Write a one-page metric charter per feature — what it measures, why, threshold to ship.

    Success signals

    • Every LLM feature has a documented metric charter.
    • No two teams disagree on what "good" means for the same task type.
  2. 2

    Build and version golden datasets

    Goal. Assemble representative, versioned evaluation sets that reflect production traffic.

    Actions

    • Sample 100–500 examples from real production traffic (PII-scrubbed).
    • Add adversarial cases: known hallucination triggers, injection attempts, edge distributions.
    • Version datasets in Git or DVC; tag with release, dataset hash, and refresh date.
    • Set a refresh cadence: quarterly for stable domains, monthly for fast-changing ones.

    Success signals

    • Every eval run points to a specific dataset version.
    • Datasets refreshed on cadence; a review log exists.
  3. 3

    Wire evaluation into CI

    Goal. Make evaluation a blocking gate on prompt and model changes, not a manual step.

    Actions

    • Add an eval job to your CI pipeline triggered on any prompt or model config change.
    • Fail the PR if any metric drops below its charter threshold.
    • Cache eval results by prompt+model+dataset hash to keep CI fast.
    • Publish a per-PR eval report as a Markdown comment; link to full run in your eval tool.

    Success signals

    • A prompt regression is blocked in CI before merge — verified by a synthetic bad PR.
    • CI eval runtime under 10 minutes for common changes.
  4. 4

    Red-team continuously

    Goal. Actively probe for hallucination, prompt injection, jailbreaks, and safety failures — not just on release day.

    Actions

    • Adopt an automated red-team suite (Giskard, Inspect AI) and integrate into CI.
    • Rotate manual red-team days: quarterly for consumer-facing systems, monthly for high-risk.
    • Track a red-team scoreboard by system, with severity classification and time-to-fix.

    Success signals

    • Automated red-team runs on every release candidate.
    • Severity-1 findings have a defined SLA to remediation.
  5. 5

    Observe drift in production

    Goal. Detect quality regressions in the field, not just from user complaints.

    Actions

    • Instrument LLM traces with an observability tool (Langfuse, TruLens).
    • Sample production outputs and score with an LLM-as-judge, tracked over time.
    • Set alerts on 7-day rolling quality drop or judge-score divergence.
    • Wire alerts to on-call; define playbook for auto-rollback vs. investigate.

    Success signals

    • A drift alert triggers a real on-call page within 24 hours of a real regression.
    • Auto-rollback is a documented, rehearsed capability.
  6. 6

    Calibrate LLM-as-judge and close the loop

    Goal. Keep judge scoring aligned to what humans actually care about; feed learning back into prompts.

    Actions

    • Label a sample of judge outputs with human review each cycle.
    • Track inter-annotator agreement and judge–human agreement over time.
    • Version rubrics; roll back judge prompts that drift out of calibration.
    • Feed high-signal failures into your prompt-optimization pipeline (e.g., DSPy) with human sign-off.

    Success signals

    • Judge–human agreement above 0.8 (Cohen's kappa) for critical metrics.
    • Rubric versions are auditable.

Where you are today

Not sure which phase to start? Take the Deep-Dive assessment — 20-25 questions across the eval-relevant portions of Governance & Risk, Data & Infrastructure, and Use Cases & Applications — and you'll see exactly which phase to prioritize.