NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Model Agnostic Sample Reweighting for Out-of-Distribution Learning

Xiao Zhou, Yong Lin, Renjie Pi, Weizhong Zhang, Renzhe Xu, Peng Cui, Tong Zhang

Introduction

MAPLE (Model Agnostic samPLe rEweighting) is a novel bilevel optimization framework designed to help large neural networks ignore "spurious correlations" and generalize to new data distributions. By shifting the optimization focus from millions of model parameters to a much smaller set of sample weights, MAPLE prevents the overfitting that plagues traditional robust learning methods.

The Problem: Spurious Correlations and Overfitting

Machine learning models are notoriously "lazy." If a dataset contains a shortcut—like most cows appearing on green grass—a model will learn to associate "grass" with "cow" rather than learning the actual features of the animal. This is known as a spurious correlation. When that model is tested on a "cow in a desert," it fails.

Existing techniques like Invariant Risk Minimization (IRM) and Distributionally Robust Optimization (DRO) were designed to fix this. However, they have a major flaw: they don't scale well to modern, overparameterized deep neural networks. Because these models have millions of parameters, they can easily "cheat" during training—minimizing the robust regularization terms while still relying on spurious features. This leads to poor Out-of-Distribution (OOD) generalization.

The Solution: MAPLE

The authors propose MAPLE, which tackles the problem through a two-tier (bilevel) optimization process:

  1. The Inner Loop: The model is trained using standard Empirical Risk Minimization (ERM) on the training data, but each sample is assigned a weight ($w$).
  2. The Outer Loop: The model’s performance is evaluated on a separate validation set using an OOD criterion (like an IRM or DRO loss). The sample weights are then updated to minimize this OOD risk.

The core innovation is moving the search for robustness from the massive parameter space of the neural network to the much smaller sample weight space. Since the number of weights is equal to the number of training samples (e.g., 50,000 for CIFAR-10), it acts as a natural bottleneck that prevents the model from overfitting to spurious patterns.

To further improve efficiency and filter out noisy data, the authors also introduced a sparsity constraint on the weights, effectively allowing the algorithm to "ignore" unhelpful training samples entirely.

Illustration of how reweighting and sparsity rotate a decision boundary to ignore spurious features and focus on core features.

Key Insights and Capabilities

  • Complexity Bottleneck: The paper proves theoretically that MAPLE’s generalization ability depends on the complexity of the weight space, not the size of the neural network. This explains why it remains effective even as models get larger.
  • Model Agnosticism: One of the most striking findings is that sample weights are transferable. Weights learned using a smaller ResNet-18 model can be successfully applied to train a much larger ResNet-50 on the same task.
  • Automatic Group Discovery: In experiments on the CelebA dataset, MAPLE automatically identified and upweighted rare groups (like blond-haired men) to balance the distribution, despite never being given explicit group annotations.

Results and Performance

The researchers evaluated MAPLE on a mix of synthetic (ColoredMNIST, ColoredObject, CIFARMNIST) and real-world benchmarks (Waterbirds, CelebA). Notably, for the DRO tasks, MAPLE was tested in a "blind" setting where it did not have access to group labels (e.g., it wasn't told which images were "blond men") during training, making the task significantly harder.

MAPLE consistently outperformed state-of-the-art (SOTA) methods across the board:

  • Scaling Robustness: On ColoredMNIST, as the model size increased, traditional IRM performance dropped significantly due to overfitting. MAPLE, however, maintained high accuracy, closely approaching the "Oracle" (a model trained on perfect, non-spurious data).
Comparison of MAPLE against SOTA methods on ColoredMNIST across different model sizes, showing MAPLE's stability.
  • Beating the Oracle: On the Waterbirds dataset, MAPLE achieved a 91.7% worst-group accuracy. This actually surpassed GroupDRO (91.4%), a method that is usually considered an upper bound because it requires manual group labels that MAPLE does not use.
  • Massive Gains: On the challenging CIFARMNIST dataset, MAPLE outperformed vanilla IRM by more than 30%.

Limitations and Future Work

While MAPLE shows great promise, the authors note a few areas for further exploration. The current study focuses primarily on computer vision; its effectiveness in Natural Language Processing (NLP), particularly with massive pre-trained transformers, remains to be seen.

Additionally, bilevel optimization is more computationally intensive than standard training. While the authors' sparsity constraints help, scaling this to billion-parameter models will require further optimization. Future work will also involve testing MAPLE on even more diverse and "messy" real-world OOD benchmarks.

Summary updated

BibTeX
@inproceedings{zhou2022model,
  author = {Xiao Zhou and Yong Lin and Renjie Pi and Weizhong Zhang and Renzhe Xu and Peng Cui and Tong Zhang},
  title = {{Model Agnostic Sample Reweighting for Out-of-Distribution Learning}},
  booktitle = {International Conference on Machine Learning},
  year = {2022},
  url = {https://openreview.net/forum?id=cNt4OI012BC},
}
Figure