liveBook · Manning

Generalization

As explained in Generative AI in Action

Generalization is a model's ability to perform effectively on examples that were not present in its training data.

Generalization is a model’s ability to perform effectively on examples that were absent from training. In fine-tuning, it matters because a model can learn the training set without learning patterns that transfer to new inputs. section 9.3.4 section 9.1.2

Use training and validation loss to assess whether fine-tuning is learning transferable patterns:

  • A good fit shows both losses decreasing toward stability, with only a small gap between them. section 9.3.4
  • Overfitting is likely when training loss decreases while validation loss increases; the model is fitting training data but generalizing poorly. section 9.3.4
  • Underfitting is likely when both losses remain high, indicating that the model has not learned the underlying patterns sufficiently. section 9.3.4
  • Judge loss by its scale, training-step count, and stability; batch-level fluctuations are normal when the overall loss improves. section 9.3.4

Reading a fine-tuning run

A fine-tuning run may show steadily declining training loss. If validation loss also declines and stabilizes nearby, the model is likely generalizing well. If validation loss begins rising, investigate overfitting rather than simply adding training steps. Figure 9.3 provides a training-loss view for GPT-3.5 Turbo fine-tuning. section 9.3.4

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

Inspect the training-loss figure to compare progress across training steps and relate loss behavior to generalization. section 9.3.4

How Generative AI in Action covers it

How deep it goes
Explains training-validation loss patterns, overfitting, underfitting, batch noise, and stability without deriving model internals.
Examples
Uses training-loss curves for GPT-3.5 Turbo fine-tuning and contrasts improving, overfit, and underfit loss patterns.
What it assumes
Assumes familiarity with training and validation datasets while explaining their relationship through loss behavior.
What you can do after
Diagnose fine-tuning quality by comparing training and validation loss and recognizing overfitting or underfitting.
How it connects
Links fine-tuning, training loss, validation loss, overfitting, underfitting, and model evaluation.

Also explained in

Compare how 13 books explain generalization →

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.