Skip to main content
Feedback loop between offline evaluation and production signals feeding new test cases

The Complete Guide to LLM Evaluation in Production

Evaluating LLMs is one of the least glamorous parts of AI engineering — and one of the most important. Without a rigorous evaluation system, you’re flying blind: unable to tell if a prompt change made things better or worse, or whether a new model version is an upgrade or a regression.

Here’s the evaluation framework we’ve developed across dozens of production AI projects.

Two Types of Evaluation You Need

Offline Evaluation (Pre-deployment)

Run before any change goes to production. You need a curated test set of representative inputs, reference outputs, and automated metrics. These run in CI — any change that degrades your eval score by more than your threshold blocks the deployment.

For LLM outputs, useful automated metrics include:

  • Exact match / F1 score for factual extraction tasks
  • ROUGE / BERTScore for summarization
  • G-Eval or LLM-as-judge for open-ended generation quality
  • Custom rule-based checks for format adherence (always do this)

Online Evaluation (Post-deployment)

Monitor production traffic continuously. You can’t evaluate every response, but you can sample. Combine automated signals (format failures, latency spikes, refusals) with periodic human review of sampled responses.

Track your production metrics over time: response quality score, refusal rate, formatting error rate, semantic drift from baseline.

Build Your Golden Test Set Carefully

Your offline test set is only as good as its inputs. Don’t use synthetic data generated by the same model you’re testing — this creates circular evaluation. Use:

  • Real production queries (anonymized)
  • Edge cases your team has found through adversarial testing
  • Inputs from customer support tickets that historically caused problems
  • Distribution-representative samples across all your use case categories

Aim for at least 200-500 examples before you trust your eval numbers. And refresh the test set every quarter — production distribution shifts.

The LLM-as-Judge Pattern

For tasks where there’s no deterministic correct answer (creative writing, nuanced Q&A, tone-of-voice consistency), automated string-matching metrics fall short. We use an LLM-as-judge approach: a separate, more capable model evaluates outputs on a rubric you define.

Key rules for LLM-as-judge:

  • Use a model different from the one you’re evaluating
  • Give the judge a structured rubric with 1-5 scoring guidelines, not vague instructions
  • Always include reference outputs in the prompt
  • Measure judge agreement with human annotators periodically

Evaluation is the foundation of continuous improvement. Without it, your AI system will silently degrade over time without your team noticing. If you need help building an eval pipeline for your AI application, we can help.

RAG pipeline from sources through permissioned indexing, retrieval and reranking to a grounded answer

How to Make a RAG System Reliable in Production

The reliability boundary in RAG A reliable RAG system retrieves authorized, current, relevant eviden...

Evaluation pipeline from dataset to quality gates, splitting into release and hold decisions

How CTOs Should Build an LLM Evaluation Framework

The evaluation decision CTOs need to make An LLM evaluation framework converts "does this feel bette...

Waterfall chart reducing monthly spend from $42k to $16k through routing, caching, prompts and batching

Reducing LLM Inference Costs by 60%: A Case Study

When a B2B SaaS company came to us, their AI features were a success story — too successful. Their m...

Model Optimization & Evaluation

Improve model quality, control costs, and establish repeatable evaluation systems.

Discuss your project