The SVM That Saw Only Dot Products
You are given a training set with and . The soft-margin SVM solves
After solving the dual, the decision function is
Now suppose instead of raw features , you map every point to a very high-dimensional (even infinite-dimensional) feature space via , and you only have access to — you can never compute explicitly.
The question: Can you still train and deploy the SVM decision function entirely using the kernel , without ever computing explicitly? If yes, write out the dual objective and decision function purely in terms of , and explain conceptually why the geometry of the primal problem is fully captured by dot products alone.
Answer: The SVM That Saw Only Dot Products
Key Idea / Intuition
The SVM's geometry — margins, distances, projections — depends on only through inner products of training points. When you write the dual, itself disappears and is replaced entirely by pairwise dot products . Swapping in is therefore a completely seamless substitution: the dual and the decision function never needed explicitly, only the Gram matrix. This is the kernel trick — you implicitly work in without ever touching it.
Formal Proof / Solution
Step 1: The Dual Objective Depends Only on Dot Products
From the excerpt (ESL eq. 12.13), the Wolfe dual of the soft-margin SVM is
subject to and .
The primal variable appears nowhere. Every occurrence of feature vectors is mediated by inner products .
Step 2: Kernelized Dual
Replace :
subject to the same constraints. This is valid as long as is a Mercer kernel (i.e., the kernel matrix is positive semi-definite), which guarantees the existence of some feature map with .
Step 3: Kernelized Decision Function
The primal solution satisfies . The decision function is
Again, vanishes; only is needed.
Step 4: Why Geometry = Dot Products
All of Euclidean geometry is expressible through inner products:
- Distance:
- Angle / projection:
- Margin width: , and
Since the SVM only cares about the geometry (maximizing the margin), and geometry lives entirely in inner products, replacing with transplants the entire algorithm into — even if is infinite-dimensional — without ever computing a single coordinate of .
The Punchline
The computational cost of training scales with (size of the Gram matrix), not with . So an SVM with the RBF kernel implicitly operates in an infinite-dimensional Hilbert space at the same cost as a linear SVM on points.
Source: The Elements of Statistical Learning, Hastie, Tibshirani, Friedman (2nd ed.), Chapter 12