liveBook · Manning

Epoch

As explained in Generative AI in Action

An epoch is one complete pass through the examples in a training dataset during model training.

An epoch is one complete pass through every example in a training dataset. Fine-tuning repeats this process so the model can update its parameters, while validation data helps reveal whether additional passes improve generalization or encourage overfitting. section 9.3.1 section 9.3.4

Use the epoch count as one training control alongside dataset quality and other hyperparameters:

  • Increase or reduce the number of epochs while monitoring validation performance; training loss alone can hide overfitting. section 9.3.1 section 9.3.4
  • Interpret a good fit as training and validation loss decreasing toward stability with only a small gap between them. section 9.3.4
  • Treat the epoch count as a production trade-off: insufficient training can underfit, whereas excessive training can reduce performance on unseen data. section 9.3.4

Setting epochs for an Azure OpenAI fine-tuning job

The fine-tuning request sets n_epochs to 3 while selecting GPT-3.5 Turbo 0613. The job is queued, so its status should be tracked until it succeeds or fails. section 9.3.3

Figure 9.3 Training loss when fine-tuning GPT-3.5 Turbo
figure

Inspect the training-loss figure to connect epoch-based evaluation with changes in model performance during fine-tuning. section 9.3.4

How Generative AI in Action covers it

How deep it goes
Defines a complete dataset pass and relates epoch count to loss, overfitting, underfitting, and validation, without deriving optimization mathematics.
Examples
Uses Azure OpenAI fine-tuning with n_epochs set to 3 and interprets training and validation loss curves.
What it assumes
Assumes familiarity with training and validation datasets, while defining an epoch through its relationship to dataset passes and model updates.
What you can do after
Operate/configure fine-tuning by selecting an epoch count and diagnose generalization through training and validation loss.
How it connects
Connects training datasets, validation datasets, hyperparameters, training loss, validation loss, overfitting, and underfitting.

Also explained in

Compare how 10 books explain epoch →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Generative AI in Action. The section links point to the parts of the book it draws on.