MSE (Mean Squared Error)
Last Updated: July 29, 2026 | By Mihail Sebastian | AI Dictionary
The average of squared differences between a model's predictions and the actual values: a regression loss where one large error outweighs many small ones.
What is MSE (Mean Squared Error)?
MSE (mean squared error) is a regression loss that averages the squared differences between a model’s predictions and the actual values. Squaring means an error twice as large costs four times as much, so a few big misses dominate the score.
It is the default loss for regression, the way cross-entropy loss is for classification. It serves double duty as both the objective a model trains on and a metric for model evaluation.
How MSE Works
\[ MSE = \frac{1}{n} \sum_{i=1}^{n} (y_i - \hat{y}_i)^2 \]where \(y_i\) is the actual value, \(\hat{y}_i\) the prediction, and \(n\) the number of data points. Each error is squared before averaging, so the sign disappears and large errors are amplified.
The squaring also makes MSE smooth and differentiable everywhere, which suits gradient descent. One side effect: the result is in squared units, so an MSE of 2,500 on prices in dollars means dollars², not dollars. Its square root (RMSE) restores the original units.
MSE vs MAE
The practical difference: MSE punishes large errors far more than small ones, while MAE weighs every unit of error equally – so MSE is sensitive to outliers and MAE is robust to them. Choose MSE when large errors are disproportionately costly, and MAE when a few extreme cases should not dominate the measure.
| Criterion | MSE | MAE |
|---|---|---|
| Penalty on large errors | Squared, so outliers dominate the total | Proportional, so outliers count once |
| Units of the result | Squared units of the target (e.g. dollars²) | Same units as the target (e.g. dollars) |
| Gradient behavior | Grows with the error, smooth everywhere | Constant magnitude, with a kink at zero |
| Choose it when | Large errors are especially costly | Outliers should not dominate the score |
Example of MSE
Compare two house-price models on ten sales. Model A misses every price by $10,000. Model B is exact on nine houses but misses one by $100,000.
Both are off by $100,000 in total, so their MAE is identical: $10,000. Their MSE is not. Model A averages \(10{,}000^2 = 10^8\), while Model B averages \(100{,}000^2 / 10 = 10^9\), ten times worse.
That gap is the point of squaring. If a single $100,000 miss is a worse outcome than ten small ones, MSE encodes that judgment; if it is not, MAE is the better fit.
Related AI terms: MAE · Cross-Entropy Loss · Loss Landscape · Regression Analysis · Model Evaluation
Did you like the MSE (Mean Squared Error) gist?
Learn about 250+ need-to-know artificial intelligence terms in the AI Dictionary.
Mihail Sebastian — Writes about AI governance, regulation, and the technology behind them. Placeholder bio — replace with a real credential line. About