Manuscript Offprint

arXiv:2611.12884

Guiding Data Allocation for Robust Subpopulation Generalization

Zhaoying Pan, Yipei Wang, Shenyu Lu, Xiaoqian Wang

Abstract

Machine learning models often achieve high average accuracy in the training data while performing poorly on test data due to subpopulation shift. A common data-centric solution is to enforce balanced subgroup proportions, but full balance can be costly, infeasible, and not always necessary. In this work, we study whether balanced training data is the unique optimal configuration for robust subpopulation generalization. We extend a Gaussian feature-model framework to theoretically characterize the performance landscape across general training subgroup distributions. We show that multiple configurations, including substantially imbalanced ones, can perform comparably to the balanced one. We further derive gradient-based directions for adjusting subgroup proportions to improve adjusted accuracy and worst-group accuracy more efficiently. These findings suggest that strategically allocating data offers a more flexible and principled path to robust performance than simple balancing. The code is available at https://github.com/zhaoyingpan/subpop-data-allocation.

1 Introduction

Machine learning models trained on data with imbalanced subgroup distributions often achieve high overall test performance but suffer from performance disparities in subgroups [11, 21, 38] or favor the majority groups [13, 18, 50]. This challenge has been widely studied under topics such as spurious correlation [2, 41, 11], fairness [12, 19, 31], and class imbalance [23, 27, 6] in machine learning, where the goal is to ensure robust generalization across subgroups or to improve the performance on the worst-performing group. One common framework to encompass the above studies is the subpopulation shift [21, 47], which refers to discrepancies between the subgroup proportions in the training and test data. In many cases, the evaluation focuses on the worst-group performance [40] or the overall performance on balanced test data [47], where models trained and evaluated on data with subpopulation shifts are likely to fail [21].

A widely acknowledged strategy to ensure generalization against subpopulation shifts is to use fully balanced data to allow the models to be trained sufficiently on each subgroup to avoid potential bias towards specific groups [40, 16, 7]. However, collecting fully balanced data is often prohibitively expensive or infeasible in real-world settings [21]. Many real-world datasets are inherently imbalanced [21]. The Waterbirds dataset [40], designed to classify bird species, exhibits a strong correlation between the bird species and backgrounds (e.g. waterbirds appear more often in water backgrounds rather than land). Or in skin cancer diagnosis, benign cases greatly predominate over the malignant ones among all data [5, 46]. Therefore, attempting to balance the datasets might require significant efforts and costs.

Motivated by the challenges of balancing subgroups, we ask a fundamental question (Optimality): Is fully balanced data the only optimal configuration of training data for robust generalization under

†Corresponding author.

40th Conference on Neural Information Processing Systems (NeurIPS 2026).

Figure

Figure

(a) Optimal Accuracy. (b) Projection of Group Sizes to Coordinates in 3-simplex. (c) Estimated Directions.

Figure 1: (a) Test accuracy varies over diverse training data configurations and many match or exceed the performance of the balanced configuration. (b) Data configurations visualized by projecting group sizes onto a 3-simplex, including the configurations for the balanced (center), the highly skewed (vertex), and a random configuration (unique coordinate). (c) Visualization of directions estimated according to the gradients (Grad) and balancing (Bal) towards the center.

subpopulation shifts? We show the accuracy obtained from diverse configurations with variants of Waterbirds in Figure 1 (a), where we find that many configurations for the training subgroup distribution can achieve test accuracy comparable to or even exceeding that of perfectly balanced training data. Building on this fact, we ask whether it is always most efficient to improve the data towards full balance, or whether there exists a shortcut that does not necessarily lead to balance, as the question of Divergence. Prior work [44] contributed theoretical solutions to the test accuracy when models are trained on data with spurious correlation. Following the framework proposed by [44], we examine the test accuracy and use the derivative of the theoretical test accuracy, which characterizes the direction that yields the greatest performance improvement. Considering the direction towards balanced subgroups as an oracle direction, we compare their similarity and find that many training configurations yield a different derived direction. This observation reveals that the derived directions might offer new paths other than balancing direction towards robust performance and suggests the potential of strategically adjusting the data distribution for better robustness (Efficiency). In practice, this can guide data collection with principled allocation strategies to ensure the robustness of downstream model training.

