Introduction
Out-of-Distribution (OOD) generalization remains a significant hurdle for machine learning models, which typically assume that training and test data are independent and identically distributed (IID). In real-world scenarios, this assumption often fails due to spurious correlations or "shortcuts" that do not persist across different environments. Stable learning algorithms attempt to mitigate this by reweighting training samples to decorrelate variables, focusing the model on stable, causal features.
However, sample reweighting often introduces a "variance inflation" problem. By reducing the effective sample size, these methods can make model parameters highly sensitive to training data fluctuations, leading to unstable predictions. This paper introduces SAmple Weight Averaging (SAWA), a bagging-inspired strategy that averages sample weights from multiple random initializations to enhance stability and accuracy without requiring environment labels or excessive computation.
Methodology: SAmple Weight Averaging (SAWA)
SAWA is designed as a universal "plug-in" for existing independence-based reweighting schemes such as Decorrelated Weighting Regression (DWR) or Sample Reweighting for Deep OOD (SRDO). The process follows a straightforward three-step pipeline:
- Multiple Starts: Execute a weight-learning algorithm $K$ times, each with a different random parameter initialization.
- Weight Generation: Obtain $K$ unique sets of sample weights.
- Averaging: Compute the final set of weights by directly averaging the $K$ sets.
Unlike traditional model ensembling which averages predictions or parameters, SAWA averages at the weight level. This approach leverages the overparameterization of weight-learning models (like MLPs) to cancel out estimation noise from different local minima.
Theoretical and Empirical Insights
The effectiveness of SAWA is rooted in several key observations:
- Convexity of Weights: The authors demonstrate that for common weight-learning objectives, the set of valid solutions is convex. Thus, the average of multiple valid weightings remains a valid weighting.
- Bias-Variance Trade-off: SAWA significantly reduces the variance of parameter estimation while maintaining low bias. This addresses the primary drawback of vanilla reweighting methods, which often trade stability for increased estimation error.
- Diversity of Initializations: Averaging weights from different initializations is found to be more effective than a moving average from a single trajectory, as it explores more diverse regions of the weight space.
Experimental Evaluation
The authors evaluated SAWA across synthetic datasets with controlled bias and collinearity, as well as real-world benchmarks including House Price Prediction, UCI Adult Income, Colored MNIST, and ACS PUMS.
Key Results
- Consistency and Stability: SAWA-enhanced methods consistently outperformed vanilla counterparts in Mean Error and Standard Deviation across all synthetic scenarios. In real-world tasks, it notably reduced "Max_Error" across environments, indicating improved worst-case reliability.
- Ensemble Efficiency: The benefits of averaging were found to plateau at approximately $K=10$, suggesting that substantial stability gains are achievable with manageable computational overhead.
- Computational Scalability: Because the $K$ weight-learning runs are independent, SAWA is inherently parallelizable, making it suitable for large-scale applications compared to iterative stability methods.
Conclusion and Future Work
SAWA provides a simple yet effective wrapper to stabilize OOD generalization. While it requires additional memory and initial computation for the $K$ runs, its parallel nature and significant variance reduction make it a compelling tool for robust machine learning. Future research may explore its application to massive transformer architectures and more complex computer vision tasks where weight learning is inherently more difficult.
Summary updated