betaFeedback

WorksComputer Science

Dynamic Minimax Regret Optimization for Robust LLM Post-Training

Abstract

Modern LLM training increasingly relies on heterogeneous data sources spanning different domains, tasks, preference distributions, and difficulty levels. We study dynamic minimax regret for group-distributionally robust LLM post-training under instantaneous mini-batch-only bandit feedback. The framework views the training as a two-player sampler-optimizer process: a sampler adaptively selects among data sources using bandit feedback, while an optimizer updates the model parameters using stochastic gradients from the selected source. We focus on the practically restrictive setting where source losses evolve with model training but historical data are not re-evaluated, requiring the sampler to track instantaneous worst-sources from stale partial feedback. We propose DUCB-OGD, a simple and scalable algorithm that couples a Discounted Upper-Confidence-Bound sampler with an Online Gradient Descent optimizer. The sampler maintains exponential moving average loss estimates and confidence radii based on discounted effective sample sizes, avoiding costly re-evaluation of past data or intrusive changes to standard training pipelines. For KK data sources and TT training steps, we prove that DUCB-OGD achieves a dynamic minimax regret of O~(K1/4T3/4)\tilde{O}(K^{1/4}T^{3/4}), which is optimal up to logarithmic factors for the undiscounted objective under our feedback model. Extensive experiments across supervised fine-tuning, preference optimization, and reinforcement learning show that DUCB-OGD integrates seamlessly into modern LLM training pipelines and improves worst-group robustness with negligible computational overhead compared with standard sampling baselines.

Introduction

Diverse data mixtures are central to modern Large Language Model (LLM) post-training. For example, supervised fine-tuning data may combine instruction-following, coding, mathematical reasoning, safety, and domain-specific examples; preference datasets may reflect different annotator populations or task families; and reinforcement learning objectives may expose the model to prompts whose rewards evolve unevenly during training ((Ouyang et al., 2022; Rafailov et al., 2023; Schulman et al., 2017; Shao et al., 2024)). As a result, post-training is not merely an average-loss minimization problem. A model can improve substantially on common or easy sources, while remaining weak on smaller, harder, or temporally under-trained groups. This makes robust performance across data sources a central objective in LLM post-training. In practical deployment, worst-source robustness is a complementary and equally important criterion to the commonly reported mean performance, but often under-emphasized in aggregate evaluations.

Group-distributionally robust optimization (GDRO) provides a principled formulation for this goal by minimizing the worst-case expected loss over a predefined set of data sources ([15] (Sagawa* et al. 2020; Oren et al. 2019)). Informally, GDRO seeks model parameters that perform well on the most challenging source rather than the average performance across sources. However, the standard GDRO viewpoint is essentially static: robustness is typically evaluated with respect to the worst-performing source at the final or time-averaged solution, or determined in hindsight over the training trajectory ((Zhang et al., 2023; Soma et al., 2025)). This static benchmark does not fully capture the shift of the worst-performing source as the model evolves in LLM post-training. A robust algorithm should therefore track and respond to the evolving worst source, rather than optimize against a fixed source chosen in hindsight.

Recent work has shown that mixture proportions can strongly affect pretraining and post-training performance, motivating both offline mixture optimization and online adaptive sampling methods ([10, 14] (Xie et al. 2023; Ye et al. 2025; Shin et al. 2025)). Such mechanisms can be expensive or intrusive in large-scale post-training systems, where throughput, memory efficiency, and compatibility with distributed training libraries are critical. This creates a gap between the theoretical appeal of GDRO and the practical constraints of LLM post-training: we need adaptive algorithms that are robust, theoretically grounded, and lightweight enough to integrate into standard training pipelines relying on well-optimized deep learning libraries. We discuss related work in detail in Appendix § 9.

In this paper, we study dynamic minimax regret for group-distributionally robust LLM post-training under instantaneous mini-batch-only bandit feedback. The training trajectory can be naturally decomposed into a sampler, which selects a source using only its observed mini-batch loss, and an optimizer, which updates the model using the corresponding stochastic gradient. We propose DUCB-OGD, a simple algorithm that combines a Discounted Upper-Confidence-Bound (DUCB) (Garivier & Moulines, [16]) sampler with an Online Gradient Descent (OGD) (Hazan, 2016) optimizer. In contrast, while Zang et al. (2025) already study dynamic worst-source tracking, they refresh source-loss estimates by re-evaluating accumulated historical samples. Our replay-free formulation instead uses fresh mini-batches as unbiased stochastic estimates of population loss, adds no auxiliary model evaluations, and requires only O(K)O(K) scalar state, at the cost of tracking unobserved sources from stale feedback. We show that this simple sampler-optimizer design achieves dynamic minimax regret of O~(K1/4T3/4)\widetilde{O}(K^{1/4}T^{3/4}) for KK data sources over TT training steps, which is optimal for the undiscounted objective up to logarithmic factors under our feedback model.

