The interview problem

Practice prompt

Explain multiclass label smoothing and distinguish two conventions for distributing the smoothing mass.

Original practice, not a reported company interview. Scenarios and numbers are illustrative. Interview date: not applicable. Sources retrieved October 1, 2026.

1. Scope and worked approach

Under the uniform-over-all-classes convention, replace one-hot target y with (1−epsilon)y+epsilon/K for each of K classes. Another convention distributes epsilon only over incorrect classes; coefficients are not interchangeable. Train with cross-entropy against the chosen soft target and evaluate against real labels. Smoothing changes the objective; it does not create evidence that alternatives are actually correct.

2. Trace the design or derivation

Choose convention
  → construct normalized targets
  → compute cross-entropy
  → evaluate real-label metrics

For an unconstrained model trained on a fixed smoothed target, the cross-entropy minimum matches that target rather than a one-hot vector. This illustrates why smoothing discourages infinite correct-class logits. In real datasets, shared parameters and conflicting examples complicate that simple per-example optimum.

3. Calculate the example

With K=4 and epsilon=0.1 under the all-class convention, the correct class target is 0.925 and each other target is 0.025, summing to 1. Under the incorrect-only convention they would be 0.9 and approximately 0.0333.

4. Failure cases and trade-offs

Uniform smoothing ignores semantic similarity and may hurt tasks needing sharp probabilities or teacher confidence. It can discourage extreme logits but does not guarantee calibration under shift. Compare accuracy, log loss and calibration on held-out data rather than inferring improvement from softer outputs.

5. Validation, follow-ups and self-review

Check epsilon=0, target sums and agreement with the library's definition. Follow-up: how would class-dependent smoothing change the assumptions? Self-review: name the convention and avoid confusing smoothing with label correction.

Sources and related practice

Technical reference: docs.pytorch.org — Soft targets and uniform label smoothing.

Source publication/update: Not established. Retrieved October 1, 2026. The workflow, calculations and review exercises are original; this reference is not evidence that a company asked this question.

Continue with When can you trust a probability?; Choose targets and losses for model distillation.

Continue your preparation

Choose a connected learning path or browse more ML fundamentals questions. Read our editorial method and attribution policy.