Why does the dual formulation of an SVM depend only on inner products between sample pairs?

Quick Overview

Asks why the dual form of a support vector machine can be written entirely in terms of inner products between training samples. Tests Lagrangian duality, the derivation of the SVM dual, the kernel trick, and the computational cost of working with a Gram matrix.

Why does the dual formulation of an SVM depend only on inner products between sample pairs?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

Why does the dual formulation of an SVM depend only on inner products between sample pairs? ```hint Stationarity Write the Lagrangian of the margin problem and set its gradient with respect to $w$ to zero. What form does the optimal $w$ take? ``` ```hint Substitute everywhere Plug that expression back into every place $w$ appears, including the decision function used at prediction time. ``` ### What a Strong Answer Covers - The Lagrangian and the stationarity conditions for $w$ and $b$ - The form of the optimal weight vector, and how substituting it produces the dual objective - Why prediction, and the bias term, also need only inner products - The kernel trick and what it makes possible - The computational consequences of working with the Gram matrix ### Follow-up Questions - What changes in the dual for the soft-margin SVM? - What conditions must a function satisfy to be a valid kernel? - Why does the kernelized dual become impractical with millions of training samples, and what do people use instead? - When would you solve the primal problem instead of the dual?

Overview: Asks why the dual form of a support vector machine can be written entirely in terms of inner products between training samples. Tests Lagrangian duality, the derivation of the SVM dual, the kernel trick, and the computational cost of working with a Gram matrix.

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

Why does the dual formulation of an SVM depend only on inner products between sample pairs?

What a Strong Answer Covers Guidance

  • The Lagrangian and the stationarity conditions for ww and bb
  • The form of the optimal weight vector, and how substituting it produces the dual objective
  • Why prediction, and the bias term, also need only inner products
  • The kernel trick and what it makes possible
  • The computational consequences of working with the Gram matrix

Follow-up Questions Guidance

  • What changes in the dual for the soft-margin SVM?
  • What conditions must a function satisfy to be a valid kernel?
  • Why does the kernelized dual become impractical with millions of training samples, and what do people use instead?
  • When would you solve the primal problem instead of the dual?