M1 · Core Machine Learning and AI KnowledgeM1-0222 min read
Lesson 2 of 51 · Module 2 of 7 · Week 1
Threads:The generative pipeline threadThe multimodal-measurement threadThe compute-efficiency thread
Overfitting vs. Underfitting: The Bias-Variance Tradeoff Explained
Overfitting is a model memorizing training data and its noise, producing low training error but high validation error; underfitting is a model too simple to capture the real pattern, producing high error on both. High training accuracy alone is not a success signal — it is a classic overfitting symptom — and the bias-variance tradeoff names the fundamental tension between the two failure modes that every model-capacity decision has to navigate.
By the end you can
- 01State the diagnostic pattern that distinguishes overfitting from underfitting using the training-versus-validation error gap.
- 02Explain why high training accuracy is not, by itself, evidence of a good model.
- 03Name at least three mitigations for overfitting and two for underfitting, and say which failure mode each one targets.
- 04Describe the bias-variance tradeoff and place a described model's behavior on the bias-variance spectrum.
What overfitting and underfitting are
Identity statement: overfitting is when a model captures the training data too closely — including its noise and idiosyncrasies — so that it performs well on training data but poorly on validation or test data. Underfitting is when a model is too simple to capture the real pattern in the data at all, so it performs poorly everywhere, training data included. [GROUND TRUTH] (Sources/nca-genm/domain-1-core-ml-ai.md) states both definitions directly: overfitting is "the model memorizes training data (including noise) and fails to generalize (low train error, high validation/test error)"; underfitting is "the model is too simple" with poor performance across the board.
When it matters: any scenario that reports a training metric and a validation/test metric and asks you to characterize what is happening, or any scenario that describes a fix and asks which failure mode it addresses.
The diagnostic signature is the single fact to memorize cold, because it is the fastest possible read of almost any scenario on this topic:
| Signature | Training error | Validation/test error | Diagnosis |
|---|---|---|---|
| Both low | Low | Low | Healthy — the model generalizes |
| Low, high | Low | High | Overfitting — a gap between the two |
| Both high | High | High | Underfitting — neither is good |
Overfitting is defined by a gap between the two numbers, not by any absolute threshold on either one. A model with 99% training accuracy and 97% validation accuracy is not overfitting in any exam-relevant sense — the gap is small and both numbers are excellent. A model with 99% training accuracy and 60% validation accuracy is a textbook overfitting case, because the gap itself, not either number alone, is the signal.
Why high training accuracy is not a success signal
This is the single most heavily emphasized trap in the source material, called out explicitly: [GROUND TRUTH] (Sources/nca-genm/domain-1-core-ml-ai.md) — "'High training accuracy = good model.' That is a classic overfitting signal — judge on held-out data." The reasoning is worth internalizing rather than memorizing as a slogan.
L1 — Intuition
A model with enough capacity — enough parameters, enough flexibility — can, in the extreme, memorize a lookup table mapping every training input to its exact training output. That model would score 100% on training data with zero generalization ability whatsoever, because it never learned any pattern; it only learned a table. Training accuracy alone cannot distinguish "I learned the real pattern" from "I memorized the specific rows I was shown," because both produce the same high number on the same data used to compute it.
L2 — Mechanism
Training accuracy is computed by evaluating the model on the exact data used to update its weights. Every gradient step nudges the model toward fitting those specific examples better. Given enough capacity and enough training steps, a model's training loss can be driven arbitrarily close to zero regardless of whether the underlying pattern is learnable at all — a sufficiently large network can, in principle, drive training error toward zero even on data that is pure noise with no real signal, simply by memorizing which noisy input maps to which output.
Validation accuracy has no such vulnerability, precisely because the validation set was never used to update a single weight. A model can only score well on validation data by having learned something that transfers — a genuine pattern, rather than a specific-row memorization. This is exactly why the training/validation/test discipline from M1-01 exists: it is the only mechanism that can separate "learned the pattern" from "memorized the examples," and training accuracy alone structurally cannot make that distinction.
L3 — The exam-relevant edge case
The trap that catches people is not usually "high training accuracy, low validation accuracy" — that pattern is easy to spot once you know to look for the gap. The harder case is a scenario that reports only a training number and asks you to evaluate the model, with no validation number given at all. The correct exam response is that the training number alone is insufficient to judge the model — you cannot conclude the model is good, and you cannot conclude it is overfitting either, because overfitting is defined by a gap, and a gap needs two numbers to exist. A scenario that omits the validation score is often testing whether you will wrongly treat the missing information as implicitly fine.
Mitigating overfitting
[GROUND TRUTH] (Sources/nca-genm/domain-1-core-ml-ai.md) names four mitigations for overfitting: more data, regularization, dropout, and early stopping. Each targets the same underlying problem — excess model capacity relative to the genuine signal in the data — from a different angle.
More data. The most direct fix, because it attacks the root cause: a model has an easier time memorizing a small dataset than a large one, so simply providing more genuinely diverse training examples reduces how much memorization can substitute for real pattern-learning. This is often the least practical fix, since collecting more labeled data — especially paired multimodal data — is expensive.
Regularization. A penalty term added to the loss function that discourages the model from fitting the training data too precisely, typically by penalizing large weight values. The model is still optimizing for low training loss, but now that objective is balanced against a competing pressure to stay simple, which tends to suppress the kind of intricate, noise-fitting behavior that produces a large train-validation gap.
Dropout. During training, dropout randomly disables a fraction of a network's neurons on each forward pass, forcing the remaining neurons to not rely on any single other neuron always being present. This prevents the network from developing brittle, over-specific dependencies that happen to work for the training set but do not generalize.
Early stopping. Training is monitored against the validation set, and training halts once validation performance stops improving — even if training performance is still improving. This directly exploits the diagnostic signature from section 1: the moment training and validation curves start to diverge is exactly the moment to stop, before the gap widens further.
Why regularization and dropout are not the same technique
Both regularization and dropout suppress overfitting, and scenarios sometimes describe one while a distractor names the other, so the distinction is worth making explicit. Regularization changes what the loss function itself rewards — it adds a term computed from the model's weights (commonly their squared magnitude, called L2 or "weight decay," or their absolute magnitude, called L1) directly into the number the optimizer is minimizing, so a model with unnecessarily large weights pays a penalty even if those large weights happen to fit the training data slightly better. Dropout, in contrast, changes nothing about the loss function at all — it changes the network's structure during the forward pass, temporarily zeroing out a random subset of neurons on each training step so no single neuron's output can be relied upon by the rest of the network every time. Both end up producing a model less prone to memorizing training-specific detail, but one works by penalizing a property of the weights and the other works by injecting structural randomness into what the network can depend on — a scenario that describes "adding a penalty term to the loss based on weight magnitude" is regularization, not dropout, even though both appear in the same four-item mitigation list.
Mitigating underfitting
[GROUND TRUTH] (Sources/nca-genm/domain-1-core-ml-ai.md) names the underfitting mitigations as a more expressive model, better features, and longer training — the mirror image of the overfitting fixes, because the underlying problem is the opposite.
A more expressive model. If the model's architecture is fundamentally too simple to represent the pattern in the data — too few layers, too few parameters, a linear model applied to a genuinely nonlinear relationship — no amount of additional training data or training time will fix it, because the model literally cannot represent the correct function. Increasing capacity (more layers, more parameters, a more flexible architecture) is the direct fix.
Better features. Sometimes the model has enough capacity, but the input features do not contain enough information for any model to find the pattern. Feature engineering — the same concept introduced in M1-01 — can expose the signal that raw features were hiding, letting even a modest model perform well.
Longer training. An underfit model may simply not have trained long enough to reach its own capacity ceiling. This fix only helps when the ceiling itself is high enough to represent the true pattern; training a too-simple model for longer cannot exceed a capacity limit that architecture, not training duration, imposes.
The bias-variance tradeoff
Identity statement: the bias-variance tradeoff is the naming of the tension between underfitting (high bias — the model's assumptions are too rigid to capture the true pattern) and overfitting (high variance — the model's predictions swing wildly depending on the specific training data it happened to see). [GROUND TRUTH] (Sources/nca-genm/domain-1-core-ml-ai.md) names this tradeoff directly as the umbrella term connecting overfitting and underfitting.
Bias is the error introduced by a model's simplifying assumptions — a linear model applied to a curved relationship has high bias, because no amount of data will let it represent the curve; it is structurally the wrong shape. Variance is the error introduced by a model's sensitivity to which specific training data it happened to see — a model with high variance would produce meaningfully different predictions if trained on a slightly different sample of the same underlying population, which is exactly the memorization behavior overfitting describes.
The "tradeoff" in the name is not metaphorical: increasing a model's capacity to reduce bias (letting it represent more complex patterns) tends to increase variance (giving it more room to fit noise specific to the training sample), and reducing capacity to control variance tends to increase bias (forcing the model back toward oversimplified assumptions). There is no capacity setting that minimizes both simultaneously for a fixed amount of data — the practical goal is to find the sweet spot where the sum of bias-driven error and variance-driven error is smallest, not to drive either one to zero in isolation.
| High bias (underfitting) | High variance (overfitting) | |
|---|---|---|
| Training error | High | Low |
| Validation error | High | High |
| What is wrong | Model too simple for the pattern | Model too sensitive to the specific training sample |
| Typical fix | More capacity, better features | More data, regularization, dropout, early stopping |
| Analogy | A student who never studied the material | A student who memorized last year's exact exam, not the underlying topic |
Learning curves: watching the gap emerge over training
Sections 1 through 5 treated overfitting and underfitting as a single snapshot — one training number, one validation number, taken at the end of training. In practice, teams usually watch both numbers across every epoch of training as a learning curve, and the shape of that curve over time carries diagnostic information a single end-of-training snapshot cannot.
Epoch Training accuracy Validation accuracy
1 58% 57%
5 74% 72%
10 85% 81%
15 93% 83%
20 97% 79%
25 99% 75%
Read this epoch by epoch rather than only at the end. Through epoch 10, training and validation accuracy rise together, tracking closely — this is the healthy phase, where the model is learning a genuine pattern that transfers to held-out data. Somewhere around epoch 10 to 15, the two curves start to diverge: training accuracy keeps climbing toward 99%, while validation accuracy peaks near epoch 10 and then declines for the rest of training, ending up 24 points below the final training number.
This is a constructed scenario with illustrative numbers, not a measurement from a real training run, but the shape is exactly the signature early stopping (section 3) is built to catch: the point where validation accuracy stops improving — here, around epoch 10 — is the point training should have halted, even though training accuracy had a long way left to climb. Continuing training past that point did not make the model better; it made the model more precisely fit to training-specific detail that actively hurt generalization, which is why validation accuracy fell rather than merely plateauing.
Two mistakes are common when reading a learning curve like this one. The first is stopping the analysis at the final epoch and only comparing the last row's two numbers — doing so still correctly diagnoses overfitting here, but throws away the more useful information about when the divergence began, which is exactly the information early stopping needs to act on. The second is assuming a temporarily flat or dipping validation curve early in training always means overfitting has begun; a validation curve can wobble for reasons unrelated to overfitting (a noisy batch, a learning-rate schedule adjustment), so the signal to act on is a validation curve that is sustained and worsening while training accuracy keeps rising, not a single epoch's dip.
Worked example: reading three training curves
A team reports training and validation accuracy after each of several training runs on the same multimodal classification task. Diagnose each.
Run 1: training accuracy = 62%, validation accuracy = 60%
-> Small gap (2 points), both numbers are mediocre.
-> UNDERFITTING. The model has not learned the pattern well anywhere.
Fix: more capacity, better features, or longer training.
Run 2: training accuracy = 98%, validation accuracy = 71%
-> Large gap (27 points), training is excellent, validation is weak.
-> OVERFITTING. The model has memorized training-specific detail.
Fix: more data, regularization, dropout, or early stopping.
Run 3: training accuracy = 91%, validation accuracy = 89%
-> Small gap (2 points), both numbers are strong.
-> HEALTHY. This is what a well-fit model's numbers look like —
a small gap is expected and not itself a red flag.
This is a constructed scenario with illustrative numbers, not measurements from a real training run. The pattern to carry forward: always compute the gap first, then look at the absolute level of both numbers. A gap alone (Run 3's 2 points versus Run 1's 2 points) does not distinguish healthy from underfit — you additionally need to know whether the absolute numbers are good or bad. Overfitting is the one diagnosis where the gap itself, independent of the absolute level of either number, is doing the diagnostic work.
Overfitting and underfitting in a multimodal setting specifically
Everything above generalizes directly to multimodal training, but multimodal models introduce one wrinkle worth naming on its own: a model can overfit on one modality while underfitting on another, at the same time, inside the same training run.
Consider a model that fuses a product photo and a free-text description to predict a category. If the text descriptions in the training set happen to be highly formulaic — say, generated from a small number of templates — the text-processing side of the model has an easy time reaching very low training error on text alone, potentially by memorizing template-specific phrasing rather than learning category-relevant language patterns that would transfer to differently-phrased descriptions at inference time. Meanwhile, if the training images are comparatively few or highly varied, the image-processing side of the same model may still be underfit — genuinely too data-starved or under-capacity to have learned a reliable visual pattern yet.
A single end-to-end training-versus-validation accuracy number for the whole fused model can mask this split entirely. The overall number might look moderately healthy — not a dramatic gap, not catastrophically bad — while one modality's branch is quietly overfit and the other is quietly underfit, and the two effects partially cancel out in the aggregate metric. This is why multimodal training in practice often benefits from per-modality diagnostics — checking each encoder branch's own train/validation behavior where the architecture allows it — rather than trusting only the fused model's single aggregate number, precisely because the aggregate can hide two simultaneous, opposite failures.
⭐ THE EARNED INSIGHT The train-validation gap is a property of a model's output, but overfitting and underfitting are properties of what each part of the model actually learned — and in a multimodal system, those are not the same thing. A healthy-looking aggregate gap is not proof that every modality inside the model is healthy; it is only proof that whatever is happening across the modalities happens to sum to something that looks fine.
This is also the practical bridge to M1-09's training-stability material later in this module: an unweighted composite loss that lets one modality's objective dominate training can produce exactly this split — one branch overfitting because it is easy to drive its share of the loss down, another branch underfitting because it never receives enough gradient signal to catch up. The bias-variance tradeoff, in other words, does not have to resolve the same way across every part of a multimodal model simultaneously, and recognizing that a single reported number can average over two opposite failures is itself an exam-relevant reading skill.
Worked example: choosing the right fix for a described failure
A model for classifying product review sentiment from text and an attached photo reports 96% training accuracy and 64% validation accuracy. The team proposes four fixes. Which are appropriate?
Proposed fix A: "Train for more epochs."
-> WRONG DIRECTION. More training time on an already-overfit model
typically widens the gap further, since the model keeps finding
more training-specific detail to fit.
Proposed fix B: "Add dropout to the network's hidden layers."
-> APPROPRIATE. Dropout directly targets the overfitting this
scenario shows (large train-validation gap, high training accuracy).
Proposed fix C: "Collect 3x more labeled training examples."
-> APPROPRIATE. More data reduces the model's ability to memorize
training-specific noise, attacking the root cause directly.
Proposed fix D: "Increase the number of layers in the network."
-> WRONG DIRECTION. Increasing capacity on an already-overfit model
gives it more room to memorize, not less — this is the fix for
underfitting, misapplied here.
Constructed scenario, illustrative numbers. Notice that fixes A and D are not bad ideas in general — longer training and more capacity are the correct fixes for underfitting — they are simply the wrong fix for the failure mode this specific scenario's numbers actually show. Matching a fix to the diagnosis, not just recognizing that a fix exists, is the actual skill this worked example is built to test.
The table below collects that same fix-to-diagnosis matching skill across every trap this lesson names.
Common mistakes about overfitting, underfitting, and the bias-variance tradeoff
| Mistake | Symptom you would actually observe | Fix |
|---|---|---|
| Treating high training accuracy as a success signal on its own | You call a model "good" having seen only its training score | Always check the validation/test score before drawing a conclusion |
| Diagnosing overfitting from a high number alone, with no gap shown | You call a 91% training accuracy "overfitting" with no validation number given | Overfitting requires a gap; a single number cannot establish one |
| Applying an overfitting fix to an underfitting problem | Adding dropout or more data to a model that is bad even on training data does not help | Check the diagnostic signature first: is training error itself high (underfitting) or just the gap (overfitting)? |
| Applying an underfitting fix to an overfitting problem | Adding capacity or training longer widens an already-large train-validation gap | Increasing capacity is the underfitting fix; it worsens overfitting |
| Believing more data always helps | A team collects more data for a genuinely underfit, too-simple model and sees no improvement | More data attacks variance (overfitting); it does not fix a model whose architecture cannot represent the pattern (bias/underfitting) |
| Assuming any small train-validation gap is a problem | A healthy model with a 2-point gap gets flagged as suspicious | A small gap alongside strong absolute performance on both is the expected, healthy pattern |
| Thinking the bias-variance tradeoff means picking one extreme | A team tries to drive bias or variance fully to zero in isolation | The goal is minimizing their combined error, not eliminating either one alone |
| Trusting one aggregate metric for a multimodal model | One modality is quietly overfitting while another is quietly underfitting, hidden inside a moderate-looking overall number | Check per-modality diagnostics where the architecture allows it, not only the fused model's single number |
| Reading a learning curve only at its final epoch | You correctly diagnose overfitting but miss exactly when the divergence began, losing the information early stopping needs | Trace training and validation curves across epochs, not just their final values |
Every row maps a specific symptom to a specific fix. Exam weight explains why this diagnostic pattern is worth holding precisely.
Why overfitting and underfitting are on the NCA-GENM exam
Core Machine Learning and AI Knowledge carries 20% exam weight, and [GROUND TRUTH] (Sources/nca-genm/domain-1-core-ml-ai.md) lists the "high training accuracy = good model" misconception as one of the domain's explicitly named common exam traps — a strong signal that this exact framing is directly testable, not incidental background. The bias-variance tradeoff is foundational vocabulary that recurs implicitly whenever a later lesson discusses model capacity, regularization, or a training-stability tradeoff, including the multimodal loss-weighting material in M1-09.
The question tends to arrive in a small number of recognizable shapes.
- Diagnosis from two numbers. A scenario reports training and validation performance and asks whether the model is overfitting, underfitting, or healthy. The keyed answer reads the gap and the absolute levels together.
- "Is high training accuracy good news" items. Direct tests of the named trap — the keyed answer is that training accuracy alone is insufficient, and the model must be judged on held-out data.
- Fix-matching items. A scenario describes a failure mode and asks which of several proposed fixes is appropriate. Distractors offer a real, valid fix — but for the other failure mode.
- Definitional items. "What is the bias-variance tradeoff?" with the keyed answer naming the tension between a too-simple model (bias) and a too-sensitive-to-training-data model (variance).
What the distractors typically look like
The reliable distractor families: offering an underfitting fix (more capacity, longer training) as the answer to an overfitting scenario, and vice versa; asserting that a single high training number is sufficient evidence of a good model; and describing bias and variance as though reducing one never affects the other, when the entire point of the "tradeoff" framing is that they move in opposite directions as capacity changes.
How do I tell overfitting apart from underfitting from just two numbers?
Look at both the absolute level of the training error and the size of the gap between training and validation error. If training error itself is high, the model has not learned the pattern well anywhere, and you are looking at underfitting — the gap is usually small because both numbers are bad. If training error is low but validation error is meaningfully higher, the model has learned training-specific detail that does not transfer, and you are looking at overfitting — here the gap itself is the diagnostic signal, not either number alone. If both numbers are low and close together, the model has generalized well and no fix is needed.
Why does adding more data fix overfitting but not underfitting?
More data reduces overfitting because overfitting is fundamentally about a model finding room to memorize noise and idiosyncrasies specific to a limited training sample — a larger, more diverse sample leaves proportionally less room for any single quirk to be memorized instead of the real pattern being learned. Underfitting is a different problem entirely: the model's architecture or feature set is not expressive enough to represent the true pattern, regardless of how much data it sees. Feeding a too-simple model more examples of a pattern it structurally cannot represent does not change what it is capable of representing, which is why more data helps variance-driven errors (overfitting) but does nothing for bias-driven errors (underfitting).
Can a model be overfitting on one part of its input and underfitting on another?
Yes, and this is specifically common in multimodal systems, where a single fused model contains what are effectively several sub-models — one processing pathway per modality — trained together. If one modality's training data is small, noisy, or unusually formulaic, its processing pathway can end up overfitting (memorizing modality-specific quirks) while a different modality's pathway, perhaps genuinely data-starved or under-capacity for its share of the problem, is simultaneously underfitting. A single aggregate train-versus-validation number for the whole fused model can average these two opposite failures into something that looks moderately healthy, which is why multimodal training benefits from checking each modality's own contribution where the architecture permits it, rather than trusting only the combined output.
Glossary recap: the terms this lesson introduced
| Term | One-line definition |
|---|---|
| Overfitting | A model memorizing training data and noise; low training error, high validation/test error |
| Underfitting | A model too simple to capture the real pattern; high error on both training and validation data |
| Bias | Error from a model's simplifying assumptions being too rigid for the true pattern |
| Variance | Error from a model's sensitivity to the specific training sample it happened to see |
| Bias-variance tradeoff | The tension where reducing bias (more capacity) tends to increase variance, and vice versa |
| Regularization | A loss-function penalty discouraging overly precise fits to training data |
| Dropout | Randomly disabling neurons during training to prevent brittle, over-specific dependencies |
| Early stopping | Halting training once validation performance stops improving, even if training performance keeps rising |
Key takeaways on overfitting, underfitting, and the bias-variance tradeoff
- Overfitting = low training error, high validation/test error (a gap). Underfitting = high error on both (no gap needed to diagnose it).
- High training accuracy alone is never a success signal — judge every model on held-out validation or test data.
- Overfitting fixes: more data, regularization, dropout, early stopping. Underfitting fixes: more capacity, better features, longer training. Applying one set to the other's problem makes things worse, not better.
- The bias-variance tradeoff names the structural tension: reducing bias (more capacity) tends to raise variance, and reducing variance (less capacity, more regularization) tends to raise bias.
- Diagnosis requires two numbers, not one — training performance alone cannot distinguish a well-fit model from a memorized one.
- A small train-validation gap alongside strong absolute performance is the healthy, expected pattern — not itself a red flag.
Every mitigation and diagnosis in this lesson assumed you already had a metric to read — training accuracy, validation accuracy. What none of this lesson covered is which metric to reach for in the first place, or what to do when accuracy itself is the wrong number to trust. Next: M1-03 covers model comparison metrics — accuracy, precision, recall, F1, ROC-AUC, MAE, MSE, and R² — including the specific way accuracy alone becomes actively misleading on imbalanced data, the same trap that resurfaces in Domain 3's evaluation material.