Self-supervised Gaussian Process

Machine Learning
Introduced by
Fortuin, V. et al.; broader self-supervised GP literature
Year
2019–2021
Type
Probabilistic model (self-supervised GP pretraining + kernel learning)
Family
Machine learning

What does it do?

Self-supervised Gaussian Process (SSL-GP) is a probabilistic regression approach that first trains on unlabeled data with a self-supervised pretext task, then fits a Gaussian process (GP) to a small labeled set.

Because the output is a GP, each prediction comes with a predictive variance alongside the mean. Its usefulness depends on how well the pretext task reflects the downstream target. SSL-GP is not a single standardised method: implementations differ in pretext task, objective and encoder, so results should be checked against the specific implementation used.

The intuition behind the method

A Gaussian process returns a predictive distribution, not just a point estimate, but its behaviour depends heavily on the kernel, which encodes assumptions about smoothness and correlation. With few labels, those assumptions are hard to check against the data. The self-supervised step tries to shape the kernel, or a feature extractor feeding it, using unlabeled inputs, so that when labels arrive the GP starts from structure taken from the data itself. Whether this improves accuracy or calibration for a given dataset has to be checked empirically.

History

No verified originator or date is established for this pretrain-then-fine-tune procedure. Fortuin, Rätsch and Mandt (2020) introduced GP-VAE, a variational autoencoder with a Gaussian process prior for probabilistic time-series imputation. That work is related research on GP-based models of time series; it does not describe the pretrain-then-fine-tune procedure outlined on this page and should not be read as its origin.

When to use it

Choose SSL-GP when labeled data are scarce, unlabeled data of the same type are available, and predictive uncertainty is needed for the decision, for example in active learning, where the posterior variance guides which point to label next. It is most natural for continuous, time-series or spatial data with smooth or correlated structure, where a GP kernel is a meaningful model. Do not use it when labeled data are plentiful, since a standard GP or a simpler neural model is then easier to set up. It is also a poor fit for very high-dimensional unstructured inputs such as raw images or audio, where a kernel is hard to design and a deep model is usually more practical. If exact or sparse GP inference is too expensive for the dataset size, the method is not suitable. The choice between SSL-GP and a standard GP is best made by comparing both on held-out labeled data, since no labeled-set or dataset-size threshold is established for this choice.

Limitations and considerations

  • The pretext task must be designed for the data type, and a task unrelated to the prediction target can produce a kernel that captures irrelevant variation.
  • Exact GP inference scales as O(n^3) in the number of training points, and sparse approximations introduce additional settings and approximation error.
  • Combining the GP marginal likelihood with a self-supervised objective can give non-convex training that is sensitive to initialization.
  • When a deep encoder feeds the kernel, the model is less transparent than a vanilla GP, because the encoder adds a black-box component.
  • The benefit of pretraining assumes that unlabeled and labeled data share the same input distribution and generating process; if they differ, the pretrained kernel may transfer poorly.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • The GP output includes a predictive variance with each mean prediction, which is useful when the uncertainty itself feeds a decision.
  • Pretraining on unlabeled data is intended to reduce how many labeled examples are needed to specify the kernel.
  • The learned kernel is an explicit covariance function, so its smoothness and correlation assumptions can be inspected.
  • The posterior variance can drive active learning, where the next point to label is chosen by uncertainty.
  • Sparse inducing-point variants address the O(n^3) cost of exact GP inference, at the price of extra approximation.

Applications

  • Time-series imputation and forecasting where uncertainty bounds are needed and labels are limited.
  • Monitoring of medical sensor data and biomarker estimation, where predictive uncertainty informs clinical judgement.
  • Active learning, where the GP posterior variance selects the next sample to label.
  • Scientific regression in areas such as physics, chemistry or environmental modelling, where calibrated uncertainty is required.
  • Anomaly detection based on deviation from the GP posterior, using few labeled fault examples.

How it works

How it works

1

A pretext task is defined on unlabeled data using only the data's own structure. For time series, the page names masked-value imputation and next-step prediction; for tabular data, feature reconstruction or contrastive pair classification. The choice of task is left to the user, and it should reflect the downstream prediction target.

