Quant Memo
Advanced

The SVM Dual and Support Vectors

A support vector machine's boundary turns out to depend on only a handful of the training points — the ones sitting closest to it. The dual formulation of the SVM's optimization problem is what makes this visible, and it's also what makes the kernel trick possible.

Prerequisites: Support Vector Machines

A support vector machine finds the boundary separating two classes with the widest possible margin — sounds like every training point should matter. It doesn't: solving the SVM's optimization problem in its dual form reveals the boundary depends only on a small subset of points — the support vectors — sitting on or inside the margin. Every other point could be deleted without changing the answer.

The analogy: the boundary is set by whoever's closest to the fence

Two crowds separated by a rope, placed as far from both as possible: to decide exactly where the rope goes, you don't survey everyone — you find whoever in each crowd stands closest to the other crowd and place the rope between those few people. Everyone standing further back could walk away and the rope wouldn't move. Those few closest people are the support vectors.

The mechanics: from the primal problem to the dual

The primal problem minimizes w2\|w\|^2 subject to every point being correctly classified with margin at least 1. Using Lagrange multipliers αi0\alpha_i \ge 0 per point, the problem rewrites entirely in terms of the αi\alpha_i's:

maxα iαi12i,jαiαjyiyj(xixj),s.t. 0αiC, iαiyi=0.\max_{\alpha} \ \sum_i \alpha_i - \frac{1}{2}\sum_{i,j} \alpha_i \alpha_j y_i y_j (x_i^\top x_j), \qquad \text{s.t. } 0 \le \alpha_i \le C, \ \sum_i \alpha_i y_i = 0 .

In plain English: only points on or inside the margin end up with αi>0\alpha_i > 0; every point comfortably on the correct side drops out with αi=0\alpha_i=0. The boundary is w=iαiyixiw = \sum_i \alpha_i y_i x_i, summed only over support vectors. The dual only ever needs dot products xixjx_i^\top x_j — never raw features directly — which is exactly what lets the kernel trick swap in a similarity function for the dot product and get a nonlinear boundary for free.

Worked example: which of five points are support vectors

Five 1-D points separating "trending" (class +1, signal values 3,4,83, 4, 8) from "mean-reverting" (class −1, values 2,1,1-2,-1,1). The widest-margin boundary sits between the closest pair across classes — here 33 and 11, since they're nearer each other than any other cross-class pair. Solving the dual, only 33 and 11 get αi>0\alpha_i>0; 44, 88, 2-2, 1-1 all get αi=0\alpha_i=0. Delete those four points and refit: the boundary lands in exactly the same place.

support support
Only the two points sitting on the margin (red) are support vectors — they alone determine the boundary. The other four points, further from the margin, could be deleted with no effect on where the line sits.

What this means in practice

Support vectors are why SVMs can be memory-efficient at prediction time — store only the support vectors, not the whole training set — and why the model ignores points far from the boundary, unlike least-squares, where every point tugs at the fit. The flip side: the decision only "listens" to the hardest, most boundary-adjacent cases, so a mislabeled point near the boundary can distort the whole surface.

The SVM dual reformulates margin maximization in terms of one weight αi\alpha_i per point, and only points on or inside the margin — the support vectors — get αi>0\alpha_i>0. The boundary is a weighted sum of support vectors alone, which explains both the SVM's memory efficiency and the mechanism behind the kernel trick.

"Support vectors define the boundary" is often misread as "SVMs are automatically robust to outliers." It's the opposite: because far-away points are ignored entirely, one mislabeled point sitting near the boundary can become a support vector and meaningfully warp the decision surface, with no averaging-out from well-behaved points further away.

Related concepts

Practice in interviews

Further reading

  • Cortes & Vapnik, Support-Vector Networks (1995)
  • Hastie, Tibshirani & Friedman, The Elements of Statistical Learning, ch. 12.2
ShareTwitterLinkedIn