Amortized Conditional Normalized Maximum Likelihood

Aurick Zhou, Sergey Levine

Abstract

Deep neural networks (DNNs) are frequently overconfident when encountering out-of-distribution (OOD) data, posing significant risks in safety-critical applications. Conditional Normalized Maximum Likelihood (CNML) provides a theoretically grounded, minimax optimal framework for uncertainty estimation but is computationally intractable for large-scale models. We introduce Amortized Conditional Normalized Maximum Likelihood (ACNML), a scalable method that approximates CNML by leveraging approximate Bayesian posteriors and efficient test-time optimization. ACNML significantly improves calibration and robustness to distribution shifts while remaining computationally feasible for deep learning pipelines.

Introduction

Standard deep learning models often fail to signal when they are "uncertain." When presented with inputs far from the training distribution—such as rare medical conditions or extreme weather in autonomous driving—these models often assign high-confidence scores to incorrect predictions. While Bayesian inference offers a path toward better uncertainty quantification, its application to deep networks often relies on approximations that do not fully mitigate overconfidence.

An alternative approach rooted in the Minimum Description Length (MDL) principle is Conditional Normalized Maximum Likelihood (CNML). CNML is designed to minimize the worst-case "surprise" by considering how the model would adapt if it were retrained on a new test point with every possible label.

The Challenge of CNML

The primary obstacle to adopting CNML is its computational complexity. To make a single prediction, the model must theoretically be retrained for every potential class label of the new input. For modern neural networks, this "naive" retraining is impossible for real-time inference.

The CNML principle: the decision boundary shifts based on the hypothesized label of a new test point compared to the original training parameters.

Amortized CNML (ACNML)

ACNML bridges the gap between theoretical optimality and practical scalability through "amortization." The method consists of three key components:

  1. Posterior Summarization: Instead of the full training set, ACNML uses an approximate Bayesian posterior (e.g., via SWAG or KFAC-Laplace) to represent the learned knowledge.
  2. Test-Time Optimization: For each new test point, ACNML performs a rapid optimization (typically 5-10 gradient steps) using the pre-computed posterior as a regularizer.
  3. Theoretical Approximation: The authors demonstrate that for large datasets, a second-order (Gaussian) approximation of the training loss is sufficient to predict model changes, effectively using influence functions to approximate the retraining process.
The effect of the regularization parameter λ on ACNML's predictive uncertainty. Increasing λ results in more conservative decision boundaries and broader uncertainty regions.

Experimental Evaluation

The performance of ACNML was evaluated on benchmarks designed to test robustness under distribution shift, including Rotated MNIST and CIFAR-10-Corrupted.

Key Findings

  • Superior Calibration: ACNML variants achieved significantly lower Expected Calibration Error (ECE) compared to Maximum A Posteriori (MAP) or standard Bayesian Model Averaging, particularly as data corruption levels increased.
  • Better "Honesty": Reliability diagrams indicated that ACNML is more "honest"; its confidence levels align closely with its actual accuracy. Unlike standard models that remain 90% confident even when accuracy drops to 40%, ACNML correctly identifies its own limitations.
  • Massive Speedup: By avoiding full retraining, ACNML provides a massive speedup—hundreds of times faster than naive CNML—making it a viable candidate for real-world deployment.

Conclusion

ACNML offers a practical path toward more reliable and "honest" neural networks. By approximating the minimax optimal CNML scheme, it provides a conservative yet scalable approach to uncertainty. While it introduces a small amount of computational overhead at test time compared to a standard forward pass, the gains in safety and calibration make it a compelling choice for high-stakes machine learning applications. Future work will focus on further reducing test-time latency and exploring non-Gaussian posterior approximations.

Summary updated

BibTeX
@misc{zhou2020amortized,
  author = {Aurick Zhou and Sergey Levine},
  title = {{Amortized Conditional Normalized Maximum Likelihood}},
  year = {2020},
  eprint = {2011.02696},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2011.02696},
}
Figure