Bandwidth Selection for Gaussian Kernel Ridge Regression via Jacobian Control

Oskar Allerbo, Rebecka Jörnsten · Submission to ICLR 2024 · Withdrawn

TL;DR

Selecting the Gaussian kernel bandwidth for Kernel Ridge Regression (KRR) usually requires slow, high-variance procedures like cross-validation or marginal likelihood maximization. By deriving an approximation of how the model’s Jacobian (derivatives) behaves, this paper introduces a closed-form, "feather-light" formula to select the optimal bandwidth directly. The resulting heuristic runs over $100{,}000\times$ faster than standard tuning methods while delivering equal or superior generalization stability.

What Problem Does This Paper Address?

In Gaussian Kernel Ridge Regression (KRR), the bandwidth hyperparameter $\sigma$ dictates the kernel's length-scale:

  • Too small $\sigma$: New query points are treated as infinitely far from training samples, causing predictions to abruptly collapse back to default values.
  • Too large $\sigma$: Training points look equidistant, making the kernel matrix near-singular and producing wildly oscillating interpolations.

Practitioners typically tune $\sigma$ via Generalized Cross-Validation (GCV) or Marginal Likelihood Maximization (MML). Both are computationally demanding—requiring multiple matrix inversions scaling as $\mathcal{O}(n^3)$—and frequently suffer from high variance or get trapped in poor local optima when data is limited. Existing closed-form rules (like Silverman’s rule of thumb) were designed for Kernel Density Estimation (KDE) rather than functional regression, ignoring regularization entirely.

Methods

Inspired by Jacobian regularization in deep learning—which penalizes the Frobenius norm of the model's derivatives to enforce smooth functions—the authors analyze the sensitivity of KRR's predictions with respect to its inputs.

  1. Jacobian Bound Decomposition: The gradient norm of the prediction $\|\frac{\partial \hat{f}(x^*)}{\partial x^*}\|_2$ is upper-bounded by the product of two opposing factors: $$J_2^a(\sigma) \propto j_a(\sigma) \cdot j_b(\sigma)$$
  2. $j_a(\sigma) = \frac{1}{\sigma}$: Reflects how rapidly the kernel function decays away from data points.
  3. $j_b(\sigma) \approx \frac{1}{n \exp\left(-\left(\frac{((n-1)^{1/p}-1)\pi\sigma}{2 l_{\max}}\right)^2\right) + \lambda}$: Bounds the spectral norm of $(K + \lambda I)^{-1}$, measuring the ill-conditioning of the kernel matrix ($l_{\max}$ is the maximum distance between training points).
  4. Closed-Form Minimum: When regularization $\lambda \le 2n e^{-3/2} \approx 0.45n$, the approximate Jacobian norm exhibits a local minimum $\sigma_0$ balancing these two forces. Using the principal branch of the Lambert $W$ function ($W_0$), this minimum is given in closed form: $$\sigma_0 = \frac{\sqrt{2}}{\pi} \frac{l_{\max}}{(n-1)^{1/p} - 1} \sqrt{1 - 2 W_0\left(-\frac{\lambda \sqrt{e}}{2n}\right)}$$

  5. Outlier Mitigation: To reduce sensitivity to spatial outliers in $l_{\max}$, the authors formulate a Jacobian median variant where the grid-spacing term $\frac{l_{\max}}{(n-1)^{1/p}-1}$ is replaced by the median nearest-neighbor distance: $\text{Med}_{i=1}^n \left(\min_{j \ne i} \|x_i - x_j\|_2\right)$.

Datasets

The authors evaluated the method across four benchmarks:

  • 2D French Temperature Data: Temperatures across 40 French weather stations at a single timestamp.
  • 1D French Temperature Time Series: 248 temporal readings from Toulouse-Blagnac station across January 2020.
  • Synthetic Cauchy Data: $n$ points drawn from a heavy-tailed $\text{Cauchy}(0, 3)$ distribution with targets $y = \sin(2\pi x) + \varepsilon$ to test outlier robustness.
  • U.K. Daily Rainfall Data: Spatial-temporal rainfall data from 164 monitoring stations across 12 monthly splits (~4,000 observations per month).

Key Insights and Ideas

  • Bandwidth selection as a stability trade-off: Rather than viewing bandwidth solely as a curve-smoothing slider, the Jacobian formulation proves that optimal bandwidth is a tug-of-war between numerical matrix conditioning (preventing extreme derivative spikes from near-singular inversion) and local decay (preventing derivative spikes from falling off a cliff to zero).
  • Invariance to regularization strength: In Equation (6), the term inside the square root strictly ranges between $1$ (at $\lambda = 0$) and $\sqrt{3}$ (at $\lambda \approx 0.45n$). This means the optimal bandwidth is inherently stable across orders-of-magnitude shifts in regularization $\lambda$.
  • Avoiding local optima traps: Marginal likelihood maximization (MML) frequently converges into flat, oversmoothed local minima on real data (e.g., choosing bandwidths hundreds of times larger than optimal). Because the Jacobian metric has an analytical solution, it avoids optimization pitfalls entirely.

Key Results

  • Massive Speedups: On the U.K. rainfall dataset ($n \approx 3{,}400$ training points), bandwidth selection took $0.108\text{ ms}$ for the Jacobian method, compared to $25.4\text{ seconds}$ for GCV and $29.1\text{ seconds}$ for MML—over $10^5\times$ faster.
  • Higher Predictive Accuracy: On the same U.K. rainfall benchmark, the Jacobian method achieved an $R^2$ of $0.981$, significantly outperforming GCV ($0.969$), Silverman's rule ($0.971$), and MML ($0.554$, which failed due to local minima).
  • Reduced Resampling Variance: In jackknife resampling on the 2D temperature dataset, the standard deviation of the selected bandwidth was $5\text{ km}$ for the Jacobian method versus $328\text{ km}$ for GCV.

Limitations and Future Work

  • Kernel Specificity: The current derivation is strictly tailored to the Gaussian/RBF kernel. Applying Jacobian control to Matérn, polynomial, or neural tangent kernels requires deriving new matrix-norm bounds.
  • Inverse Kernel Matrix Bounds: The spectral bound on $(K + \lambda I)^{-1}$ relies on idealized spatial regularities; tighter analytical bounds could improve precision in complex geometries.
  • High-Dimensional Geometry: While the median nearest-neighbor heuristic mitigates outliers, the volume scaling $(n-1)^{1/p}$ faces the curse of dimensionality in very high-dimensional feature spaces ($p \gg 1$).

Summary updated

BibTeX
@misc{allerbo2022bandwidth,
  author = {Oskar Allerbo and Rebecka Jörnsten},
  title = {{Bandwidth Selection for Gaussian Kernel Ridge Regression via Jacobian Control}},
  year = {2022},
  eprint = {2205.11956},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2205.11956},
}
Figure