Online Gaussian Process

Machine Learning
Introduced by
Csató, L. & Opper, M.
Year
2002
Type
Bayesian nonparametric model (sequential/online)
Family
Machine learning

What does it do?

Online Gaussian Process (OGP) extends Gaussian process regression to streaming or sequentially arriving data.

Rather than recomputing the full GP posterior each time an observation arrives, it maintains a compact summary, a sparse set of inducing points, and updates that summary incrementally. This makes probabilistic prediction with uncertainty estimates feasible when data arrive continuously or in large volumes.

The intuition behind the method

A standard Gaussian process provides principled uncertainty estimates, but its cost grows cubically with the number of training points, which becomes impractical once data arrive continuously. Online GP keeps only a small subset of past observations, the active set or inducing points, that carries most of the information needed for prediction. Each new observation is either absorbed into the current model or, if it is not well explained by the existing set, added to it as a new inducing point. The model stays tractable as the stream grows and still reports how uncertain each prediction is.

History

Csató and Opper (2002) developed a sparse online approximation to the GP posterior, combining a Bayesian online algorithm with a sequential selection of a relevant subsample of the data and projection techniques in a reproducing kernel Hilbert space, yielding propagation of predictions and Bayesian error measures. Engel, Mannor and Meir (2004) introduced the kernel recursive least-squares algorithm, a nonlinear online least-squares method that uses a novelty-based sparsification rule. It is not a probabilistic GP method, but its sparsification idea is closely related to the active-set selection used in online GP methods.

When to use it

Choose Online GP when observations arrive sequentially or as a stream and refitting a full GP on all past data is too slow, when calibrated uncertainty is needed alongside each prediction, or when the dataset is too large for a batch GP but Bayesian uncertainty is still required. It suits smooth continuous regression where a kernel such as squared-exponential or Matérn is a reasonable prior belief about the function. Avoid it when inputs are very high-dimensional and no kernel engineering or dimensionality reduction is available, when the relationship is strongly non-stationary in ways a fixed kernel cannot capture, when the data are not stream-like and a batch GP is affordable, or when exact GP posteriors are required, since OGP is an approximation. Classification is possible but needs an extra likelihood approximation, so it is a weaker fit than regression.

Limitations and considerations

  • Kernel choice and hyperparameters (length-scale, noise variance) strongly affect performance and usually need offline tuning or a separate adaptation mechanism.
  • The active-set size m must be fixed in advance: a small budget degrades accuracy, while a large one reduces the speed advantage.
  • A fixed (stationary) kernel may struggle with strongly non-stationary or drifting data streams.
  • The error of the sparse approximation relative to the full GP posterior is hard to bound or monitor in practice.

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

Strengths

  • Gives a predictive variance at each step, which supports active learning and anomaly flagging in streaming settings.
  • The cost of each update scales with the active-set size m rather than with the full dataset size, and is much lower than the cubic cost of batch GP inference, so long or unbounded streams remain tractable; the exact cost depends on the implementation.
  • Handles nonlinear relationships through the kernel without manual feature construction.
  • Csató and Opper (2002) derive the sparse approximation using projection techniques in a reproducing kernel Hilbert space combined with a Bayesian online algorithm.
  • The active-set size m gives the practitioner an explicit accuracy-versus-speed setting.
  • Does not require the full data history to be stored or revisited.

Applications

  • Real-time sensor fusion and environmental monitoring where measurements arrive continuously.
  • Online Bayesian optimization and active learning loops requiring live uncertainty estimates.
  • Robot localization and control (GP-based state estimation with streaming sensor data).
  • Time-series anomaly detection using predictive variance as a confidence signal.
  • Adaptive recommendation and contextual bandits where reward functions are learned on-the-fly.
  • Financial signal modeling with evolving market data streams.

How it works

How it works

1

A GP prior is specified by a mean function (often zero) and a covariance kernel, typically squared-exponential or Matérn, encoding smoothness beliefs about the latent function. This prior defines a probability distribution over all possible functions before any data is seen.

