Skip to content

Overfitting

Written by GPT-6 Luna from the web 18 of 77 sentences cited

An AI wrote this article, and it can be wrong.

Overfitting is a statistical modeling error in which a model learns features specific to its training data—including random noise—so that its fit to those data does not translate into reliable performance on new observations. It matters because a model can appear accurate when judged on the data used to build it yet make poor predictions, or support misleading conclusions, when applied elsewhere. The problem arises in regression, classification and other forms of statistical learning, and can affect both conventional statistical models and machine-learning systems.12

Overfitting is commonly associated with excessive model flexibility relative to the information available in the data, but complexity alone does not determine whether a model will generalize well. Researchers assess the problem by evaluating performance on data not used to fit or select the model, and try to manage it through methods such as regularization, cross-validation and model-selection criteria. Modern machine-learning research has also shown that some highly flexible models can fit their training data exactly and still perform well on new data, complicating the older view that exact fit necessarily signals overfitting.3

Definition

A statistical model estimates a relationship between observed inputs and outcomes. Its fit is usually measured using a loss or error: for example, the difference between predicted and observed values in regression, or the fraction of incorrectly classified cases in classification. Training error measures performance on the data used to estimate the model; generalization performance concerns how well it performs on relevant, previously unseen data. Overfitting occurs when the model captures patterns in the training sample that do not reliably recur beyond it.43

The “noise” in this definition refers to variation that does not represent a stable relationship of interest. It can include measurement error, chance fluctuations, unusual observations or other sample-specific features. A flexible model may reproduce these details as though they were meaningful structure. That can lower its training error while making its estimates more sensitive to which observations happened to be collected.12

Overfitting is not simply the fact that a model performs better on its training data than on new data: training performance is ordinarily optimistic because the model was fitted to those observations. Nor is a large training–test gap, by itself, a universal definition. The central concern is whether the model’s performance on data relevant to its intended use is inadequate; that assessment depends on the task, the data and the evaluation method.3

Origins and theory

The term is used in statistical modeling to describe the consequences of including unnecessary terms or too much flexibility. The U.S. National Institute of Standards and Technology explains that extra terms can let a model treat random variation as deterministic structure. It also notes that the resulting effects can extend beyond prediction, increasing estimated uncertainty and potentially affecting scientific or engineering conclusions.1

A common theoretical account is the bias–variance trade-off. A restrictive model may be systematically unable to represent the underlying relationship, a problem associated with bias. A more flexible model can represent a wider range of patterns, but its fitted predictions may vary more from one training sample to another, a problem associated with variance. In the classical account, increasing flexibility can reduce bias while increasing variance, so the expected prediction error may fall at first and then rise. The balance depends on the data and model, rather than on a single complexity threshold.56

Model selection has long addressed the risk of fitting too many features to a finite sample. In a 1974 paper, statistician Hirotugu Akaike presented the Akaike information criterion (AIC), which compares models using a measure of fit penalized by the number of independently adjusted parameters. The criterion was intended to support selection among statistical models; it is one approach to balancing fit against complexity, not a guarantee that the selected model is correct or will perform well in every setting. ieee.org

Detection

A basic diagnostic compares training performance with performance on data withheld from fitting. A held-out test set provides an estimate of how the model performs on observations it did not use during training. A validation set serves a different role: it helps choose among models or tune their settings. If the test set is repeatedly consulted while making those choices, it effectively becomes part of the selection process and no longer provides an independent final assessment.3

Cross-validation estimates performance by repeatedly fitting and evaluating a model on different partitions of the available data. In k-fold cross-validation, the data are divided into k parts; each part is held out in turn while the model is fitted on the others. This can make more efficient use of limited data than relying on a single split, but it does not remove all sources of uncertainty or correct a flawed evaluation design. The chosen partitions and scoring method should reflect the data and the intended use of the model.3

Validation also requires attention to how the data are prepared. If information from a test set influences steps such as feature selection or normalization, the reported score can be overly optimistic, even if the model-fitting procedure itself excludes test observations. This problem, called data leakage, is one reason preprocessing should be fitted using training data and then applied to held-out data without learning from it. In scientific modeling, residual analysis provides a complementary check on whether unexplained errors show patterns inconsistent with the model’s assumptions.78

