esc
  • WorkflowsPages
  • Case studiesPages
  • Machine Learning FoundationsLearn
  • AI EngineeringLearn
  • AI Guardrails & Red TeamingLearn
  • UI/UXLearn
  • Design SystemsLearn
  • Production System DesignLearn
  • AI papersPages
  • Interview KitPages
  • Book a callContact
  • Download ResumeContact
Let’s talk

I’ll build the agent for it.

How Do You Spot Overfitting During Fine-Tuning?

How to spot overfitting when you fine-tune a model: training loss falling while validation loss rises, and the checks that keep the score honest, for your AI interview.

In short

Overfitting in fine-tuning means the model learns its training examples so well that it does worse on new ones. You spot it when training loss keeps falling while validation loss, measured on examples it never trained on, starts rising. Then you stop and keep the best checkpoint.

11 min readIntermediateCommon · estimateFacts checked 26 November 2026

Say it out loud

Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.

Overfitting in fine-tuning means the model memorises its training examples instead of learning the pattern behind them. I spot it by watching two numbers after each pass over the data. Training loss keeps falling, but validation loss, scored on examples the model never trained on, starts rising. When that gap grows, I stop and keep the checkpoint from the best pass. I also check that no validation example is a near copy of a training one, because a copy hides the problem.

What is overfitting during fine-tuning, in plain words?

Fine-tuning takes a model that already exists and trains it further on your own examples, such as past claim notes or support chats. The aim is for it to learn the pattern behind those examples. Overfitting is when it learns the examples themselves instead, typos and one-off wording included.

Google's machine learning course puts it simply: "Overfitting occurs when a model performs well on training data but poorly on new, unseen data." The model looks clever on the files it has seen and stumbles on the next one.

Think of a claims adjuster who learns last year's files word for word. A new flood claim arrives on a slightly different form, and she freezes, because she learned the files, not how claims work. A realistic case: a triage model fine-tuned on 4,000 past claim notes (made-up numbers) scores very well on those notes, yet sends genuine new claims to the wrong queue.

Key words

Epoch
One full pass through the training examples. Azure's guide describes the number of epochs as the number of complete passes through the training dataset.
Training loss
The error the model makes on the examples it learns from. Lower is better, but only up to a point.
Validation loss
The error on held-out examples the model never trains on. This is the number to trust most when you judge how the model will do on new work.
Checkpoint
A saved copy of the model at one point in training, so you can go back to it.
Base model
The model before your extra training, the starting point you tune.

Which two numbers do you watch, and what do they tell you?

After every epoch I record two losses. The validation set is the part kept back for checks while training runs: "A validation set performs the initial testing on the model as it is being trained."

Watch the gap between two losses

Each epoch you record

Training loss

error on examples it learns from

Validation loss

error on examples it never saw

Validation rising?

while training keeps falling

Gap is widening

memorising the training set

Keep the best checkpoint

the one before the turn

  1. 1Training loss keeps falling as the model learns the examples.
  2. 2Validation loss is read on examples held back from training.
  3. 3When validation turns up while training falls, the gap widens.
  4. 4Stop after a few epochs with no gain, and keep the best checkpoint.
Read after each epoch. Training loss and validation loss fall together at first. When validation turns up while training still falls, the model has started to memorise, so the best checkpoint is the one just before the turn.
  • “after a certain number of iterations, loss declines or holds steady (converges) for the training set, but increases for the validation set.”

    Google's machine learning crash course

So the check is the gap between the two numbers, not one number on its own. A training loss of 0.36 looks great until you see the validation loss sitting at 1.38 beside it.

Why does a fine-tune overfit so easily?

Three things raise the risk. The first is the number of passes. Microsoft's fine-tuning guide says: "More passes give the model more opportunities to learn, but can increase overfitting."

The second is a small dataset. A narrow job may have only a small set of examples, and a large model can memorise a small set quickly. The third is data that misses real cases. Google lists this as a common cause: "The training set doesn't adequately represent real life data (or the validation set or test set)." The same page names overly complex models as a second common cause.

Causes and fixes

What raises the risk

Small dataset

few examples for the job

Too many epochs

many passes over the same rows

Unrepresentative data

misses how real cases look

Overfitting

memorises the training examples

Fixes that help

Stop after a few epochs

keep the best checkpoint

Smaller LR multiplier

can help reduce overfitting

Clean the split

remove copies from validation

  1. 1Few examples make memorising easy.
  2. 2Many passes over the same rows push it to memorise.
  3. 3Data that misses real cases teaches the wrong pattern.
  4. 4The fixes start at the turn: stop, lower the rate, clean the split.
Three things raise the risk, and each can lead to overfitting. The fixes start at the turn: stop after a few epochs with no gain, lower the learning rate multiplier, and clean the split.

How do you pick the checkpoint and stop?

OpenAI's fine-tuning guide says: "We create a full model checkpoint for you at the end of each training epoch." So you can roll back to the best one instead of keeping the last one. OpenAI notes these checkpoints help when a model improves early on but then memorises the training data.

  • “Use with metric_for_best_model to stop training when the specified metric worsens for early_stopping_patience evaluation calls.”

    Hugging Face Transformers docs, early stopping

