Work

Förbättring av Laplace Posterior Approximation med hjälp av skarphetsmedveten minimering

Year: 2025
Type: dissertation
Abstract: The Laplace Approximation (LA) transforms neural networks with maximum a posteriori estimates (MAP) into Bayesian Neural Networks through quadratic approximation of the posterior distribution. However, a very sharp minimum could turn its uncertainty estimates into a point estimate in the extreme case, as its covariance directly relates to the sharpness of the loss landscape. Recently, various optimizers like Sharpness-Aware Minimization (SAM) have been proposed that can find flatter minima than standard optimizers such as SGD or AdamW. This thesis investigates whether sharpness-aware training can improve the uncertainty estimates produced by the Laplace Approximation. Four different model architectures (ResNet18, ViT-B/16, BERT and DistilRoBERTa) were trained with traditional and sharpness-aware optimizers on various datasets from Computer Vision and NLP. Due to computational limitations, a Last Layer LA was applied for evaluation. This variant of the LA treats only the weights of the last layer probabilistically, while keeping the MAP estimate of all other weights. For both domains, a consistent trend was found that uncertainty estimates produced by SAM+LA are better calibrated on in-distribution and shift data than those produced by SGD+LA or AdamW+LA. This observation was based on the mean Expected Calibration Error and related calibration metrics. The ViT-B/16 models, however, were an exception, and sharpness-aware training did not improve the Laplace Approximation in that case. Furthermore, the standard deviation was relatively high throughout the experiments, questioning the statistical significance of the results. Uncertainty estimates produced by SAM+LA are significantly closer to the categorical distribution from label samples than those produced by SGD+LA. However, the effect size of that finding was low (around 0.1). The out-of-distribution results are mixed: For the vision domain, SAM+LA sometimes performed worse and sometimes better than AdamW+LA or SGD+LA, depending on metric, dataset, and model architecture. SAM+LA, however, clearly worsened the out-of-distribution detection performance for BERT and, to a lesser extent, DistilRoBERTa compared to AdamW+LA. Overall, although the standard deviation was high, the results across different models and tasks showed the same trend, favoring SAM+LA. This suggests that sharpness-aware training could be a useful way to improve uncertainty estimates using the Laplace Approximation. Further investigations are necessary, such as applying the LA to all weights.
Author: Deckenbach, Katharina
Language: English
Open Access status: green
OpenAlex ID: W7047471083
Cites: 66
Cited by:
Related to: 10