Introduction
The bias vs variance tradeoff explained in machine learning shows why models must generalize beyond their training data. The article Overfitting vs Underfitting in Machine Learning Explained considered models that are either too simple or too sensitive to training data. It showed that both extremes perform poorly on unseen data. Prediction error in overly generalized or overly complex models is associated with high bias or high variance, respectively. This bias-variance tradeoff helps explain the relationship between model complexity and generalization. High bias is commonly associated with underfitting the training data. On the other hand, high variance is commonly associated with overfitting the training data. The goal of this article is to explain how ML engineers need to balance bias and variance to improve model performance.
What Is Bias in Machine Learning?
Bias refers to systematic prediction error associated with the assumptions made by a machine learning model. These model assumptions cause predictions to be repeatedly biased in a particular direction or manner. They arise from simplified relationships between input features and the target. These assumptions shape how the model learns patterns from training data. However, a high-bias model may lack sufficient flexibility to represent underlying data relationships and consistently fails to capture important patterns.
Typically, models with high bias are associated with low model complexity, meaning they have limited capacity to represent complex data relationships. An overly simple model can fail to capture important patterns and interactions. A clear example is using linear regression to fit a strongly nonlinear relationship. This results in a persistent mismatch between the learned model and the underlying pattern. In this case, the limitation comes from insufficient model flexibility rather than insufficient training observations and is commonly associated with underfitting.
There are several observable characteristics of high-bias models. The most significant are relatively high training error and high validation or test error. Another important characteristic is a comparatively small difference between training and validation error. These characteristics result from insufficient learning of meaningful signal from the training data. Therefore, the model performs poorly on both seen and unseen data. Engineers can reduce bias by increasing model flexibility or complexity. However, excessive flexibility can increase sensitivity to variations in the training data, introducing variance.
What Is Variance in Machine Learning?
Variance refers to model sensitivity to changes in training data, resulting in excessive dependence on a particular training sample. The model ends up learning relationships unique to the observed training data. Furthermore, small data changes may lead to substantial changes in learned model behavior, with different training samples producing different predictions. Hence, the model may have difficulty distinguishing generalizable signal from training-specific noise.
Typically, models with high variance are associated with greater model complexity or flexibility, meaning that they have greater capacity to fit detailed training relationships. However, excessive flexibility can lead to the model learning subtle patterns specific to the training sample. Furthermore, random variations may be incorrectly treated as meaningful patterns, causing the model to fit training noise. An example that clearly illustrates this is a deep decision tree fitting every individual training observation. These models can achieve very strong training performance and very low prediction error. However, their performance on unseen data can be significantly weaker.
There are several observable characteristics of high-variance models. The most significant is relatively low training error while having significantly higher validation/test error. Consequently, this creates a large performance gap between training and validation results. The main cause is excessive sensitivity to training-specific patterns and noise, with the model having strong training performance but weak generalization. Engineers often address this by adding constraints that limit overly complex learned relationships or by adding more representative data. Reducing variance can improve stability across different datasets but can potentially increase bias. Hence, the core engineering tradeoff is balancing bias and variance.
Bias vs Variance Tradeoff Explained
Why Bias and Variance Create a Tradeoff
Bias and variance are competing contributors to model error, where reducing one can sometimes increase the other. Introducing greater model flexibility typically lowers the bias but can potentially result in a higher variance. On the other hand, reducing model flexibility lowers variance but potentially increases bias. Hence, improvement in one can worsen the other, and engineers need to find the appropriate balance rather than attempting to eliminate either independently.
Simple models are likely to have high bias and lower variance. Conversely, more complex models are likely to have lower bias but higher variance. Significantly, models with intermediate complexity are more likely to balance the two error sources. Also, more complex models can achieve better training performance, but this does not necessarily result in lower generalization error. Hence, engineers need to adjust and train the model to ensure reliable performance on unseen data.
Engineers should adjust model complexity and training approaches to arrive at the optimal balance between bias and variance. They need to assess evidence of model behavior on unseen observations to validate model performance and not just training performance. Engineers need to select a suitable model complexity that balances bias and variance for optimal performance on unseen data, but this does not mean equal bias and variance. Additionally, they should use cross-validation to provide a robust assessment across different data partitions.

