Notes

Label Smoothing Loss

When you train a classifier, the labels are usually treated as absolute truth: one class is 100% correct and every other class is 0%. Label smoothing loss relaxes that certainty on purpose, which can make models less brittle and less overconfident.

What it is and how it changes the target

In standard multiclass training with cross-entropy loss, the target label is a one-hot vector (e.g., “cat” = 1, all others = 0). With label smoothing, you replace that hard target with a slightly “soft” distribution. If there are K classes and smoothing strength ε, the target becomes:

  • True class: 1 - ε
  • Each other class: ε / (K - 1)

You then compute cross-entropy between the model’s predicted probabilities and this smoothed target. The model is still pushed toward the correct class, just not toward absolute certainty.

Why it helps in practice

Label smoothing acts like a small, targeted regularizer:

  • Reduces overconfidence, improving probability calibration (useful in credit scoring or medical triage where scores drive decisions).
  • Makes training more robust to label noise (e.g., mislabeled spam emails or ambiguous churn outcomes).
  • Can improve generalization by discouraging “memorize-the-label” behavior, especially in high-capacity neural nets.

Where you’ll see it

Deep learning libraries expose it directly. For example, PyTorch’s CrossEntropyLoss supports label_smoothing, and TensorFlow/Keras offers label smoothing in categorical cross-entropy. A common pitfall is setting ε too high, which can under-train the true class signal and hurt accuracy.

Label Smoothing Loss is a classification objective (typically cross-entropy) computed against smoothed labels, where the target distribution assigns most probability to the true class and a small nonzero probability to other classes instead of a hard one-hot vector. It matters because it reduces overconfident predictions, improves probability calibration, and acts as a simple regularizer that can improve generalization and robustness to label noise.

Think of teaching a kid to recognize animals. If you insist “this is 100% a dog, never anything else,” they may get overconfident and struggle with unusual breeds. Label Smoothing Loss is a training trick that gently relaxes those “100% certain” labels. Instead of telling the model one class is absolutely correct, it gives a tiny bit of credit to other classes too.

This matters in classification tasks like spam detection or image recognition because it discourages extreme confidence, helps the model handle messy real-world data, and can improve how trustworthy its probability scores are.