Table of Contents
Fetching ...

Mitigating Catastrophic Forgetting in Large Language Models with Self-Synthesized Rehearsal

Jianheng Huang, Leyang Cui, Ante Wang, Chengyi Yang, Xinting Liao, Linfeng Song, Junfeng Yao, Jinsong Su

TL;DR

This work tackles catastrophic forgetting in continual learning for large language models when original past data is unavailable. It introduces Self-Synthesized Rehearsal (SSR), a data-efficient framework that generates rehearsal data via in-context learning with a base LLM, refines outputs using the latest model, and selects diverse synthetic instances for rehearsal. Through extensive experiments on SuperNI across multiple base LLMs, SSR consistently outperforms traditional rehearsal baselines in AR and BWT and approaches multi-task learning performance while using far less real past data, also demonstrating preservation of generalization in Alpaca-7b scenarios. The results suggest SSR as a practical approach for continual updating of LLMs in real-world settings where data access is restricted, with robust behavior across tasks and domains, albeit with some limitations in forward transfer and potential safety considerations in synthetic content.

Abstract

Large language models (LLMs) suffer from catastrophic forgetting during continual learning. Conventional rehearsal-based methods rely on previous training data to retain the model's ability, which may not be feasible in real-world applications. When conducting continual learning based on a publicly-released LLM checkpoint, the availability of the original training data may be non-existent. To address this challenge, we propose a framework called Self-Synthesized Rehearsal (SSR) that uses the LLM to generate synthetic instances for rehearsal. Concretely, we first employ the base LLM for in-context learning to generate synthetic instances. Subsequently, we utilize the latest LLM to refine the instance outputs based on the synthetic inputs, preserving its acquired ability. Finally, we select diverse high-quality synthetic instances for rehearsal in future stages. Experimental results demonstrate that SSR achieves superior or comparable performance compared to conventional rehearsal-based approaches while being more data-efficient. Besides, SSR effectively preserves the generalization capabilities of LLMs in general domains.

Mitigating Catastrophic Forgetting in Large Language Models with Self-Synthesized Rehearsal

TL;DR

This work tackles catastrophic forgetting in continual learning for large language models when original past data is unavailable. It introduces Self-Synthesized Rehearsal (SSR), a data-efficient framework that generates rehearsal data via in-context learning with a base LLM, refines outputs using the latest model, and selects diverse synthetic instances for rehearsal. Through extensive experiments on SuperNI across multiple base LLMs, SSR consistently outperforms traditional rehearsal baselines in AR and BWT and approaches multi-task learning performance while using far less real past data, also demonstrating preservation of generalization in Alpaca-7b scenarios. The results suggest SSR as a practical approach for continual updating of LLMs in real-world settings where data access is restricted, with robust behavior across tasks and domains, albeit with some limitations in forward transfer and potential safety considerations in synthetic content.

Abstract

Large language models (LLMs) suffer from catastrophic forgetting during continual learning. Conventional rehearsal-based methods rely on previous training data to retain the model's ability, which may not be feasible in real-world applications. When conducting continual learning based on a publicly-released LLM checkpoint, the availability of the original training data may be non-existent. To address this challenge, we propose a framework called Self-Synthesized Rehearsal (SSR) that uses the LLM to generate synthetic instances for rehearsal. Concretely, we first employ the base LLM for in-context learning to generate synthetic instances. Subsequently, we utilize the latest LLM to refine the instance outputs based on the synthetic inputs, preserving its acquired ability. Finally, we select diverse high-quality synthetic instances for rehearsal in future stages. Experimental results demonstrate that SSR achieves superior or comparable performance compared to conventional rehearsal-based approaches while being more data-efficient. Besides, SSR effectively preserves the generalization capabilities of LLMs in general domains.
Paper Structure (32 sections, 2 equations, 9 figures, 9 tables)

This paper contains 32 sections, 2 equations, 9 figures, 9 tables.

Figures (9)

  • Figure 1: Comparison of standard rehearsal and our proposed Self-Synthesized Rehearsal (SSR).
  • Figure 2: Our SSR framework. To mitigate catastrophic forgetting with limited or no rehearsal data, we first adopt the base LLM $\theta^{(0)}$ with in-context learning to generate synthetic instances $\{(\hat{x},\hat{y})\}$. We then utilize the latest LLM $\theta^{(t-1)}$ to generate the refined output $\bar{y}$ based on $\hat{x}$. Finally, diverse high-quality synthetic instances are selected for rehearsal in the future stages.
  • Figure 3: AR, FWT, and BWT during continual learning for Llama-2-7b on 10 SuperNI tasks.
  • Figure 4: Effect of synthetic output refinement (SOR) for Llama-2-7b on 5 SuperNI tasks under different continual learning orders.
  • Figure 5: Effect of K-means clustering for Llama-2-7b on 5 SuperNI tasks under different continual learning orders.
  • ...and 4 more figures