GeRe: Towards Efficient Anti-Forgetting in Continual Learning of LLM via General Samples Replay

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Zhang, Yunan, Jiang, Shuoran, Zhao, Mengchen, Li, Yuefeng, Fan, Yang, Wu, Xiangping, Chen, Qingcai
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866912523710627840
author Zhang, Yunan
Jiang, Shuoran
Zhao, Mengchen
Li, Yuefeng
Fan, Yang
Wu, Xiangping
Chen, Qingcai
author_facet Zhang, Yunan
Jiang, Shuoran
Zhao, Mengchen
Li, Yuefeng
Fan, Yang
Wu, Xiangping
Chen, Qingcai
contents The continual learning capability of large language models (LLMs) is crucial for advancing artificial general intelligence. However, continual fine-tuning LLMs across various domains often suffers from catastrophic forgetting, characterized by: 1) significant forgetting of their general capabilities, and 2) sharp performance declines in previously learned tasks. To simultaneously address both issues in a simple yet stable manner, we propose General Sample Replay (GeRe), a framework that use usual pretraining texts for efficient anti-forgetting. Beyond revisiting the most prevalent replay-based practices under GeRe, we further leverage neural states to introduce a enhanced activation states constrained optimization method using threshold-based margin (TM) loss, which maintains activation state consistency during replay learning. We are the first to validate that a small, fixed set of pre-collected general replay samples is sufficient to resolve both concerns--retaining general capabilities while promoting overall performance across sequential tasks. Indeed, the former can inherently facilitate the latter. Through controlled experiments, we systematically compare TM with different replay strategies under the GeRe framework, including vanilla label fitting, logit imitation via KL divergence and feature imitation via L1/L2 losses. Results demonstrate that TM consistently improves performance and exhibits better robustness. Our work paves the way for efficient replay of LLMs for the future. Our code and data are available at https://github.com/Qznan/GeRe.
format Preprint
id arxiv_https___arxiv_org_abs_2508_04676
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle GeRe: Towards Efficient Anti-Forgetting in Continual Learning of LLM via General Samples Replay
Zhang, Yunan
Jiang, Shuoran
Zhao, Mengchen
Li, Yuefeng
Fan, Yang
Wu, Xiangping
Chen, Qingcai
Computation and Language
Artificial Intelligence
Machine Learning
The continual learning capability of large language models (LLMs) is crucial for advancing artificial general intelligence. However, continual fine-tuning LLMs across various domains often suffers from catastrophic forgetting, characterized by: 1) significant forgetting of their general capabilities, and 2) sharp performance declines in previously learned tasks. To simultaneously address both issues in a simple yet stable manner, we propose General Sample Replay (GeRe), a framework that use usual pretraining texts for efficient anti-forgetting. Beyond revisiting the most prevalent replay-based practices under GeRe, we further leverage neural states to introduce a enhanced activation states constrained optimization method using threshold-based margin (TM) loss, which maintains activation state consistency during replay learning. We are the first to validate that a small, fixed set of pre-collected general replay samples is sufficient to resolve both concerns--retaining general capabilities while promoting overall performance across sequential tasks. Indeed, the former can inherently facilitate the latter. Through controlled experiments, we systematically compare TM with different replay strategies under the GeRe framework, including vanilla label fitting, logit imitation via KL divergence and feature imitation via L1/L2 losses. Results demonstrate that TM consistently improves performance and exhibits better robustness. Our work paves the way for efficient replay of LLMs for the future. Our code and data are available at https://github.com/Qznan/GeRe.
title GeRe: Towards Efficient Anti-Forgetting in Continual Learning of LLM via General Samples Replay
topic Computation and Language
Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2508.04676