Skip to main content
QUICK REVIEW

[Paper Review] Diverse Weight Averaging for Out-of-Distribution Generalization

Alexandre Ramé, Matthieu Kirchmeyer|arXiv (Cornell University)|May 19, 2022
Domain Adaptation and Few-Shot LearningComputer Science9 citations
TL;DR

This paper proposes Diverse Weight Averaging (DiWA), a novel weight averaging method that improves out-of-distribution (OOD) generalization by averaging weights from multiple independently trained models sharing a common initialization. DiWA enhances functional diversity, leading to state-of-the-art performance on the DomainBed benchmark without inference overhead, particularly under diversity shift (covariate shift), as validated through a new bias-variance-covariance-locality error decomposition.

ABSTRACT

Standard neural networks struggle to generalize under distribution shifts in computer vision. Fortunately, combining multiple networks can consistently improve out-of-distribution generalization. In particular, weight averaging (WA) strategies were shown to perform best on the competitive DomainBed benchmark; they directly average the weights of multiple networks despite their nonlinearities. In this paper, we propose Diverse Weight Averaging (DiWA), a new WA strategy whose main motivation is to increase the functional diversity across averaged models. To this end, DiWA averages weights obtained from several independent training runs: indeed, models obtained from different runs are more diverse than those collected along a single run thanks to differences in hyperparameters and training procedures. We motivate the need for diversity by a new bias-variance-covariance-locality decomposition of the expected error, exploiting similarities between WA and standard functional ensembling. Moreover, this decomposition highlights that WA succeeds when the variance term dominates, which we show occurs when the marginal distribution changes at test time. Experimentally, DiWA consistently improves the state of the art on DomainBed without inference overhead.

Motivation & Objective

  • To improve out-of-distribution generalization in vision models under distribution shifts, especially covariate shift.
  • To address the limitations of existing weight averaging (WA) methods that do not explicitly promote model diversity.
  • To provide a theoretical foundation for WA's success in OOD generalization using a bias-variance-covariance-locality decomposition.
  • To empirically validate that increased diversity among averaged models leads to better OOD performance.
  • To establish DiWA as a strong, inference-efficient alternative to existing domain generalization methods.

Proposed method

  • DiWA averages model weights from multiple independent training runs initialized from the same seed, increasing functional diversity.
  • The method leverages linear mode connectivity in weight space, which is empirically validated when models start from a shared pretrained initialization.
  • A theoretical decomposition of expected error into bias, variance, covariance, and locality terms is used to justify the approach.
  • The variance term increases under marginal distribution shift (diversity shift), and DiWA enhances this term by increasing model diversity.
  • The approach avoids retraining or architectural changes, relying solely on weight averaging post-training.
  • DiWA is applied to models trained on multiple domains in the DomainBed benchmark, with no additional inference cost.

Experimental results

Research questions

  • RQ1Why does weight averaging improve out-of-distribution generalization, and under what distribution shifts is it most effective?
  • RQ2How does model diversity influence the performance of weight-averaged models in OOD settings?
  • RQ3Can a theoretical decomposition of error into bias, variance, covariance, and locality terms explain the success of WA?
  • RQ4Does averaging models from independent training runs (with shared initialization) lead to better OOD generalization than averaging along a single training trajectory?
  • RQ5How does DiWA compare to state-of-the-art domain generalization methods like IRM and Fishr under different types of distribution shifts?

Key findings

  • DiWA achieves state-of-the-art performance on all real-world datasets in the DomainBed benchmark without any inference overhead.
  • On the ColoredMNIST dataset, DiWA-uniform and DiWA-restricted outperform ERM and MA under diversity shift, with DiWA-restricted achieving 55.7% accuracy under test-domain model selection.
  • Under correlation shift (e.g., ColoredMNIST with spurious correlations), WA does not improve performance, confirming that DiWA is effective primarily under diversity shift.
  • DiWA consistently improves OOD generalization across all DomainBed datasets, especially when models are selected from diverse training runs.
  • When last-layer retraining is applied on target domain data (e.g., Office-Home), DiWA-based feature extractors outperform ERM-based ones, achieving 78.1% accuracy with 80% target data.
  • The theoretical decomposition shows that WA succeeds when variance dominates, which occurs under marginal distribution shifts (diversity shift), validating the core design of DiWA.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.