2

During pretext training, the kernel parameters, or a deep feature extractor feeding the GP covariance function, are adjusted. The aim is for the kernel to capture structure present in the unlabeled data, such as smoothness, periodicity or non-stationarity, before any labels are used.

Formula
k_{\theta}(x, x') = \text{kernel parameterized by } \theta \text{ learned on unlabeled data}
3

The GP is fitted to the self-supervised objective on the unlabeled data. Depending on the implementation, this objective is a marginal likelihood or an evidence lower bound (ELBO) on the pretext targets, and the choice affects both tractability and approximation quality. Sparse approximations such as inducing-point methods keep this step tractable as the data grow.

4

The pretrained kernel, and optionally the encoder, is fine-tuned on the small labeled set by maximizing the GP marginal likelihood for the regression or classification target. Fine-tuning allows the downstream target, rather than only the pretext task, to shape the final model.

5

At test time the GP posterior gives a predictive mean and variance for each query point, conditioned on the kernel parameters and noise variance fitted in the earlier steps. With a Gaussian likelihood and exact inference, the predictive distribution is Gaussian and available in closed form. For non-Gaussian likelihoods or variational approximations, the predictive distribution is only approximated, and a Gaussian form should not be assumed. The variance reflects uncertainty from limited labels together with observation noise.

Formula
p(f^* | X, y, x^*) = \mathcal{N}(\mu^*, \sigma^{*2})

Common pitfalls

  • Choosing a pretext task that does not match the downstream target, so the kernel reflects structure that does not help prediction.
  • Attempting exact GP inference on a large unlabeled corpus instead of using a sparse approximation, which can exceed available memory and compute.
  • Keeping the pretrained kernel fixed and not fine-tuning it on labeled data, so downstream predictions carry the pretext-task bias.
  • Reporting only mean accuracy and not evaluating calibration, for example with a proper scoring rule such as the log-predictive density, which misses the main reason for using a GP.
  • Placing inducing points poorly in sparse approximations, which can degrade both accuracy and the uncertainty estimates.

Frequently asked questions

How does Self-supervised GP differ from a standard semi-supervised GP?

A semi-supervised GP typically uses labeled and unlabeled points together within one training procedure, propagating label information through the kernel. Self-supervised GP as described on this page first trains on an annotation-free pretext task to shape the kernel, and then fine-tunes on labels. The two-stage structure is the defining difference.

What pretext tasks are used for time-series data?

This page names masked-value imputation (predicting held-out observations) and next-step or multi-step prediction. Both train the model on temporal structure, which is related to the smoothness and correlation a GP kernel encodes. Whether a given task works better than another should be tested on the target data.

How do I scale Self-supervised GP to large datasets?

Use a sparse inducing-point GP approximation with M inducing points, where M is much smaller than n. Many implementations train such approximations with mini-batch stochastic gradient descent. Check scalability, and the effect of M on accuracy and uncertainty, on the actual dataset.

Is the uncertainty from Self-supervised GP well calibrated?

Calibration is not guaranteed by the method. It should be assessed empirically after fine-tuning on the labeled set, using proper scoring rules such as the negative log-predictive density or calibration curves. The results depend on the pretext task, the kernel and the approximation used.

When should I prefer a deep self-supervised model over SSL-GP?

Deep contrastive models, for example SimCLR feeding a classifier, are more natural for very high-dimensional unstructured data such as images or audio, and they do not require kernel design. SSL-GP is more suitable when predictive uncertainty is a primary requirement and the data are continuous or smooth, such as time series, spatial data or lower-dimensional tabular inputs.

Related methods

Sources

  1. Fortuin, V., Rätsch, G., & Mandt, S. (2020). GP-VAE: Deep probabilistic time series imputation using Gaussian process variational autoencoders. Proceedings of the 23rd International Conference on Artificial Intelligence and Statistics (AISTATS), PMLR 108, 1651–1661.

    Open publication reference
  2. Gaussian process. Wikipedia.

    Open publication reference