Replay on Demand: An Emergent Curriculum for Balancing Adaptation and Forgetting in Continued Pretraining

Lukas Thede, Shengzhuang Chen, Stefan Winzeck, Matthias Bethge, Zeynep Akata, Jonathan Richard SchwarzarXiv 2026

TL;DR

Replay on Demand (RoD) is a novel method for continued pretraining that eliminates the need for manually tuned replay ratios. By letting adaptation and replay samples compete for training slots based on the model's real-time learning and forgetting dynamics, RoD automatically discovers an optimal, evolving curriculum that balances new knowledge acquisition with the preservation of old capabilities.

What Problem Does This Paper Address?

Continued Pretraining (CPT) is the standard way to specialize Large Language Models (LLMs) for specific domains (like law or medicine) or new languages. However, it suffers from the "stability-plasticity" dilemma: learning new data often causes the model to forget its original pretraining knowledge.

The traditional solution is replay—mixing original pretraining data back into the new stream. But this presents a difficult resource-allocation problem. How much should you replay? If you replay too little, the model forgets; too much, and it fails to adapt. Currently, researchers have to "guess" a fixed ratio (e.g., 10% replay) and hope for the best. Furthermore, forgetting isn't uniform; some topics are forgotten faster than others, and the model's needs change as training progresses.

Methods

RoD moves away from fixed ratios and instead treats data selection as a dynamic competition. It builds on the concept of Reducible Holdout Loss (RHO) to score every potential training example:

  1. Adaptation Score ($\rho_A$): Measures "remaining learning potential." It compares the current model's loss on a new sample to the loss of an "adaptation specialist" (a model already converged on the new domain).
  2. Replay Score ($\rho_R$): Measures "observed forgetting." It compares the current model's loss on an old sample to the loss of the original pretrained base model.
Figure 1: RoD dynamically balances adaptation and replay through joint data selection. Adap- tation candidates are scored by their remaining learning potential and replay candidates by their forgetting. Joint top-k selection lets both compete for a shared training budget, dynamically deter- mining the replay share and composition. As adaptation learning potential decreases and forgetting emerges, replay becomes increasingly competitive and receives a larger share of the training budget.

At each training step, RoD draws a large pool of candidates from both sources and performs a joint top-k selection. Samples with the highest scores—those the model is currently forgetting the most or has the most room to learn—enter the batch. This creates an emergent curriculum: early in training, the model focuses on adaptation; as it starts to forget, replay samples naturally become more "competitive" and take up more of the training budget.

Datasets

The authors evaluated RoD across several challenging settings:

  • Adaptation Domains: Legal text (Nemotron-Pretraining-Legal-v1) and a custom German-language corpus.
  • Replay Data: The original Nemotron pretraining corpus (14 categories including world knowledge, math, and code).
  • Proxy Replay: For models like Qwen where original data is private, they tested using Nemotron data as a "proxy" replay source to see if the method still holds up when the replay distribution isn't a perfect match.

Key Insights and Ideas

  • Demand-Driven Allocation: Replay shouldn't be a "tax" paid at every step. RoD shows that replay is initially unnecessary and should grow as forgetting emerges. In their experiments, the replay share naturally climbed from 0% to roughly 20-30% by the end of training.
  • Targeted Protection: RoD doesn't just decide how much to replay, but what to replay. It identifies "vulnerable" knowledge categories (like world knowledge) and samples them more frequently than "stable" ones (like math textbooks).
  • The "Shadow Price" of a Training Slot: The selection process effectively treats the $k$-th highest score as a "price." A sample only gets trained on if its utility (learning or retention gain) exceeds this current market price.
  • Cross-Scale Transfer: Perhaps the most practical finding is that a curriculum discovered by a small model (e.g., 4B parameters) can be successfully applied to a much larger model (e.g., 35B parameters). This allows engineers to "preview" the optimal data mix on cheap hardware before committing to a massive training run.

Key Results

RoD consistently reaches or outperforms the "frontier" of tuned fixed-replay baselines without requiring any manual tuning of the replay ratio.

  • Efficiency: On Legal adaptation, RoD reduced validation-loss forgetting by 43% compared to a standard 10% fixed-replay baseline while maintaining the same level of adaptation.
  • Superior Trade-offs: As seen in Figure 2, RoD (the star) sits at the bottom-left of the graphs, indicating it achieves lower adaptation loss and lower forgetting than most fixed-ratio mixtures (the circles).
  • Robustness: The method proved effective even when using "proxy" replay data for the Qwen model family, though the gains were slightly more pronounced when using native pretraining data.
Figure 2: RoD reaches or improves upon the adaptation–forgetting frontier. Adaptation loss is shown against general validation-loss forgetting (top) and task-based forgetting (bottom); lower is better on both axes. Fixed-replay CPT traces the frontier as replay share varies, while RoD reaches or improves upon it without specifying a replay ratio in advance. Nemotron uses native replay from its pretraining data, whereas Qwen uses the Nemotron data as proxy replay because its pretraining data are unavailable. No-replay CPT and model merging provide additional baselines; max replay is a higher-budget reference trained with approximately 2× the trained-token budget. Insets magnify the operating region around RoD and the strongest baselines.

Limitations and Future Work

  • Reference Model Overhead: RoD requires an "adaptation specialist" reference model. While the authors showed this can be a smaller, cheaper model, it still adds an extra step to the pipeline.
  • Computational Cost: Scoring a large pool of candidates (e.g., $2\times$ the batch size) adds a forward-pass overhead. The authors suggest that curriculum transfer (training a large model on a small model's pre-selected sequence) is the best way to mitigate this.
  • Replay Distribution Quality: RoD can only protect knowledge that exists in your replay buffer. If your replay pool is missing key capabilities the model originally had, RoD cannot "detect" that they are being forgotten.
  • Weighting: Currently, RoD treats one "nat" of learning and one "nat" of forgetting as equal. Future work could explore adding a hyperparameter to explicitly favor one over the other for specific applications.

Summary updated

BibTeX
@misc{thede2026replay,
  author = {Lukas Thede and Shengzhuang Chen and Stefan Winzeck and Matthias Bethge and Zeynep Akata and Jonathan Richard Schwarz},
  title = {{Replay on Demand: An Emergent Curriculum for Balancing Adaptation and Forgetting in Continued Pretraining}},
  year = {2026},
  eprint = {2609.40089},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.40089},
}
Figure