Training loss went down, the sample outputs look nicer, and someone in the channel says “it feels better.” None of that proves the adapter helped. The honest way to find out is a controlled comparison, and this guide lays out how to run eval before and after fine-tune so the answer is a number you can defend rather than a mood.
The core idea is boring on purpose: freeze everything except the model, run the same inputs through both versions, score with the same method, and compare paired results with a sense of how much noise is normal. Most disappointing fine-tuning projects skipped at least one of those steps.
The baseline is a competitor, not a formality
Teams often compare the tuned model with the raw base model and a weak prompt. Of course it wins. The comparison that matters is against the best alternative you could ship today for free. Build three baselines.
- Best-prompted base model. Your strongest system prompt, few-shot examples, and structured-output settings, as covered in prompt engineering.
- Retrieval-augmented base model, if the task involves knowledge. Often the “improvement” from tuning is really missing context.
- The current production system, whatever is serving traffic now.
An adapter that beats the raw model but loses to the best-prompted one is a net negative: you added a training pipeline and gained nothing. Write the baseline numbers down before the first training run starts, so no one can quietly move the goalposts later.
Build the evaluation set before you train
The test set has three rules.
- Held out for good. Split before generating or collecting training data, and deduplicate against train, including near-duplicates. Leakage inflates results silently, and synthetic data for SFT explains how it creeps in.
- Representative. Sample from production inputs, including ugly ones. Two hundred real inputs beat two thousand tidy invented ones.
- Sliced. Tag each item with the attributes you care about: language, length, task type, difficulty, customer tier. You will want per-slice numbers.
Keep three tiers: a dev set you may look at while iterating, a test set you consult once per candidate, and a small regression set of general prompts the model must not break. If you peek at the test set to tune, it becomes a dev set, and you need a new one.
Choose metrics that match the failure you tried to fix
The metric should come from the problem statement, not from what is easy to compute.
| Problem you tuned for | Primary metric | Companion metrics |
|---|---|---|
| Invalid or drifting JSON | Schema-valid rate | Field-level accuracy, retry rate |
| Wrong tone or voice | Blind human preference | Style-rubric score, length |
| Classification or routing | Accuracy or F1 by class | Confusion pairs, escalation rate |
| Tool-call formation | Exact-match or execution success | Argument validity, wasted calls |
| Grounded answers over context | Faithfulness and context use | See RAGAS |
Always add a cost-and-latency pair: tokens per request and p95 latency. A tuned small model that matches quality at a third of the cost is a win even if the headline score is flat.
If you use an LLM as a judge, calibrate it against human labels on a sample first and use the same judge model, prompt, and settings for both arms. A judge that changes between runs measures the judge. The MT-Bench and Chatbot Arena paper documents judge biases such as position and verbosity effects, which is why calibration is not optional.
Hold the experiment constant
A fair comparison fixes everything that is not the model.
- Same inputs, same prompt template, same chat formatting. Training-versus-serving template mismatch is a classic cause of bad tuned-model results.
- Same decoding settings. Temperature zero, or a fixed seed with multiple samples per item.
- Same retrieval snapshot and tool mocks.
- Same scoring code, versioned.
Then run each item through both versions and compare item by item, not just in aggregate. Paired comparison removes difficulty variation: you ask “on how many items did the tuned model win, tie, or lose?” rather than comparing two separate averages.
Is the difference real? A quick sense of noise
Suppose baseline accuracy is 80 percent on 200 items. The standard error of a proportion is about the square root of 0.8 times 0.2 divided by 200, roughly 2.8 points. A 3-point “improvement” on that set is well within noise, and many fine-tuning wins live in that range.
Paired analysis helps, since the two models are scored on identical items. A simple, honest tool is a paired bootstrap: resample the test items with replacement many times, compute the score difference each time, and look at the interval.
diffs = []
for _ in range(10000):
idx = rng.integers(0, n, n)
diffs.append(tuned[idx].mean() - base[idx].mean())
low, high = np.percentile(diffs, [2.5, 97.5])
If the interval comfortably excludes zero and the lower bound still clears your minimum useful gain, you have evidence. If it straddles zero, you have an inconclusive result, and the right move is more test items or a larger effect, not a victory post. Set the minimum useful gain before you look.
Slice, then slice again
Averages hide damage. A tuned model can improve overall while collapsing on non-English inputs, long documents, or the refusal cases that keep you out of trouble. Report each slice with its sample size and refuse to read slices below a handful of items.
Specific slices worth always checking after tuning:
- Regression prompts unrelated to the task. Forgetting shows up here first.
- Refusal and safety cases. Tuning on helpful-only data can erode guardrails.
- Out-of-distribution inputs. Does the model behave sanely on a question it was not trained for?
- Length and verbosity. Preference-tuned and distilled models often drift longer or shorter.
- Format under pressure. Long contexts, odd characters, and truncated inputs.
Look at transcripts, not just scores
Numbers tell you whether; transcripts tell you why. Read thirty paired outputs where the tuned model lost, grouped by failure type. You will usually find one or two patterns: it over-applies a learned template, it now refuses benign requests, it drops a field it used to include. Those patterns feed straight into the next dataset revision.
The ship-or-kill decision table
Define the rule up front and write it into the experiment log.
| Result | Action |
|---|---|
| Beats best baseline on primary metric with interval above minimum gain; no slice regresses beyond tolerance | Canary behind a flag |
| Beats raw model but not best-prompted baseline | Kill; keep the prompt |
| Gain only on slices you do not serve | Kill or retarget the dataset |
| Mixed: big win on one slice, loss on another | Fix data for the losing slice, retrain once |
| Inconclusive | Expand the test set before another training run |
A canary then verifies the offline story with real traffic: route a small share, monitor the same metrics plus complaints and fallback rate, and keep the previous artifact one flag away. These release habits are expanded in the LLMOps production guide, and the agent-side equivalent, where evaluation spans tools and steps, is touched on in harness engineering in practice.
What to store with every adapter
Treat the evaluation report as part of the artifact. Store the base model revision, adapter weights, training data hash, config, test-set version, scores with intervals, per-slice tables, and the decision log. When a regression appears months later, this record lets you tell a data problem from a model problem. If results are underwhelming, when fine-tuning fails provides the diagnosis ladder, and the adapter details live in the LoRA fine-tuning guide. The official PEFT docs explain how to load and swap the adapter versions you are comparing.
FAQ: evaluating before and after fine-tuning
What should I compare a fine-tuned model against?
Compare against the best alternative you could ship today: the base model with your strongest prompt, a retrieval-augmented version if knowledge matters, and the current production system. Beating a weak baseline proves little.
How big should my test set be?
Large enough that your expected gain exceeds noise. With a couple hundred items, differences of a few points are often within sampling error. Use paired bootstrap intervals, and expand the set when results are inconclusive.
Can I use an LLM judge to compare outputs?
Yes, after calibrating it on human-labeled samples. Use the same judge model, prompt, and settings for both versions, and spot-check judge decisions by hand, because judges carry biases such as favoring longer answers.
How do I detect catastrophic forgetting?
Keep a regression set of general prompts unrelated to your task and score both models on it. Also check refusal behavior and out-of-distribution inputs, since those degrade quietly when training data is narrow.
Do I need online evaluation if offline results are good?
Yes. Offline sets cannot cover every real input. Roll out behind a flag to a small traffic share, monitor quality, cost, latency, and fallback rates, and keep the previous artifact ready for instant rollback.
What if the tuned model wins on average but loses on one slice?
Check whether that slice matters to your users. If it does, add targeted examples for it and retrain once, then re-run the full comparison. Do not ship on an average that hides a failing segment you serve.
AI Generated Apps AI Code Learning Technology
