Back to list
Lv.1

Loss Function

Loss Function

A calculation that measures how far an AI's prediction is from the correct answer.

In Simple Terms

A loss function is a mechanism that expresses, as a number, how far apart an AI's predicted answer is from the actual correct answer. When an AI is learning, it uses this loss function to calculate how wrong its prediction was, every single time. By adjusting its internal settings so that this calculated gap gets smaller, the AI gradually becomes smarter.

Behind the Name

In "Loss Function," "loss" refers to the error or penalty that occurs whenever the AI's prediction misses the mark. A "function," meanwhile, is a mathematical formula that takes in data and calculates a result. This is also sometimes called a "Cost Function."

Take a Closer Look!

A loss function is a mathematical formula used in AI training to calculate and quantify the gap between the AI's predictions and the actual correct data.
The bigger the gap, the higher the number the loss function produces; the closer the prediction gets to the correct answer, the closer that number gets to zero.

To put it simply, a loss function works a bit like subtracting to find a test score for the AI. Let's use an example where an AI is judging whether an animal in a photo is a dog or a cat.
Say the AI predicts "80% chance it's a dog," but the actual answer is a cat — that creates a big gap between the prediction and the correct answer. The loss function calculates this gap and produces a number that essentially says, "here's how wrong you were this time."

As the AI continues training, it keeps adjusting its internal data so that the number produced by the loss function gets even a little smaller. The smaller that gap becomes, the more accurate the AI's predictions get.
In this way, the loss function serves as a crucial benchmark that helps the AI learn the right answers and become smarter.

CategoryAIData