Digitala Vetenskapliga Arkivet

Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
Improving the Laplace Posterior Approximation via Sharpness-Aware Minimization
KTH, School of Electrical Engineering and Computer Science (EECS).
2025 (English)Independent thesis Advanced level (degree of Master (Two Years)), 20 credits / 30 HE creditsStudent thesisAlternative title
Förbättring av Laplace Posterior Approximation med hjälp av skarphetsmedveten minimering (Swedish)
Abstract [en]

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.

Abstract [sv]

Artificiell intelligens och maskininlärning blir allt viktigare i samhället, men många AI-system kan inte uttrycka hur säkra de är på sina förutsägelser eller är okalibrerade - det vill säga, när systemet säger att det är 80% säkert, har det inte faktiskt rätt ungefär 80% av gångerna. Detta är problematiskt inom kritiska områden som sjukvård eller autonoma fordon, där osäkerhet måste kommuniceras tydligt. En metod som kallas Laplace-approximationen kan omvandla vanliga neurala nätverk till så kallade Bayesianska nätverk som kan ge osäkerhetsestimat, men tekniken har begränsningar när träningsprocessen resulterar i mycket ”skarpa” lösningar. Denna avhandling undersöker om en nyare träningsmetod som kallas ”skärpmedveten minimering” kan förbättra kvaliteten på dessa osäkerhetsestimat. Genom att träna fyra olika AI-modeller (inom både datorseende och språkbehandling) med både traditionella och nya träningsmetoder, kunde jämföras hur väl de olika metoderna uppskattar osäkerhet. Resultaten visar lovande trender: den nya träningsmetoden producerade generellt lite bättre kalibrerade osäkerhetsestimat. Detta gällde både för data som liknade träningsdata och för något annorlunda data. Dock var resultaten mer blandade när AI-systemet ställdes inför nya typer av data som det aldrig sett förut. Resultaten visar på intressanta trender, men den stora variationen mellan experimenten gör att slutsatserna måste dras försiktigt. Även om samma mönster återkom över flera olika modeller och uppgifter, krävs ytterligare forskning för att bekräfta om skärpmedveten träning verkligen kan bli en pålitlig metod för att förbättra AI-systems förmåga att kommunicera osäkerhet.

Place, publisher, year, edition, pages
2025. , p. 113
Series
TRITA-EECS-EX ; 2025:460
Keywords [en]
Deep Learning, Supervised Learning, Calibration, Uncertainty, Sharpness-Aware Minimization, Laplace Approximation
Keywords [sv]
Djupinlärning, Övervakad inlärning, Kalibrering, Osäkerhet, Skärpmedveten minimering, Laplace-approximation
National Category
Computer and Information Sciences
Identifiers
URN: urn:nbn:se:kth:diva-368027OAI: oai:DiVA.org:kth-368027DiVA, id: diva2:1986685
Supervisors
Examiners
Available from: 2025-08-10 Created: 2025-08-01 Last updated: 2025-08-10Bibliographically approved

Open Access in DiVA

fulltext(1908 kB)275 downloads
File information
File name FULLTEXT01.pdfFile size 1908 kBChecksum SHA-512
a7af6aa04542f4e6517ef93c86fde7d1f5a094c74fae2948b3f6b0e40e9b28ecdd6132c1be993da8789558d1f22581c66a24c1dbd12f86441a4a3a9b41192a3a
Type fulltextMimetype application/pdf

By organisation
School of Electrical Engineering and Computer Science (EECS)
Computer and Information Sciences

Search outside of DiVA

GoogleGoogle Scholar
Total: 279 downloads
The number of downloads is the sum of all downloads of full texts. It may include eg previous versions that are now no longer available

urn-nbn

Altmetric score

urn-nbn
Total: 817 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf