Joint Flashback Adaptation for Forgetting-Resistant Instruction Tuning

Yukun Zhao, Lingyong Yan, Zhenyang Li, Shuaiqiang Wang, Zhumin Chen, Zhaochun Ren, Dawei Yin · DOI

Abstract

Large Language Models (LLMs) are increasingly fine-tuned on evolving instruction sets, yet they remain susceptible to catastrophic forgetting. This paper presents Joint Flashback Adaptation (JFA), a task-agnostic continual learning framework. JFA leverages a minimal set of unlabeled 'flashback' prompts and latent task interpolation to anchor existing knowledge while adapting to new domains. Experimental results on Llama-3.1-8B and Vicuna-13B demonstrate that JFA effectively mitigates forgetting with high data efficiency, requiring only 10-30 prompts per task to maintain performance on complex reasoning benchmarks.

Introduction

In the rapidly evolving landscape of AI, LLMs are not static entities. They undergo continuous fine-tuning to align with human preferences, learn specialized domains, or follow new types of instructions. However, a significant hurdle in this process is catastrophic forgetting: the tendency of neural networks to overwrite weights associated with previously learned tasks when exposed to new data. This paper introduces Joint Flashback Adaptation (JFA), a method designed to preserve historical capabilities without the heavy computational or privacy costs associated with traditional replay methods.

The Challenge of Catastrophic Forgetting

Existing approaches to mitigate forgetting often come with significant trade-offs. Replay methods require storing and retraining on vast amounts of historical data, which is often impractical due to privacy constraints or dataset size. Regularization techniques, which penalize weight changes, can be difficult to tune, often leading to a model that either fails to learn the new task (plasticity) or fails to remember the old ones (stability). Finally, adapter-based methods typically require a "task ID" at inference time to route inputs correctly, limiting their flexibility in real-world, task-agnostic scenarios.

Methodology: Joint Flashback Adaptation (JFA)

JFA addresses these limitations through a three-pronged approach:

  1. Flashbacks (Output Constraining): JFA utilizes a tiny set of unlabeled prompts (approximately 30) from previous tasks. During the training of a new task, these "flashback" prompts are processed by both the active model and a frozen reference copy of the original model. A KL-divergence loss ($L_{DIV}$) is applied to ensure the updated model's output distribution remains consistent with its prior state.
  2. Joint Task Learning via Latent Tasks: To overcome the sparsity of using only a few dozen prompts, JFA introduces "latent tasks." Input prompts are encoded (e.g., using RoBERTa), and the system retrieves the top-$k$ most relevant latent tasks, represented as learned LoRA weight increments. This interpolation allows for smoother knowledge sharing across domains and prevents the model from overfitting to the small flashback set.
  3. Gradient Projection (PCGrad): To resolve conflicts between the new task's loss ($L_{SFT}$) and the flashback divergence loss ($L_{DIV}$), JFA employs gradient surgery. By projecting conflicting gradients, the system ensures that learning new skills does not actively degrade existing ones.
The JFA architecture, incorporating flashback prompts and latent task interpolation.

Experimental Setup

The effectiveness of JFA was evaluated using a continual learning simulation. The model was trained on a "New Task" using the Super Natural Instructions (SNI) dataset, which contains over 1,600 diverse NLP tasks. Performance was then measured on several "Old Tasks" (Evaluation/Flashbacks), including arithmetic reasoning (GSM-8K, SVAMP) and general reasoning benchmarks (ARC-Challenge, BIG-Bench-Hard, and MMLU-Pro). The primary models used for testing were Llama-3.1-8B and Vicuna-13B.

Results and Discussion

JFA demonstrated a remarkable ability to resist catastrophic forgetting while simultaneously improving performance on new tasks.

  • Forgetting Resistance: In a standard Supervised Fine-Tuning (SFT) scenario on Llama-3.1-8B, accuracy on the GSM-8K math benchmark dropped from 82.79% to 8.95% after training on SNI. In contrast, JFA maintained GSM-8K performance at 83.09%.
  • New Task Generalization: JFA achieved a 43.72 BLEU score on the new SNI task, outperforming standard SFT (41.50 BLEU), suggesting that the joint learning approach aids overall model capability.
  • Data Efficiency: One of the most significant findings is the extreme efficiency of the flashback mechanism. As shown in the figure below, performance on various benchmarks stabilizes with as few as 30 flashback prompts per dataset.
Performance across benchmarks relative to the number of flashback prompts used.

Conclusion

Joint Flashback Adaptation (JFA) provides a robust, task-agnostic solution to the stability-plasticity dilemma in LLM instruction tuning. By combining minimal unlabeled flashbacks with latent task interpolation and gradient surgery, JFA achieves state-of-the-art results in preserving old knowledge while mastering new domains. Future work will focus on refining the boundary between existing capabilities and new learning requirements to further minimize knowledge conflicts at a granular level.

Summary updated

BibTeX
@misc{zhao2025joint,
  author = {Yukun Zhao and Lingyong Yan and Zhenyang Li and Shuaiqiang Wang and Zhumin Chen and Zhaochun Ren and Dawei Yin},
  title = {{Joint Flashback Adaptation for Forgetting-Resistant Instruction Tuning}},
  year = {2025},
  eprint = {2505.15467},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.15467},
}
Figure