M1: Why Fine-Tune M2: Dataset Prep M3: LoRA M4: RLHF M5: Evaluation M6: Deployment Capstone
Intermediate Read time: 14 min Module 5 of 6

Evaluating a Fine-Tuned Model

A logistics company fine-tuned a model for order tracking queries. The training loss dropped to near zero. They deployed it, and it failed on 30% of real user questions. Training loss doesn't measure what matters. This module teaches you what does.

Module 5 of 6 — Fine-Tuning LLMs

By the end of this module, you will be able to design an evaluation suite for a fine-tuned model, explain the difference between automatic and human evaluation, and detect catastrophic forgetting before deploying.

The Evaluation Stack

Good evaluation uses multiple complementary methods. No single metric tells the whole story.

Layer 1: Perplexity

Perplexity measures how surprised the model is by text in your held-out validation set. Lower perplexity means the model assigns higher probability to the correct tokens — it "expected" what actually appeared. Perplexity is fast to compute and tracks training progress well.

The limit: perplexity can improve even when model outputs get worse for users. A model might get better at predicting tokens in your training distribution while still failing on the edge cases that matter most in practice.

Layer 2: Task-Specific Metrics

Match the metric to the task:

Layer 3: LLM-as-Judge

Use a capable LLM (e.g., GPT-4 class) to score your fine-tuned model's outputs on a rubric: helpfulness, accuracy, tone, and format. This scales better than human evaluation and correlates well with human preference when the judge model is calibrated carefully (Zheng et al., arXiv:2306.05685).

Layer 4: Human Evaluation

For high-stakes applications, there is no substitute. Have real users (or domain experts) rate outputs on a 1–5 scale. Sample 100–200 representative inputs. This is expensive but provides ground truth that automatic metrics can't give you.

Key concept

Use at least two evaluation layers: an automatic metric that runs at every training step to catch regressions, and a human or LLM-judge evaluation that runs before every deployment decision.

Evaluation stack: four layers from perplexity to human eval Layer 1: Perplexity — runs every training step, fast, tracks convergence Layer 2: Task metrics (F1, ROUGE, EM) — runs on held-out test set Layer 3: LLM-as-judge — runs before deployment decisions Layer 4: Human evaluation — high-stakes, ground truth directional illustration

Catastrophic Forgetting: The Hidden Trap

Fine-tuning on a narrow dataset can cause the model to forget what it knew from pre-training. This is called catastrophic forgetting. The model gets better at your task but worse at everything else. In a customer support model, this might mean the model starts refusing to answer general questions it handled confidently before fine-tuning.

How to detect it: run a general-purpose benchmark (MMLU, HellaSwag, or a set of diverse test questions) on both the base model and your fine-tuned model. If scores drop significantly (more than 5 percentage points), your fine-tuning is too aggressive. Reduce epochs, lower learning rate, or use LoRA, which is less likely to cause forgetting than full fine-tuning.

Research grounding The MEDFIT-LLM paper (Rao, Jaggi, Naidu — IEEE RMKMATE 2025, DOI:10.1109/RMKMATE64574.2025.11042816) evaluated fine-tuned models on medical fitness assessments and demonstrated the importance of domain-specific evaluation alongside general capability checks — a principle that applies across industries.
Evaluation Score Comparator Interactive

Compare a base model against your fine-tuned model across evaluation dimensions. Adjust to explore tradeoffs.

3
70
from datasets import load_dataset
from evaluate import load
import torch

