Underfitting occurs when a model is too simple โ or hasn't trained long enough โ to capture even the genuine patterns in the training data, resulting in poor performance on both training and validation/test data alike.
The Defining Signature
| Metric | Underfitting Signature |
|---|---|
| Training loss | High โ the model can't even fit the data it's directly training on |
| Validation loss | Also high, and close to training loss (not a large gap) |
| Gap between train and validation performance | Small โ both are bad for similar reasons |
This is the key diagnostic distinction from overfitting (next note): underfitting means the model is failing on data it has already seen, not just data it hasn't.
Common Causes
- Model too simple for the task's true complexity โ e.g. a 2-layer MLP trying to learn a highly non-linear image classification task that really needs a CNN.
- Insufficient training โ too few epochs, or a learning rate so small the model hasn't had a chance to converge yet.
- Excessive regularization โ very high dropout rates or weight decay can prevent the model from fitting the training data adequately, even if the architecture itself is capable.
- Poor features or preprocessing โ if the input representation doesn't actually contain the information needed to solve the task, no amount of model capacity or training will fix that.
Visualizing Underfitting
A straight-line model can't represent the data's obvious curvature โ it fails on the training data itself, not just new data.
Fixes for Underfitting
| Fix | Addresses |
|---|---|
| Increase model capacity (more layers, more neurons) | Model architecture too simple |
| Train for more epochs, or increase the learning rate | Insufficient training |
| Reduce regularization strength (lower dropout rate, lower weight decay) | Excessive regularization |
| Improve feature engineering or input representation | Insufficient input information |
Code โ Diagnosing Underfitting From Training Logs
train_losses = [2.3, 2.1, 2.0, 1.9, 1.9, 1.85, 1.83] # barely decreasing, staying high
val_losses = [2.4, 2.2, 2.1, 2.0, 2.0, 1.95, 1.92] # tracking training loss closely, also high
# Both losses are high AND close together -- this pattern is the signature of underfitting,
# not overfitting (which would show training loss dropping much lower than validation loss)
Common Mistakes
- Adding more regularization (dropout, weight decay) to a model that's actually underfitting โ this makes underfitting worse, since regularization deliberately limits a model's ability to fit the training data, which is the opposite of what's needed here.
- Assuming a model that performs poorly is automatically overfitting โ always check whether training performance itself is poor before assuming the problem is a generalization gap.
Interview Relevance
Q: "A model has 70% training accuracy and 68% validation accuracy on a task where you'd expect much higher accuracy to be achievable. Is this overfitting or underfitting, and how do you know?" Underfitting โ both training and validation accuracy are low and close together, meaning the model is failing even on data it has directly trained on. Overfitting would instead show high training accuracy with a much lower validation accuracy โ a large gap between the two, not both being uniformly poor.
Practice Question
A model shows training accuracy of 60% and validation accuracy of 58%. Would you recommend increasing or decreasing dropout to address this? Why?