Manuscript Offprint

arXiv:2610.32141

Beyond Data Schedule: Fast LLM Pretraining on Data Mixtures by Loss-Reweighting

Jiazheng Li, Huaqing Zhang, Jing Xu, Tianle Cai, Jingzhao Zhang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Large language models often acquire specialized capabilities through successive pretraining stages, but these gains can come at the cost of forgetting earlier knowledge. In this work, we investigate whether such trade-offs can be improved by changing how strongly each domain contributes to learning while keeping its data exposure fixed. We find that, in controlled knowledge–mathematics experiments, loss reweighting produces a single checkpoint that surpasses the best knowledge and reasoning scores attained along either stage trajectory. This reveals an independent control that data-mixture ratios alone do not capture. Building on this finding, we propose LARE (Loss-Adaptive Reweighting under fixed Exposure), which automatically adjusts domain weights from running loss statistics. Motivated by a theoretical analysis of gradient noise, its normalized inverse-square-root rule balances relative loss scales without changing the sampled mixture or requiring additional runs to search for weights. Across knowledge, mathematics, and code, LARE improves all five evaluated benchmarks for a 1.5B model trained on 240B tokens, averaging +7.84 pp over a matched direct mixture, including gains of +17.06 pp on GSM8K and +9.00 pp on MATH. These findings demonstrate that adjusting domain loss scales can improve joint capabilities without additional domain exposure.

Date: October 26, 2026

Correspondence: Jiazheng Li at foreverlasting1202@outlook.com

Jingzhao Zhang at jingzhaoz@mail.tsinghua.edu.cn

1 Introduction

Large language models are increasingly expected to master multiple capabilities simultaneously—from broad world knowledge to mathematical reasoning, code generation, and instruction following. Meeting these demands has pushed pretraining beyond a single stationary data distribution: practical recipes now begin with broad-coverage corpora and subsequently introduce midtraining or continued-pretraining stages enriched with curated, domain-specialized data [17, 34, 40, 49]. Yet whether successive stages are the best way to combine multiple domains remains an open question. Emphasizing a new domain can rapidly improve the corresponding capability, but these gains often come at the cost of forgetting what was learned earlier [26, 45, 70]. In effect, multi-stage training selects a point on an acquisition–retention trade-off rather than producing a model that is simultaneously strong across domains.

A natural alternative is to train all domains jointly from a stationary mixture, replacing stage ordering

Figure

Training progress →\rightarrow

Figure

Figure 1 Loss reweighting, rather than additional domain exposure, yields a joint improvement in knowledge and mathematical reasoning. Top: colored areas show cumulative Knowledge:Math exposure; the 2:1 schematic keeps both domains visible. Labels ×1 and ×k denote relative loss multipliers: direct mixing weights both domains equally, whereas reweighting increases the mathematics loss. Bottom: under matched 7:1 exposure, open triangles mark first-domain peaks and filled triangles mark selected post-switch checkpoints, while the square, circles, and diamond denote direct mixing, fixed coefficients, and LARE. Fixed 1:2 weighting and LARE exceed the coordinate-wise stage maxima; LARE reaches this region online without changing exposure.

with a data-mixture ratio [9, 38]. Prior work has devoted substantial effort to selecting or adapting these sampling proportions [13, 37, 61, 66]. By keeping every domain active throughout training, joint mixtures avoid the abrupt distribution shifts introduced by stage boundaries—yet they do not automatically recover the strongest outcome of each specialized stage. Different ratios favor different domains, so a direct mixture often settles at an interior compromise (see 1). Recent work further shows that domain learning can exhibit threshold behavior as mixture shares vary, while repeated exposure yields scale-dependent returns [16, 30, 31]. Optimizing the mixture ratio therefore searches for a better point on the trade-off rather than eliminating it.

Our work starts with the identification of a central limitation of ratio tuning: a single control variable is asked to serve two fundamentally different roles. Increasing a domain's sampling share changes both its exposure—how much data the model sees—and, under the standard unweighted objective, its optimization scale—how strongly prediction errors in that domain shape parameter updates. These two quantities are conceptually distinct [53], and their preferred allocations need not coincide: the amount of data needed for sufficient coverage may differ from the relative loss weight that yields the strongest joint model. This observation motivates a different intervention: hold the sampled-data mixture fixed and adjust domain loss coefficients directly, decoupling what the model sees from how strongly each domain drives learning. Figure 2 visualizes this distinction: remixing and reweighting trace different paths through the capability plane.

Figure 1 illustrates the opportunity created by this decoupling. With the sampled-data mixture and token budget held fixed, a suitable mathematics loss coefficient improves both MMLU and GSM8K over direct mixing—and even surpasses the best value attained on each benchmark along the multi-stage trajectories. A fixed coefficient, however, merely trades one search problem for another: its optimal value is unknown a priori, expensive to sweep at pretraining scale, and may not transfer across data compositions or training configurations.

We therefore introduce LARE (Loss-Adaptive Reweighting under fixed Exposure), an online domain-level controller that derives relative loss weights from running domain-loss statistics. After learning-rate warmup, it applies a normalized inverse-square-root rule that adapts relative optimization scale without globally rescaling the training objective. Under this rule, the 7:1 adaptive run reaches a competitive region of the fixed-weight trade-off in a single training run, eliminating the need for a post-hoc oracle grid. The core contributions of this work are threefold:

  • We disentangle domain exposure from optimization scale in multi-domain pretraining. Under matched 30B-token exposure, stage scheduling, direct mixing, and loss reweighting yield markedly different endpoints; a suitable fixed loss coefficient simultaneously exceeds the best knowledge and mathematical-reasoning scores attained along either stage trajectory (Figure 1 and Section 2).

  • We introduce LARE, a lightweight online controller that derives domain coefficients from running loss statistics. Its normalized inverse-square-root rule adapts relative optimization scale after warmup while keeping sampled exposure fixed and the mixture-averaged coefficient at one. The controller reaches a competitive region of the fixed-weight trade-off in a single run, without auxiliary search runs (Section 3).

  • We validate the method across optimizers, sampled-data ratios, domain compositions, and training budgets (Section 4). At 4×4 \times Chinchilla with K:M = 7:1, LARE improves MMLU by 0.39 points, GSM8K by 13.57 points, and MATH by 8.40 points. Extending training with mathematics and code to 8×8 \times Chinchilla yields gains of 0.83, 17.06, 9.00, 6.71, and 5.60 points on MMLU, GSM8K, MATH, HumanEval, and MBPP, respectively, over direct mixing (Table 2).

References (63)