Fast Variational Learning in State-Space Gaussian Process Models

Paul E. Chang, William J. Wilkinson, Mohammad Emtiyaz Khan, Arno Solin · DOI

TL;DR

This paper introduces State-Space VI (SSVI), a novel method for efficiently performing variational inference in Gaussian Process (GP) models with non-Gaussian likelihoods. By leveraging Kalman filtering and smoothing within a conjugate-computation variational inference framework and implementing it with JAX's just-in-time compilation, SSVI achieves linear time complexity, enabling scalable and stable inference on massive time-series datasets.

What Problem Does This Paper Address?

Gaussian Processes (GPs) are powerful non-parametric tools for modeling complex relationships, but their standard inference cost scales cubically with the number of data points ($O(n^3)$). This becomes a significant bottleneck for large datasets. While reformulating GPs as state-space models (SSMs) can reduce inference to linear time ($O(n)$) for Gaussian likelihoods, this benefit is lost with non-Gaussian likelihoods. Existing approximate inference methods for non-Gaussian likelihoods, like Expectation Propagation (EP), can suffer from numerical instability and convergence issues. Variational Inference (VI) methods, while more stable, often require $O(n^2)$ memory or are difficult to implement efficiently with Kalman recursions, hindering hyperparameter optimization through automatic differentiation. This paper aims to bridge this gap by providing a stable, linear-time variational inference method for state-space GPs with non-Gaussian likelihoods that is amenable to efficient hyperparameter learning.

Methods

The core of the proposed method, SSVI, builds upon Conjugate-Computation Variational Inference (CVI). CVI works by converting non-Gaussian likelihoods into Gaussian ones, allowing the use of Kalman smoothing for $O(n)$ inference. The key innovation here is the development of an efficient JAX implementation that leverages just-in-time (JIT) compilation and avoids loop unrolling. This allows for automatic differentiation through large for-loops, which are inherent in Kalman filtering and smoothing.

Specifically, the paper details:

  • Sequential CVI by Filtering and Smoothing: Adapting the Kalman filter and Rauch-Tung-Striebel smoother to incorporate the variational likelihood approximations. This allows for efficient computation of the necessary terms for the variational update and the Evidence Lower Bound (ELBO).
  • Variational Parameter Updates: Deriving update rules for the variational parameters that are computed using the derivatives of the expected log-likelihood with respect to the posterior mean and variance. These updates can be performed efficiently using the smoother's output.
  • Initialization Technique: Proposing a novel initialization strategy for the variational parameters by using the output of the forward filtering pass. This is shown to significantly improve convergence rates.
  • Direct Marginal Likelihood Computation: Providing a method to compute the marginal likelihood, which can be used as an alternative to the ELBO for hyperparameter learning.

The JAX implementation's efficiency stems from its ability to compile the Kalman filter/smoother into a static graph, avoiding the overhead of re-tracing computational graphs for each iteration, and its use of XLA for accelerated linear algebra operations.

Datasets

The paper evaluates SSVI on the following datasets:

  • Simulated GP Classification Data: Used to demonstrate the linear scaling of SSVI compared to CVI.
  • Coal Mining Disaster Dataset: A real-world dataset used to compare the posterior mean and variances of SSVI and CVI.
  • Airline Accidents Dataset: A large time-series dataset (n ≈ 35,959 observations) used to evaluate the performance of SSVI for large-scale log-Gaussian Cox process modeling.

No new benchmarks were introduced; existing datasets were used to validate the proposed method.

Key Insights and Ideas

  • Bridging the Gap: SSVI successfully combines the stability of VI with the computational efficiency of Kalman recursions for non-Gaussian likelihoods, a long-standing challenge in GP modeling.
  • JAX for Scalability: The paper highlights the power of JAX's JIT compilation and functional transformations for efficiently handling sequential models with large loops, enabling practical application to massive datasets.
  • Initialization Matters: The proposed filtering-based initialization strategy is a crucial practical insight, significantly speeding up convergence by providing a better starting point for the optimization.
  • Unified Framework: The interpretation of SSVI as a nonlinear Kalman filter provides a unifying perspective on variational inference methods for state-space models.

Key Results

  • Linear Time Complexity: SSVI achieves $O(n)$ computational complexity for inference, a significant improvement over the $O(n^3)$ of standard CVI, as demonstrated in Figure 2a.
  • Scalability: The method scales to time series with millions of data points, with a single training iteration on one million data points taking approximately 20 seconds.
  • Accuracy and Stability: SSVI recovers the same posterior as CVI and is shown to be numerically stable and avoid convergence issues, unlike some EP-based methods.
  • Faster Convergence: The filtering-based initialization technique leads to superior convergence rates in practice, as shown in Figure 3.
  • Comparable Performance: SSVI performs comparably to EP in terms of test performance and convergence speed on large datasets.

Limitations and Future Work

  • Setup Cost: While SSVI scales linearly, there is an initial setup cost associated with JIT compilation, which can dominate for smaller datasets (up to $n \approx 1000$ in Figure 2a). However, this cost is amortized over subsequent iterations.
  • Generalization to Higher Dimensions: The paper primarily focuses on 1D inputs. Extending the method to higher-dimensional input spaces for GPs might introduce additional complexities.
  • Further Exploration of Initialization: While the filtering-based initialization is effective, further research could explore other advanced initialization techniques.
  • Broader Applications: The authors suggest that the framework could be extended to other types of state-space models and non-Gaussian likelihoods.

Summary updated

BibTeX
@inproceedings{chang2020fast,
  author = {Paul E. Chang and William J. Wilkinson and Mohammad Emtiyaz Khan and Arno Solin},
  title = {{Fast Variational Learning in State-Space Gaussian Process Models}},
  booktitle = {MLSP},
  year = {2020},
  doi = {10.1109/mlsp49062.2020.9231560},
}
Figure