Loss curve
A loss curve is a chart of a model's error, or loss, plotted against training steps, used to see whether training is working, has levelled off or has started to overfit.
During training a model's error on its data is measured again and again. That error is called the loss, and a loss curve plots it against the number of training iterations. Google's machine learning glossary notes that the curve can show training loss, validation loss on held-back data, or test loss. Plotting training and validation loss together gives what Google calls a generalisation curve.
A healthy curve drops steeply at first and then flattens as improvements get smaller. When it barely changes from one iteration to the next, the model is said to have converged. Google's glossary adds a warning: in deep learning, loss can stay almost flat for many iterations and then fall again, which can give a false impression of convergence.
Unhealthy curves have recognisable shapes. Google's Machine Learning Crash Course walks through several. A curve that oscillates suggests bad examples in the data or a learning rate that is too high. A sudden jump can mean invalid values such as NaNs in the input or a batch full of outliers. A validation curve that rises while the training curve keeps falling is the classic sign of overfitting. A curve that turns erratic after a while can mean the data was not shuffled well, for instance a run of dog pictures followed by a run of cat pictures.
Large training runs have their own problems. Google's 2022 paper on PaLM, a 540 billion parameter model, reported spikes in the loss roughly 20 times during training despite gradient clipping. The team restarted from a checkpoint about 100 steps before each spike and skipped 200 to 500 batches of data. Retraining on the same batches from a different checkpoint did not cause a spike, so they concluded the spikes came from particular data meeting a particular model state rather than bad data alone.
Loss curves often appear in technical reports to show that a model kept improving. Meta's 2023 Llama 2 paper, for example, showed curves with no sign of levelling off after 2 trillion tokens. Read them for what they are: a measure of how well the model fits its training objective, not a direct measure of how useful it is.
It is a graph of a model's loss, a measure of its error, against the number of training steps. Developers use it to check that training is progressing, to see when it has levelled off, and to spot problems such as overfitting. Plot training loss and validation loss together. If the training loss keeps falling while the validation loss stops falling and starts to rise, the model is fitting its training data too closely and getting worse on new data. A loss spike is a sudden jump in the loss during training. Causes include bad values in the data, unusual batches or instability in very large models; Google reported about 20 spikes while training its 540 billion parameter PaLM model and handled them by restarting from an earlier checkpoint and skipping some data. Usually that the model has converged and further training of the same kind will not improve it much. In deep learning, though, loss can plateau for a long time and then fall again, so a flat stretch is not always the end.Common questions
What is a loss curve?
How can a loss curve show overfitting?
What is a loss spike?
What does it mean when the loss curve flattens?
Search for "interpreting loss curves", "training vs validation loss" or "loss spikes LLM training" to learn more. Google's Machine Learning Crash Course has worked examples of common shapes, and developers' technical reports show real curves from large runs. A falling loss curve in a company announcement shows training progress, not proof of better performance on real tasks.Finding more
Working out what this means for your business?
Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.