Our main contributions are summarized as follows:

  1. We formulate robust LLM post-training under instantaneous mini-batch-only feedback, where evolving source losses must be tracked from stale observations without historical replay or auxiliary model evaluations.

  1. We propose DUCB-OGD, an efficient algorithm that combines DUCB sampling with OGD optimization, and prove that it achieves a dynamic minimax regret of O~(K1/4T3/4)\widetilde{O}(K^{1/4}T^{3/4}), matching the optimal rate up to O(log⁡T)O(\log T) factors for the undiscounted objective under our feedback model.

  1. We evaluate the method across supervised fine-tuning, preference optimization, and reinforcement learning, showing improved worst-source robustness under negligible computational overhead against standard and heuristic sampling baselines.

Problem Setup

Let X\mathcal{X} be a data space with KK data sources indexed by [K]:={1,…,K}[K]:=\{1,\ldots,K\}. Each source k∈[K]k\in[K] is associated with a distribution Dk\mathcal{D}^{k} supported on X\mathcal{X}, and each query to source kk returns i.i.d.i.i.d. samples from Dk\mathcal{D}^{k}. Let θ\theta be the learnable parameter from a parameter space Θ\Theta. Let ℓ:Θ×X→R\ell:\Theta\times\mathcal{X}\to\mathbb{R} be a differentiable loss function. The expected loss of source kk at the model parameter θ\theta is defined as μk(θ):=EX∼Dk[ℓ(θ,X)]\mu^k(\theta) := \mathbb{E}_{X \sim\mathcal{D}^k}[\ell(\theta, X)]. A global minimax solution is any optimizer of the GDRO objective, i.e.,

θ⋆∈arg⁡min⁡θ∈Θ max⁡k∈[K]μk(θ).(1)\theta^\star\in\underset{\theta\in\Theta}{\arg\min}\ \max_{k \in[K]} \mu^k(\theta). \tag*{(1)}

This formulation captures a broad class of LLM post-training objectives through appropriate choices of the source distributions and loss functions as described in Table 1. Let πθ\pi_\theta be an LLM, and q,oq, o be a pair of prompt and response. Then πθ(o∣q)\pi_\theta(o \mid q) is the probability that the LLM generates the response oo given the prompt qq. In supervised fine-tuning (SFT), each source generates prompt-response pairs, and the loss is the negative log-likelihood of the target response ((Ouyang et al., 2022)). For direct preference optimization (DPO), let (o+,o−)(o^+, o^-) denote a preferred and dispreferred response pair. Let pθBT(o+≻o−∣q)p_\theta^{\mathrm{BT}}(o^+ \succ o^- \mid q) denote the Bradley-Terry probability ([8] (Rafailov et al. 2023)) that the model prefers o+o^+ to o−o^-, and the loss is the negative Bradley-Terry preference probability. For reinforcement learning (RL), let r(q,o)r(q, o) denote the reward assigned to the response oo for the prompt qq. Each source generates prompts, the model induces the response distribution, and the loss is the negative reward ((Schulman et al., 2017; Shao et al., 2024)). For simplicity, Table 1 presents these objectives at the sequence level, omitting token-wise factorization, reference-model regularization, and implementation-specific normalization terms.

Objective−ℓ(θ,⋅)-\ell(\theta,\cdot)WS Switches / 1k Steps
SFTEo∼Dk(⋅∣q)[log⁡πθ(o∣q)]\mathbb{E}_{o\sim\mathcal{D}^{k}(\cdot\mid q)}[\log\pi_{\theta}(o\mid q)]41 [3,124]
DPOE(o+,o−)∼Dk(⋅∣q)[log⁡pθ(o+≻o−∣q)]\mathbb{E}_{(o^{+},o^{-})\sim\mathcal{D}^{k}(\cdot\mid q)}[\log p_{\theta}(o^{+}\succ o^{-}\mid q)]31 [13,53]
RL (GRPO)Eo∼πθ(⋅∣q)[r(q,o)]\mathbb{E}_{o\sim\pi_{\theta}(\cdot\mid q)}[r(q,o)]20 [0,32]

