Loss is a single number that summarizes how wrong the model is across many examples, built by combining individual errors into one overall measure.
Why square the errors?
Squaring removes the sign so that overshooting and undershooting both count as mistakes, and it makes a few large errors weigh more heavily than many small ones. That matches the intuition that being badly wrong on one example is worse than being slightly wrong on several.
Same two examples, two models
Model A (errors 0.4, 0.1)
- Squared errors: 0.16 and 0.01
- Average loss: 0.085
Model B (errors 0.1, 0.05)
- Squared errors: 0.01 and 0.0025
- Average loss: 0.00625
A smaller loss means the model's predictions are closer to the correct answers on the data it was measured on. It does not yet tell you whether the model will do well on new data, only that it is doing better on the examples it has seen.