Fundamentals GUIDE

Overfitting and Underfitting

Overfitting describes fitting training-specific patterns that generalize poorly, while underfitting describes failing to capture useful structure even in the training data.

Listen to this guideAI-narrated · ~3 min

On this page3 min read
  1. Overview
  2. Deep Dive
  3. Real-World Implementation
  4. The Future of Overfitting and Underfitting
  5. Putting it into practice
  6. Keep Exploring
  7. Frequently asked questions

Overview

These are fitting diagnoses to investigate, not conclusions guaranteed by model size or one accuracy number.

Deep Dive

A trained model should be evaluated beyond the examples used to fit it. Under comparable training and held-out conditions, high training performance with much weaker held-out performance can indicate overfitting to training-specific patterns. Poor performance on both sets can be consistent with underfitting, although failed optimization, unsuitable data, and other causes also need consideration. The labels therefore guide diagnosis rather than substitute for it. Changing relevant features or model capacity can be worth testing when the representation is too limited, while regularization and data choices can affect how flexibly a model fits. Bias and variance describe another view of prediction error: bias concerns systematic deviation of the estimated predictor, and variance concerns sensitivity to the sampled training data. Small models are not automatically biased, and large models are not automatically high-variance in every task. The data-generating relationship and fitting procedure matter. Validation and final testing also have different roles. Validation data can help choose a model, hyperparameters, or stopping point. Repeatedly using the final test set for those choices can make the reported final estimate optimistic, so final testing should remain separate when possible. Modern research includes double-descent curves where test error rises near an interpolation regime and falls again as capacity increases. Such observations do not make that curve universal. Assess the actual task, information available, data splits, and fitting procedure rather than infer reliability solely from parameter count.

Real-World Implementation

A spam filter that flags every email containing a specific sender's name because that sender happened to spam heavily in training data, missing new spammers entirely (overfitting).

A house-price model using only square footage and ignoring location, bedrooms, and condition, so it misses badly in expensive neighborhoods (underfitting).

A medical image classifier that learns to detect a hospital's scanner watermark instead of the disease, and fails at other hospitals (overfitting to a spurious feature).

Plotting training loss versus validation loss during training and stopping when validation loss starts rising while training loss keeps falling (catching overfitting early).

The Future of Overfitting and Underfitting

Research can examine fitting behavior across architectures, optimization methods, sample sizes, and data conditions. Results should identify the setup in which a curve or diagnostic was observed. Larger models and richer features can be candidates for evaluation, while they do not guarantee improved generalization. Reports should distinguish validation used for selection from final testing and explain the available information, so an apparent improvement can be assessed alongside sampling uncertainty and possible distribution changes.

Putting it into practice

Why it matters

  • Clearer decisions. It helps you separate clear technical claims from marketing language.
  • Cost and budget. You can ask better implementation questions before spending money or time.
  • Team and workflow. Teams with shared understanding make better product, policy, and learning decisions.

Watch out for

  • Different teams may use the same term differently, so define scope early.
  • Benchmarks can look strong while real-world performance is uneven.
  • Ignoring data quality and evaluation plans often creates fragile outcomes.

Next steps

  1. Start with a plain-language definition of the outcome you need.
  2. Pick one success metric and one failure condition before testing.
  3. Run a small pilot with representative data, not a polished demo set.
  4. Document where Overfitting and Underfitting helps and where simpler methods are better.

Keep Exploring

Free newsletter

Get the daily AI briefing

Three verified AI stories every weekday morning, written in plain English. Free forever, no ads.

One email each weekday. Unsubscribe in one click. We never sell or share your address.

Test yourself

Take the Overfitting and Underfitting quiz

Instant feedback on every answer, and a shareable certificate with a verifiable ID once you pass a course.

Start quiz

Support free AI education. AI Understanding is a 501(c)(3) nonprofit — no ads, no paywall, ever. Make a donation

Frequently asked questions

What is Overfitting and Underfitting?

Overfitting describes fitting training-specific patterns that generalize poorly, while underfitting describes failing to capture useful structure even in the training data. These are fitting diagnoses to investigate, not conclusions guaranteed by model size or one accuracy number.

Under comparable train and held-out conditions, an illustrative model scores 98% on training and 71% on held-out data. Which fitting concern is consistent with that gap?

The gap is consistent with overfitting, while a complete diagnosis should also check evaluation and data conditions.

Which performance pattern can be consistent with a model underfitting useful structure?

Underfitting concerns inadequate fitting of useful structure, but the pattern should be investigated alongside other possible causes.

In a bias-variance analysis, what does high estimator variance concern?

Estimator variance concerns changes across sampled training sets, not a universal outcome of parameter count.

A house-price model has too limited a representation of relevant inputs and fits poorly. Which candidate change should be evaluated?

Testing a better representation can address an underfitting hypothesis; it is not a guaranteed improvement.

Why is a held-out validation or test set essential for detecting overfitting?

Overfitting is invisible if you only look at training accuracy. Evaluating on unseen data exposes the gap between memorization and genuine generalization.

Overfitting vs Underfitting Explained | AI Understanding