Reproducing Kernel Hilbert Spaces
Mercer’s theorem, the representer theorem and kernel norms.
Every kernel secretly defines a space of functions, and in that space evaluating a function is an inner product. That one property explains why kernel methods collapse infinite-dimensional problems to coefficients, what the regularizer actually penalizes, and which kernels can learn any continuous function.
What you’ll learn
- Define positive-definite kernels and reproducing kernel Hilbert spaces, derive the continuity of point evaluation, and sketch the Moore–Aronszajn construction.
- State Mercer's theorem and read the RKHS norm as a penalty on eigen-components, in examples (Brownian motion, the Laplacian and Gaussian kernels).
- Prove the representer theorem and apply it to kernel ridge regression, SVMs and splines.
- Explain universal kernels, and how eigenvalue decay and smoothness set the minimax rate of kernel ridge regression.
Positive-definite kernels and their Hilbert spaces
Two consequences are immediate. Applying (ii) to gives , so is a feature map for , the canonical one. And Cauchy–Schwarz gives
functions that are close in the RKHS norm are close at every single point. This is what makes these spaces special. In two functions at distance zero may differ at any given point, so "the value at " is not even defined, and no kernel can reproduce it. Conversely, by the Riesz representation theorem, any Hilbert space of functions on which every evaluation is continuous is an RKHS.
Start from finite combinations of kernel sections, , and define an inner product that makes the sections behave like feature vectors:
It is well defined: the right side equals for , which depends on the function and not on how it is written. The reproducing property holds by construction:
It is positive definite: because is, and if , Cauchy–Schwarz (valid for any semi-inner product) forces pointwise:
Complete it. A Cauchy sequence in is Cauchy at every point, by the same inequality, so it converges pointwise; is the set of these pointwise limits with the limiting norm (Aronszajn checks that this is consistent). Any RKHS with kernel contains as a dense subspace, because a function orthogonal to every vanishes everywhere, hence equals this completion: uniqueness.
Mercer's theorem: the kernel's spectrum
Many texts, and the glossary, write these eigenvalues ; this lesson writes because is the regularization parameter of kernel ridge regression throughout.
The expansion is an explicit feature map, , and an explicit description of the space (sums over ):
The RKHS norm charges each eigen-component by the inverse of its eigenvalue. For smooth kernels the eigenfunctions with small oscillate fast, so a small norm means few fast oscillations: the RKHS norm measures roughness, in the currency of the kernel. (Mercer's theorem is the classical route; Moore–Aronszajn needs no topology or measure at all.)
For a translation-invariant kernel on whose Fourier transform is integrable and positive, the same picture holds with frequencies in place of eigenfunctions:
Frequencies that the kernel's spectrum makes rare are expensive. For the Laplacian kernel in one dimension, , so , a Sobolev norm. For the Gaussian kernel with length scale , : high frequencies cost exponentially much, and every function in its RKHS is real-analytic. Infinite-dimensional, yet a very small space.
A kernel has Mercer eigenvalues . Which function has the larger RKHS norm: or ?
- , because its norm is ten times larger
- They are equal, because both are single eigenfunctions
- : , against
- They cannot be compared without the eigenfunctions' formulas
Show the answer
C. : , against
: for and for . A small coefficient on a fast-decaying direction is expensive, which is how the norm penalizes roughness.
The representer theorem
Split any into its projection onto and the orthogonal rest:
The rest is invisible at the data, by the reproducing property:
So the loss term is unchanged when is dropped, while Pythagoras, , can only lower the penalty:
With strictly increasing the inequality is strict unless , so every minimizer lies in . Writing gives and : a search over a space of functions has become a search over .
Three consequences:
- Kernel ridge regression. and give , whose gradient vanishes at . This is the formula of The Kernel Trick, now justified for every kernel, including those with no finite feature map.
- Support vector machines. The hinge loss with gives the expansion over training points; the offset is unpenalized, which the semiparametric version of the theorem covers by adding a finite-dimensional unpenalized part (Schölkopf, Herbrich & Smola, 2001).
- Splines. Kimeldorf and Wahba's original setting. Smoothing splines minimize , an RKHS seminorm whose null space, the straight lines, goes unpenalized; the minimizer is a natural cubic spline with knots at the data (Splines & Additive Models).
The representer theorem is the precise sense in which kernel methods fit "a linear model in feature space" without ever leaving the span of the data.
Take the Brownian-motion kernel on . Among all in its RKHS with , the representer theorem says the smallest norm is achieved by some . What is that smallest squared norm, ?
Show the answer
2
gives , so : a ramp of slope 2 up to , flat afterwards, with . Any other function must still climb from 0 to 1 by , and by Cauchy–Schwarz . With several data points, sums of ramps give the piecewise-linear interpolant through the origin and the data.
Think first Show that the optimal value of kernel ridge regression, divided by , equals : that is, .
At the minimizer the residuals are and . Adding times the squared residuals to the norm gives . Gaussian processes report this quantity, multiplied by and with , as the "data fit" part of their log marginal likelihood.
Universal kernels and learning rates
Universality is what makes kernel methods universally consistent: with a universal kernel and a regularization slowly enough as , SVMs and related regularized kernel classifiers reach the Bayes risk for every data distribution (Steinwart, 2005). It says nothing about speed, and by the no-free-lunch theorem no rate holds for all distributions. Rates need assumptions, and for kernel methods the natural ones are spectral: how fast the eigenvalues of decay (a measure of the space's size), and how smooth the target is relative to the kernel.
Kernel ridge regression is a spectral filter. In the eigenbasis of , the -th coefficient of the target is kept with weight : directions with pass, those with are suppressed.
Variance. Each passed direction carries noise of order ; the number of directions that pass is the effective dimension:
Bias. What the filter removes. Writing with , and using for :
Balance against . For a Sobolev space of smoothness in dimensions, , and with the rate is , the classical minimax rate for -smooth regression, which collapses as grows (The Curse of Dimensionality).
Key takeaways
- A positive-definite kernel and its RKHS determine each other (Moore–Aronszajn). The reproducing property makes point evaluation continuous: .
- Mercer: and , so the norm penalizes components along small-eigenvalue, typically rough, directions; in Fourier terms it is .
- Representer theorem: any minimizer of a data loss plus a strictly increasing function of lies in , which turns kernel ridge regression, SVMs and smoothing splines into -dimensional problems.
- Universal kernels such as the Gaussian approximate every continuous function, which yields universal consistency. Rates come from eigenvalue decay and smoothness : for kernel ridge regression, for Sobolev classes.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
In an RKHS, why does convergence in norm imply convergence at every point?
- Because , by the reproducing property and Cauchy–Schwarz
- Because the RKHS norm is the supremum norm
- Because every function in an RKHS is differentiable
- It does not: like , an RKHS only controls averages
Show the answer
A. Because , by the reproducing property and Cauchy–Schwarz
, and Cauchy–Schwarz bounds it by . With a bounded kernel the convergence is even uniform.
A kernel has eigenvalues and orthonormal eigenfunctions . Which lies in its RKHS?
Show the answer
D.
. Membership requires the coefficients to decay faster than ; every other choice fails that, although all of them are in .
In the proof of the representer theorem, why is the loss term unchanged when the component , orthogonal to every , is removed?
- Because has a small norm, so it barely moves the predictions
- Because the loss is convex, so its minimum lies in the span
- Because at every training point
- Because is the zero function
Show the answer
C. Because at every training point
The reproducing property turns "orthogonal to " into "zero at ". The loss sees only the values at the training points, so costs norm and buys nothing. No convexity is needed: the theorem holds for any loss .
Which kernel on is universal, so that its RKHS is dense in the continuous functions?
Show the answer
B.
The Gaussian kernel is universal on every compact subset of (Steinwart, 2001). The others are not, for different reasons: two have finite-dimensional RKHSs, and the third has an infinite-dimensional RKHS whose functions all vanish at .
Further reading
- N. Aronszajn, "Theory of reproducing kernels," Transactions of the American Mathematical Society 68(3), 337–404 (1950).
- B. Schölkopf, R. Herbrich & A. J. Smola, "A generalized representer theorem," COLT 2001, Lecture Notes in Computer Science 2111, 416–426 (Springer, 2001).
- I. Steinwart, "On the influence of the kernel on the consistency of support vector machines," Journal of Machine Learning Research 2, 67–93 (2001).
- A. Caponnetto & E. De Vito, "Optimal rates for the regularized least-squares algorithm," Foundations of Computational Mathematics 7(3), 331–368 (2007).
- I. Steinwart & A. Christmann, Support Vector Machines (Springer, 2008).