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
Let’s talk

I’ll build the agent for it.

Learning Rate and Epochs for Fine-Tuning

How to set the learning rate and the number of epochs when you fine-tune a model, and how to tell when training has gone too far, for your AI interview.

In short

Fine-tuning usually uses small learning-rate steps, so the model adjusts gently and keeps what it knew. Epochs are full passes over your examples: more passes can help, but too many make the model memorise them, so you watch validation loss to choose.

12 min readAdvancedOccasional · estimateFacts checked 27 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.

A learning rate is how big a step the model takes each time it corrects itself. For fine-tuning I keep those steps small, because the model already knows a lot and I only want to teach it my job. An epoch is one full pass over my training examples. I don't guess the number. I score the model after each epoch on examples it never trained on, and I keep the copy from before the score starts to rise.

What are the learning rate and epochs, in plain words?

A model learns by making small corrections. After each batch of examples it checks how wrong it was, then nudges its weights, the numbers inside it, to be a little less wrong. The learning rate is the size of each nudge.

An epoch is one full pass through the training set. Google's machine learning course says that "the entire training dataset is used during training" once per epoch, and that the count affects both quality and training time.

Think of a claims handler who moves to a new insurer. She already knows how claims work, so the new firm doesn't teach her from zero. Some feedback on its own files is enough to start. Fine-tuning works the same way: it starts from a model that already reads English well and corrects it on your own examples.

Our running example is a claims triage model. An insurer wants it to tag each new claim note as urgent, routine or possible fraud. Its staff have already labelled 4,000 notes, each about 900 tokens long. A token is a small chunk of text, a word or part of one.

Key words

Learning rate
The size of each correction the model makes to its weights during training.
Epoch
One full pass through every training example.
Validation set
Examples held back from training, used to score the model as it learns.
Checkpoint
A saved copy of the model at one point in training, so you can go back to it.

Validation loss is a score for how wrong the model is on those held-back examples. Lower is better. We watch it after each epoch.

Why keep the learning rate small when you fine-tune?

A fine-tune starts from a model that already knows a lot. Big corrections can overwrite that knowledge, so the model gets good at your labels and can lose skills it had before. Small steps let it learn the new job while keeping what it had.

Three learning rates, three outcomes

Step size

Steps too big

each step overshoots the good weights

Steps too small

tiny nudges, slow progress

Steps just right

gentle, steady corrections

What happens

Bounces, never settles

loss jumps up and down, no clean fit

Learns too slowly

the run ends before it fits

Learns the job

keeps general skills and fits

  1. 1Big steps make the loss jump about and never settle.
  2. 2Tiny steps barely move the model, so the run drags on.
  3. 3Steady steps keep the base model's skills and learn your labels.
Three step sizes lead to three outcomes. Big steps bounce around and never settle. Tiny steps barely learn. Steady steps keep the old skills and learn the job, which is the good end.

The step size has two sides. Google's crash course says that if the learning rate is too low, the model can take a long time to converge, meaning settle on a good answer. If it is too high, the model never converges and bounces around the best answer instead.

OpenAI, Azure and AWS each expose this as a dial. OpenAI's API calls it a learning rate multiplier, a scaling factor for the learning rate. Azure's guide says a smaller multiplier can help reduce overfitting, the point where the model memorises its examples.

There is no universal number. Hugging Face's Trainer, in its Transformers library, starts at 5e-5 by default. Treat it as a starting point to test on your own data.

Tip

Don't give a magic number in the interview. Say you start from the provider's default or a value you have seen work. If the loss bounces during training, lower the step. If validation loss rises after a few epochs, stop earlier or check the data first.

How many epochs should you run?

OpenAI's API reference defines an epoch as one full cycle through the training dataset. More epochs give the model more chances to learn, and more chances to memorise.

The starting point differs by provider. For Amazon Nova Lite, Micro and Pro, AWS's Bedrock guide gives a default of 2 epochs, which it says works for most cases. It also says larger datasets need fewer epochs to converge, and smaller datasets need more.

OpenAI saves a full checkpoint at the end of each epoch, so you can compare them after the run. You don't have to stop at the last one.

Stop at the best validation score

Start run

provider default or a known setting

Score each epoch

on held-back examples only

Read the curve

Still falling

training carries on to the next epoch

Up two epochs in a row

one rise can be noise

Keep best checkpoint

the copy from before the rise

  1. 1Each epoch, the run is scored on held-back examples.
  2. 2A falling score means training carries on.
  3. 3A rise means the score moved up this epoch.
  4. 4Stop here and keep the copy from before the rise.
After each epoch the run is scored on examples it never trained on. While that score still falls, training carries on. Once the score has risen for two epochs in a row, the model has started memorising, so keep the checkpoint from just before the rise.

How do you pick the epoch count in practice?

Here is a made-up claims triage run. The numbers are invented, but the arithmetic and the stopping rule are the kind a team checks before it spends money.

