- Introduced by
- Rasmussen, C. E. & Williams, C. K. I. (GP); XAI layer via Lundberg & Lee (SHAP, 2017) and others
- Year
- 2006 (GP); 2017+ (XAI integration)
- Type
- Probabilistic model with post-hoc or built-in interpretability
- Family
- Machine learning
What does it do?
An Explainable Gaussian Process (XAI-GP) is a Gaussian Process model whose probabilistic predictions are paired with interpretability tools, such as SHAP attributions, kernel decomposition, or sensitivity analysis.
Each prediction comes with a posterior uncertainty interval, and post-hoc tools can approximate which inputs contributed to it. The term covers several combinations of a GP with these tools rather than one fixed algorithm. The uncertainty intervals are only as reliable as the model's assumptions about the kernel and the noise.
The intuition behind the method
A Gaussian Process treats prediction as Bayesian inference over functions. Given training data, it returns a posterior distribution over the target at new inputs, so the output is both a predicted mean and a measure of how uncertain that prediction is. The kernel function determines how similar inputs are assumed to be and therefore how information from training points is shared across the input space. Explainable variants add attribution on top of this: post-hoc tools such as SHAP can estimate how much each feature moves the posterior mean for a given prediction, and additive kernels make per-feature contributions part of the model structure itself.
History
Gaussian Processes for machine learning were consolidated in the 2006 MIT Press monograph by Rasmussen and Williams, which remains a standard reference. Gaussian process methods were developed before that monograph, which brought together their theory and their use in machine learning. The kernel and posterior make a GP's assumptions inspectable, which is one basis for its interpretability. Post-hoc attribution for these models is commonly done with SHAP, introduced by Lundberg and Lee in 2017 (NeurIPS, vol. 30). Sparse approximations such as inducing-point methods are used to extend GP inference to larger datasets.
When to use it
Use an Explainable GP when you need uncertainty estimates alongside feature-level explanations, for example in risk scoring or emulation of expensive simulators, where the uncertainty is needed for decisions and the explanations for review. GPs suit datasets of modest size with continuous inputs and targets that vary smoothly. Exact inference becomes impractical as the number of training points grows, because its cost scales cubically, so sparse approximations are needed for large datasets. Avoid the method when the inputs are high-dimensional text or categorical data that a standard kernel cannot represent sensibly, or when a linear model already fits the data well, since the explanation gained over a linear model is then small. Binary and multi-class targets are also supported, but they require non-Gaussian likelihoods and approximate inference, so their uncertainty is less exact than in regression.
Limitations and considerations
- Exact GP inference scales cubically with the number of training points, so large datasets require sparse or inducing-point approximations.
- Kernel choice is largely a matter of domain judgement; an unsuitable kernel gives posterior means and intervals that look precise but are misleading.
- Standard stationary kernels lose effectiveness as input dimension grows, and automatic relevance determination (ARD) kernels add hyperparameters that must be estimated from the same data.
- SHAP attributions require many model evaluations per explained prediction, which adds cost on top of GP inference.
- Additive kernels cannot represent interactions between features, so explanations based on them omit any interaction effects.
- Classification with binary or multi-class targets relies on approximate inference (Laplace or expectation propagation), so its uncertainty estimates are approximate.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- For regression with a Gaussian likelihood, the posterior mean and variance are available in closed form, so uncertainty intervals do not require a separate sampling step.
- The kernel makes the model's assumptions about smoothness and feature structure explicit and open to inspection.
- The posterior mean is a differentiable function of the inputs for smooth kernels, so gradient-based attribution can be applied to it.
- Additive kernels represent each feature's marginal effect directly, which supports per-feature interpretation without relying only on post-hoc tools.
- With small training sets, the prior specified by the kernel regularises the fit, which limits overfitting in the way a fully flexible model would not.
Applications
- Risk scoring and clinical decision support where predictions need uncertainty estimates and an auditable explanation.
- Surrogate modelling and emulation of expensive simulations, where uncertainty about the emulator matters.
- Environmental and geospatial prediction, where kernels can encode spatial structure.
- Settings with explanation requirements, where each prediction must be justified to reviewers.
- Bayesian optimisation, where the GP's posterior uncertainty drives the choice of the next evaluation.
How it works
How it works
A covariance (kernel) function is chosen to encode assumptions about the smoothness and structure of the target function. The squared-exponential (RBF) kernel is a common default, but it assumes smooth, stationary variation, which may not hold for a given dataset. Additive kernels, built as sums of single-feature sub-kernels, restrict the model so that each feature's effect is represented separately.
Formula
k(x_i, x_j) = \sigma^2 \exp\!\left(-\frac{\|x_i - x_j\|^2}{2l^2}\right)The GP conditions on the observed data to give a posterior mean and covariance over the target at new inputs. The posterior mean is the point prediction, and the posterior variance gives the uncertainty interval for regression with a Gaussian likelihood. The standard regression form assumes independent, identically distributed Gaussian noise. Kernel hyperparameters such as the length-scale and signal variance are usually estimated by maximising the marginal likelihood, and residuals should be checked against the noise assumption. Those intervals are calibrated only if the kernel and noise assumptions are reasonable for the data.
Formula
f^* | X, y, X^* \sim \mathcal{N}(\mu^*, \Sigma^*)The posterior variance reflects how much the training data constrain the prediction at a given input. Predictions far from the training data generally have wider intervals, so the variance gives a built-in signal of where the model is least reliable. This is one of the main practical differences from many black-box models, although the signal is only as good as the kernel choice.
SHAP or LIME can be applied to the GP predictive mean to split each prediction into per-feature contributions. KernelSHAP is model-agnostic and estimates contributions by evaluating the model on perturbed inputs, so it applies to a GP without modification. Setting it up requires a background (reference) dataset, which defines the baseline: each SHAP value is a deviation from the expected prediction over that background. Estimates depend on the number of sampled coalitions, so the sample budget should be increased until the attributions stop changing. Strongly correlated features can produce perturbed inputs far from the training distribution, which can distort the attributions. The attributions describe the fitted posterior mean, not its uncertainty, and they inherit any approximation error in the GP's inference.
With an additive kernel, the function is modelled as a sum of components that each depend on one feature, so the marginal effect of each feature is explicit in the model. This is a structural form of interpretability that differs from post-hoc attribution. It holds only to the extent that the additive assumption, which excludes interactions between features, is appropriate for the problem.
Common pitfalls
- Using the default RBF kernel without checking whether the assumed smooth, stationary variation suits the data.
- Reporting only the posterior mean and discarding the posterior variance, which removes the uncertainty information that motivates using a GP.
- Applying exact GP inference to large datasets without a sparse approximation, which can exhaust memory.
- Treating kernel length-scales and SHAP feature importances as interchangeable; a length-scale describes how quickly the function varies along a feature, while a SHAP value describes a feature's contribution to one prediction.
- Ignoring whether the likelihood fits the target: a Gaussian noise model for regression, or a probit or logit link for classification, must be appropriate for the response variable.
- Reading SHAP values without the background dataset: each value is a deviation from a baseline defined by that dataset, so changing the background changes the attributions.
Frequently asked questions
How does a Gaussian Process differ from a regular regression model?
A standard regression model outputs a single predicted value. A GP outputs a probability distribution over possible values, consisting of a mean prediction and a variance that indicates how confident the model is. This uncertainty is useful in safety-critical or scientific settings, provided the kernel and noise assumptions are reasonable.
Can I use SHAP with a Gaussian Process?
Yes. KernelSHAP is model-agnostic: it evaluates the GP posterior mean on perturbed inputs and does not require gradients, so it applies directly. DeepSHAP is designed for neural networks and is not a default choice here. For additive kernels, the kernel structure already gives per-feature contributions that can be compared with SHAP values.
What makes a GP 'explainable' compared to a standard GP?
An Explainable GP pairs a GP with interpretability tools. Post-hoc attribution such as SHAP or LIME approximates each feature's contribution to the posterior mean for an individual prediction, and additive kernels build per-feature effects into the model structure. The kernel also states the model's assumptions about smoothness and feature structure, which can be inspected. These attributions are approximations and do not describe the posterior uncertainty.
When does a GP become too slow to use?
Exact GP inference requires inverting an n-by-n covariance matrix, which costs O(n^3). The practical limit depends on the available hardware and the problem. For larger datasets, sparse variants such as FITC or SVGP reduce the cost to O(m^2 n), where m is the number of inducing points.
Is an Explainable GP suitable for classification?
It can be, using Laplace or expectation-propagation approximations for the non-Gaussian likelihood. These approximations make the uncertainty estimates approximate rather than exact, but SHAP attribution can still be applied to the approximate posterior mean.
Related methods
Sources
Rasmussen, C. E., & Williams, C. K. I. (2006). Gaussian Processes for Machine Learning. MIT Press.
ISBN: 978-0-262-18253-9Lundberg, S. M., & Lee, S.-I. (2017). A unified approach to interpreting model predictions. Advances in Neural Information Processing Systems, 30.
Open publication reference