Skip to content

LLM Evaluation Frameworks

“It looks good in the demo” is how LLM systems ship bugs. Evaluation is the discipline of measuring whether your system works — and, crucially, whether a change made it better or worse. Without evals you’re tuning prompts by vibes; with them you can iterate safely.

Decide what you’re measuring before picking a method:

  • Capability — can the model do the task (accuracy, task completion)?
  • Safety — does it refuse what it should and avoid harmful output?
  • Alignment — does behavior match intent (tone, format, following instructions)?
  • Domain-specific — correctness against your domain (does the support bot give right answers from your docs?).

Most production teams care most about the last one — a use-case eval on real inputs beats a high public-benchmark score.

The foundation is a golden set: representative input→expected-output (or input→rubric) pairs you can re-run on every change. Collect real, representative examples (including edge cases and failure modes), write clear annotation guidelines, and balance the difficulty distribution. Start small — even 50–100 well-chosen cases catch most regressions — and grow it as you find new failures. Build it early; it’s what makes every later change measurable. (For RAG specifically, see the evaluation section of RAG Patterns.)

Human grading doesn’t scale, so a common pattern is LLM-as-judge: a strong model scores outputs against a rubric (the G-Eval / MT-Bench approach). It’s fast and surprisingly good, but knows biases you must control for:

  • Position bias — judges tend to prefer the first answer in a pairwise comparison; randomize order or average both orderings.
  • Verbosity bias — judges over-reward longer answers; control for length.
  • Self-preference — a model judging its own family’s outputs can be lenient; consider a different judge model.

Calibrate the judge against human labels on a subset before trusting it at scale.

Treat evals like tests: run the golden set in CI on every prompt/model change, compare scores against the previous baseline, and fail or alert on regressions past a threshold. Track scores over time so you can see drift. This is what lets you change a prompt or swap a model without flying blind.

BenchmarkMeasures
MMLUBroad knowledge across subjects
HumanEval / MBPPCode generation
GPQAGraduate-level reasoning (hard)
MATHMathematical problem solving
HELMHolistic, multi-metric evaluation
  • Promptfoo — open-source prompt/regression testing, CI-friendly.
  • RAGAS — RAG-specific metrics (faithfulness, relevance).
  • OpenAI Evals — open-source eval framework.
  • Hosted platforms (e.g. Braintrust, LangSmith) for managing datasets and runs at scale.

Human eval is most accurate but slow and expensive; automated metrics are cheap but shallow; LLM-as-judge sits in between. Mix them: cheap automated checks on every run, LLM-as-judge for nuanced quality, and periodic human review to keep the judge honest.