Table 1. GDRO formulations of LLM post-training objectives and estimated worst-source (WS) switching. The final column reports the mean number of switches per 1,000 steps, with the range across experiments in brackets. The worst source has the largest exponentially smoothed loss for SFT/DPO or the lowest exponentially smoothed reward for GRPO. Additional optimization dynamics are reported in § 4 and D.5.

We consider an iterative training algorithm A\mathcal{A}, consisting of a sampler and an optimizer, that runs for TT steps. At each step t∈[T]t \in[T], the sampler specifies a distribution Pt\mathcal{P}_t over the data-source indices [K][K]. A source kt∼Ptk_t \sim\mathcal{P}_t is then selected, and a mini-batch Bt⊆Xkt\mathcal{B}_t \subseteq\mathcal{X}^{k_t} of i.i.d. samples is drawn from the corresponding distribution Dkt\mathcal{D}^{k_t}. The model observes Bt\mathcal{B}_t and calculates the empirical loss μ^kt(θt;Bt):=∑X∈Btℓ(θt,X)/∣Bt∣\hat{\mu}^{k_t}(\theta_t; \mathcal{B}_t) := \sum_{X \in\mathcal{B}_t} \ell(\theta_t, X)/|\mathcal{B}_t| based on the current model parameter θt\theta_t. Then the optimizer updates the parameter to obtain θt+1\theta_{t+1} for the next step. The sampler observes only μ^kt(θt;Bt)\hat{\mu}^{k_t}(\theta_t; \mathcal{B}_t); it neither observes the current losses of unselected sources nor re-evaluates historical mini-batches. After TT steps, the algorithm generates a trajectory of data source indices and model parameters AT:={(kt,θt),t=1,…,T}\mathcal{A}_T := \{(k_t, \theta_t), t = 1, \ldots, T\}. Our goal is to evaluate this trajectory by how well it controls the adaptive sequence of maximum source-wise losses throughout the training. Following the notion of dynamic regret in online learning, the (undiscounted) dynamic minimax regret is defined as follows.

Definition 1 (Undiscounted Dynamic Minimax Regret). Let θ⋆\theta^\star be the global minimax optimum in Eq. (1). The undiscounted dynamic minimax regret of an algorithm A\mathcal{A} after TT steps is defined as

R(AT):=∑t=1Tmax⁡k∈[K]μk(θt)−Tmax⁡k∈[K]μk(θ⋆).(2)R(\mathcal{A}_T) := \sum_{t=1}^{T} \max_{k \in[K]} \mu^k(\theta_t) - T \max_{k \in[K]} \mu^k(\theta^\star). \tag*{(2)}

This definition compares the worst-case loss incurred by AT\mathcal{A}_T with the best achievable minimax loss. Crucially, the maximizing source in max⁡kμk(θt)\max_k \mu^k(\theta_t) may vary with tt, which makes the dynamic ((Zang et al., 2025)), i.e., at each step, it reflects the source that is currently under-performing, rather than a single fixed source chosen in hindsight ((Zhang et al., 2023; Soma et al., 2025)). To analyze the sampler-optimizer structure, we decompose the regret into an optimization component and a bandit component. The optimization component measures how well the optimizer competes with the minimax solution on the sampled sources. The bandit component measures how well the sampler tracks the instantaneous worst-performing source. We also introduce discount factors ρ,γ∈[0,1]\rho, \gamma\in[0, 1] to emphasize recent observations, which is natural in post-training because source-wise losses evolve as the model changes.

Definition 2 (Optimization Regret and Dynamic Bandit Regret). Let ρ,γ∈[0,1]\rho, \gamma\in[0, 1]. The discounted optimization regret of an algorithm A\mathcal{A} after TT steps is defined as

Rρo(AT):=∑t=1TρT−t(μkt(θt)−μkt(θ⋆)),(3)R_{\rho}^{o}(\mathcal{A}_T) := \sum_{t=1}^{T} \rho^{T-t}\left(\mu^{k_t}(\theta_t) - \mu^{k_t}(\theta^\star)\right), \tag*{(3)}

and the discounted dynamic bandit regret is defined as

Rγb(AT):=∑t=1TγT−t(max⁡k∈[K]μk(θt)−μkt(θt)).(4)R_{\gamma}^{b}(\mathcal{A}_T) := \sum_{t=1}^{T} \gamma^{T-t}\left(\max_{k \in[K]} \mu^k(\theta_t) - \mu^{k_t}(\theta_t)\right). \tag*{(4)}

