ML MATH & LINEAR ALGEBRA · INTERVIEW QUESTION
Explain the KKT conditions and their role in SVM optimization.
⚫ expert · Numerical Methods
Hint: Think about the Lagrangian, complementary slackness, and the dual problem.
Answer
KKT (Karush-Kuhn-Tucker) conditions are necessary at a local optimum for differentiable inequality-constrained problems under a constraint qualification (for example LICQ). For convex problems, feasible KKT points are globally optimal; necessity still needs an appropriate qualification. The inequality-only conditions are:
- Stationarity:
- Primal feasibility:
- Dual feasibility:
- Complementary slackness:
In hard-margin SVMs, the constraints are .
Complementary slackness means only when , i.e., only support vectors have non-zero dual variables.
The SVM dual problem:
subject to and .
In a soft-margin SVM, slack variables allow violations and the dual adds . Support vectors with can lie inside the margin or be misclassified; only implies an exact unit margin. Sparsity can reduce prediction work, but kernel SVM training may still be expensive.
Related questions
- What is the difference between model parameters and hyperparameters? Give examples for GPT and XGBoost.
- What is the difference between eigenvalues and singular values?
- Explain the role of SVD in PCA. How does truncated SVD relate to dimensionality reduction?
- Derive the gradient of the cross-entropy loss for softmax output.
- What is the difference between convex and non-convex optimization? Why does it matter in deep learning?