๐Ÿ”ฅLimited Offer: Get 50% OFFon AI & Full Stack Courses๐Ÿ”ฅ
Back to Deep Learning Notes
Topic #127

Underfitting

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

MetricUnderfitting Signature
Training lossHigh โ€” the model can't even fit the data it's directly training on
Validation lossAlso high, and close to training loss (not a large gap)
Gap between train and validation performanceSmall โ€” 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

underfit model: too simple to capture the curve

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

FixAddresses
Increase model capacity (more layers, more neurons)Model architecture too simple
Train for more epochs, or increase the learning rateInsufficient training
Reduce regularization strength (lower dropout rate, lower weight decay)Excessive regularization
Improve feature engineering or input representationInsufficient 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?

Want to go beyond the notes?

Join CodingNow 2.0's Deep Learning course โ€” live mentorship, real projects, and 100% placement support.

Enroll Now โ€” Free Demo Available

Underfitting โ€“ FAQs

Quick answers about learning Underfitting in Deep Learning.

This free note from CodingNow 2.0 explains Underfitting in Deep Learning โ€” concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every Deep Learning topic on CodingNow 2.0, including Underfitting, is 100% free with no signup required.
With focused practice, most students grasp Underfitting in 1โ€“3 days from these notes; pairing it with CodingNow 2.0's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the CodingNow 2.0 Community (/community) โ€” expert instructors answer within 24 hours.
WhatsApp
Call NowEnroll Now