Sapiens
Technicals

What is a loss function?

Published June 2, 2026 · 4 min read

LOSS FUNCTIONHow far did we miss?Loss is the gap to the bullseye — training pulls the shots inward.bullseye = the correct answerLOSS =Σ gap lengthsLower loss meanstighter on center.Add up every arrow's distance from center — that single number is the loss we shrink.

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.

References

  1. What is a Loss Function in Machine Learning? IBM www.ibm.com
  2. Loss Functions in Machine Learning Explained. DataCamp www.datacamp.com
  3. Loss and Loss Functions for Training Deep Learning Neural Networks. Machine Learning Mastery machinelearningmastery.com
  4. 7 Common Loss Functions in Machine Learning. Built In builtin.com

Comments

Questions, corrections, and links welcome. Be specific and civil.

  • Loading comments…