A tutorial on Gaussian process regression: Modelling, exploring, and exploiting functions

Eric Schulz, Maarten Speekenbrink, Andreas KrausebioRxiv 2016

Abstract

This tutorial introduces the reader to Gaussian process regression as an expressive tool to model, actively explore and exploit unknown functions. Gaussian process regression is a powerful, non-parametric Bayesian approach towards regression problems that can be utilized in exploration and exploitation scenarios. This tutorial aims to provide an accessible introduction to these techniques. We will introduce Gaussian processes which generate distributions over functions used for Bayesian non-parametric regression, and demonstrate their use in applications and didactic examples including simple regression problems, a demonstration of kernel-encoded prior assumptions and compositions, a pure exploration scenario within an optimal design framework, and a bandit-like exploration-exploitation scenario where the goal is to recommend movies. Beyond that, we describe a situation modelling risk-averse exploration in which an additional constraint (not to sample below a certain threshold) needs to be accounted for. Lastly, we summarize recent psychological experiments utilizing Gaussian processes. Software and literature pointers are also provided.

Introduction

In many scientific fields, researchers face the challenge of modeling unknown functions where the underlying shape is a mystery or data acquisition is prohibitively expensive. Traditional regression often requires choosing a specific parametric form (like a linear or quadratic equation) upfront. If that choice is incorrect, the model fails to accurately represent the data. Gaussian Process (GP) regression addresses this by treating functions as distributions rather than fixed equations, allowing for flexible modeling of complex, non-linear relationships without being tied to a specific equation.

Methods: Modeling, Exploration, and Exploitation

Gaussian Process regression is a non-parametric Bayesian approach. Unlike standard regression that learns fixed parameters (weights), GPs define a distribution over possible functions. This framework is versatile, supporting passive modeling as well as active learning and optimization strategies.

Kernels and Composition

The "heart" of a GP is the kernel (or covariance function), which encodes prior assumptions like smoothness or periodicity. For instance, the Radial Basis Function (RBF) is commonly used for smooth data, while Matérn kernels are better suited for more "rugged" functions. A powerful feature of GPs is kernel composition, where simple kernels are added or multiplied to model complex patterns, such as a linear trend combined with a seasonal cycle.

Acquisition Functions

To decide where to sample next in active learning scenarios, GPs use acquisition functions. For Exploration, uncertainty sampling is used to target areas where the model is most unsure. For Exploitation, the Upper Confidence Bound (UCB) algorithm balances predicted high rewards with high uncertainty to find the function's maximum efficiently.

Summary of Gaussian Process methods, purposes, and application examples.

Safe Optimization

In specialized cases like clinical or robotic applications, the SafeOpt algorithm optimizes a function while ensuring that samples never fall below a critical "safety threshold," allowing for risk-averse exploration.

Applications and Datasets

The tutorial demonstrates GP versatility across several diverse datasets:

  • Mouse Trajectories: Real-world x-y coordinate data from a categorization task used to test smoothing capabilities.
  • Atmospheric CO2: The classic Mauna Loa dataset used to demonstrate kernel composition (trend + seasonality).
  • Response Times: Psychological experimental data showing how GPs can decompose trial-by-trial dependencies.
  • Synthetic Functions: A suite of functions (linear, quadratic, sine, non-stationary) used to benchmark active learning efficiency.
  • IMDb Movie Database: A dataset of over 5,000 movies used to simulate a movie recommendation engine via Bayesian Optimization.

Key Insights and Results

GPs provide a unique "language" for researchers; by choosing or combining kernels, one can explicitly encode structural knowledge into a model. Because GPs are non-parametric, the data itself dictates the model's complexity, avoiding the need for researchers to guess the degree of a polynomial.

Key results from the tutorial include:

  • Superior Smoothing: GPs produced lower out-of-sample prediction errors compared to traditional polynomial regression and cubic splines in mouse trajectory tasks.
  • Faster Learning: In simulations, "GP-Active" models recovered underlying functions significantly faster and with less data than random sampling or fixed parametric models.
  • Efficient Recommendation: The GP-UCB algorithm successfully identified highly-rated movies within just a few trials, minimizing "regret" (the cost of recommending a bad movie).
  • Cognitive Modeling: A unique insight is the potential for GPs to serve as models of human cognition, suggesting that human function learning may utilize similar compositional kernel structures to understand the world.

Limitations and Future Work

The primary drawback of GPs is computational scaling, as they scale cubically ($O(N^3)$) with the number of observations. This necessitates approximation methods, such as sparse GPs, for large datasets. Additionally, while kernel composition is powerful, selecting the right combination remains a manual task, leading to research into "Automatic Statisticians" to automate this process. Finally, while kernels offer structural insight, GPs can be less directly interpretable than simple linear models, providing a "black box" of sorts in some applications.

Summary updated

BibTeX
@misc{schulz2016tutorial,
  author = {Eric Schulz and Maarten Speekenbrink and Andreas Krause},
  title = {{A tutorial on Gaussian process regression: Modelling, exploring, and exploiting functions}},
  year = {2016},
  doi = {10.1101/095190},
  howpublished = {bioRxiv},
}
Figure