def evaluate_model(model, tokenizer, test_data, general_benchmark):
    """
    Run two-track evaluation: task-specific + forgetting check.
    """
    results = {}

    # Track 1: Task-specific F1 on your domain test set
    rouge = load("rouge")
    task_preds = []
    task_refs = []

    model.eval()
    with torch.no_grad():
        for ex in test_data:
            inputs = tokenizer(ex["instruction"], return_tensors="pt").to(model.device)
            outputs = model.generate(**inputs, max_new_tokens=128)
            pred = tokenizer.decode(outputs[0], skip_special_tokens=True)
            task_preds.append(pred)
            task_refs.append(ex["output"])

    rouge_scores = rouge.compute(predictions=task_preds, references=task_refs)
    results["task_rouge_l"] = rouge_scores["rougeL"]

    # Track 2: General capability check (catastrophic forgetting detection)
    # Run a subset of MMLU or your own general questions
    general_correct = 0
    for q in general_benchmark[:100]:
        inputs = tokenizer(q["question"], return_tensors="pt").to(model.device)
        with torch.no_grad():
            outputs = model.generate(**inputs, max_new_tokens=50)
        pred = tokenizer.decode(outputs[0], skip_special_tokens=True)
        if q["answer"].lower() in pred.lower():
            general_correct += 1

    results["general_accuracy"] = general_correct / 100
    results["forgetting_risk"] = "HIGH" if results["general_accuracy"] < 0.6 else "LOW"

    return results

A Minimal Evaluation Suite You Can Build Today

You don't need a research team or infrastructure to run useful evaluations. Here's a practical checklist:

  1. Hold out 15% of your data before fine-tuning. Never train on it. Use it to measure task performance.
  2. Compile 30 general questions covering topics the base model handles well (geography, basic math, factual questions). Run these on both models and compare.
  3. Run 20 adversarial inputs: edge cases, unusual phrasings, inputs just outside your training distribution. These reveal gaps that average metrics hide.
  4. Score 20 outputs with LLM-as-judge on: accuracy (1–5), format correctness (1–5), and appropriateness for your use case (1–5).
  5. Compare distributions rather than just averages. A model with average F1 of 0.82 might still fail badly on a specific subcategory. Always segment results.
Try this — no setup required Design a 10-question evaluation for a fine-tuning task you care about. Write 3 questions that test the core task, 3 that test edge cases in your domain, 2 general knowledge questions (to detect forgetting), and 2 adversarial inputs (designed to trip up the model). You now have the skeleton of a real evaluation suite. The act of writing the questions forces clarity about what "good" means for your specific task.

Knowledge check

Q1: After fine-tuning, your task-specific F1 rose from 0.62 to 0.89. But MMLU accuracy dropped from 0.71 to 0.48. What is the most likely cause?

A) The evaluation is broken — you can't lose accuracy from fine-tuning
B) Catastrophic forgetting — the model over-specialized and lost general capabilities
C) The MMLU benchmark is not relevant to your domain
D) The model needs more training data
Why is perplexity a poor proxy for user satisfaction? Think first. +
Perplexity measures how well the model predicts the next token in your validation set — which is a sample of your training distribution. A model can get very low perplexity by confidently generating text that looks like your training data but gives incorrect answers. It can also get low perplexity by overfitting to patterns in the validation set. User satisfaction depends on accuracy, helpfulness, and tone — properties that don't map cleanly onto token prediction probability.

Before you go

Reflect: For the task you want to fine-tune on, what would a catastrophic failure look like? Design an adversarial test case that would catch that failure before deployment.

Share this insight
"Training loss goes to zero and the model fails in practice. The gap is always evaluation. You can't improve what you don't measure — and you can't measure what you haven't defined."

You might also like

Want help designing an evaluation suite for your fine-tuning project?

Book a free 30-min call with Arjun

References

  1. Rao, A., Jaggi, A., Naidu, S. (2025). MEDFIT-LLM. IEEE RMKMATE 2025. DOI:10.1109/RMKMATE64574.2025.11042816.
  2. Zheng, L. et al. (2023). Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena. arXiv:2306.05685.
  3. Hendrycks, D. et al. (2020). Measuring Massive Multitask Language Understanding. arXiv:2009.03300.
  4. Lin, C-Y. (2004). ROUGE: A Package for Automatic Evaluation of Summaries. ACL Workshop.
  5. Rajpurkar, P. et al. (2016). SQuAD: 100,000+ Questions for Machine Comprehension of Text. arXiv:1606.05250.
  6. McCloskey, M., Cohen, N. J. (1989). Catastrophic Interference in Connectionist Networks. Psychology of Learning and Motivation, Vol. 24.
← Module 4: RLHF Module 6: Deployment →
Was this helpful?