Group Distributionally Robust Optimization with Flexible Sample Queries

Haomin Bai, Dingzhi Yu, Shuai Li, Haipeng Luo, Lijun Zhang

TL;DR

Training models to perform well across $m$ distinct data groups usually forces an awkward choice: wait to sample from all $m$ groups at once, or process a single sample per step at a snail’s pace. This paper introduces FLEX-GDRO, an algorithm that adapts on the fly to whatever dynamic sampling budget you have at each step. It achieves near-optimal sample efficiency while slashing wall-clock training time by up to 13x compared to single-sample methods.

What Problem Does This Paper Address?

Standard machine learning optimizes for average performance, meaning models often fail on underrepresented subgroups or shifting distributions. Group Distributionally Robust Optimization (GDRO) fixes this by training models to minimize the worst-case loss across $m$ predefined groups.

Existing GDRO algorithms live at two rigid extremes regarding data collection per training round:

  1. All-at-once ($m$ samples): Query one sample from every single group per update. If bandwidth drops or human annotators are busy, the system stalls, introducing latency while waiting for missing groups.
  2. One-by-one ($1$ sample): Query just one group per update. If you suddenly have the capacity to process 10 samples at once, you still have to feed them sequentially—ballooning iteration counts and runtime.

Real-world constraints—like fluctuating mobile-edge bandwidth or varying human review capacity in content moderation—change from moment to moment. The authors formulate Flexible Sample Queries (FSQ), where the environment reveals a time-varying sample budget $r_t \in [m]$ at the start of each round $t$, and the learner chooses which $r_t$ groups to query.

Methods

Following classic literature, the authors cast GDRO as a zero-sum game between two players:

  • The $w$-player (minimizer): Updates model weights $w$ to lower loss. It uses a standard Follow-The-Regularized-Leader (FTRL) algorithm with time-varying step sizes, needing just one unbiased stochastic gradient reused from the other player's queries.
  • The $q$-player (maximizer): Maintains a probability distribution $q$ over the $m$ groups to spotlight whichever group currently has the highest loss.

Because each player’s objective depends on the other’s past moves, both face non-oblivious (adaptive) environments. The $q$-player’s task maps to Prediction with Limited Advice (PLA)—a cousin of multi-armed bandits where you can peek at $r_t$ arms per round.

Since no existing PLA method handles both adaptive adversaries and fluctuating budgets, the authors invent NPLA-EXP3 for the $q$-player:

Algorithm 1: NPLA-EXP3 for the q-player, switching between implicit and active exploration based on sample budget.

NPLA-EXP3 uses a clever hybrid exploration strategy based on $r_t$:

  • When $r_t \ge 2$ (Active Exploration): It spends 1 sample exploiting a group drawn from $q_t$, and spreads the remaining $r_t - 1$ samples uniformly across the other groups, yielding a low-variance, unbiased loss estimator.
  • When $r_t = 1$ (Implicit Exploration): With no spare samples to explore, it falls back on an Implicit-eXploration (IX) estimator—adding a tiny offset to selection probabilities to keep importance weights from exploding, trading a sliver of bias for stability.

Combining NPLA-EXP3 and FTRL yields FLEX-GDRO, an anytime algorithm—meaning you don't need to pre-specify the total number of rounds, and you can stop training whenever you want with a valid solution.

Datasets

No new benchmarks are introduced, though a custom synthetic setup is used alongside three established datasets (all training linear classifiers, using frozen DistilBERT features for text):

  • Synthetic binary classification dataset ($m = 20$ groups; plus $m \in \{50, 100, 200\}$ for variance checks).
  • Diabetes ($m = 12$ groups): A multi-class tabular clinical dataset.
  • CivilComments-WILDS ($m = 16$ groups): An online text toxicity moderation benchmark.
  • FEMNIST ($m = 100$ writer groups): A federated handwritten character dataset.

Key Insights and Ideas

  • Total sample count is invariant to batching: Whether you query 1 sample, $m$ samples, or anything in between ($r \in [m]$), FLEX-GDRO requires the exact same near-optimal total number of samples—$O(m \log(m)/\epsilon^2)$—to reach an $\epsilon$-accurate model. Bigger per-round budgets simply get you there in proportionally fewer rounds!
  • Beating the $O(\log t)$ anytime tax: Previous anytime GDRO methods used Stochastic Mirror Descent, which accumulates step-size harmonic series into an extra $O(\log t)$ error penalty. Switching both players to FTRL shaves off this logarithmic drag.
  • First high-probability bound for non-oblivious PLA: NPLA-EXP3 achieves a regret bound matching the best expected regret against simpler, oblivious adversaries—a neat theoretical contribution to bandit literature on its own.

Key Results

  • Major wall-clock speedups under dynamic budgets: When $r_t$ is sampled uniformly from $[1, m-1]$ each round, FLEX-GDRO matches the sample efficiency of the single-sample baseline (ONLINE(1)) while running 5.91x to 13.00x faster on the synthetic and diabetes datasets.
  • Real-world NLP efficiency: On CivilComments-WILDS, FLEX-GDRO hits target worst-group risks 8.40x to 11.20x faster than ONLINE(1) (e.g., 7.03s vs. 78.80s to reach a 0.64 risk) while using fewer samples at tighter risk thresholds (101.84k vs. 120.00k).
  • Variance scales with the ratio $m/r_t$: Empirical checks confirm that the loss estimator's variance stays flat as $m$ grows from 50 to 200 so long as $m/r$ is held constant, validating the theoretical error rate of $O\left(\frac{1}{t}\sqrt{\sum_{j=1}^t \frac{m}{r_j}\log m}\right)$.

Limitations and Future Work

  • Convexity and boundedness assumptions: Like standard theoretical GDRO works, the guarantees rely on convex group risk functions, bounded losses ($[0, 1]$), bounded gradient norms, and a convex parameter domain. Deep neural networks are only evaluated via linear probing on frozen encoders.
  • Future directions: The authors suggest extending the Flexible Sample Queries framework to alternative objectives like Minimax Regret Optimization (MRO), and applying it to communication-constrained federated learning, recommendation systems, and large language model training.

Summary updated

BibTeX
@inproceedings{bai2026group,
  author = {Haomin Bai and Dingzhi Yu and Shuai Li and Haipeng Luo and Lijun Zhang},
  title = {{Group Distributionally Robust Optimization with Flexible Sample Queries}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=GKDd9FPubr},
}
Figure