Python
# Made-up claims triage fine-tune: 4,000 past claim notes, about 900 tokens each.
EXAMPLES = 4000
TOKENS_PER_EXAMPLE = 900
PATIENCE = 2  # stop after this many epochs in a row with no new best

for epochs in (3, 6):
    tokens = EXAMPLES * TOKENS_PER_EXAMPLE * epochs
    print(f"{epochs} epochs = {tokens:,} training tokens")

# Made-up validation loss after each epoch (lower is better).
val_loss = [1.84, 1.52, 1.31, 1.22, 1.20, 1.23, 1.29]
best, best_epoch, waited = float("inf"), 0, 0
for epoch, loss in enumerate(val_loss, start=1):
    print(f"epoch {epoch}: val loss {loss:.2f}")
    if loss < best:
        best, best_epoch, waited = loss, epoch, 0
    else:
        waited += 1
    if waited == PATIENCE:
        print(f"stop after epoch {epoch}")
        break
print(f"keep the checkpoint from epoch {best_epoch} (val loss {best:.2f})")

Output

3 epochs = 10,800,000 training tokens
6 epochs = 21,600,000 training tokens
epoch 1: val loss 1.84
epoch 2: val loss 1.52
epoch 3: val loss 1.31
epoch 4: val loss 1.22
epoch 5: val loss 1.20
epoch 6: val loss 1.23
epoch 7: val loss 1.29
stop after epoch 7
keep the checkpoint from epoch 5 (val loss 1.20)

Read the output. Six epochs cost twice as many training tokens as three, because Google's Gemini tuning docs count training tokens as the dataset size times the epochs. The validation loss bottoms out at epoch 5, rises for two epochs, and the run stops at epoch 7 with the copy from epoch 5.

  1. 1

    Start from a known setting

    Use the provider's default or a value you have seen work on similar data. Don't guess a big number.

  2. 2

    Score after every epoch

    Measure validation loss on examples held back from training. Training loss keeps falling even while the model memorises, so it can't warn you.

  3. 3

    Stop when the score turns

    The code waits two epochs in a row with no new best, then stops. Two is a setting you can change to suit the data.

  4. 4

    Keep the best copy

    Return to the checkpoint from the best epoch. The last copy may have started to memorise.

What do the two settings trade off?

  • Learning rate up

    Faster, but less stable

    The score can improve sooner, but training may become unstable near the end.

  • Epochs up

    More learning, then memorising

    Each pass can help, until validation loss turns up. Each pass also adds cost.

  • The safe pattern

    Small steps, a few passes, watched

    Keep the steps modest, watch validation loss, and let it choose when to stop.

  • “A smaller learning rate may be useful to avoid overfitting.”

    OpenAI API reference

  • “More passes can improve learning, but can increase overfitting.”

    Microsoft Foundry docs

  • “A faster convergence might also be achieved by increasing the learning rate, but this is less desirable because it might lead to training instability at convergence.”

    AWS Bedrock docs

How would you set them for only 300 examples?

Three hundred labelled examples is small. The model can memorise them quickly, and a validation set of 15% (45 notes) gives a noisy score, so one run's curve can mislead. AWS notes that smaller datasets usually need more passes to converge, which makes the stop point matter even more.

So I would keep the step size small, repeat the same settings with three different random starts, and compare their best validation scores. If the scores disagree a lot, I'd trust none of them. I would also ask whether more labels are possible before adding more passes over these 300.

What does the interviewer want to hear?

A strong answer covers

  • Learning rate: the size of each correction, and why fine-tuning keeps it small.
  • Epoch: one full pass, which costs tokens and can lead to memorising.
  • Validation loss after each epoch decides when to stop.
  • Keep the best checkpoint, not necessarily the last one.
  • The right values depend on the data and the provider, so you test them.

Common traps

  • Trap"A big learning rate helps it learn faster."

    BetterBig steps can overwrite what the model already knows. Start small and watch the curve.

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

    BetterMore passes can memorise the notes. Stop when validation loss turns up.

  • Trap"The last checkpoint is always the best one."

    BetterKeep the checkpoint with the best validation score, which is often an earlier one.

Can you spot the problem?

Spot the problem

A contract-review team's fine-tune log shows training loss falling for 9 epochs, while validation loss has risen since epoch 4. What should they do?

Quick check

Your insurer's fine-tune is good enough, but the bill is too high. Which change cuts the training cost most, with the same data?

Can you answer these from memory?

Flash cards · tap a card to flip it

1 / 6

What will they ask next?

  1. Q297How do you spot overfitting during fine-tuning?11 min
  2. Q296What is catastrophic forgetting?12 min
  3. Q300How do you evaluate a fine-tuned model?11 min
  4. Q294How do you prepare a fine-tuning dataset?11 min
  5. Q417What does the learning rate do?11 min
  6. Q286What does LoRA rank mean?10 min

Learn it in depth

Last updated on 27 November 2026

Fine-tuning a model on your own data?

I design and build AI products and agents, including the training and checks around them. Book a short call and tell me what your data looks like and what the model must do.