InstructReplay: Replaying Assistant Turns to Preserve General Behavior During Factual Fine-Tuning

Xiaofeng Shi, Qian Kou, Hua ZhouarXiv 2026

TL;DR

When you fine-tune a chatty, helpful AI assistant on a batch of new, bite-sized facts, it learns the facts—but suddenly forgets how to be an assistant, collapsing into terse, broken responses on general tasks. This paper shows that having the model practice a small set of its own pre-recorded answers to general instructions during training (a method called InstructReplay) stops this behavioral amnesia almost completely, without slowing down how well it learns the new material.

What Problem Does This Paper Address?

Imagine hiring a brilliant, articulate tutor and handing them a stack of medical flashcards to memorize. By the next morning, they know every card cold—but when you ask them to write an email or solve an algebra problem, they only grunt eight-word answers.

This is a well-known headache in machine learning called "catastrophic forgetting." Practitioners routinely adapt instruction-tuned language models (like Qwen, Phi, or SmolLM) to specialized domains by fine-tuning them on question-answer pairs. While the models absorb the new domain facts, their general abilities—following formatting rules, writing code, and reasoning step-by-step—fall off a cliff.

Crucially, the authors diagnose where the damage actually happens. When tested on multiple-choice benchmarks scored purely by internal probability (like MMLU), the model's underlying knowledge barely budges. The model hasn't suffered a lobotomy; it has suffered a style shift. Because domain Q&A pairs are short (around 30 tokens), the model overwrites its conversational habits, slashing its average response length in half or more and breaking chain-of-thought reasoning.

Figure 2: (a) IFEval accuracy change versus median re- sponse length relative to M0 for the 60 adapted check- points (Spearman ρ = 0.77; Appendix Figure 7 adds MATH-500 and BBH). (b) Failure rate on questions that M0 answers correctly, by the length of each response relative to M0’s on the same question, pooled over the same checkpoints (Appendix Table 26).

Methods

To anchor the model's conversational habits while it studies new facts, the authors introduce InstructReplay. While "replay" (rehearsing old examples during new training) and "knowledge distillation" (penalizing a student model for drifting from a frozen teacher model's probabilities) are classic techniques, the authors isolate the exact recipe needed for instruction-tuned assistants:

  1. Build a self-generated buffer once: Before fine-tuning begins, the frozen initial model ($M_0$) is given 9,600 general prompts under its native chat template and generates its own responses. Any external "gold" answers in that general dataset are thrown away.
  2. Joint training: In every training step, the student model updates its weights using two losses at a 1:1 sequence ratio: standard cross-entropy to learn the new domain Q&A pairs, and forward Kullback-Leibler (KL) divergence—a measure of how much two probability distributions differ—to match $M_0$'s full vocabulary probabilities at every token of the saved general responses.
Figure 1: Overview of InstructReplay. (a) Before training, the frozen initial model M0 answers each general in- struction once under its chat template, and these assistant turns form the replay buffer; the dataset’s own answers are not used. (b) In each step the student matches M0’s full next-token distribution at every saved prefix of the replayed turns while it learns domain answers with cross-entropy; the two losses share the student’s weights. (c) Equal- weight mean acquisition A and forgetting F over six model–domain settings, combining the adaptation methods in Table 3 and replay controls in Table 4. The green star marks InstructReplay; shading indicates S = A −F > 0.

What’s novel here isn't a complex loss function, but the surgical precision of where the constraint is applied (inside native assistant turns) and whose voice is replayed (the model's own).

Datasets

  • Domain Fine-Tuning & Acquisition (9,600 train / 512 eval Q&A pairs each):
  • CommonCorpus: Technical energy and engineering documents.
  • PMC Biomedical: Newly constructed from open-access articles published after the base models were released (May–August 2026), ensuring the facts are genuinely new.
  • Replay Prompts: 9,600 prompts from UltraData-SFT, split evenly across instruction following, academic tasks, math, code, and translation.
  • General Ability (Forgetting) Benchmarks: Fixed subsets of IFEval (formatting/instruction constraints), MATH-500, BIG-Bench Hard (BBH), HumanEval+ (coding), and MMLU (likelihood-scored knowledge).

Key Insights and Ideas

  • It's a generation problem, not a knowledge problem: Standard factual fine-tuning drops generative benchmarks by 35 percentage points on average, while likelihood-scored MMLU moves by just $-0.4$ points. Forgetting here is largely forgetting how to talk at length.
  • Context is king: Applying the exact same KL distillation penalty to the domain answers themselves barely helps (IFEval still drops 43 points). Applying it to unprompted, raw text continuations without a chat template recovers about two-thirds of the loss. Applying it inside general chat-template turns recovers nearly all of it.
  • Replay your own voice, not someone else's: If you replay the prompt collection's original dataset answers instead of the model's own self-generated answers ("Gold replay"), forgetting more than doubles. Forcing the model to mimic an external author's style pulls it away from its initial equilibrium in a whole new direction.
  • The exact form of the loss matters much less: Replacing full probability distributions (soft targets) with simple cross-entropy on the saved tokens ("Hard" replay) performs nearly identically, because both preserve the right prefixes in the model's own voice.

Key Results

Tested across three ~3B–4B models (SmolLM3-3B, Qwen3-4B, and Phi-4-mini-instruct) and two domains:

  • Drastic reduction in forgetting: InstructReplay slashes the average drop across the five general benchmarks from 28.1 percentage points (Naive SFT) down to 2.4 points, while keeping median response lengths within 15% of the original model.
  • No sacrifice in learning: Domain fact acquisition averages 15.5 points for InstructReplay vs. 15.2 points for standard fine-tuning.
  • Sweeps the competition: Using an overall trade-off score ($S = \text{Acquisition} - \text{Forgetting}$), InstructReplay beats all seven adaptation baselines—including LoRA, SDFT, and RAFT—in every single model-domain setting, while taking at most 2.22 GPU-hours per model on PMC (less than half the compute time of RAFT).
Figure 3: Acquisition versus forgetting for every method, including the two replay controls (open markers). Upper left is better; the shaded region has S = A −F > 0 and the dashed line marks S = 0. Forgetting shares one scale; acquisition scales differ by domain.

Limitations and Future Work

  • Scale and duration: Experiments focus on smaller models (~3B–4B parameters) and short training runs (300 optimizer steps). How this scales to massive frontier models or prolonged continual learning remains open.
  • Unseen capabilities: The five general evaluation benchmarks overlap in style (math, code, instructions) with the UltraData-SFT replay mixture; it is untested whether InstructReplay protects out-of-distribution behaviors like safety guardrails or long-context reasoning.
  • LLM-as-a-judge quirks: Factual acquisition is graded by an ensemble of three LLM judges without human calibration, and small MMLU declines under certain replay settings warrant further investigation.

Summary updated

BibTeX
@misc{shi2026instructreplay,
  author = {Xiaofeng Shi and Qian Kou and Hua Zhou},
  title = {{InstructReplay: Replaying Assistant Turns to Preserve General Behavior During Factual Fine-Tuning}},
  year = {2026},
  eprint = {2611.32918},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.32918},
}
Figure