Deep Gaussian processes: stacking uncertainty
What composing Gaussian processes buys and what it costs. If a composition of GPs is not a GP, how is anything computed? What does all the mathematics buy, what is new, and where are deep GPs still the right tool? Fundamentals first, every step derived, with a deep GP fitted and taken apart.
Contents
- Notation
- 1. What one GP cannot do
- One texture everywhere
- Two classic remedies
- 2. Composing Gaussian processes
- The model
- Sampling a deep GP
- If it is not a GP, how does anything work?
- The covariance of a two-layer deep GP
- 3. What depth does
- 4. Why exact inference is impossible
- 5. Doubly stochastic variational inference
- One layer, recalled
- The model, augmented
- The variational family
- A forward pass by hand
- Turning it into an algorithm
- A deep GP, fitted
- 6. Is all this mathematics worth it?
- 7. Where deep GPs are the right tool today
- 8. What is new, 2018 to 2026
- 9. Deep GPs, neural networks and deep kernels
- Width matters
- Neural networks as deep GPs, and the other way round
- 10. A checklist
- Questions
- References
A Gaussian process is shallow in one precise sense. Its kernel, chosen before any data arrive, fixes the texture of every function it believes in: how often it wiggles, how smooth it is, and, for the usual stationary kernels, that this texture is the same everywhere. Real functions are calm in some places and sharp in others. A deep GP feeds one GP into another, so that the first layer can stretch and squeeze the input before the second one sees it.
Below are draws from deep GPs with one to five layers, each layer a GP with the same squared-exponential kernel. Raise the number of layers:
What to try. With one layer the draws look like any GP: about 6% of the axis is nearly flat. At three layers more than half of it is (55% for the default draws), with steep cliffs in between, and at five layers the steepest slope has grown from about 2 to about 16. That is the pathology of Section 3. Switch to input-connected: at five layers only about 5% of the axis is flat. Identity mean sits in between, at about 19%. Shorten the length-scale and the collapse slows down, because the ratio approaches the critical value that Section 3 derives.
This is the third post in the Gaussian-process series, after Gaussian processes, from first principles and sparse variational GPs. It is written to answer four questions that beginners ask, and that many experts never quite settle:
- If a composition of GPs is not a GP, how is anything computed? (Section 2.)
- What does all this mathematics buy, compared with a GP or a neural network? (Section 6.)
- Is it still relevant, and for which tasks is it the right tool? (Section 7.)
- What is new? (Section 8.)
Every result is derived in numbered steps, with nothing left to the reader. The Gaussian identities it uses are proved in the primer and in the Gaussian toolkit, and the one formula it needs from the sparse GP post is re-derived here.
The plan:
- what one GP cannot do;
- composing GPs: what the model is, and how anything is computed although it is not a GP;
- what depth does: the pathology of deep compositions, and two fixes;
- why exact inference is impossible;
- doubly stochastic variational inference: one layer recalled, the bound derived, a forward pass by hand, and a deep GP fitted;
- is the mathematics worth it?
- where deep GPs are the right tool today;
- what is new, 2018 to 2026;
- deep GPs, neural networks and deep kernels;
- a checklist.
Notation
Plain italic letters are scalars, bold italic lower case are vectors, bold upright capitals are matrices. To keep the derivations readable, every hidden layer has one output; Section 5 explains what changes with more.
| Symbol | Meaning |
|---|---|
| number of layers; indexes them | |
| layer , a GP: , independent across layers | |
| , | hidden values; the model output is |
| , | amplitude and length-scale of the squared-exponential kernel |
| , | layer- values at the training inputs, and the -th of them |
| , | inducing inputs and inducing variables of layer ( of each) |
| variational distribution of layer | |
| , | mean and variance of layer ‘s variational marginal at a single input |
| observation-noise variance | |
| , | standard normal variables; is a number of Monte Carlo samples |
1. What one GP cannot do
One texture everywhere
A kernel is stationary if . Then shifting a zero-mean GP does not change its distribution: has the same covariance as , for every shift . The prior therefore expects the same behaviour in every region of the input space. One concrete measure: for a one-dimensional stationary GP, the expected number of times a draw crosses zero upwards on an interval of unit length is (Rice’s formula; Rasmussen and Williams, 2006, Section 4.1). For the squared-exponential kernel that is : the same in every region.
Data rarely cooperate. Take a step: flat, a jump, flat again. A stationary GP has one length-scale to spend. A long one cannot follow the jump. A short one follows the jump, but it also expects wiggles on both plateaus, rings near the jump, and forgets everything a short distance outside the data. Type-II maximum likelihood picks a compromise, and it is not a good one. The fitted figure in Section 5 shows it: the GP takes and inflates the noise estimate to more than twice its true value, to explain the wiggles it cannot avoid.
Two classic remedies
- Design a non-stationary kernel. Let the length-scale depend on the input (Gibbs, 1997), or put non-stationarity in the basis, as wavelet features do (From Fourier to wavelets). This works when you know what form the non-stationarity takes.
- Warp the input. Use a stationary kernel on transformed inputs, (Sampson and Guttorp, 1992; Snoek et al., 2014). Where is steep, a small change of is a large change of , so the function changes quickly there.
Proposition 1 (A warped kernel is a kernel)
If is a positive semi-definite kernel and is any function, then is a positive semi-definite kernel.
Proof
Step 1. What must be shown. For any inputs and any real coefficients , .
Step 2. Rename the points. Let . By the definition of , the sum equals .
Step 3. Use the property of . That is the quadratic form of the Gram matrix of at the points . It is non-negative because is positive semi-definite. Repeated points are allowed in that definition, so it does not matter whether is one-to-one.
A deep GP takes the second remedy and does not choose the warp by hand: it puts a GP prior on it and learns it, with uncertainty, from the data.
2. Composing Gaussian processes
The model
Definition 1 (Deep Gaussian process (Damianou and Lawrence, 2013))
Let be independent GPs. The deep GP with layers is the random function
and the observations are with . A layer with several outputs is a vector of independent GPs, one per output.
Sampling a deep GP
To draw the function at inputs :
- Draw the first layer at the inputs: . This is an ordinary GP draw.
- Draw the second layer at the points : , where is the matrix with entries . Another ordinary GP draw, at random inputs.
- Continue to layer .
Each step is a Cholesky factorisation and a matrix-vector product; the figure at the top does exactly this. Nothing in the recipe is exotic. But the result is not a GP. The next subsection shows what that means, and why it does not stop us computing anything.
If it is not a GP, how does anything work?
Start with the smallest possible question: the output at one input.
Proposition 2 (At a single input, the output is Gaussian)
In a deep GP whose last layer is zero-mean and stationary, at every single input , exactly as for a GP. (For the squared-exponential kernel, .)
Proof
Step 1. Condition on the layer below. Fix the lower layers, and with them the value . Then is the GP at one fixed input, so .
Step 2. Stationarity removes the dependence. , whatever is. The conditional distribution is the same for every value of the lower layers.
Step 3. Average. The marginal is the average of the conditional over the lower layers: , because the integrand does not depend on and integrates to 1.
So one point at a time, you cannot tell a deep GP from a GP. The difference is entirely in how different points relate to each other. Take two inputs, and , and two one-dimensional layers.
Proposition 3 (At two inputs, a mixture of Gaussians)
Write and . With zero-mean layers,
with . It is a continuous mixture of bivariate Gaussians whose correlation is random, and it is not a Gaussian.
Proof
Step 1. Condition on layer 1. Given , the pair is the GP at two fixed inputs, so it is bivariate Gaussian with variances and covariance .
Step 2. Only matters. That conditional depends on only through .
Step 3. The law of . and are jointly Gaussian with mean zero. A linear combination of jointly Gaussian variables is Gaussian, so is Gaussian with mean and variance .
Step 4. Average. The joint density is the conditional averaged over , which is the integral in the statement.
Step 5. Not Gaussian. If it were Gaussian, the difference would be Gaussian too, with kurtosis 3. The proposition on heavy tails below shows its kurtosis is strictly larger.
Here is that joint density, next to the Gaussian with exactly the same covariance matrix. Move the distance between the two inputs:
Same covariance, very different shapes. The GP’s density is a single ellipse. The deep GP’s is a sharp ridge along the diagonal on top of a round cloud. When the two hidden values happen to be close, sees almost the same input twice, so : that is the ridge. When they are far apart, the two outputs are almost unrelated: that is the cloud. Averaging the two situations gives the same correlation as the ellipse ( at ) but not the same shape, and the difference has kurtosis instead of . The shape carries information that a GP throws away: the deep GP says “either the same or unrelated”, where the GP can only say “moderately related”.
That answers the question in the heading. Three things still work exactly as for a GP, and one does not:
- Each layer, given the layer below, is an ordinary GP. Conditioning, sampling and Gaussian marginals all work within a layer.
- Joint densities are averages of Gaussians, so they can be computed by averaging: exactly in small cases like the one above, by Monte Carlo in general.
- Predictions are averages too, by the next proposition.
- What is lost is a closed form for the posterior and the evidence, because they need an average over all the hidden values at once. Section 5 replaces the evidence by a lower bound that can be computed.
Proposition 4 (Prediction by Monte Carlo)
Let be the distribution of the hidden value at a test input (under the approximate posterior), and the Gaussian of the last layer given it. Then
and is unbiased with variance .
Proof
Step 1. Sum rule. , which is the expectation of the function under .
Step 2. Unbiased. Each term has expectation by Step 1, and the expectation of an average is the average of the expectations.
Step 3. Variance. The terms are independent and identically distributed, so the variance of their average is the variance of one term divided by . The error therefore shrinks like .
Each term is a Gaussian in , so the prediction is a mixture of Gaussians. The animation does this for the deep GP fitted in Section 5, at , just beyond the data, where the hidden value is uncertain. Most samples of the hidden value land where the second layer is at ; a few land where it falls away. The average is sharp at with a long tail downwards. The Gaussian with the same mean and variance, in grey, spreads its mass where the model does not believe the answer lies.
The covariance of a two-layer deep GP
For two one-dimensional layers with squared-exponential kernels, the covariance has a closed form. It shows what composition does to correlations, and it uses one tool worth proving first.
Lemma 1 (Law of total covariance)
For random variables , and with finite second moments,
Proof
Step 1. Definitions. , and likewise conditionally: .
Step 2. Tower property. , and .
Step 3. Substitute the conditional identity of Step 1.
Step 4. Subtract . The last term of Step 3 minus this product is , by the definition of covariance.
Proposition 5 (Two-layer covariance)
Let and be independent with squared-exponential kernels, and . Then
Proof
Step 1. Law of total covariance, conditioning on .
Step 2. The second term vanishes. Given , is the zero-mean GP at a fixed point, so , and the covariance of two constants is zero.
Step 3. The first term is an expected kernel. Given , the covariance is with .
Step 4. The law of . As in the previous proposition, with .
Step 5. Write the expectation as an integral and collect the exponents.
Step 6. The Gaussian integral. . So the expectation is .
Step 7. Multiply by .
A Monte Carlo check with , , and gives against the formula’s . Three readings:
- Still stationary. The covariance depends only on , because the first layer is stationary. The non-stationarity of a deep GP is not in its covariance. It is in its individual draws, and in its posterior once the data have chosen a warp.
- Long-range memory. As , and the covariance tends to . Far-apart inputs stay correlated: their hidden values land in the same range, and is evaluated there twice.
- The covariance is not the whole story. A GP with this kernel has the same covariance and Gaussian increments. The deep GP’s increments are not Gaussian.
Proposition 6 (Heavy-tailed increments)
The increment of the two-layer model has kurtosis
whenever . A Gaussian has kurtosis 3.
Proof
Step 1. Conditionally Gaussian. Given , is a difference of two jointly Gaussian values of , so with .
Step 2. Moments of a Gaussian. For the second moment is and the fourth is . Averaging over (tower property): and .
Step 3. Compute . by Steps 5 and 6 of the covariance proof, so .
Step 4. Compute . , and . So is the same integral with replaced by , which is . Hence .
Step 5. Divide. is the stated ratio; the factors cancel.
Step 6. Why it exceeds 3. , with equality only if is constant. For , is a non-degenerate Gaussian, so is not constant and the inequality is strict.
With the numbers above the kurtosis is (Monte Carlo: ). A random variance makes a scale mixture of Gaussians: most increments are small, where the warp is flat, and a few are large, where it is steep. That is the prior of a function that is calm in most places and sharp in a few, which is what the step needed.
The animation shows the mechanism with the warp the deep GP of Section 5 actually learned. Evenly spaced inputs pass through the first layer; they bunch where it is flat and spread where it is steep. A stationary second layer then sees them, and the composition changes fast only where the warp is steep.
3. What depth does
If two layers help, do ten help more? The figure at the top says no. With plain layers the draws become flat almost everywhere, with a few cliffs. Duvenaud, Rippel, Adams and Ghahramani (2014) explained why. The one-dimensional argument needs one fact about GPs, proved first.
Lemma 2 (The derivative of a stationary GP at a point)
If with stationary and twice differentiable at 0, then at every input the derivative is Gaussian with mean 0 and variance , the same for every . For the squared-exponential kernel, .
Proof
Step 1. A difference quotient is Gaussian. For , is a linear combination of two jointly Gaussian values, so it is Gaussian with mean 0.
Step 2. Its variance. Using and ,
Step 3. Taylor expansion. A stationary kernel is even, , so and .
Step 4. Take the limit. Substituting, as . Mean-square limits of Gaussian variables are Gaussian with the limiting mean and variance, so . Nothing depends on .
Step 5. The squared-exponential case. has and .
Proposition 7 (The derivative of a deep composition)
Let every layer be one-dimensional, zero-mean and stationary, with . At any fixed input , the derivative of the composition is a product of independent Gaussians:
Proof
Step 1. Chain rule. , so . Unrolling from gives . Call the factors .
Step 2. Each factor, given the layers below. is determined by layers , which are independent of . Given them, is evaluated at a fixed point, which is by the lemma.
Step 3. The conditional law does not depend on the condition. It is for every value of the lower layers, so is independent of those layers.
Step 4. Hence of the earlier factors. are functions of the lower layers, so is independent of them. By induction all factors are independent.
Corollary 1 (The log-derivative is a random walk)
With , ,
where is the Euler–Mascheroni constant. For equal layers the mean of is and its standard deviation is .
Proof
Step 1. Logs turn the product into a sum of independent terms, because the are independent; .
Step 2. Reduce to a Gamma variable. is chi-squared with one degree of freedom, which is the Gamma distribution with shape and scale , with density . And .
Step 3. The mean of . Start from the normalisation and differentiate both sides with respect to . On the left, . On the right, . Dividing by gives , where is the digamma function.
Step 4. The variance of . Differentiate once more. The left side becomes , and after dividing, . Subtracting the square of the mean gives .
Step 5. Plug in. The standard values and give and . Since , halve the mean and divide the variance by 4.
So with the typical slope shrinks by a factor per layer, while the spread of the log-slope grows like . A simulation of for :
| layers | median | share of inputs with | 99.9% quantile of |
|---|---|---|---|
| 1 | 0.67 | 8% | 3.3 |
| 2 | 0.37 | 22% | 5.8 |
| 4 | 0.10 | 49% | 9.9 |
| 8 | 0.008 | 81% | 11.1 |
Flat almost everywhere, with rare steep places: the draws look piecewise constant. Unless is tuned to about , the median slope drifts to zero or to infinity, and even then the spread grows. With multi-dimensional hidden layers the same happens to the Jacobian, a product of random matrices: its singular values spread apart exponentially, so a deep representation keeps effectively one direction of variation (Duvenaud et al., 2014).
Remark (Two fixes, both familiar from neural networks)
- Input connections (Duvenaud et al., 2014). Feed the original input to every layer: . The derivative gains a term that is not multiplied through the earlier layers, so it cannot collapse.
- Identity mean functions (Salimbeni and Deisenroth, 2017). Make each hidden layer a correction to the identity: . The chain rule now gives factors instead of . For small , a second-order Taylor expansion gives , whose mean is about : the drift per layer is instead of . This is a residual connection, and it is the default in practice. For a hidden layer that changes dimension, a fixed linear map (for example a PCA projection of the inputs) plays the role of the identity.
Switch the figure to input-connected or identity mean and raise : the draws stay alive.
4. Why exact inference is impossible
For a GP, the evidence and the posterior are Gaussian integrals. For a deep GP, already with two layers,
Look at where appears in the first factor: inside , inside a matrix, which is then inverted and whose determinant is taken. As a function of that is nothing like the exponential of a quadratic, so the integral over has no closed form. The posterior over the hidden layer is not Gaussian, and typically multimodal. For example, with even kernels the pairs and produce the same output and have the same prior probability, so every posterior mode has a mirror image.
So inference is approximate, by one of two routes:
- Variational inference, fast and scalable: Damianou and Lawrence (2013), and the doubly stochastic method of Salimbeni and Deisenroth (2017) that is now standard.
- Monte Carlo, slower but able to represent several modes: stochastic-gradient Hamiltonian Monte Carlo (Havasi et al., 2018), and elliptical slice sampling for full Bayesian surrogates (Sauer, Gramacy and Higdon, 2023).
5. Doubly stochastic variational inference
One layer, recalled
Each layer is a sparse variational GP. Everything below needs one formula from the sparse GP post: the variational distribution of a layer’s output at a single input. Here it is again, derived.
Proposition 8 (One layer’s marginal at one input)
Let a layer have inducing inputs , inducing variables with , and let and . Then with
Proof
Step 1. The joint of and . Both are values of the same GP, so they are jointly Gaussian with mean zero, , and .
Step 2. Condition on (Gaussian conditioning, the primer’s Lemma 5): with .
Step 3. Write it as a linear-Gaussian model. with independent of .
Step 4. Integrate out . A linear function of a Gaussian plus independent Gaussian noise is Gaussian. Its mean is , and its variance is , because variances of independent terms add.
Read the variance as two parts. is what the inducing points cannot pin down at : zero at an inducing input, the full prior variance far from all of them. is our remaining uncertainty about the inducing values themselves. For a layer with an identity mean, add to ; the variance is unchanged. Each evaluation costs once is factorised.
The model, augmented
Give every layer inducing inputs and inducing variables . With , the augmented joint distribution is
where is the GP conditional of layer at the inputs . Integrating out every gives back the deep GP, so nothing has been approximated yet.
The variational family
Salimbeni and Deisenroth (2017) keep the layers’ dependence on each other and approximate only the inducing variables:
Each layer is a sparse variational GP whose inputs are the previous layer’s outputs. The earlier method of Damianou and Lawrence (2013) instead gave the hidden values of each layer their own independent Gaussian, which breaks exactly the dependence between layers that makes the model deep.
Theorem 1 (The doubly stochastic ELBO (Salimbeni and Deisenroth, 2017))
For this family,
and the marginal depends only on the -th input, through a chain of one-dimensional Gaussians:
Proof
Step 1. The ELBO. By definition, .
Step 2. Write the ratio out and cancel.
Every -dimensional conditional cancels, exactly as in Titsias’s derivation.
Step 3. Take logs and expectations.
Step 4. The KL terms. Under , integrate out first: is a normalised density in , so it integrates to 1. Then , and so on down to . What remains is : the inducing variables are independent under with marginals . Each second term depends only on , so it equals .
Step 5. Integrate out each . Define . By the one-layer proposition applied at each of the inputs, it is Gaussian with -th mean and -th variance . Because the are independent, the layers form a Markov chain under :
Step 6. The -th term needs one marginal. depends only on , so its expectation needs only the marginal : integrate the chain over every other coordinate.
Step 7. Integrate the top layer. In , integrate out the coordinates of other than . The marginal of one coordinate of a Gaussian vector is Gaussian with that coordinate’s mean and variance, , and this depends on only through .
Step 8. Induct downwards. After Step 7, the coordinates of other than appear only in . Integrating them out leaves . Repeating down to layer 1 leaves the chain in the statement.
That is the whole method. Every point travels through the layers on its own, carrying one mean and one variance per layer, and no matrix is ever formed.
A forward pass by hand
Formulas are easier to trust after one pass with numbers. Take a tiny two-layer model:
- both layers: squared-exponential kernel with , zero mean, two inducing inputs ;
- and ;
- one training point , , noise , and one draw .
Both layers share , since the two inducing inputs are 2 apart.
| step | formula | value |
|---|---|---|
| 1. kernel to the inducing inputs | ||
| 2. interpolation weights | ||
| 3. layer-1 mean | ||
| 4. what cannot pin down | ||
| 5. uncertainty about | ||
| 6. layer-1 variance | , so | |
| 7. sample the hidden value | ||
| 8. layer 2 at | , then | , |
| 9. layer-2 mean | ||
| 10. layer-2 variance | ||
| 11. expected log-likelihood |
Step 11 shows what training will do. The mean is close to , so the data-fit term costs only nats. The variance term costs , because the model is far less certain () than the noise (). To raise the ELBO, the optimiser will make the layers more certain where the data are, and move the hidden values to where layer 2 is certain. That is how a warp gets learned.
Turning it into an algorithm
The chain has no closed form, because and are nonlinear functions of their input. But it is easy to sample, and samples can be differentiated.
Proposition 9 (The reparameterisation trick)
If , then for any differentiable ,
Proof
Step 1. Same distribution. If , then , an affine map of a Gaussian. So .
Step 2. The density no longer depends on . Only the integrand does. Under the usual integrability conditions the gradient moves inside the integral, which is the statement.
Step 3. Why this matters. An average of over a few draws of is an unbiased estimate of the gradient. It uses the slope of , which typically makes it far less noisy than estimators that only use the values of .
So one training step is:
- pick a minibatch of points and draw standard normals ;
- for each point, push a sample through the layers: , starting from , as in steps 1 to 7 of the table;
- at the last layer, do the expectation in closed form instead of sampling; for a Gaussian likelihood that is step 11 of the table;
- estimate the ELBO by , and take a gradient step on everything: , , , the kernel hyperparameters and .
The estimate is unbiased twice over, for the random minibatch and for the random : hence doubly stochastic. A step costs for samples per point, with no dependence on ; Salimbeni and Deisenroth (2017) report data sets “ranging in size from hundreds to a billion points”. With several outputs per layer, each output dimension gets its own and KL term, and the samples are vectors.
Three practical choices matter a lot:
- Identity (or linear) mean functions on hidden layers, the fix from Section 3.
- Start inner layers almost deterministic. Initialise near zero for , so training starts from a GP on almost unwarped inputs and the warp is learned only as far as the data justify. Sáez-Maldonado, Maroñas and Hernández-Lobato (2026) argue that this conditioning at initialisation, more than the identity mean itself, is what avoids posterior collapse, where the hidden layers fall back to their priors and the model explains the data as noise.
- Predict with the mixture of Section 2: push samples of a test input through the layers and average the final Gaussians.
A deep GP, fitted
Here is an exact GP and a two-layer deep GP fitted to the same 150 noisy points of a step. I trained the deep GP with exactly the algorithm above: 20 whitened inducing points per layer, an identity mean on the hidden layer, 8 samples per step, 6000 Adam steps. The hyperparameters of both models were learned from the data. Move the pointer across the plot to see the predictive density at that input, drawn sideways on the right:
- The GP has to choose a short length-scale to follow the jump. It rings on both plateaus, inflates the noise standard deviation to (the truth is ), and returns to zero within a short distance of the data.
- The deep GP learns a warp that is steep at and flat elsewhere (Hidden layer), so its second layer can be smooth. The plateaus are flat, the noise estimate is right (), and beyond the data it keeps predicting the plateau with growing uncertainty, through the skewed mixture of the animation in Section 2.
- At the jump it does not hedge. The two nearest data points are at and . The deep GP switches from one plateau to the other inside that gap, so just outside it all its mass is on a plateau. Put the pointer at : the GP’s predictive is centred at , between the plateaus, where no data have ever been.
- The numbers agree. On 1000 held-out points the average log predictive density is for the deep GP and for the GP. The deep GP’s ELBO is nats; it is a lower bound on its log evidence, against the GP’s exact log evidence of . The data prefer the deep model by a wide margin.
6. Is all this mathematics worth it?
Each piece of the machinery buys one specific thing:
| piece | what it buys | without it |
|---|---|---|
| composition | non-stationarity learned from data | one texture everywhere, or a hand-designed kernel |
| a GP prior on each layer | uncertainty about the warp itself, and a prior that prefers simple warps | a point-estimated warp that can overfit (deep kernel learning) |
| the ELBO with its KL terms | automatic complexity control on small data, and model comparison | early stopping and validation sets |
| the predictive mixture | skewed, heavy-tailed or multimodal uncertainty | a single Gaussian, which hedges between modes |
| inducing points and doubly stochastic VI | linear cost in , minibatches, any likelihood | per step, Gaussian likelihoods only |
Compared with the alternatives:
| learns non-stationarity | uncertainty about the representation | predictive shape | data it suits | main risk | |
|---|---|---|---|---|---|
| GP, stationary kernel | no | none needed | Gaussian | small | the wrong texture |
| GP, hand-designed non-stationary kernel | only the form you designed | none | Gaussian | small | the wrong design |
| deep kernel learning | yes | none (a point estimate) | Gaussian | medium | overfitting the marginal likelihood |
| neural-network ensembles | yes | from the spread of the members | any | large | poor uncertainty with little data |
| deep GP | yes | yes (variational or sampled) | a mixture | small to medium | harder optimisation; VI too narrow |
The costs are real. Training is slower than for a single sparse GP by roughly a factor . The optimisation has more local optima, and needs the initialisation above to avoid posterior collapse. And a variational posterior is zero-forcing: it tends to be too narrow (the sparse GP post, Section 2, proves this for the mean-field case). So the mathematics is worth it when three things matter at once: there is little data, the structure is non-stationary, and you will act on the uncertainty.
7. Where deep GPs are the right tool today
- Surrogates of expensive simulators. A finite-element, climate or chemistry code may be run only tens to thousands of times. Its response is often non-stationary (regimes, shocks, phase changes), and the surrogate’s uncertainty drives design, calibration or the choice of the next run. This is where deep GPs are most used. Sauer, Gramacy and Higdon (2023) use them for active learning. Ming, Williamson and Guillas (2023) train them by stochastic imputation, which turns a deep GP into a chain of ordinary GPs. Booth (2025) adds gradient observations and predicts gradients, for molecular energies and forces.
- Multi-fidelity modelling. When a cheap, coarse simulator and an expensive, accurate one are both available, each layer can be one fidelity level, and the composition captures the non-linear relation between them (Cutajar et al., 2019).
- Spatial statistics with non-stationary fields. Deep compositions of injective warps model fields whose correlation length changes across space, for example satellite radiances (Zammit-Mangion et al., 2022).
- Mappings between functions. Stacking linear and non-linear GP layers in function space gives calibrated operator learning (Lowery et al., 2025), the setting of the operator-kernel post.
- Sequential decisions. Bayesian optimisation and active learning on non-stationary objectives, where better-shaped uncertainty chooses better next queries.
Where they are usually not the right tool: large data sets with plenty of compute (neural networks and ensembles), images and text (deep kernel machines, in Section 9, or neural networks), and problems where a single GP with a sensible kernel already fits.
8. What is new, 2018 to 2026
The doubly stochastic family has one weakness: each is Gaussian and independent of the other layers, so the approximate posterior is unimodal and ignores how the layers’ inducing variables co-vary. Most work since attacks that, makes inference cheaper, or takes deep GPs to new settings.
| year | work | what it changes |
|---|---|---|
| 2018 | Havasi, Hernández-Lobato and Murillo-Fuentes | samples the inducing variables with stochastic-gradient HMC; the true posterior is multimodal |
| 2019 | Salimbeni, Dutordoir, Hensman and Deisenroth | latent input variables and an importance-weighted bound, for multimodal outputs |
| 2019 | Yu, Chen, Dai, Low and Jaillet | implicit (non-Gaussian) posteriors, trained adversarially |
| 2020 | Jankowiak, Pleiss and Gardner | deep sigma point processes: a learned quadrature replaces sampling |
| 2020 | Lindinger, Reeb, Lippert and Rakitsch | keeps covariances between layers, still marginalising the inducing variables in closed form |
| 2021 | Ober and Aitchison | “global” inducing points defined at the input and propagated through the layers |
| 2021 | Dutordoir et al. | neural networks as point estimates of deep GPs (Section 9) |
| 2022 | Zammit-Mangion, Ng, Vu and Filippone | deep compositional spatial models with injective warps |
| 2023 | Sauer, Gramacy and Higdon; Sauer, Cooper and Gramacy | fully Bayesian deep GP surrogates, made near-linear with the Vecchia approximation |
| 2023 | Ming, Williamson and Guillas | training by stochastic imputation, through ordinary GP fits |
| 2023–24 | Yang et al.; Milsom, Anson and Aitchison | deep kernel machines, including convolutional ones for images |
| 2024 | Meng and Zhang | amortised inference: a network maps each observation to its variational parameters |
| 2025 | Lowery et al. | deep GPs for mappings between functions |
| 2025 | Booth | gradient-enhanced deep GPs for computer experiments |
| 2026 | Xu, Zhao, Paisley and Zeng (ICLR) | diffusion-bridge variational inference: a diffusion started near the posterior |
| 2026 | Sáez-Maldonado, Maroñas and Hernández-Lobato | why posterior collapse happens, and an initialisation that prevents it |
9. Deep GPs, neural networks and deep kernels
Width matters
A neural network with one hidden layer becomes a GP as its width goes to infinity (Neal, 1996), and so does a deep network, with a compositional kernel (Lee et al., 2018; Matthews et al., 2018). A Gaussian limit has a fixed kernel, so it cannot learn a representation. Deep GPs have the same limit.
Proposition 10 (Infinitely wide hidden layers make a deep GP shallow)
Let layer 1 have independent outputs , and let layer 2 use a squared-exponential kernel on the scaled distance, . As , converges almost surely to the deterministic kernel , with as in Section 2. So the output becomes an ordinary GP.
Proof
Step 1. Write the distance as an average. .
Step 2. Law of large numbers. The terms are independent and identically distributed, each the square of a variable (Section 2), so each has mean . The strong law of large numbers gives almost-sure convergence of the average to .
Step 3. Continuity. is continuous, so the kernel converges to its value at , which is not random.
Step 4. A fixed kernel means a GP. Given layer 1, the output is Gaussian with this covariance. In the limit the covariance no longer depends on layer 1, so averaging over layer 1 changes nothing, and the output is a GP with that kernel.
Finite width is what makes a deep GP deep. Deep kernel processes (Aitchison, Yang and Ober, 2021) and deep kernel machines (Yang et al., 2023; Milsom, Anson and Aitchison, 2024) change how the limit is taken, so that representation learning survives it, and obtain a deep generalisation of kernel methods that scales to images.
Neural networks as deep GPs, and the other way round
- Neural networks as point estimates. Dutordoir et al. (2021) read activation functions as inter-domain inducing features (the inter-domain idea of the sparse post, Section 10). The posterior mean of a deep sparse GP then has the same structure as a network’s forward pass, so a deep GP can be initialised and trained like a network, and a network gains calibrated uncertainty.
- Deep kernel learning. Wilson, Hu, Salakhutdinov and Xing (2016) use with a neural network fitted by maximising the marginal likelihood: a deep GP whose inner layers are point estimates. It is fast and often accurate. But with millions of warp parameters and no posterior over them, it can overfit the marginal likelihood badly (Ober, Rasmussen and van der Wilk, 2021).
10. A checklist
- Start simple. Fit a single GP, then one with a non-stationary kernel or warped inputs. Move to a deep GP only if the residuals or the held-out likelihood say the texture is wrong.
- Two or three layers, identity or linear mean functions on hidden layers, 100 to 500 inducing points per layer, whitening, and inner layers initialised nearly deterministic.
- Monitor the ELBO and a held-out log density, not only the error of the mean. If the hidden layers fall back to their priors, suspect posterior collapse and revisit the initialisation.
- Look at predictive distributions, not only means: the benefit often shows up as uncertainty with the right shape, sharp at a jump instead of smeared across it.
- If the posterior itself matters, as in active learning, consider sampling (Section 8): variational posteriors are unimodal and tend to be too narrow.
Questions
Question 1
A colleague says: “A deep GP is not a GP, so you cannot compute its predictive distribution.” What is wrong with that?
Answer
Each layer is a GP given the layer below, so every conditional distribution is Gaussian and computable. The predictive is the average of the last layer’s Gaussian over the hidden value, , which Monte Carlo estimates without bias, with an error shrinking like . What is lost is a closed form, not computability.
Question 2
In the two-layer covariance, what happens as , and why?
Answer
, so the covariance tends to for every pair of inputs: and become perfectly correlated. Over the range of the hidden values, a GP with an enormous length-scale is essentially constant, so the composition is a single random constant.
Question 3
Every layer has a squared-exponential kernel with . Does the typical slope of a deep composition grow or shrink with depth?
Answer
Here , and the mean of is , so the median slope grows, very slowly. Its standard deviation still grows like , so the slopes still spread out over orders of magnitude: flat in places, cliffs in others. Tuning moves the drift but cannot remove the spread.
Question 4
In the forward pass by hand, what would happen to the expected log-likelihood if were ten times larger, and what does that tell you about training?
Answer
would grow from to , so and the variance term would cost nats instead of . The ELBO strongly rewards certainty about the inducing values where there are data; the KL term pulls back towards the prior, and training balances the two.
Question 5
The variational distribution is an -dimensional Gaussian with a full covariance. Why does doubly stochastic VI never form an matrix?
Answer
The likelihood factorises over points, and Steps 6 to 8 of the theorem show that the marginal of needs only the one-dimensional conditionals along point ‘s own path. Those need and at one input, which cost each. Covariances between different points never enter the objective.
Question 6
Show that with an identity mean the derivative of the composition is , and explain why that stops the collapse.
Answer
With , the chain rule gives , so . When the GP part is small, each factor is close to 1 and has mean about . The drift per layer is instead of the of a plain layer, which is why residual connections let networks and deep GPs grow deep.
References
- A. Damianou, N. D. Lawrence. Deep Gaussian processes. AISTATS, 2013. arXiv:1211.0358
- H. Salimbeni, M. P. Deisenroth. Doubly stochastic variational inference for deep Gaussian processes. NeurIPS, 2017. arXiv:1705.08933
- D. Duvenaud, O. Rippel, R. P. Adams, Z. Ghahramani. Avoiding pathologies in very deep networks. AISTATS, 2014. arXiv:1402.5836
- C. E. Rasmussen, C. K. I. Williams. Gaussian Processes for Machine Learning. MIT Press, 2006.
- M. N. Gibbs. Bayesian Gaussian processes for regression and classification. PhD thesis, University of Cambridge, 1997.
- P. D. Sampson, P. Guttorp. Nonparametric estimation of nonstationary spatial covariance structure. JASA, 1992.
- J. Snoek, K. Swersky, R. Zemel, R. P. Adams. Input warping for Bayesian optimization of non-stationary functions. ICML, 2014.
- M. Havasi, J. M. Hernández-Lobato, J. J. Murillo-Fuentes. Inference in deep Gaussian processes using stochastic gradient Hamiltonian Monte Carlo. NeurIPS, 2018.
- H. Salimbeni, V. Dutordoir, J. Hensman, M. P. Deisenroth. Deep Gaussian processes with importance-weighted variational inference. ICML, 2019.
- H. Yu, Y. Chen, Z. Dai, B. K. H. Low, P. Jaillet. Implicit posterior variational inference for deep Gaussian processes. NeurIPS, 2019.
- M. Jankowiak, G. Pleiss, J. R. Gardner. Deep sigma point processes. UAI, 2020.
- J. Lindinger, D. Reeb, C. Lippert, B. Rakitsch. Beyond the mean-field: structured deep Gaussian processes improve the predictive uncertainties. NeurIPS, 2020. arXiv:2005.11110
- S. W. Ober, L. Aitchison. Global inducing point variational posteriors for Bayesian neural networks and deep Gaussian processes. ICML, 2021. PMLR
- V. Dutordoir, J. Hensman, M. van der Wilk, C. H. Ek, Z. Ghahramani, N. Durrande. Deep neural networks as point estimates for deep Gaussian processes. NeurIPS, 2021. arXiv:2105.04504
- A. Zammit-Mangion, T. L. J. Ng, Q. Vu, M. Filippone. Deep compositional spatial models. JASA, 2022.
- A. Sauer, R. B. Gramacy, D. Higdon. Active learning for deep Gaussian process surrogates. Technometrics, 2023.
- A. Sauer, A. Cooper, R. B. Gramacy. Vecchia-approximated deep Gaussian processes for computer experiments. JCGS, 2023. arXiv:2204.02904
- D. Ming, D. Williamson, S. Guillas. Deep Gaussian process emulation using stochastic imputation. Technometrics, 2023. arXiv:2107.01590
- K. Cutajar, M. Pullin, A. Damianou, N. D. Lawrence, J. González. Deep Gaussian processes for multi-fidelity modeling. 2019. arXiv:1903.07320
- Q. Meng, Y. Zhang. Amortized variational inference for deep Gaussian processes. 2024. arXiv:2409.12301
- M. Lowery, Z. Xu, D. Long, K. Chen, D. S. Johnson, Y. Bai, V. Shankar, S. Zhe. Deep Gaussian processes for functional maps. 2025. arXiv:2510.22068
- A. S. Booth. Gradient-enhancement and gradient predictions for deep Gaussian process modeling of expensive computer experiments. 2025. arXiv:2512.18066
- J. Xu, Q. Zhao, J. Paisley, D. Zeng. Diffusion bridge variational inference for deep Gaussian processes. ICLR, 2026. arXiv:2509.19078
- F. J. Sáez-Maldonado, J. Maroñas, D. Hernández-Lobato. An analysis of posterior collapse, parameterization and initialization in variational deep Gaussian processes. 2026. arXiv:2606.25882
- R. M. Neal. Bayesian Learning for Neural Networks. Springer, 1996.
- J. Lee, Y. Bahri, R. Novak, S. S. Schoenholz, J. Pennington, J. Sohl-Dickstein. Deep neural networks as Gaussian processes. ICLR, 2018.
- A. G. de G. Matthews, M. Rowland, J. Hron, R. E. Turner, Z. Ghahramani. Gaussian process behaviour in wide deep neural networks. ICLR, 2018.
- L. Aitchison, A. X. Yang, S. W. Ober. Deep kernel processes. ICML, 2021.
- A. X. Yang, M. Robeyns, E. Milsom, B. Anson, N. Schoots, L. Aitchison. A theory of representation learning gives a deep generalisation of kernel methods. ICML, 2023. PMLR
- E. Milsom, B. Anson, L. Aitchison. Convolutional deep kernel machines. ICLR, 2024.
- A. G. Wilson, Z. Hu, R. Salakhutdinov, E. P. Xing. Deep kernel learning. AISTATS, 2016.
- S. W. Ober, C. E. Rasmussen, M. van der Wilk. The promises and pitfalls of deep kernel learning. UAI, 2021.
Was this useful?
Thanks, that helps me decide what to write next.