AI Glossary Term

What does “Loss Function” mean?

Definition

A mathematical objective that quantifies prediction error during training.

How Loss Function works

Diagram for Loss Function, a repeating loop: Model predicts; then Loss function scores the error; then Optimizer lowers the loss; then Weights update; then back to the start.Model predictsLoss function scores the errorOptimizer lowers the lossWeights updaterepeat

Example

In a house-price model, the loss might be the average squared difference between predicted and actual prices. Training tries to make that single number as small as possible.

Why it matters

The loss defines what the model is rewarded for. A loss that does not match your real goal can lead to a model that scores well but is not useful.

Common questions

Is loss the same as accuracy?

No. Loss is a smooth training signal; accuracy is a human-friendly measure. They often move together but not always.

What are common loss functions?

Mean squared error for numbers and cross-entropy for classes and next-token prediction.

Can I design my own?

Yes, and teams often do when the standard ones do not reflect their goals.

Learn more in our free guides

Test yourself

See also