BXUP Track progress & test yourself — free
Data Science & ML/AI · Playbook · Advanced · ~5 min read
DATA SCIENCE & ML/AI · PLAYBOOK · ADVANCED

Evaluate the Fine-Tune Honestly: Contamination, Regressions, Base-vs-Tuned

Most fine-tunes "work" in the demo and die in production, and the cause is almost always evaluation malpractice: eval examples that leaked into training, comparisons against a strawman baseline, and nobody checking what the model forgot.

Tier: Advanced · Workflow area: Fine-tuning & Model Adaptation

Indian fine-tuning-specialist postings now name "benchmarking model performance" explicitly — this playbook is that skill: a three-part honest evaluation (contamination audit, matched base-vs-tuned harness, general-capability regression suite) that produces a ship/no-ship verdict you can sign.

When to use

  • Any adapter from pb-29/pb-30 (or a vendor's fine-tune) is a candidate for shipping.
  • A fine-tune's reported gains look too good and you have review responsibility.
  • You inherited a tuned model with no evaluation trail and must establish one before it goes near production.

This playbook is not optional after fine-tuning — treat "we fine-tuned it" without this evidence as an unreviewed PR.

Prerequisites

  • The tuned adapter, exact base model + revision, and the training dataset version (pb-28's data card).
  • The held-out eval set (task-specific) plus grader — deterministic checks where possible (pb-37), calibrated judge where not (pb-36).
  • lm-eval-harness (or a custom equivalent) for general-capability checks; Kaggle/Colab GPU is enough for 3–8B inference.

The workflow

  1. Audit contamination independently — do not trust the data card. Re-run the check yourself: embed all training instructions and all eval inputs, flag cosine similarity > 0.85; plus n-gram overlap (13-gram collision is a standard tripwire) between training pair texts and eval texts. Any hit gets the eval item replaced or the training pair documented-and-removed for a retrain. Report the contamination rate even if zero — "0 of 1,014 pairs flagged at 0.85" is evidence; silence is not.

  2. Build the matched harness. One script, two models (base and tuned), and everything else identical: same chat template, same system prompt, same decoding (temperature 0 for graded tasks), same max tokens, same grader version. The number-one source of fake fine-tune gains is an unmatched comparison — a tuned model with a tuned-friendly prompt against a base model with a lazy prompt.

  3. Give the base model its best shot. Run the base model with few-shot examples and an optimized prompt as an additional arm. The honest question is not "tuned vs naive base" but "tuned vs the best you can get without training" — pb-27's rung 1. If prompt-engineered base ≈ tuned, the adapter is not paying for its maintenance.

  4. Score with slices and uncertainty. Report per-slice metrics (sub-task, difficulty, input length) and bootstrap confidence intervals over eval items. A +6-point average hiding a −15-point slice on the highest-volume sub-task is a no-ship; averages are where regressions hide.

  5. Run the general-capability regression suite. Fine-tuning on 1k narrow pairs can degrade instruction-following, refusal behavior, and out-of-domain competence (catastrophic forgetting still bites at LoRA scale, just less). Run base vs tuned on: (a) 2–3 lm-eval-harness tasks near your domain (e.g., an MMLU subset, GSM8K if numeric); (b) 20 hand-picked out-of-domain prompts scored by your judge; (c) 10 safety/refusal probes relevant to your deployment. Flag any drop > 2–3 points for investigation.

  6. Check behavioral regressions specific to your stack. Schema-validity rate under the production parser, latency and tokens/response (tuned models often get verbose or terse), and — if the tune combines with RAG — the full Ragas run (pb-35) on the combined pipeline, since a tuned generator can increase hallucination by answering from tuned "knowledge" instead of retrieved context.

  7. Write the verdict memo. One page: contamination audit result; the three-arm table (base, base+best-prompt, tuned) with CIs and slices; regression suite deltas; ship / ship-with-conditions / retrain decision; and the monitoring hooks that carry these metrics into production (pb-37's CI gates pick them up from here).

Key Takeaway:

The comparison that matters is tuned-model vs prompt-engineered base on decontaminated data with matched everything — any easier comparison is marketing.

Tool variants

  • lm-eval-harness: standardized general-capability tasks; reproducible flags and versioned task defs.
  • Custom pytest-style harness: for your task metrics and schema checks; slots directly into CI later (pb-37).
  • Ragas + Phoenix: when the fine-tune lives inside a RAG pipeline — evaluate the pipeline, not the model in isolation.

Verification

  • Contamination audit re-run by someone other than the dataset author, with method and rate stated.
  • Three arms present (base, base+optimized-prompt, tuned) under matched templates, decoding, and grader.
  • Confidence intervals reported; no slice regression above threshold left undiscussed.
  • General-capability and safety/refusal deltas documented; schema-validity and verbosity checked under production parsing.
  • The verdict memo names a decision and its conditions — not "results look promising."

Pitfalls

  • Trusting the training team's own decontamination. Independent re-audit is the point; incentives are misaligned by construction.
  • Template mismatch between arms. A base model scored without its expected chat template loses points it deserves; matched harness means byte-level matched formatting.
  • Averaging away the regression. Slice reporting is mandatory; production traffic is never uniformly distributed over your eval set.
  • Judge grading its own family. If the judge model shares a family with the tuned model, self-preference bias inflates scores — use a different-family judge or double-grade a sample (pb-36).
  • One-time evaluation. These numbers are the baseline for CI regression gates; a fine-tune without ongoing gates regresses silently at the next prompt change.

Restricted-environment variant

  • Run everything self-hosted: lm-eval-harness and custom harnesses work offline with local checkpoints; judge calls go to a self-hosted 8B judge with a doubled human-verified sample (pb-36's restricted pattern).
  • If eval items derive from client data, the verdict memo may cross the boundary but eval items may not — write the memo with counts and deltas only, no verbatim examples.
  • Pin and archive everything inside the boundary: base revision, adapter hash, harness commit, judge version — client audits ask for exactly this chain.
Remember:

An honest "no-ship, retrain with fixed data" verdict is a successful evaluation — the failure mode is shipping on flattering numbers, not failing to ship.

Success criteria

  • A signed verdict memo with the three-arm table, contamination rate, and regression deltas.
  • At least one potential self-deception caught and neutralized (leaked pair, unmatched prompt, hidden slice regression) — if you found none, look again.
  • Eval artifacts versioned and wired so pb-37's CI can replay them on the next change.
  • Your team's default question shifted from "did the loss go down?" to "what did we check it against?"
This is the free reading view. Open BXUP to track your progress, run the hands-on labs, and prove it with original, exam-pattern assessments.
© Anvi Innovate · BXUP — Be Exponentially Upskilled · BXUP is an independent learning platform, not affiliated with or endorsed by AWS, Microsoft, Google, NVIDIA, IBM, Salesforce, Databricks, Oracle or Anthropic. All trademarks belong to their respective owners. · bxup.in