To validate our findings, we conducted a series of controlled experiments on synthetic and standard datasets, covering images and text. We varied the training data configurations systematically to compare the directions by measuring performance gains obtained along different directions, which shows the advantage of the derived directions on specific configurations and validates the Divergence question. Secondly, for those training configurations where directions differ, we conducted experiments that allocate data gradually along various directions, to demonstrate the potential application to dataset collection, which corresponds to the answer to Efficiency. Lastly, we confirm the Optimality by showing the existence of multiple configurations that achieve comparable optimal performance across datasets. Collectively, our empirical analysis demonstrates that our theoretical insights consistently apply to practical settings. Moreover, we demonstrate the potential applications of our method by integrating the allocation with resampling and last-layer retraining methods. Our contributions can be summarized as follows:

  1. We characterize the performance landscape by extending a prior Gaussian modeling framework and identify imbalanced configurations that perform comparably to balance.

  2. We derive principled directions for adjusting subgroup configurations to improve robustness more efficiently than enforcing full balance.

  3. We empirically validate our theoretical insights and show the potential in data allocation with extensive experiments.

References (49)

  • Representation invariance and allocation: When subgroup balance matters (opens arXiv in a new tab)
  • Invariant risk minimization (opens arXiv in a new tab)
  • Nuanced metrics for measuring unintended bias with real data for text classification
  • Fairness of deep ensembles: On the interplay between per-group task difficulty and under-representation
  • Class-balanced loss based on effective number of samples
  • Robust learning with progressive data expansion against spurious correlation
  • Bert: Pre-training of deep bidirectional transformers for language understanding
  • Transformers for image recognition at scale
  • Learning models with uniform performance via distributionally robust optimization
  • Shortcut learning in deep neural networks
  • Equality of opportunity in supervised learning
  • Learning from imbalanced data
  • Deep residual learning for image recognition
  • DeBERTa: Decoding-enhanced BERT with Disentangled Attention
  • Simple data balancing achieves competitive worst-group-accuracy
  • On feature learning in the presence of spurious correlations
  • Survey on deep learning with class imbalance
  • Preventing fairness gerrymandering: Auditing and learning for subgroup fairness
  • Last layer re-training is sufficient for robustness to spurious correlations
  • A benchmark of in-the-wild distribution shifts
  • 3d object representations for fine-grained categorization
  • Towards last-layer retraining for group robustness with fewer annotations
  • Let samples speak: Mitigating spurious correlation by exploiting the clusterness of samples
  • A whac-a-mole dilemma: Shortcuts come in multiples where mitigating one amplifies others
  • Focal loss for dense object detection
  • Self-supervised learning is more robust to dataset imbalance
  • Deep learning face attributes in the wild
  • Neural collapse inspired debiased representation learning for min-max fairness
  • A survey on bias and fairness in machine learning
  • The generalization error of random features regression: Precise asymptotics and the double descent curve
  • On the impact of spurious correlation for out-of-distribution detection
  • The generalization error of max-margin linear classifiers: Benign overfitting and high dimensional asymptotics in the overparametrized regime (opens arXiv in a new tab)
  • Understanding the failure modes of out-of-distribution generalization
  • Group-robust sample reweighting for subpopulation shifts via influence functions
  • Simple and fast group robustness by automatic feature reweighting
  • Dataset shift in machine learning
  • Representation matters: Assessing the importance of subgroup allocations in training data
  • Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case generalization
  • An investigation of why overparameterization exacerbates spurious correlations
  • Mind the graph when balancing data for fairness or robustness
  • The caltech-ucsd birds-200-2011 dataset
  • On the effect of key factors in spurious correlation: A theoretical perspective
  • Elastic representation: Mitigating spurious correlations for group robustness (opens arXiv in a new tab)
  • Discover and cure: Concept-aware mitigation of spurious correlation
  • Change is hard: A closer look at subpopulation shift
  • Improving out-of-distribution robustness via selective augmentation
  • Correct-n-contrast: a contrastive approach for improving robustness to spurious correlations
  • Deep long-tailed learning: A survey
  • Neurontune: Towards self-guided spurious bias mitigation