Skip to main content
AI on Kubernetes · GPU/NPULesson 20 of 20

Evaluating a Model Before and After Deploy

A new model, prompt or quantization can look fine in a few chats and still break real tasks. Evaluation turns "looks fine" into numbers you can compare: offline before deploy, then online on real traffic.

Candidatechat-model q4
Baselinechat-model bf16
Decision—
ProductionCandidatemodel · prompt · quantEval setfrom real tasksEval runnerCI jobLLM judgescores open answersHuman labelscalibrate the judgeRegression gatepromote or blockResults storeper model versionCanarysmall traffic shareStable modelcurrent versionnew version
RequestResponse / reportWatchAppears in a later step

What you will learn

  • Build an eval set from real tasks, not from a demo
  • Exact match, pass@k and task-specific scores
  • LLM-as-judge biases and calibration against humans
  • Why contaminated test data inflates scores
  • A CI regression gate with safety and refusal evals
  • Canary or A/B with quality and latency, tracked per version

Which evaluation for which job​

MethodGood forWatch out
Exact matchShort answers, labels, IDsNormalize case, spaces and punctuation first
pass@kCode with unit testspass@1 is what users see; tests must be strong
Format checksJSON, tool calls, schemasValid format does not mean right content
LLM-as-judgeSummaries, replies, open answersPosition, length and self-preference bias; calibrate with humans
Human reviewSmall samples, new tasks, judge calibrationSlow and costly; use a clear rubric
Safety and refusal evalsHarmful requests refused, benign ones answeredTrack both over-refusal and under-refusal
Online canary or A/BReal traffic, real latencyNeeds enough traffic and an automatic rollback

Try it yourself​

# Run the same eval against baseline and candidate (both serve an OpenAI-compatible API)
lm_eval --model local-completions --tasks gsm8k \
--model_args model=chat-model,base_url=http://baseline:8000/v1/completions \
--output_path results/baseline --log_samples
lm_eval --model local-completions --tasks gsm8k \
--model_args model=chat-model,base_url=http://candidate:8000/v1/completions \
--output_path results/candidate --log_samples

# Compare the scores side by side
find results -name 'results_*.json' -exec jq -c '{file: input_filename, results}' {} \;

# Watch the online canary (if you deliver with Argo Rollouts)
kubectl argo rollouts get rollout chat-model -n llm --watch

Check yourself

  1. The candidate is 1 point lower on average but 9 points lower on the SQL slice. What should the gate do?
  2. An LLM judge prefers whichever answer it reads first. What is the usual fix?
  3. A model scores far higher on a public benchmark than on your private eval set. What is a likely reason?

Further reading: lm-evaluation-harness · Judging LLM-as-a-Judge (biases) · Evaluating LLMs Trained on Code (pass@k) · Making a Model Smaller (Quantization) · Progressive Delivery with Argo Rollouts · From Training Job to Model