The relevance vector machine
A precision per weight (ARD), choosing the precisions by maximizing the evidence, MacKay's updates $\gamma_i = 1 - \alpha_i \Sigma_{ii}$, $\alpha_i \leftarrow \gamma_i / m_i^2$, why useless functions are removed entirely, EM versus the fixed point, and how the RVM compares with the SVM.
One precision per weight
The topic Bayesian linear regression gave every weight the same prior and chose and by maximizing the evidence. One shrinks all weights alike: a useful basis function and a useless one pay the same penalty. When we suspect that only a few of many basis functions matter, we want the data to tell us which.
The fix takes one line. Give each weight its own precision:
This prior is called automatic relevance determination (ARD). A large is a narrow prior that holds close to zero; a small is a wide one that lets go wherever the data push it.
The rest of the model is unchanged: with . The design matrix has entries : row is the feature vector of object , and column is basis function evaluated on all objects. The posterior is computed exactly as before, with replaced by :
These are and of the previous topic. We drop the subscript so that a subscript can name a weight: , .
The running example is the three points of the topic Bayesian linear regression, and , now with three basis functions: a constant, the slope and a quadratic term,
The quadratic term is shifted so that its column is orthogonal to the other two. All three columns are orthogonal, so , the matrix is diagonal, and every weight is computed on its own:
We index the weights for the constant, the slope and the quadratic term. Here . Take and start every at . Then and . Least squares would use all three weights, , and pass through every point: three functions, three points. The question of this topic is whether the data justify the curvature.
The evidence and a razor for every function
Precisions are hyperparameters, and the topic Bayesian model selection told us how to choose those: by the evidence. Integrate the weights out. Since is a sum of independent Gaussians,
Mind the sizes: is the covariance of the targets, while is the covariance of the weights. The log-evidence is
Each basis function adds the term to : it spreads the targets the model expects along the direction . Two parts of the formula pull in opposite directions.
- The fit term gets smaller when stretches in the direction where the observed actually lies.
- The volume term grows with every stretch. Adding a positive semidefinite matrix such as can never decrease it.
This is the automatic Occam's razor of Bayesian model selection, now applied to each basis function separately. A function whose column does not help explain costs volume and buys no fit. Its best precision is : its term leaves , and the model becomes exactly the model without that function.
Choosing and this way is type-II maximum likelihood, also called empirical Bayes. The weights are integrated out; the hyperparameters get point estimates. It is not full Bayes: nobody integrates over . On the running example, maximizing the evidence raises it from at the start to , and the optimum indeed sends one precision to infinity. Which one, and how to get there, is the next two blocks.
MacKay's fixed-point updates
The determinant and the inverse of are awkward to differentiate directly. The previous topic rewrote the log-evidence in terms of the posterior; with in place of it reads
Differentiate in . Three pieces contribute:
- gives ;
- depends on through one diagonal entry, and ;
- minimizes over , so moving does not change this minimum to first order. Only the explicit counts, giving .
So at the optimum : the prior variance equals the posterior second moment . This is not a closed form, because and depend on themselves. MacKay multiplied it by and named one piece:
lies between and and says how well the data determine . If the data pin down, and ; if the posterior is just the prior, and . The sum is the effective number of parameters.
The noise precision is handled the same way. Its derivative is
where the identity follows from .
Training repeats one round. Build and pick starting values of and . With them, compute the posterior and . From the posterior get the . Use the to update every and . Basis functions whose has passed a large threshold, say , are removed with their columns, and the round starts again until the precisions stop changing.
On the running example, one round from : for the constant, and ; for the slope, and .
Why precisions run off to infinity
Why do so many precisions run off to infinity instead of settling at some large number? Look at the evidence as a function of one with all the others fixed. Split off the term of basis function : . Two numbers describe how relates to the rest of the model:
, the sparsity factor, measures how much room still has, given the noise and the other functions. , the quality factor, measures how well is aligned with the targets. The determinant lemma and the Sherman–Morrison formula turn and into those of plus a correction:
As the bracket tends to : we recover the model without . Setting the derivative to zero gives , hence
In the second case the derivative is positive for every , so the evidence keeps growing all the way to infinity. There is no "small but nonzero" weight: a basis function either earns its place, , or is removed entirely. Only the size of matters, not its sign.
The same two numbers give the posterior of the weight in general: and . For orthogonal columns , so and , which matches the first block. On the running example with :
| basis function | vs | ||
|---|---|---|---|
| constant | |||
| slope | |||
| quadratic |
The constant stays with , a prior standard deviation of . The quadratic term goes: its column is long (), so it would add a lot of volume, but the data barely lean along it. With the quadratic term removed and the other two precisions at their optimum, the evidence is about times larger than with .
EM versus the fixed point
The same evidence can also be maximized by EM, treating as a latent variable (EM gets its own topic later; here we need only its two steps). The E-step computes the posterior at the current . The M-step maximizes the expected complete-data log-likelihood . In it contains , and the maximum is at
Compare with the previous block: the stationarity condition was . EM reads it as an update directly; MacKay first rearranges it into . Both rules therefore have the same fixed points. Do not call MacKay's -updates "the E- and M-steps": they are a different iteration toward the same optimum.
They travel very differently. EM never decreases the evidence, a property MacKay's rule lacks. But MacKay's rule removes useless functions much faster. With one basis function in the orthogonal form, and , so
When the precision is multiplied by a constant greater than one: geometric growth. Do the same substitution in the EM update and you will find that for large it adds roughly per step: linear growth. On the running example the quadratic term (, ) goes under MacKay and passes after steps. EM moves it and needs about steps.
Kernels, relevance vectors and the SVM
So far the basis functions were fixed in advance. The relevance vector machine (Tipping, 2001) takes one per training object. With a kernel , for example the Gaussian ,
plus a constant, so . ARD switches most of them off. The training objects whose functions survive are the relevance vectors, and they give the method its name. A new input is predicted from them alone:
The variance is noise plus weight uncertainty, as in Bayesian linear regression.
An experiment: points with uniform on , plus noise of standard deviation , the Gaussian kernel with . MacKay's updates keep of the basis functions (the constant is among those removed), estimate the noise standard deviation as , and recover the true curve with root-mean-square error . Support vector regression with the same kernel, at the best and of a small grid, reaches the same error with support vectors; with a narrower tube, , it keeps .
What the comparison with the SVM comes down to:
- Sparser. Usually far fewer relevance vectors than support vectors, so prediction is cheaper.
- Probabilistic. A predictive distribution instead of a point, with error bars.
- Fewer knobs. No or to cross-validate: and come from the evidence. The kernel width is still chosen outside, for instance by cross-validation.
- Any basis. The need not come from a positive definite (Mercer) kernel.
- Training is harder. The SVM solves a convex quadratic program with a unique optimum. The RVM maximizes a non-concave evidence, and its early iterations invert an matrix: time and memory.
Where the RVM breaks and what comes next
The RVM is exact Bayesian inference over , but it is not free of approximations, and they show.
- Overconfident far from the data. Gaussian kernels vanish away from their centres, so and the predictive variance falls to the noise level . In the sinc experiment the predictive standard deviation is at and exactly the noise estimate at , outside the data. The model is most sure where it knows least. A Gaussian process (a later topic) with the same kernel goes back to the prior variance there instead.
- Point estimates of precisions. is maximized, not integrated over. The exact zeros are a product of that shortcut: full Bayes over would not remove any function with certainty.
- Local optima. The evidence is not concave in . Different starting points, thresholds and stopping rules can leave different relevance vectors, and nothing guarantees one survivor per group of correlated functions. An exact copy of a column is never removed, since the evidence cannot tell how to split the prior variance between the two; in the sinc run two kept centres sit at and , almost the same function.
- Cost. per iteration at the start, until most functions are gone.
One more limitation sets the next topic. Everything here was exact because a Gaussian likelihood times a Gaussian prior is Gaussian. For classification the likelihood becomes a product of sigmoids. The posterior over is no longer Gaussian, and the evidence has no closed form, so neither the posterior nor the updates of this topic can be written down. The topic The Laplace approximation and Bayesian classification replaces that posterior with a Gaussian at its mode, and with it brings back both the evidence and the relevance vectors.
Check your understanding
The same questions as in Pulse. Answers are shared between modes.
Answers are saved on the server and tied to this browser until you sign in.