Why does hinge loss produce sparse solutions in terms of support vectors?

Quick Overview

Asks why an SVM trained with hinge loss depends on only a subset of the training points, the support vectors. Tests the shape of the hinge loss, the dual form of the solution and its KKT conditions, the contrast with logistic loss, and how regularization changes the number of support vectors.

Why does hinge loss produce sparse solutions in terms of support vectors?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

Why does hinge loss produce sparse solutions in terms of support vectors? ```hint Look at the slope Write the hinge loss as a function of the margin $y_i f(x_i)$ and look at its slope for points that are already classified with room to spare. ``` ```hint Use the dual Write the optimal weight vector as a weighted sum of training points, then ask which KKT condition forces a point's weight to zero. ``` ### What a Strong Answer Covers - The shape of the hinge loss and why points beyond the margin contribute no gradient - The dual form of the solution and the complementary slackness cases that set each point's weight - The contrast with a loss that is never exactly zero, such as logistic loss - What sparsity buys at prediction time and what makes the number of support vectors grow or shrink ### Follow-up Questions - How does the number of support vectors change as C decreases, and why? - Squared hinge loss is also zero beyond the margin. Is its solution sparse too, and how does it differ? - A kernel SVM ends up with nearly every training point as a support vector. What would that tell you? - How does this kind of sparsity differ from the sparsity an L1 penalty produces?

Overview: Asks why an SVM trained with hinge loss depends on only a subset of the training points, the support vectors. Tests the shape of the hinge loss, the dual form of the solution and its KKT conditions, the contrast with logistic loss, and how regularization changes the number of support vectors.

PracHub logo
General
Nov 25, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

Why does hinge loss produce sparse solutions in terms of support vectors?

What a Strong Answer Covers Guidance

  • The shape of the hinge loss and why points beyond the margin contribute no gradient
  • The dual form of the solution and the complementary slackness cases that set each point's weight
  • The contrast with a loss that is never exactly zero, such as logistic loss
  • What sparsity buys at prediction time and what makes the number of support vectors grow or shrink

Follow-up Questions Guidance

  • How does the number of support vectors change as C decreases, and why?
  • Squared hinge loss is also zero beyond the margin. Is its solution sparse too, and how does it differ?
  • A kernel SVM ends up with nearly every training point as a support vector. What would that tell you?
  • How does this kind of sparsity differ from the sparsity an L1 penalty produces?