Bias, Variance, and Prediction Error
All models have varying degrees of bias and variance that contribute to the expected prediction error, along with irreducible error.
For squared-error regression, this relationship is commonly represented as:
Bias is the error from systematic differences between expected predictions and the underlying relationship. Squared bias represents the squared systematic deviation between the expected prediction and the underlying relationship. Variance is the error from model sensitivity to different training samples. Finally, irreducible error is the inherent noise or uncertainty within the data-generating process and is impossible to eliminate through model improvement. This conceptual framework helps engineers understand the sources of prediction error rather than attempting to optimize them individually.
With this conceptual framework, engineers understand that increasing model complexity can reduce bias but potentially increase variance. It also explains that excessive simplicity can result in high generalization error through high bias. Conversely, excessive complexity can result in high generalization error through high variance. The engineering objective is to select a model that minimizes expected prediction error on unseen data. Cross-validation helps estimate this generalization performance by evaluating performance across multiple training and validation partitions. They can then evaluate models at different levels of complexity and select the appropriate balance between bias and variance.
How Model Complexity Affects Bias and Variance
Model complexity is typically defined as the capacity to represent relationships in the data. Simple models have low complexity because they have fewer parameters, rules, interactions, or decision boundaries and therefore have less capacity to represent complex relationships. Complex models can support greater complexity in these areas, thereby having greater flexibility to represent more detailed relationships. Complexity depends on model type and configuration and exists on a continuum rather than being simply “simple” or “complex.”
Increasing model complexity makes a model more flexible, allowing it to capture more complex patterns and reducing restrictive assumptions. This reduces model bias as relevant relationships become representable, improving fit to the training data. A good illustrative example is decision trees, where increasing tree depth allows the model to capture more patterns in the data. However, too little complexity can leave meaningful patterns uncaptured.
However, further increasing the model’s flexibility will eventually capture training-specific details that do not represent the population. This includes noise that the model can potentially learn as a meaningful signal. This increases sensitivity to individual training samples where small training-data changes produce different fitter models. Whenever complexity becomes excessive, it is likely to increase variance even though training error may continue to decrease while validation performance deteriorates.
ML engineers need to select the appropriate model complexity between excessive simplicity and excessive flexibility. Their key objective is to attain the lowest generalization error rather than the lowest training error. Validation curves combined with cross-validation can help engineers compare model performance across different complexity levels. Additionally, different datasets require different optimal complexities, so there is no universal complexity level for a model family.
How Bias and Variance Relate to Underfitting and Overfitting
High bias is commonly associated with underfitting, where the model is too restrictive to capture important training-data relationships. This behavior typically produces both relatively high training error and relatively high validation/test error. The model’s poor performance typically stems from insufficient learning rather than excessive sensitivity.
High variance is commonly associated with overfitting, where the model is excessively sensitive to training-specific patterns. This behavior typically produces relatively low training error but significantly higher validation/test error. This results in a large performance gap between training and unseen data, indicating poor generalization performance.
Therefore, bias and variance are mechanisms that help explain model underfitting and overfitting. These concepts are covered in Overfitting vs Underfitting in Machine Learning Explained, which details their causes, symptoms, diagnosis, and remedies. Underfitting is usually associated with the high-bias end of the complexity spectrum, whereas overfitting is typically associated with the high-variance end. Hence, engineers should select an appropriate level of model complexity based on its ability to generalize to unseen data.
How to Manage the Bias vs Variance Tradeoff
Adjust Model Complexity and Regularization
The bias vs variance tradeoff can be managed by adjusting model complexity as a primary control. Whenever the model is experiencing high bias, increasing model flexibility can help reduce it. Likewise, when the model is experiencing high variance, reducing unnecessary complexity can help control it. A simple illustration is decision-tree depth, where greater tree depth allows greater model complexity. Overall, use validation performance rather than training performance as the selection criterion.
A different approach to bias-variance control is to use regularization as a constraint on excessive model flexibility. Engineers impose penalties on model complexity that discourage overly complex learned relationships. L1 regularization penalizes the absolute values of learned coefficients, while L2 regularization penalizes their squared values. These constraints can reduce variance by limiting excessive model flexibility. Regularization strength requires tuning since excessive regularization can increase bias.
Use Cross-Validation and Representative Training Data
Engineers can use cross-validation to evaluate models across multiple training and validation partitions. This provides a more robust generalization estimate than a single split. Engineers can better identify models that are sensitive to particular samples, allowing them to compare model complexity and hyperparameter settings. Consequently, they can select model configurations based on validation performance rather than training performance alone. For classification models, this evaluation also requires selecting appropriate performance metrics, such as [AUC or F1 Score].
Additional representative data can potentially reduce variance by providing broader coverage of the underlying data distribution. Hence, there is less dependence on individual observations or sample-specific noise. Engineers should also consider the importance of data quality and representativeness. Poor or unrepresentative data can potentially preserve or introduce problems, and more data will not automatically resolve high bias.
After engineers establish acceptable generalization performance, [feature importance in machine learning] can help identify which input variables are influencing model behavior.
Use Ensemble Methods and Model-Specific Techniques
Another technique for reducing sensitivity to individual training samples is to combine predictions from multiple models. Bagging trains multiple models on different bootstrap samples of the original training data and aggregates their predictions. This can reduce overall variance and dependence on a particular training sample. A simple example is a random forest, where multiple decision trees are trained using different samples and subsets of features. Models can address bias by building models sequentially, known as boosting. Boosting allows successive models to focus on errors from earlier models and can reduce bias. However, ensemble methods can affect bias and variance differently depending on their algorithm and configuration.
Adjusting complexity techniques vary according to the model type, where depth and pruning adjust decision tree complexity. Neural networks can control excessive model flexibility through regularization, dropout, or early stopping during training. Other algorithms have their own appropriate hyperparameter controls, and there is no single technique that fits every model. Ultimately, bias-variance management is an iterative engineering process with the emphasis on generalization performance.
Bias vs Variance Example

