Summary
A Gaussian process (GP) places a prior over functions such that any finite collection of values is jointly Gaussian. The GP is fully specified by a mean function (usually 0) and a covariance kernel .
GPs are the canonical Bayesian regression model. They give a closed-form posterior over functions, with a predictive mean and a predictive variance per query point. Under a suitable, well-specified kernel, that variance can be calibrated and returns toward the prior variance as kernel similarity to the observations falls. This makes GPs a standard tool for Bayesian optimization, active learning, and settings where uncertainty quantification matters as much as the prediction.
The cost is brutal scaling: exact inference. GPs are practical up to a few thousand training points without approximation; modern variants (sparse, structured kernel, deep kernel) push that to millions.
The mechanism
For training inputs , training targets , test point , prior covariance kernel , and noise variance :
The joint distribution is
where , is the vector of , and .
Conditioning on training data gives the Gaussian posterior:
Learning objective
See how kernel similarity makes observations reshape both the posterior mean and uncertainty.
Two matrix-vector products against give you both the predictive mean and the predictive variance at any test point. The hard part is , which costs to compute and to store.
Choosing the kernel
The kernel encodes prior beliefs about the function:
- RBF / squared exponential: . Smooth functions, infinite differentiability. Default.
- Matern: lets you tune smoothness via a half-integer parameter . is a common modern default; smoother than , less restrictive than RBF.
- Periodic: . For periodic data.
- Linear: . Recovers Bayesian linear regression.
- Sums and products of valid kernels are valid kernels. Add a periodic and an RBF for “trend plus seasonality.”
Hyperparameters (lengthscale , variance , noise ) are typically learned by maximizing the marginal likelihood:
Scaling: sparse and approximate variants
- Inducing points (Snelson & Ghahramani, 2005). Pick inducing inputs, approximate via a low-rank decomposition. training, prediction.
- SVGP (Hensman et al., 2013). Variational inference over inducing point values. Stochastic mini-batch training. The standard for large-data GPs.
- KISS-GP / structured kernels (Wilson & Nickisch, 2015). Exploit grid structure for inference.
- Deep kernels. Replace with where is a neural network. Combines deep features with kernel-conditional uncertainty.
Where GPs are still the right tool
- Bayesian optimization of expensive functions (hyperparameter search, materials discovery, drug design). The acquisition function uses the posterior variance to balance exploration and exploitation.
- Geospatial / time-series modeling with structured covariance (kriging is just a GP).
- Small-data regression where calibrated uncertainty matters more than predictive accuracy.
- Probabilistic numerics (treat numerical algorithms as Bayesian inference).
For most large-scale supervised learning, deep nets with bootstrapping or deep ensembles deliver competitive uncertainty estimates at much better scaling.
Common pitfalls
- Using RBF without setting the lengthscale. Default lengthscale produces nearly-flat predictions or wildly oscillating ones. Always optimize.
- Ignoring the noise term . Without it, is often singular and inversion fails. Add a small jitter even for noiseless data.
- Reading posterior variance as “model uncertainty.” GP variance is uncertainty in the function value given the kernel and the prior. Misspecified kernels give miscalibrated variance.
- Treating GPs as automatic. Kernel choice is a strong prior. The model can fail silently if the kernel does not match the data structure.