Bayesian Kernel Shaping for Learning Control

Jo-Anne Ting, Mrinal Kalakrishnan, Sethu Vijayakumar, Stefan SchaalNeurIPS 2008

In kernel-based regression learning—such as Gaussian Processes (GPs) or Support Vector Machines—the "kernel" defines how much influence a data point has on its neighbors. Most standard algorithms rely on a global kernel, meaning the width or shape of the kernel remains constant across the entire data space.

However, real-world data, particularly in robotics and control systems, is rarely uniform. Data density fluctuates, regression surfaces exhibit varying curvatures, and the magnitude of output noise (heteroscedasticity) changes spatially. Using a global kernel forces a compromise: a kernel wide enough to smooth out noise in one region might be too wide to capture sharp, critical details in another. While local kernel shaping methods exist, they historically require tedious manual tuning, complex statistical hypothesis tests, or computationally expensive sampling techniques like Markov Chain Monte Carlo (MCMC).

This paper introduces a novel Bayesian Local Kernel Shaping framework that automatically and locally shapes regression kernels to handle these variations, offering high-accuracy local linearizations essential for stable robot control.

A Bayesian Approach to Kernel Shaping

The authors propose a formulation that treats local kernel shaping as a probabilistic inference problem. Key technical innovations include:

  • Probabilistic Weighting: Instead of treating the influence weights of samples as fixed values, the model associates a scalar, indicator-like weight with each sample, modeled as a Bernoulli-distributed random variable.
  • Variational Inference: To make the complex optimization mathematically tractable, the authors employ a variational approach to lower-bound the log-likelihood. This transforms a difficult problem into an efficient, Expectation-Maximization (EM)-like algorithm that simultaneously estimates regression and kernel parameters.
  • Computational Efficiency: Standard GP regression requires $O(N^3)$ matrix inversions, which scales poorly with large datasets. By introducing hidden variables, this Bayesian formulation avoids these inversions, resulting in an algorithm with a complexity of $O(Nd)$ per iteration (where $N$ is the number of samples and $d$ is the number of dimensions).
  • Nonstationary GP Extension: The bandwidths learned from this local model can be integrated into a global covariance function, creating a "nonstationary" GP without the need for expensive MCMC sampling.

Experiments and Results

The researchers evaluated their approach across a mix of synthetic challenges and real-world datasets to test its adaptability.

Synthetic 1D Functions

To isolate specific regression challenges, the algorithm was tested on synthetic functions featuring discontinuities, spatially inhomogeneous structures (varying frequency and amplitude), and simple straight lines.

Performance on synthetic 1D functions with varying characteristics.

The proposed method drastically outperformed standard stationary GPs. On the inhomogeneous data, the Bayesian kernel shaping achieved a Normalized Mean Squared Error (nMSE) of 0.0092, compared to 0.1251 for a standard stationary GP. The model naturally adapts its bandwidth to the local curvature, tightening around sharp kinks and expanding over flat regions.

Handling Real-World Heteroscedasticity

The algorithm was also tested on the classic Motorcycle Impact Data, a benchmark known for its nonstationary characteristics—specifically, a flat, low-noise period followed immediately by high-variance oscillations.

Regression on the Motorcycle Impact dataset.

The Bayesian approach successfully captured both the initial flat region and the subsequent high-noise oscillations, matching the performance of much more complex, computationally heavy MCMC-based expert systems.

Application to Robot Control

For physical validation, the authors applied the algorithm to a 3-DOF haptic robot arm (a SensAble Phantom) to learn inverse kinematics for a figure-eight tracking task using 60,000 data samples.

In robot control, accurately estimating the "slope" (local tangent plane) is often more critical than just predicting the absolute value. Global kernels tend to "wiggle" between data points, creating false slopes that destabilize controllers. Because this Bayesian method provides much cleaner local linearizations, the learned inverse kinematics model performed just as well as the mathematically derived analytical solution, proving its viability for real-time control.

Key Insights and Limitations

Beyond raw accuracy, the Bayesian formulation offers several practical advantages:

  • Automatic Outlier Rejection: Data points inconsistent with their neighbors are naturally assigned low probabilities during the EM process, preventing noise spikes from skewing the regression.
  • Minimal Tuning: Unlike many local methods that require a flood of open parameters, this approach requires the user to specify only one prior: the expected output noise.

However, the authors note a few limitations. While the algorithm scales linearly with the number of dimensions, numerical instabilities can arise if many of those dimensions are redundant. Future work will likely need to incorporate Automatic Relevance Determination (ARD) to prune useless input features. Additionally, the current formulation is batch-oriented; developing an online version that updates dynamically as a robot moves remains a logical next step for real-time reinforcement learning.

Summary updated

BibTeX
@inproceedings{ting2008bayesian,
  author = {Jo-Anne Ting and Mrinal Kalakrishnan and Sethu Vijayakumar and Stefan Schaal},
  title = {{Bayesian Kernel Shaping for Learning Control}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2008},
  url = {https://openreview.net/forum?id=BJuRd-OZr},
}
Figure