The bias vs variance tradeoff is clearly illustrated using a decision tree trained for prediction problems. It serves as a good example for illustrating model complexity adjustment since tree depth is one important control of model complexity. Shallow trees represent low complexity, while increasing depth allows additional decision rules and relationships. Validation performance is used to evaluate generalization.
Shallow trees are more likely to exhibit high bias since they have fewer levels and decision splits. They lack the capacity to capture important relationships. Therefore, they have both high training and validation error, typically with a small training-validation performance gap. To improve this, engineers can increase tree depth, potentially improving performance.
Increasing the depth captures more meaningful relationships and can reduce bias compared with shallower trees. Validation error can decrease as the tree gains sufficient complexity to represent useful patterns without fitting excessive training-specific detail. This improves generalization with unseen data, but bias and variance are not necessarily equal. The lowest validation error can indicate a more appropriate level of model complexity.
Further increasing depth will create increasingly specific decision rules, lowering the training error further. However, the tree will begin to fit individual observations and noise, increasing its sensitivity to the particular training sample. The validation error begins to increase again despite the strong training performance, resulting in high variance and overfitting. Engineers can respond by pruning the tree or limiting its maximum depth.
Conclusion
The bias vs variance tradeoff explains how competing sources of model error affect generalization performance. High bias is associated with insufficient model flexibility and underfitting, whereas high variance is associated with excessive sensitivity and overfitting. Model complexity influences the balance between these two prediction error contributors. However, the appropriate balance focuses on minimizing generalization error rather than minimizing training error.
Across different models and model types, there is no universal optimal model complexity level. Evaluating generalization typically uses validation and cross-validation. These results can guide model adjustments using regularization, representative data, ensemble methods, and model-specific controls. Therefore, bias-variance management is an iterative development process focused on improving generalization. The decision-tree example demonstrates this progression clearly, moving from high bias toward high variance as model complexity increases. Ultimately, engineers should seek the bias-variance balance that produces the lowest expected prediction error on unseen data.
Further Reading
Affiliate Disclosure: Some links on this page are affiliate links. As an Amazon Associate, AI Cloud Data Pulse earns from qualifying purchases. We also participate in the Pluralsight affiliate program and may earn a commission if you subscribe or purchase through our links, at no additional cost to you. We only recommend courses and resources that provide genuine value to our readers.
References
- Scikit-learn — Validation curves: plotting scores to evaluate models
- Scikit-learn — Underfitting vs. Overfitting
- Scikit-learn — Model selection and evaluation
- Scikit-learn — Ensemble methods
Books
- An Introduction to Statistical Learning: with Applications in Python
by Gareth James - Hands-On Machine Learning with Scikit-Learn and PyTorch: Concepts, Tools, and Techniques to Build Intelligent Systems
by Aurélien Géron - Pattern Recognition and Machine Learning
by Christopher M. Bishop
Online Learning
Continue Learning with Pluralsight
Want to strengthen your machine learning skills? Pluralsight provides courses covering machine learning, Python, model development, and related AI technologies. Explore machine learning courses on Pluralsight.

