TL;DR
When machine learning models fail on rare subgroups—like mistaking a waterbird for a landbird just because it’s standing in a forest—the standard fix is to collect a perfectly balanced dataset. This paper proves that perfect 50/50 balance isn't actually unique in its optimality; plenty of imbalanced data mixes work just as well. Better yet, the authors derive a mathematical compass that tells you which data subgroups to collect next, getting you to robust performance faster and cheaper than naive balancing.
What Problem Does This Paper Address?
Real-world datasets are naturally skewed. Benign skin lesions vastly outnumber malignant ones; waterbirds are usually photographed on water, not land. When a model trains on skewed data, it takes lazy shortcuts (spurious correlations) and fails when subgroup proportions change at test time—a challenge known as subpopulation shift.
The gold-standard data-centric fix is to make every subgroup equally represented. Practically, though, hunting down rare edge cases to achieve full balance is expensive or flat-out impossible. The authors ask two fundamental questions: Is a perfectly balanced dataset the only way to get peak generalization? And if you have a limited budget to collect or resample data, is marching straight toward equal proportions always the most efficient route?
Methods
To map out how subgroup proportions affect test accuracy without training millions of neural networks, the authors extend an idealized Gaussian feature model. They represent inputs as vectors made of an invariant feature (which always matches the true label) and spurious features (which only correlate with the label). Each subgroup forms a Gaussian cluster in feature space, and the "separability" of each feature—how easy it is to tell apart—is measured via Mahalanobis distance.
While prior work only solved this setup for symmetric, neat distributions, the authors generalize the math to arbitrary subgroup mixes. Focusing on binary labels and attributes (four subgroups total, which conveniently map into a 3D pyramid, or 3-simplex), they solve for the Bayesian optimal linear classifier and write its Adjusted Accuracy (the average accuracy across all subgroups) as a smooth, differentiable function of the training proportions.
Because this accuracy landscape is differentiable, you can take its gradient! This yields Grad: an analytical vector pointing in the exact direction you should tweak your subgroup proportions for the steepest jump in test accuracy. Because estimating feature separability on real, messy data can be noisy, they also introduce Sign, a ruggedized variant that only uses the + or - signs of the gradient entries.
Datasets
To test whether insights from clean Gaussian math survive contact with deep neural networks (ResNet50 for vision, BERT for text), the authors evaluate across four benchmarks:
- Waterbirds-syn & UrbanCars-syn: Flexible synthetic variants of standard vision benchmarks (Waterbirds and UrbanCars), built by stitching foreground objects onto backgrounds so the authors can dial subgroup proportions to any setting on their 343-point test grid.
- CelebA-subset & CivilComments-subset: Custom-sampled subsets of the CelebA (face attributes) and CivilComments (toxic text) datasets, alongside the original Waterbirds and CelebA splits for downstream retraining tests.
Key Insights and Ideas
- Balance is a plateau, not a lonely peak: Perfectly balanced data sits in a broader neighborhood of high-performing configurations. Many substantially imbalanced mixes achieve virtually identical—and occasionally slightly higher—test accuracy.
- Balancing isn't always the shortest shortcut: Near the edges of the configuration space (highly skewed datasets), the steepest path to better accuracy (Grad) diverges sharply from the path toward the center (Bal). Instead of rigidly filling every minority bucket equally, Strategic allocation prioritizes whichever signal breaks the model's current blind spot fastest.
- Idealized theory transfers to deep features: Even though ResNet and BERT features aren't strictly Gaussian, you only need to estimate basic feature separability once to steer data collection effectively.
Key Results
- Faster budget efficiency: Across 5 to 25 steps of simulated data collection under a fixed budget, following Grad consistently climbed in Adjusted Accuracy faster than Bal or random allocation across all four datasets when starting from divergent configurations.
- Smarter resampling: Using Grad to pick an imbalanced target distribution for standard resampling on Waterbirds-syn beat vanilla balanced resampling. For over-sampling, Worst-Group Accuracy (WGA) jumped from 36.6% (balanced target) to 54.1% (Grad target). For under-sampling, Adjusted Accuracy rose from 77.7% to 90.1% (with WGA ticking up from 83.7% to 84.8%) because the imbalanced target discarded less original data.
- Plug-and-play with robust retraining: State-of-the-art last-layer retraining methods (DFR, SELF, GSR, AFR) usually demand a strictly balanced held-out validation set. Swapping that balanced set for an imbalanced Grad allocation of the same total size preserved performance across the board, and even boosted AFR's worst-group accuracy from 80.74% to 83.84% on CelebA.
Limitations and Future Work
- Noisy separability estimates: Calculating Grad requires estimating how separable features are in real data, which can get shaky under noisy labels or unstable training—though the Sign variant helps cushion this blow.
- Scaling to many attributes: While the math generalizes to $N$ attributes ($2^N$ subgroups), the chain-rule derivatives explode in complexity as subgroups multiply, keeping the main analysis focused on two attributes.
- Surrogate objective: Because Worst-Group Accuracy uses a non-smooth
minoperator (its derivative breaks whenever the "worst" group changes), the global theory optimizes Adjusted Accuracy instead. Empirically this lifts WGA too, but proving a general theoretical link between the two remains an open problem.
Summary updated