Should We Learn Most Likely Functions or Parameters?

Shikai Qiu, Tim G. J. Rudner, Sanyam Kapoor, Andrew Gordon Wilson

Abstract

In Bayesian machine learning, the standard practice is to perform Maximum A Posteriori (MAP) estimation in parameter space. However, because the mapping from parameters to functions is often non-linear and redundant, the most likely parameters do not necessarily correspond to the most likely function. This paper investigates Function-Space MAP (FS-MAP) estimation as an alternative. While FS-MAP offers desirable properties like parameterization invariance and a preference for flat minima, it introduces "pathological" infinite densities in neural networks. To address this, the authors propose Laplacian-MAP (L-MAP), a scalable objective that regularizes the function's Laplacian to achieve better calibration and robustness in deep learning models.

Introduction

When we train a neural network using standard loss functions like cross-entropy with weight decay ($L_2$ regularization), we are performing Parameter-Space Maximum A Posteriori (PS-MAP) estimation. We are searching for the most likely set of weights $\theta$ given the observed data.

However, a fundamental conceptual gap exists: we care about the behavior of the model (the function) rather than the specific values of the weights. Because neural networks are highly over-parameterized and possess numerous symmetries—such as the ability to permute hidden units or rescale weights without changing the output—many different parameter settings can represent the exact same function. This leads to a "pathology" where the most likely parameters may not represent the most likely functional behavior. This paper explores the implications of shifting our objective from finding the most likely parameters to finding the most likely function.

The Challenge of Function-Space MAP

Moving from parameter space to function space requires a mathematical change of variables. This transformation introduces a Jacobian term into the loss function, which accounts for how the density of parameters translates into the density of functions.

Pathological Infinite Densities

In the context of neural networks, the authors discovered that a direct application of FS-MAP fails. Neural network architectures contain inherent symmetries and redundancies that make the Jacobian singular. This singularity leads to "infinite posterior density," where the optimizer finds degenerate solutions that maximize the density by exploiting these mathematical "cheats" rather than learning useful features. Consequently, standard FS-MAP results in models that fail to generalize.

L-MAP: A Scalable Solution

To overcome these singularities and make function-space estimation viable for modern deep learning, the authors introduce Laplacian Regularized MAP (L-MAP). This approach relies on three key innovations:

  1. Variational Remedy: By adopting a variational perspective and "blurring" the function space slightly, the authors remove the infinite singularities that plague raw FS-MAP.
  2. The Laplacian Trick: The authors demonstrate that a first-order Taylor expansion of the function-space objective is equivalent to regularizing the Laplacian of the function. This provides a principled way to penalize functions that are overly sensitive to parameter perturbations.
  3. Scalable Approximation: Calculating the full Jacobian determinant for a large neural network is computationally prohibitive, requiring $O(P^3)$ complexity. L-MAP avoids this by using a Monte Carlo approach to estimate the Laplacian. This requires only standard forward passes with injected noise, making it feasible for architectures as large as ResNet-50.

Experimental Results

The authors validated L-MAP across a variety of benchmarks, ranging from synthetic regression to large-scale image classification.

UCI Regression and Image Classification

On eight standard UCI regression datasets, L-MAP outperformed standard PS-MAP in 7 out of 8 cases. In image classification tasks using FashionMNIST and CIFAR-10, L-MAP achieved competitive raw accuracy while significantly improving model calibration. For example, on CIFAR-10, L-MAP reduced the Expected Calibration Error (ECE) from 2.5% to 1.4%, indicating that the model's confidence levels were much more representative of its actual accuracy.

Robustness and Generalization

L-MAP demonstrated superior performance under conditions of data shift and label noise. When tested on CIFAR-10.1 (a dataset designed to test robustness to covariate shift), L-MAP maintained higher performance than standard training. Furthermore, visualizations of the loss landscapes confirmed that L-MAP naturally gravitates toward flatter minima, which are empirically associated with better generalization.

Key Insights

  • Parameterization Invariance: FS-MAP is invariant to how the model is "wired." If the internal mathematical structure is changed but the output remains the same, the FS-MAP solution remains stable, unlike PS-MAP.
  • The BMA Disconnect: It is often assumed that FS-MAP is a better approximation of the Bayesian Model Average (BMA) than PS-MAP. The authors show this is not a universal truth; the quality of the approximation depends heavily on the scale and specification of the prior.
  • Preference for Flatness: By regularizing the Laplacian, L-MAP inherently prefers functions that are robust to small changes in parameters, effectively "baking in" a preference for flat regions of the weight space.

Limitations and Future Work

Despite its advantages, L-MAP is sensitive to the choice of the prior; a misspecified prior can lead to underfitting. Additionally, the method requires an "evaluation distribution" to define the function space, and the choice of this distribution (e.g., using an external dataset like KMNIST) can impact results. Finally, while L-MAP is significantly faster than full FS-MAP, the additional forward passes required for the Laplacian estimation make it slightly more computationally expensive than standard SGD. Future research may focus on even more efficient estimators to further close this gap.

Summary updated

BibTeX
@inproceedings{qiu2023should,
  author = {Shikai Qiu and Tim G. J. Rudner and Sanyam Kapoor and Andrew Gordon Wilson},
  title = {{Should We Learn Most Likely Functions or Parameters?}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=9EndFTDiqh},
}
Figure