The optimization regret RoρR^\rho_o captures the loss incurred by following the optimizer trajectory instead of using the minimax solution on the sampled sources. The bandit regret RbγR^\gamma_b captures the loss incurred by sampling ktk_t instead of the instantaneous worst-performing source at time tt. The following decomposition connects these quantities to the original undiscounted regret. Its proof simply follows from the fact that max⁡kμk(θ)≥μkt(θ)\max_k \mu^k(\theta) \ge\mu^{k_t}(\theta) for all θ\theta and tt and is provided in Appendix § 11.§ 1.

Proposition 1 (Regret Decomposition). Any trajectory ATA_T satisfies R(AT)≤Ro1(AT)+Rb1(AT)R(A_T) \le R^1_o(A_T) + R^1_b(A_T).

Finally, we define the normalized discounted dynamic minimax regret as follows.

Definition 3 (Dynamic Minimax Regret). For any ρ,γ∈[0,1]\rho, \gamma\in[0,1], the normalized (ρ,γ)(\rho,\gamma)-discounted dynamic minimax regret of an algorithm AA after TT steps is defined as

Rρ,γ(AT):=TNT(ρ)Roρ(AT)+TNT(γ)Rbγ(AT),(5)R^{\rho,\gamma}(A_T) := \frac{T}{N_T(\rho)}R^\rho_o(A_T) + \frac{T}{N_T(\gamma)}R^\gamma_b(A_T), \tag*{(5)}

where NT(β):=∑t=1TβT−tN_T(\beta) := \sum_{t=1}^{T}\beta^{T-t} for any β∈[0,1]\beta\in[0,1].

The normalization converts each discounted sum to the scale of a length-TT horizon, making regret bounds comparable across choices of ρ\rho and γ\gamma. Here, ρ\rho and γ\gamma separately discount the optimization and bandit components, whereas β\beta will be selected by the analyses. When ρ=γ=1\rho= \gamma= 1, the normalized regret reduces to the undiscounted sampler-optimizer decomposition, and by Proposition 1, R(AT)≤R1,1(AT)R(A_T) \le R^{1,1}(A_T). For ρ,γ<1\rho,\gamma< 1, the discounted statistics used in our analysis can be viewed as exponential moving-average (EMA) estimates of past observations. This connects our theoretical quantities to EMA-based state tracking, which is widely used in deep learning optimization and training diagnostics Polyak & Juditsky (1992); Kingma & Ba (2014).

We make the following standard assumptions for the theoretical analysis. Specifically, Assumptions 1 and 2 are required for analyzing gradient descent, and Assumption 3 is required to ensure that the empirical loss and gradient estimators are unbiased.