Here is the same rule as a short program. The numbers are made up, from a claims triage run. The code stops after two epochs with no better validation loss and keeps the best one.

Python
# Made-up losses from a claims-triage fine-tune, one number per epoch.
train_loss = [1.92, 1.31, 0.88, 0.55, 0.36]
val_loss = [1.97, 1.40, 1.02, 1.11, 1.38]

best_epoch, best_val, bad_epochs = 0, float("inf"), 0
for epoch, (train, val) in enumerate(zip(train_loss, val_loss), start=1):
    print(f"epoch {epoch}: train {train:.2f}  val {val:.2f}  gap {val - train:+.2f}")
    if val < best_val:
        best_epoch, best_val, bad_epochs = epoch, val, 0
    else:
        bad_epochs += 1
        if bad_epochs == 2:  # stop after 2 epochs with no better validation loss
            print("stop: no better validation loss for 2 epochs in a row")
            break
print(f"keep the checkpoint from epoch {best_epoch} (val {best_val:.2f})")

Output

epoch 1: train 1.92  val 1.97  gap +0.05
epoch 2: train 1.31  val 1.40  gap +0.09
epoch 3: train 0.88  val 1.02  gap +0.14
epoch 4: train 0.55  val 1.11  gap +0.56
epoch 5: train 0.36  val 1.38  gap +1.02
stop: no better validation loss for 2 epochs in a row
keep the checkpoint from epoch 3 (val 1.02)

Read the output from the bottom up. Epoch 3 had the lowest validation loss, 1.02, so that checkpoint is kept. By epoch 5 the gap was 1.02 and validation had risen to 1.38, so the run was stopped.

Tip

In an interview, say the rule in one line: keep the checkpoint with the best validation score, even if it is earlier.

How do you keep the check honest?

  • Loss alone

    A good number, a weak model

    A low loss can come from copied examples, or from a model that learns the scoring quirks rather than the job.

  • Loss plus checks

    Honest, and tested on the job

    Remove near-copies from the validation set, then test on fresh tasks and compare with the base model.

Google's guide on splitting data gives the first rule: "After splitting a dataset into training, validation, and test sets, delete any examples in the validation set or test set that are duplicates of examples in the training set."

Microsoft says the same about the split: "Keep validation and final test examples out of the training set." Azure also lists a learning rate multiplier, a setting that scales how big each learning step is, and says: "A smaller multiplier can help reduce overfitting."

Google's guide for Vertex AI tuning adds a last check: "Evaluate the tuned model using tuning and validation metrics after the tuning job completes." Then test the model on fresh tasks, and compare it with the untuned base model. A tuned model that barely beats the base has learned little.

What would you check if validation loss looks too good?

  1. 1

    Look for copies

    Search the validation rows for near-copies of training rows. Copies make the score look great, so remove them first.

  2. 2

    Check the split

    Confirm the split was made before training, and that the same customer or claim never sits on both sides.

  3. 3

    Compare with the base model

    Run the same fresh tasks on the untuned model. A small gain means the fine-tune taught little.

  4. 4

    Read real answers

    Read twenty outputs by hand, from cases the model never saw. A person spots a copied answer quickly.

What does the interviewer want to hear?

A strong answer covers

  • Two losses: training loss, and validation loss on held-out examples.
  • Overfitting shows as a gap that opens after the turn, so watch both numbers.
  • Stop at the turn and keep the best checkpoint, which may be an earlier one.
  • Many epochs, a small dataset, unrepresentative data and overly complex models all raise the risk.
  • A check on fresh tasks against the base model, alongside the loss.
  • A low loss can still hide a weak model, so say so plainly.

Common traps

  • Trap"The lower the training loss, the better the model."

    BetterTraining loss can keep falling while the model does worse on new data. Watch validation loss.

  • Trap"Train for more epochs to be safe."

    BetterMore passes can increase overfitting. Stop when held-out loss stops improving.

  • Trap"A perfect score means it is ready to ship."

    BetterA perfect score can come from copied examples. Check the split and test on fresh tasks first.

Can you spot the overfit?

Spot the overfit

Which run is overfitting, judging by its loss numbers?

Quick check

Validation loss is very low from the first epoch. What do you check first?

Can you answer these from memory?

Flash cards · tap a card to flip it

1 / 6

What will they ask next?

  1. Q294How do you prepare a fine-tuning dataset?11 min
  2. Q295How much data do you need?9 min
  3. Q296What is catastrophic forgetting?12 min
  4. Q298Learning rate and epochs for fine-tuning?Coming soon
  5. Q300How do you evaluate a fine-tuned model?11 min
  6. Q413Overfitting vs underfitting?10 min

Last updated on 26 November 2026

Fine-tuning a model on your own data?

I design and build AI products and agents, the interface and the system behind it, including how they are checked on real work. Book a short call and tell me what you need.