Definition
A loss function is a single number that measures how far an AI model’s predictions are from the correct answers, so training can work to shrink it.[1]
At a glance
- Lower loss means better predictions; high loss means the model is guessing badly.[1]
- It is the feedback signal that drives every adjustment a model makes while learning.[2]
- Different tasks use different loss functions (e.g. predicting prices vs. sorting into categories).[4]
- The choice of loss function defines what good means for your model, so it is a business decision too.
Why it matters to you
The loss function is how an AI model knows it is improving. During training, the model makes a guess, the loss function scores the error, and the model nudges itself to do better next time.[2] Repeat millions of times and you get a useful model. No loss function, no learning.[3]
It encodes your priorities
Picking a loss function quietly decides which mistakes matter most. One choice punishes big errors harshly; another treats all errors evenly; another cares about ranking things correctly.[4] If a model behaves in surprising ways, the loss function it was trained on is often the reason worth asking about.
Bottom line
A loss function is the model’s report card, and the entire goal of training is to make that grade as low as possible.