Formula
f \sim \mathcal{GP}(m(\mathbf{x}), k(\mathbf{x}, \mathbf{x}'))
2

A sparse active set (inducing set) of representative input locations is maintained. This representation replaces the full training history, so memory and computation per update depend on the size of the set rather than on the number of observations seen. The budget m on the set size is a user-controlled setting that trades accuracy for speed.

Formula
\mathcal{A}_t=\{\tilde{\mathbf{x}}_1,\dots,\tilde{\mathbf{x}}_{m_t}\},\quad m_t\le m
3

When a new observation arrives, the posterior over the latent function is updated through recursions for the effective parameters and a sparse Gaussian approximation of the posterior process (Csató and Opper, 2002), rather than a full matrix solve over all past data. The update uses the kernel similarity between the new input and the current active set to propagate the new information.

4

A novelty criterion decides whether a new input is admitted to the active set. In the kernel recursive least-squares formulation of Engel, Mannor and Meir (2004), a sample is admitted only if its feature-space image cannot be sufficiently well approximated by combining the images of the samples already admitted; otherwise it is not added to the set. Csató and Opper (2002) similarly build a sequential selection of a relevant subsample. Keeping the set within a fixed budget m also requires a removal rule, such as discarding the oldest point; removal is a design choice of a particular implementation.

Formula
\delta_{t+1}=\min_{\mathbf{c}}\Big\|\sum_{j}c_j\,\phi(\tilde{\mathbf{x}}_j)-\phi(\mathbf{x}_{t+1})\Big\|^2 > \nu \;\Rightarrow\; \text{admit } \mathbf{x}_{t+1}
5

For a test input, the predictive distribution is computed from the active set alone. In the Gaussian-likelihood (regression) case the predictive is Gaussian, with a mean built from the kernel vector between the test input and the active set and a variance that includes a posterior-covariance term; the variance indicates how confident the model is at that input. Csató and Opper (2002) describe the propagation of predictions together with Bayesian error measures. With a probit or logistic likelihood for classification, the predictive is not Gaussian, so an additional approximation is needed and the Gaussian form does not hold exactly.

Formula
p(y^* | \mathbf{x}^*, \mathcal{D}_t) = \mathcal{N}(\mu^*, \sigma^{*2})

Common pitfalls

  • Fixing kernel hyperparameters without any adaptation, which leads to miscalibrated uncertainties as the data distribution evolves.
  • Setting the active-set budget too small and reading poor predictions as model failure rather than as an effect of sparsification.
  • Misjudging the novelty threshold: if it is too high, few points enter the set and new information is missed; if it is too low, nearly every point is admitted, so the fixed budget fills quickly and the set churns, evicting older points that may still be informative.
  • Treating OGP variance as exact Bayesian uncertainty; it is an approximation and should be checked on held-out data.
  • Applying OGP to very high-dimensional raw inputs without dimensionality reduction or a suitable structured kernel.

Frequently asked questions

How does OGP differ from a standard (batch) Gaussian process?

A batch GP stores and inverts the full n×n kernel matrix, costing O(n³) time and O(n²) memory. OGP replaces the full history with a sparse active set of m points and updates it incrementally, so the cost depends on m rather than n. This makes OGP scalable to streaming and large datasets at the cost of introducing an approximation error.

How do I choose the active-set size m?

Start with a small budget and monitor predictive performance on a held-out part of the stream. Increase m while accuracy keeps improving and latency stays within your limits. The novelty threshold also controls how quickly the set fills, so it should be tuned together with m.

Can OGP handle concept drift?

Standard OGP with a fixed kernel assumes a stationary function, so concept drift can degrade performance. Addressing drift usually requires extra design choices, such as forgetting old points, using a non-stationary kernel, or a sliding window. These are not part of the basic method described in the cited sources.

Is OGP suitable for classification?

It can be applied, but not with a closed-form Gaussian predictive. A probit or logistic likelihood requires an additional approximation for the online updates and predictions, such as expectation propagation or a Laplace approximation. This adds a second source of approximation beyond sparsification.

What software implements online Gaussian processes?

No specific implementation is endorsed here. Check the documentation of any GP library you use to confirm whether it supports sequential updates and a sparsification rule, since many GP frameworks are designed for batch fitting.

Related methods

Sources

  1. Csató, L. & Opper, M. (2002). Sparse on-line Gaussian processes. Neural Computation, 14(3), 641–668.

    Open DOI reference
  2. Engel, Y., Mannor, S. & Meir, R. (2004). The kernel recursive least-squares algorithm. IEEE Transactions on Signal Processing, 52(8), 2275–2285.

    Open DOI reference