Midtraining Bridges Pretraining and Posttraining Distributions
SAI replication review · Referee report
Summary
This paper argues that midtraining—the now-common practice of inserting an intermediate phase mixing specialized data (code, math, instructions, higher-quality web) with the general pretraining corpus—is best understood as distributional bridging: an initialization-shaping intervention for posttraining rather than a cooldown, an early SFT surrogate, or teaching to the test. The conceptual move is to reframe midtraining as changing the starting point of SFT so that it is (i) close enough to the target to make specialization cheap and (ii) retains enough of the pretraining distribution to keep the SFT update from destroying it. The authors support this with controlled Pythia experiments (70M–1B, 128B tokens), sweeping five midtraining mixes across four SFT targets, a code-focused start-time × mixture-weight grid, a comparison against continued pretraining on 100% specialized data, and a CKA probe of representational change. The empirical picture is coherent: benefits concentrate on distant domains (code, math), scale with a token-level proximity-advantage metric, exceed continued pretraining while forgetting less, and interact with timing so that late-and-aggressive introduction is harmful. A first-order theory in Appendix A sketches how initialization changes bound both SFT progress and pretraining-loss drift. The reframing is useful and the design principle (early-and-mixed over late-and-heavy) is likely to influence practice. Two conceptual limitations stand out: the mechanism the theory formally derives (a descent/energy term) is not the gradient-conflict mechanism the abstract and Figure 1 foreground, and the empirical instrument is a unigram token-similarity that captures surface overlap more cleanly than the semantic bridging the framing implies. The domain comparison is further confounded because mixes differ in both introduction time and mixture weight. An independent re-run reproduced the similarity/proximity backbone cleanly but could not execute the headline loss tables, which therefore remain unverified rather than confirmed.
Strengths
- Conceptual contribution. Reframing midtraining as an initialization intervention — rather than a curriculum, cooldown, or early SFT — is a clean move that unifies several existing practices and generates the timing-weight interaction hypothesis instead of merely reporting it.
- Controlled experimental design. Fixing model family, tokenizer, total-token budget, and posttraining procedure while varying midtraining along interpretable axes is exactly the kind of ablation this space needs. The 5-mix × 4-target grid at four sizes is genuinely useful data.
- Fair-by-design continued-pretraining comparison. Deliberately giving continued pretraining more specialized tokens than midtraining and still showing midtraining wins meaningfully rules out the obvious "more data" explanation.
- Pre- vs post-SFT decomposition. Table 3 isolates the initialization contribution from SFT-induced drift, the right way to defend the forgetting claim against the alternative that specialized SFT simply hurts less when the domain was seen earlier.
- Practical takeaway with negative advice. Finding 4 (late-and-aggressive is worse than late-and-conservative) is directly usable and is stated with appropriate hedging about the small scale of the ablation.
- Reproducible diagnostic pipeline. The token-similarity/proximity machinery re-ran end-to-end and produced the block structure and sign pattern the paper's thesis predicts, which increases confidence in the qualitative backbone of Findings 1–2.
Weaknesses
- Theory conclusion does not match the foregrounded mechanism. The one-step inequality (2) contains a gradient-alignment term and a curvature/energy term; only the energy term is controlled by the "less work initially" bound the sketch invokes, yet the abstract and Figure 1 sell the mechanism as avoiding gradient conflict (the alignment term the theory never harnesses). This is more than cosmetic: the sketch licenses a different story than the empirical narrative.
- Central descent condition is assumed, not derived. Lemma A.5 gives a sufficient condition for the midtraining displacement to reduce at initialization but never argues midtraining satisfies it; midtraining optimizes a mixture, not . Similarly, the timing-weight interpretation of Lemma A.6 reads off monotonicities of and that are never established.
- Domain comparison is confounded by timing and mixture weight. Finding 1 compares mixes introduced at different start points (Starcoder 6k, Math 20k, others 40k steps) and at different weights (5%–20%). Because the paper itself shows both timing and weight strongly affect outcomes, the domain ranking (and FLAN's weak effect at only 5%) cannot be cleanly attributed to domain.
- "Nearly unchanged" C4 overstates the code case. For Starcoder-20% on Pycode, Pre-SFT C4 rises +0.030 and total (midtrain+SFT) C4 change is +0.068 vs +0.073 baseline — a wash. The narrative holds for math but not code.
- Compensation-failure inference confounds two variables. The (10%@42B, 20%@63B, 30%@84B) progression varies start time and weight simultaneously, so degradation cannot be attributed to "weight fails to compensate" versus "later start is worse." The confident "we can see that this is not the case" overstates a three-point diagonal.
- Forgetting is measured only by C4 loss. The claim that midtraining "preserves prior knowledge better" rests entirely on held-out C4 cross-entropy, which measures web-text language modeling, not knowledge or general capabilities. No knowledge/capability benchmark is run.
- Only cross-entropy is reported; no downstream task metric. All of Tables 2–4 and 9 are validation losses; the paper never shows the loss deltas translate to GSM8K accuracy, HumanEval/MBPP pass@k, or SciQ accuracy.
- No error bars or significance tests. Every table is 5-seed means; many bolded "best" cells (LIMA, SciQ, several GSM8K rows) differ by amounts almost certainly within seed variance.
- Proximity metric is a unigram token overlap. Finding 2 rests on a metric that captures surface lexical/syntactic overlap, not the semantic bridging the framing implies; the strong Starcoder→Pycode signal is likely dominated by shared code-syntax tokens.
- Scale generalization asserted but not tested. The largest model is 1B and the timing/weight ablation is 70M/160M, yet the paper motivates itself with multi-B production models and generalizes to "any training phases."
- SFT LR tuned only on the base checkpoint, systematically (if conservatively) biasing the midtraining comparison; reversals in marginal cells cannot be ruled out.
- Statistical and notational slips. The reported , does not fit any obvious ; is called "the SFT loss"; the Appendix D rule is incoherent; the "overlap ratio" is computed but not combined; and "catastrophic overtraining" is equated with "catastrophic forgetting."
Reproducibility & code
This is a full/executed evaluation, but in practice almost none of the quantitative results could be run at the paper's scale in the reproduction environment; the qualitative backbone could.
- Similarity/proximity backbone reproduced cleanly. The shipped similarity pipeline re-ran end-to-end and reproduced the token-similarity matrix (Figure 2 / Appendix D) with the described block structure, and the derived proximity-advantage table has the exact sign pattern the thesis predicts (StarCoder→PyCode largest positive, Math→GSM8K positive, mismatched pairs negative). Two off-tolerance cells (C4–StarCoder, SciQ–PyCode) trace to running in pure-data mode and substituting public proxy datasets for gated corpora, not to a method defect.
- Headline loss tables and correlations could not be executed. Tables 2/3/4/9, the proximity-vs-improvement correlations, the timing/weight ablations (Figure 4), and the temporal-emergence figure (Figure 5) all depend on the full-scale fine-tune loss grid, which requires the 128B-token pre-tokenized shards (absent from the release), multi-GPU training, and the authors' private W&B runs (aggregation scripts fetch an inaccessible project). These claims are therefore unverified, not contradicted.
- Continued-pretraining comparison (Table 4) unverified. None of its 16 cells could be reproduced for the same reasons; the SFT data path itself had to be patched to run at all, and the dual-loss logging behind the forgetting decomposition is only partially wired.
- CKA directional claim reversed on runnable checkpoints. The four-panel figure reproduced structurally, but on the only (toy, ~6-step) checkpoints trainable here the central pattern reversed — final-layer CKA was 0.86 for midtrained-vs-midtrained-SFT versus 0.93 for base — and a humaneval probe was used instead of APPS. Most likely a toy-scale artifact, but the claim rests on one descriptive figure that did not reproduce.
- Released code is fragile and partly cluster-bound. One data loader silently falls back to fabricated placeholder text ("def function_i") instead of erroring on missing inputs; several scripts carry hardcoded absolute cluster paths; the 5-seed set is enumerated in neither the paper nor the configs; and the results pipeline depends on a private W&B project. Exact reproduction of any averaged table is not currently possible from the release alone.
Recommended Changes
Essential
- Reconcile the theory with the stated mechanism. Either extend Appendix A to bound the accumulated gradient-alignment term (what the abstract and Figure 1 promise), or rewrite the "Connection to midtraining" paragraph to reflect only the descent/energy mechanism the bound captures.
- Justify or explicitly assume the descent condition and the monotonicity of and , since Finding 4's interpretation depends on them.
- De-confound the domain comparison. Rerun Finding 1 with matched introduction times and matched mixture weights across mixes (or clearly caveat that the domain ranking, and FLAN's weak effect at 5%, is entangled with timing and weight).
- Add at least one downstream task metric on code and math (e.g., GSM8K accuracy and HumanEval/MBPP pass@k for C4, Starcoder-20%, Math-12% at 1B) so the loss deltas are priced against a community metric.
- Add a knowledge/capability probe for "forgetting," or restrict the forgetting claim to held-out C4 loss and drop the "preserves prior knowledge" phrasing.
- Add per-seed variance to Tables 2, 3, 4, and 9, so conclusions turning on sub-0.01 differences (LIMA, SciQ) can be separated from noise.
- Rerun or soften the compensation-failure claim off the diagonal, using the Figure 4 grid to show best-weight-at-late-start still underperforms early-start-best.
- Ship the aggregated results CSVs underlying Tables 2/3/4/9, enumerate the SFT seeds, document the 128B-token shard reconstruction, refactor scripts off hardcoded absolute paths, and remove the silent placeholder-text fallback so the headline numbers become reproducible without private W&B access.
Suggested
- Add a second, non-unigram proximity check (subword KL or n-gram overlap on NL domains) so Finding 2 does not rest on a surface-token metric.
- Restrain the abstract/conclusion generalization ("any training phases," multi-B scale) to what SFT on Pythia-70M–1B supports, flagging RL/multi-stage/larger-scale as conjectures.
- Spot-check a per-checkpoint SFT LR sweep on the code/math cells to confirm fixing the LR on the base checkpoint does not bias the comparison.
- Quantify the CKA-diagonal difference across layers/sizes (with variance) rather than summarizing qualitatively, and reconcile the "changes less" prediction with the convergent-endpoints observation.
- State the total token budget of the continued-pretraining runs in Section 5.2 so the fairness accounting is self-contained.
- Fix the notation/definition issues: (parameters, not "the SFT loss"), in Appendix D, the unused "overlap ratio," the /smoothness scope, and the forgetting-vs-overtraining conflation.
- Recompute or clarify the reported Pearson , , and so they are internally consistent.
- Clarify Figure 5's x-axis for the midtrained curve and add a source-pool-vs-consumed-tokens column (or footnote) to Table 1.