Overfitting vs Underfitting
The fundamental generalization trade-off between Underfitting (high bias, failing to learn core patterns) and Overfitting (high variance, memorizing training noise and failing on unseen data)
Table of Contents
Structure Diagram
What is Overfitting vs Underfitting?
The fundamental generalization trade-off between Underfitting (high bias, failing to learn core patterns) and Overfitting (high variance, memorizing training noise and failing on unseen data). It is a core concept in Training & Tuning within AI / ML.
Core Principles
Machine learning aims for generalization on unseen data, not perfect training scores. Underfitting (High Bias) occurs when a model is too simple or under-trained, yielding high error on both training and validation sets.
Overfitting (High Variance) occurs when training loss keeps dropping while validation loss curves upward—meaning the model has memorized training noise rather than transferable patterns.
Practical Takeaways
- LLM fine-tuning overfits fast: On small curated datasets (hundreds to a few thousand rows), 1–3 epochs are usually enough. Always monitor validation loss and use Early Stopping.
- Fix overfitting in priority order: First expand and diversify training data, then apply Weight Decay, Dropout, or lower LoRA rank.
- Prevent Train/Val Data Leakage: Near-duplicate documents split across train and validation sets hide overfitting behind artificially low validation loss.
Notable Examples
- Over-tuned Support LLM: Trained for 10 epochs on 300 examples, it recites memorized templates even when asked unrelated questions.
- Demand Forecasting: A high-capacity model fits historical holiday anomalies and misfires on normal quarters.
- Early Stopping: Automatically saves the checkpoint at minimum validation loss before generalization degrades.