Bayesian Deep Learning (BDL) often relies on "tempering" the posterior distribution to achieve state-of-the-art performance. This phenomenon, known as the Cold Posterior Effect (CPE), involves raising the likelihood to a power $\beta > 1$, effectively sharpening the distribution. While empirically successful, finding the optimal temperature usually requires exhaustive and computationally expensive grid searches. This paper proposes a fast, data-driven method to automatically optimize the temperature parameter, significantly reducing the overhead of Bayesian inference in deep models.
The Cold Posterior Problem
In standard Bayesian inference, the posterior is defined with an inverse temperature $\beta=1$. However, in deep learning, practitioners frequently find that "colder" posteriors ($\beta > 1$) yield superior predictive performance. The root cause of this effect remains a subject of debate, but its practical implication is clear: the standard posterior is often suboptimal for prediction.
Currently, the standard approach to find the best $\beta$ is grid search. This involves running multiple full Bayesian sampling processes (e.g., SGMCMC) for various temperature values and selecting the one that performs best on a validation set. For large-scale neural networks, this process is computationally prohibitive.
Methodology: Joint Optimization of Weights and Temperature
The authors introduce a method to select the optimal inverse temperature $\beta$ directly from the data by treating it as a learnable model parameter.
- The Tempered Model: The likelihood function is modified to incorporate $\beta$ directly (e.g., by scaling variance in regression or using a tempered softmax in classification).
- Joint Optimization: Instead of post-hoc tuning, the weights $\theta$ and the inverse temperature $\beta$ are optimized simultaneously using Stochastic Gradient Descent (SGD) on the training data, with performance monitored on a validation set. This single optimization run identifies a candidate $\beta$ before the more expensive Bayesian sampling begins.
- Theoretical Foundation: Using Singular Learning Theory (SLT), the authors provide an asymptotic expansion of the predictive density. They demonstrate that for "singular" models like neural networks, the optimal temperature for prediction is rarely 1, even in well-specified scenarios.
Experimental Evaluation
The proposed method was evaluated on standard regression (UCI datasets) and classification (MNIST, CIFAR-10) benchmarks.
Key Findings
- Efficiency: The automated selection process is 4x to 8x faster than grid search, as it avoids multiple sampling runs.
- Predictive Performance: The automatically selected temperature ($\beta = \hat{\beta}^*$) consistently matched or nearly matched the performance of the best temperature found via exhaustive grid search.
- Adaptability: The method successfully adapts to changes in training conditions, such as varying strengths of data augmentation, which is known to shift the optimal temperature.
Discussion and Limitations
While the method offers a significant speedup, its success depends on the stability of the initial SGD optimization. Poor convergence during the joint optimization phase can lead to suboptimal temperature selection. Furthermore, while the theoretical framework is robust for linear models, extending formal guarantees to deep, non-linear architectures remains an area for future research.
By automating temperature selection, this work moves BDL closer to being a "plug-and-play" technology, removing one of the primary manual tuning hurdles for practitioners.
Summary updated