Interpreting Loss Curves

Machine learning would be a breeze if all our loss curves looked like this the first time we trained our model:

A plot showing the ideal loss curve when training a machine learning model.
The loss curve plots loss on the y-axis against the number of training steps on
the x-axis. As the number of training steps increases, loss begins high, then
decreases exponentially, and ultimately flattens out to reach a minimum
loss.

But in reality, loss curves can be quite challenging to interpret. Use your understanding of loss curves to answer the following questions.

1. My Model Won't Train!

Your friend Mel and you continue working on a unicorn appearance predictor. Here's your first loss curve.

A loss curve plot with the same axes as the previous plot. Here, the loss does
not flatten out, but instead erratically increases and decreases, such that the
plot oscillates.

Describe the problem and how Mel could fix it:

2. My Loss Exploded!

Mel shows you another curve. What’s going wrong here and how can she fix it? Write your answer below.

A loss curve plot that shows how the loss decreasing up to a certain number of
training steps and then suddenly increasing with further training
steps.

3. My Metrics are Contradictory!

Mel wants your take on another curve. What’s going wrong and how can she fix it? Write your answer below.

The image shows two plots. The plot on the left shows the ideal loss curve.
The plot on the right shows the recall metric staying at 0 even as the number of
training steps increases.

Describe the problem and how Mel could fix it:

4. Testing Loss is Too Damn High!

Mel shows you the loss curves for training and testing datasets and asks "What's wrong?” Write your answer below.

A loss curve plot showing divergence between training and test loss as a model
is trained.

Describe the problem and how Mel could fix it:

5. My Model Gets Stuck

You're patient when Mel returns a few days later with yet another curve. What's going wrong here and how can Mel fix it?

A plot of a loss curve showing the loss beginning to converge with training but then displaying repeated patterns that look like a rectangular wave.

Describe the problem and how Mel could fix it:

It's Working!

"It's working perfectly now!" Mel exclaims. She leans back into her chair triumphantly and heaves a big sigh. The curve looks great and you beam with accomplishment. Mel and you take a moment to discuss the following additional checks for validating your model.

  • real-world metrics
  • baselines
  • absolute loss for regression problems
  • other metrics for classification problems
  • A plot showing a loss curve that converges.