Reducing risk

Regularization constrains a model’s effective flexibility or discourages certain fitted solutions. In penalized regression, for example, a penalty is added to the fitting objective, so that a model must improve its fit enough to justify greater coefficient magnitude or complexity. Adjusting the penalty changes the balance between fitting the sample and limiting the fitted model. The setting is commonly chosen with validation data or cross-validation rather than by checking training error alone.3

Other approaches limit model complexity more directly. Analysts can remove terms that are not supported, restrict the depth of a decision tree, or choose among candidate models using criteria that penalize complexity. The choice depends on what counts as complexity in the model: a parameter count, for example, may not capture every relevant aspect of a highly flexible method. Simpler models can reduce variance but may also omit genuine structure, so reducing complexity is not an end in itself.19

In iterative training, early stopping uses performance on validation data to decide when to stop updating a model. It is used in neural-network training because continued reduction of training error need not improve performance on held-out data. Early stopping is a model-selection decision: if many stopping points or training choices are compared, the validation data can themselves be overused. A separate test set is therefore useful for estimating final performance after training and selection are complete.103

Consequences

In prediction, overfitting can make a model’s apparent accuracy fail to carry over to new cases. The problem is especially important when researchers or practitioners rely on training fit as evidence of predictive value. A high coefficient of determination, or R², does not by itself establish that a regression model is adequate; the NIST handbook recommends validation and emphasizes examining residuals as well as numerical fit measures.4

In explanatory or scientific work, an overfit model may assign meaning to sample-specific patterns. Relationships that appear strong in one dataset may not replicate, and extra terms can affect estimated uncertainty. Model fitting, uncertainty estimation and interpretation are therefore connected: a model that closely reproduces observed data is not automatically a sound account of the process that produced them.12

The risk can also arise during model selection rather than only during the initial fit. If many candidate models are compared using a finite validation sample, some may appear especially successful by chance. Selecting the best-looking candidate can then tailor the choice to that sample’s noise. Research on cross-validation-based model selection has shown that this selection step can bias subsequent performance estimates, which is why evaluation procedures should account for the full process of choosing and tuning a model.

Deep learning

The classical account of overfitting has a more complicated relationship with modern machine learning. Many large neural networks have enough parameters to fit their training examples closely, yet some achieve strong performance on held-out data. This observation does not mean overfitting has ceased to matter; it shows that the number of parameters or the fact of exact training fit alone may not predict generalization. pnas.org

In 2019, Mikhail Belkin and co-authors described a “double descent” pattern in which test error can rise as model capacity approaches the point where the training data can be fit exactly, then fall again as capacity increases further. Their paper presented evidence for this pattern across a range of models and datasets and argued that it extends the familiar U-shaped picture of prediction error. The curve is a reported phenomenon in particular settings, not a guarantee that making a model larger will improve it. pnas.org

Subsequent research has explored when double descent appears and how its behavior differs across model classes and learning settings. A 2020 NeurIPS paper, for example, distinguishes two types of overfitting peaks in certain neural-network and regression settings and argues that they should not be treated as identical. Such work has made the relationship between model capacity, interpolation and generalization an active theoretical question rather than a settled rule.1112

Evaluation limits

An estimate of generalization performance is only informative if the evaluation data resemble the data to which the model will be applied. A held-out test score does not establish performance under changed conditions, such as a different population or a later period, unless the evaluation design represents those conditions. Data leakage can create optimism even when training and test sets appear separate, while a mismatch between the test sample and intended use can make a score difficult to interpret.74

Consequently, there is no single diagnostic or correction that applies to every model. Cross-validation, regularization and information criteria address different parts of the problem, and each depends on assumptions about the data, model and goal. The practical objective is not necessarily the simplest model or the one with the smallest training error, but one whose performance and uncertainty are assessed appropriately for its intended use.93

References

12 sources
  1. ncbi.nlm.nih.gov/books/NBK583970ncbi.nlm.nih.gov· cited 3×

  2. 1.3.3.33. 6-Plotitl.nist.gov

  3. The Overfitting Principles Supporting AICcensus.govApr 9, 1993· cited 2×

  4. pubmed.ncbi.nlm.nih.govpubmed.ncbi.nlm.nih.gov