References

  1. [1]Alekh Agarwal and Tong Zhang. Minimax Regret Optimization for Robust Machine Learning under Distribution Shift. In Po-Ling Loh and Maxim Raginsky (eds.), Proceedings of Thirty Fifth Conference on Learning Theory, volume 178 of Proceedings of Machine Learning Research, pp. 2704–2729. PMLR, July 2022.arxiv.org/abs/2202.05436
  2. [2]AI@Meta. The Llama 3 Herd of Models, 2024. URL https://doi.org/10.48550/arXiv.2407.21783.
  3. [3]Peter Auer, Nicolò Cesa-Bianchi, and Paul Fischer. Finite-time Analysis of the Multiarmed Bandit Problem. Machine Learning, 47(2/3):235–256, 2002a. ISSN 08856125. doi: 10.1023/A:1013689704352.DOI
  4. [4]Peter Auer, Nicolò Cesa-Bianchi, Yoav Freund, and Robert E. Schapire. The Nonstochastic Multiarmed Bandit Problem. SIAM Journal on Computing, 32(1):48–77, January 2002b. ISSN 0097-5397, 1095-7111. doi: 10.1137/S0097539701398375.DOI
  5. [5]Jiamu Bai, Daoyuan Chen, Bingchen Qian, Liuyi Yao, and Yaliang Li. Federated Fine-tuning of Large Language Models under Heterogeneous Tasks and Client Resources. In A. Globerson, L. Mackey, D. Belgrave, A. Fan, U. Paquet, J. Tomczak, and C. Zhang (eds.), Advances in Neural Information Processing Systems, volume 37, pp. 14457–14483. Curran Associates, Inc., 2024. doi: 10.52202/079017-0461.DOI
  6. [6]Omar Besbes, Yonatan Gur, and Assaf Zeevi. Stochastic Multi-Armed-Bandit Problem with Non-stationary Rewards. In Z. Ghahramani, M. Welling, C. Cortes, N. Lawrence, and K. Weinberger (eds.), Advances in Neural Information Processing Systems, volume 27. Curran Associates, Inc., 2014.
  7. [7]Stacie Bloom, Joshua C. Brumberg, Ian Fisk, Robert J. Harrison, Robert Hull, Melur Ramasubramanian, Krystyn Van Vliet, and Jeannette Wing. Empire AI: A new model for provisioning AI and HPC for academic research in the public good. In Practice and Experience in Advanced Research Computing (PEARC ’25), pp. 4. Columbus, OH, USA, July 2025. ACM. doi: 10.1145/3708035.3736070. URL https://doi.org/10.1145/3708035.3736070.
  8. [8]Ralph Allan Bradley and Milton E. Terry. Rank Analysis of Incomplete Block Designs: I. The Method of Paired Comparisons. Biometrika, 39(3/4):324, December 1952. ISSN 00063444. doi: 10.2307/2334029.DOI
  9. [9]J. S. Butler and Robert Moffitt. A Computationally Efficient Quadrature Procedure for the One-Factor Multinomial Probit Model. Econometrica, 50(3):761, May 1982. ISSN 00129682. doi: 10.2307/1912613.DOI
  10. [10]Mayee Chen, Nicholas Roberts, Kush Bhatia, Jue WANG, Ce Zhang, Frederic Sala, and Christopher Ré. Skill-it! A data-driven skills framework for understanding and training language models. In A. Oh, T. Naumann, A. Globerson, K. Saenko, M. Hardt, and S. Levine (eds.), Advances in Neural Information Processing Systems, volume 36, pp. 36000–36040. Curran Associates, Inc., 2023.
  11. [11]Xiaoyin Chen, Jiarui Lu, Minsu Kim, Dinghuai Zhang, Jian Tang, Alexandre Piché, Nicolas Gontier, Yoshua Bengio, and Ehsan Kamaloo. Self-Evolving Curriculum for LLM Reasoning, 2025. Version Number: 4.arxiv.org/abs/2505.14970
  12. [12]François Chollet. On the Measure of Intelligence, 2019. Version Number: 2.arxiv.org/abs/1911.01547
  13. [13]Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reichiro Nakano, Christopher Hesse, and John Schulman. Training Verifiers to Solve Math Word Problems. arXiv preprint arXiv:2110.14168, 2021.arxiv.org/abs/2110.14168
  14. [14]Nicholas E. Corrado, Julian Katz-Samuels, Adithya M. Devraj, Hyokun Yun, Chao Zhang, Yi Xu, Yi Pan, Bing Yin, and Trishul Chilimbi. AutoMixAlign: Adaptive Data Mixing for Multi-Task Preference Optimization in LLMs. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 20234–20258, Vienna, Austria, 2025. Association for Computational Linguistics. doi: 10.18653/v1/2025.acl-long.990.
  15. [15]John C. Duchi and Hongseok Namkoong. Learning models with uniform performance via distributionally robust optimization. The Annals of Statistics, 49(3), June 2021. ISSN 0090-5364. doi: 10.1214/20-AOS2004.
  16. [16]Aurélien Garivier and Eric Moulines. On Upper-Confidence Bound Policies for Switching Bandit Problems. In Jyrki Kivinen, Csaba Szepesvári, Esko Ukkonen, and Thomas Zeugmann (eds.), Algorithmic Learning Theory, volume 6925, pp. 174–188. Springer Berlin Heidelberg, Berlin, Heidelberg, 2011. ISBN 978-3-642-24411-7 978-3-642-24412-4. doi: 10.1007/978-3-642-24412-4_16. Series Title: Lecture Notes in Computer Science.
  17. [17]Soumya Suvra Ghosal and Yixuan Li. Distributionally Robust Optimization with Probabilistic Group. Proceedings of the AAAI Conference on Artificial Intelligence, 37(10):11809–11817, June 2023. ISSN 2374-3468, 2159-5399. doi: 10.1609/aaai.v37i10.26394.DOI

Paper details

vlnc:W_k44a7s56
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

generative AI tools

View statement
Looking for related papers…
Contents