On-Policy Replay for Continual Supervised Fine-Tuning

Yan Chen, Taojie Zhu, Meng Zhang, Xin Chen, Jiaqi Huang +2 more
5/28/2026
9 citations
cs.LG
distillation

Official code: Yancey2024/OnPolicyReplay (3 stars, Python, last commit 2026-05-29).

Abstract

Continual supervised fine-tuning (SFT) is the de facto recipe for adapting large language models (LLMs) to a stream of downstream tasks, but it suffers from catastrophic forgetting of earlier capabilities. Recent work shows that on-policy signals -- training on the model's own outputs -- reduce forgetting more reliably than off-policy supervision.

Show full abstract

Existing on-policy methods route this signal through a new training objective (e.g., self-distillation losses with a teacher copy), inheriting an extra forward pass, schedule sensitivity, and stylistic drift from the teacher.We instead route the on-policy signal through the training data source. Our method, On-Policy Replay (OPR), rolls out the most recent checkpoint on a small budget of historical prompts, filters the generations by a task reward, and replays the surviving (prompt, model response) pairs as ordinary SFT examples. There is no teacher, no auxiliary loss, and no on-the-fly distillation. Across three 7--8B instruction-tuned backbones (Qwen2.5-7B-Instruct, Qwen3-8B, Llama3.1-8B-Instruct) on the TRACE continual-learning benchmark, OPR consistently reduces forgetting; on the sharpest stress test (Qwen2.5-7B-Instruct, Sequential SFT BWT -13.93), OPR lifts BWT to -0.65 at a 10% replay budget and to -2.29 at a 1% budget -- a 46% reduction in |BWT| over a tuned Vanilla Replay baseline, with 42--46% reductions observed across all three backbones. We give a KL-shrinkage interpretation that places OPR and prior on-policy distillation methods on a single axis, and we present a counterintuitive finding that explains why Vanilla Replay is already a strong baseline: low-score replay is uniformly worse than Vanilla Replay, demonstrating that the active ingredient in OPR is the on-policy distribution, not the response quality alone.Our code is available at https://github.com/Yancey2024/OnPolicyReplay.

View on arXivView PDF

Code Implementations(1)

30Python, ShellMay 28, 20266 months ago

Similar Papers

Cite this paper

@article{chen2026onpolicy,
  title  = {On-Policy Replay for Continual Supervised Fine-Tuning},
  author = {Yan Chen and Taojie Zhu and Meng Zhang and Xin Chen and Jiaqi Huang and Dongyang Xu and Yizhi Wang},
  year   = {2026},
  eprint = {2605.29495},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2605.29495v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2605.29495.svg)](https://codeofpaper.com/paper/2605.29495)

Discussion