ML & Deep Learning Foundations·Question 39 of 55Advanced

Why is MSE a bad loss for classification, even though it "works"? Connect it to the probabilistic view of loss functions.

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

Two independent arguments - mechanical and probabilistic - and a strong answer gives both.

Full worked answer

Two independent arguments - mechanical and probabilistic - and a strong answer gives both.

Mechanical: gradient starvation on confident mistakes. For a sigmoid output p = σ(z) with MSE loss (p − y)², the gradient w.r.t. the logit is 2(p − y)·σ'(z), and σ'(z) = p(1−p) → 0 whenever the output saturates. So an example the model gets confidently wrong (p≈0, y=1) produces almost no gradient - precisely the examples that most need correction learn slowest. Cross-entropy's sigmoid/softmax gradient is p − y with no σ' factor: the derivative of the log exactly cancels the sigmoid's saturation, so confident errors get the largest updates. This also makes MSE-on-sigmoid non-convex in z per example with bad plateaus, whereas CE is convex in the logits.

Probabilistic: wrong noise model. Every loss is a negative log-likelihood under some noise assumption. MSE ⇔ Gaussian noise with fixed variance - a model for continuous targets that can be "off by 0.3." Class labels are categorical events; the correct likelihood is Bernoulli/categorical, whose NLL is cross-entropy. Using MSE asserts that predicting 0.7 for a true label 1 incurs the same kind of penalty as a regression miss, and it bounds the maximum penalty for total confidence in the wrong class at 1.0, where CE assigns unbounded penalty (−log p → ∞). CE is the negative log-likelihood of the categorical model, so training with it is MLE - which is why probabilities trained under CE are the ones with a clean probabilistic interpretation.

Going further: follow-up territory

Nuance to volunteer: Brier score (MSE on probabilities) is a proper scoring rule and is used for evaluating calibration - the objection is about optimization dynamics and likelihood correctness for training, not that MSE on probabilities is meaningless. And regression flips everything: CE doesn't apply directly, MSE is exactly right under Gaussian assumptions, L1/Huber when you want robustness to outliers.

What a good answer covers

  • Mechanical: gradient starvation on confident mistakes
  • For a sigmoid output p = σ(z) with MSE loss (p − y)², the gradient w.r.t
  • So an example the model gets confidently wrong (p≈0, y=1) produces almost no gradient - precisely the…
  • Cross-entropy's sigmoid/softmax gradient is p − y with no σ' factor
  • This also makes MSE-on-sigmoid non-convex in z per example with bad plateaus, whereas CE is convex in…

Key terms: no gradient · Probabilistic: wrong noise model

Interviewer follow-ups to expect

  1. Derive the p − y gradient and show where the cancellation happens. When would you use Brier score deliberately?

  2. What loss corresponds to Laplace noise, and when would you prefer it?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep