AI GLOSSARY · AI CONCEPTS
Overfitting
Definition
Overfitting is when a machine learning model matches its training data so closely, including its noise, that it makes poor predictions on new data it has not seen.
Also called: overfit, overfitted model.
In plain language
Overfitting means a fitted model captures training-specific patterns that do not generalize well. A model may improve its training score while its held-out performance stops improving or gets worse. This does not require literal memorization or failure on every new example. Compare appropriate training and held-out results, check for leakage and evaluate the conditions in which the model will be used.
Technical definition
Overfitting means fitting details of training data that do not generalize well. A large training-versus-held-out error gap can be evidence, but a finite test score is an estimate affected by the sample and evaluation design. IBM describes detection by comparing training error with error on a held-out test set, or by k-fold cross-validation, where each of k subsets serves once as the test set and the scores are averaged. Mitigations it lists are early stopping, more clean data, regularization, including coefficient penalties such as lasso and ridge, or dropout, which randomly zeroes activations during training, feature selection and ensemble methods. Underfitting is inadequate capture of relevant patterns; capacity, features, regularization and optimization can all matter.
Worked examples in this catalogue
Catalogue examples point at a skill, guide or coding tool listed on this site, with what to run and what you see. An example marked illustrative describes the item from its own documentation; it was not executed for this page. Platform Scores are our assessment under a published method, not a safety guarantee.
Skill by Skill Almanac · Illustrative, not executed
split-leakage-check 53/100 · Provisional, not yet measuredScored · Method v0.2 · How we score
- What you see
- A JSON report on train, validation and test files that flags duplicates, shared groups, time leakage and label leakage between the splits.
- Why it exercises the concept
- A held-out test set only exposes overfitting if it is truly held out. Duplicates or shared groups across splits can make an overfit model look good, and this skill checks for them.
Skill by Skill Almanac · Illustrative, not executed
llm-eval-test-sets 57/100 · Provisional, not yet measuredScored · Method v0.2 · How we score
- What you see
- An eval dataset for an LLM feature, with a checker that reports duplicates, missing graders and imbalance.
- Why it exercises the concept
- Tuning a prompt or a fine-tuned model against the same few examples fits it to those examples. A separate, validated test set is the check.
Skill by Hugging Face · Illustrative, not executed
huggingface-datasets 25/100 · Provisional, not yet measuredScored · Method v0.2 · How we score
- What you see
- A look at Hugging Face datasets through the Dataset Viewer API: metadata, rows, search and filters.
- Why it exercises the concept
- Inspecting dataset rows and metadata can reveal issues to investigate. Overfitting depends on the learning procedure and evaluation setting as well as the data.
How it shows up when you use agents
If you ask an agent such as Claude Code or Codex to build a model, or to improve one, overfitting is one possible failure. An agent told to "raise the accuracy" can keep adjusting settings until the number on your test file improves, which means the test file has become part of training. An improved score on repeatedly reused test data is not independent evidence of better deployment performance.
The same shape appears with LLM features. If you tune a prompt against ten examples until all ten pass, you have fitted the prompt to those ten, and new inputs may behave differently. A fine-tuned model trained for too long on a small set can also fit its quirks.
What breaks when this is misunderstood: you ship on a number that does not mean what you think. The safer habit is to keep a test set that neither the agent nor the model sees while tuning, check that it shares no duplicates or groups with the training data, and report the training and held-out scores together. The skills below check the splits and the eval set. See supervised learning, where the problem is most often discussed.
Ask for the gap between training and held-out results, not just the best score. A large gap is the warning sign IBM describes.
Worked example (illustrative)
Imagine comparing two models on the same well-designed split: one has lower training error but higher held-out error than the other. That pattern motivates checking whether the extra fit captured training-specific details. It is not, by itself, a complete causal diagnosis: leakage, distribution differences and sampling uncertainty also need attention. No empirical model results are claimed in this illustration.
Common confusions
- Overfitting versus underfitting. Underfitting is inadequate capture of relevant patterns; limited capacity, unsuitable features, excessive regularization or insufficient optimization can contribute. Overfitting concerns fitting training-specific patterns that do not generalize; the size of the resulting error depends on the problem.
- Training score versus held-out score. A high score on the training data alone says little. IBM's detection method is the comparison with data the model did not train on.
- Overfitting versus [hallucination](/glossary/hallucination). Hallucination is a model stating false things in an answer. Overfitting is a training and evaluation failure. They can co-occur but have different fixes.
- Myth. More training always improves a model. In fact, more training can improve a model, up to a point: IBM lists training for too long as a cause of overfitting, which is why early stopping exists.
Related terms
Show all 35 related terms
Terms that mention Overfitting
31 terms mention this one
- Bias-variance tradeoff
- Cross-validation
- Data augmentation
- Data drift
- Data leakage (machine learning)
- Decision tree
- Dimensionality reduction
- Early stopping
- Ensemble learning
- Epoch (machine learning)
- Feature engineering
- Gradient boosting
- Hyperparameter
- Keras
- Logistic regression
- Loss function
- Mixture of experts (MoE)
- Model collapse
- Neural network
- Predictive analytics
- Random forest
- Regularization
- scikit-learn
- Support vector machine (SVM)
- Train-test split
- Training data
- Transfer learning
- Underfitting
- Vanishing gradient problem
- Weight decay
- XGBoost
More in AI concepts
Sources
- Machine Learning Glossary (entry: overfitting), Google for Developers (accessed 2026-11-23)
- What is Overfitting?, IBM (accessed 2026-11-23)
- Underfitting vs. Overfitting, scikit-learn documentation (accessed 2026-11-23)
- Dropout layer, TensorFlow (accessed 2026-11-24)
Definitions are written by Skill Almanac from these sources and were checked against them on 2026-11-24. Wikipedia is never the only source.
Review record
Last verified
Drafted by Claude (original draft) and Codex (automated revisions); sources and example targets checked by Independent automated source review (OpenAI Codex); not human peer review on 2026-11-24. Last verified .
Change log (8)
- : Independent automated factual/example review completed. Cached US query estimate aligned to receipt; no traffic promise. Final technical gate recorded separately; publication disabled.
- : First version.
- : Verifier pass: applied verifier corrections to wording and sources.
- : Targeted correction from source-supported early audit; complete exact-version review remains pending.
- : Learning-method scope and counterexample corrections; independent exact-version review pending.
- : Aligned related-tool explanations with scoped definitions; no blanket claims about the full catalog.
- : Aligned underfitting contrast with capacity, feature, regularization and optimization causes. Independent recheck pending.
- : Automated review completed; approved for the staged public release. Search indexing is controlled by the release configuration.