Skip to main content

LLM Evaluation and Evals

LLM evals replace demo-driven guesswork with repeatable, scored tests of accuracy, faithfulness, safety, and cost. Run them in CI and gate releases so quality improves with evidence instead of drifting silently.

Organization
OpenAI
Published
May 1, 2023

Best Practice: LLM Evaluation and Evals

LLM evaluation ("evals") is the practice of measuring the quality of a model or an LLM-powered application with repeatable, scored tests. Because model output is non-deterministic, you cannot rely on a quick demo to know if a change helped or hurt. Evals give you a quantitative signal across dimensions such as accuracy, faithfulness to source, safety, format compliance, latency, and cost. This matters because without evals, prompt and model changes become guesswork and regressions ship silently.

Evals come in two broad forms. Offline evals run a curated test set against the system and score the results before release. Online evals sample real production traffic and score a slice of it continuously. Both are needed: offline evals catch regressions before they ship, while online evals reveal the long tail of real-world inputs you never imagined. A mature team treats its eval suite like a regression test suite, growing it every time a new failure is found so the same mistake cannot return unnoticed.

Step-by-Step Implementation Guidance

  1. Build a representative test set from real or realistic inputs, including hard cases.
  2. Define metrics tied to user value: correctness, faithfulness, helpfulness, safety.
  3. Choose scoring methods: exact match, rubric scoring, or LLM-as-judge with a clear rubric.
  4. Establish a baseline score for the current system.
  5. Run evals automatically on every prompt or model change in CI.
  6. Track per-metric scores over time and gate releases on thresholds.
  7. Expand the test set with new failures found in production.
  8. Audit LLM-judge agreement against human labels periodically.

Scoring is the hard part of evals. Exact-match works for closed answers but fails for free text. Reference-based metrics compare against a gold answer. The most flexible approach is LLM-as-judge, where a second model scores a response against a written rubric; it scales well but must be validated against human labels periodically, because an unchecked judge can drift or develop its own biases. Combining a small set of human-labeled examples with automated scoring gives both coverage and trust. Coverage matters as much as method: a test set that omits hard, adversarial, or edge-case inputs will report high scores while the system fails on exactly the cases users hit most. Curating those difficult examples is often what separates a useful eval suite from a misleading one.

Common Mistakes Teams Make When Ignoring This Practice

  • Shipping based on a few hand-picked demos.
  • Using only one metric and missing safety or cost regressions.
  • Tiny or unrepresentative test sets that overfit.
  • Trusting LLM-as-judge without validating against humans.
  • No CI gate, so quality drifts release by release.

Tools and Techniques That Support This Practice

  • Frameworks: OpenAI Evals, RAGAS, DeepEval, promptfoo, LangSmith, TruLens.
  • Techniques: LLM-as-judge, rubric scoring, golden datasets, regression suites.
  • Observability: trace-linked evals for production sampling.

How This Practice Applies to Different Migration Types

  • Cloud Migration: Evaluate an assistant that interprets migration logs before trusting it.
  • Database Migration: Score generated schema mappings against known-correct answers.
  • SaaS Migration: Test that generated integration code passes contract checks.
  • Codebase Migration: Measure translation accuracy with compile and test pass rates.

Checklist

  • Representative test set built
  • Value-aligned metrics defined
  • Scoring method chosen and documented
  • Baseline recorded
  • Evals run in CI on every change
  • Release gated on thresholds
  • LLM-judge validated against human labels