RECALL: REpresentation-aligned Catastrophic-forgetting ALLeviation via Hierarchical Model Merging

Bowen Wang, Haiyuan Wan, Liwen Shi, Chen Yang, Peng He, Yue Ma, Haochen Han, Wenhao Li, Tiao Tan, Yongjian Li, Fangming Liu, Yifan Gong, Sheng Zhang

TL;DR

RECALL is a novel, data-free model merging framework that mitigates catastrophic forgetting in Large Language Models (LLMs) by leveraging internal hidden representations. By calculating layer-wise similarities across models using a small set of representative data samples, RECALL adaptively fuses parameters to preserve domain-general features in shallow layers while maintaining task-specific specialization in deeper layers.

What Problem Does This Paper Address?

When Large Language Models (LLMs) are sequentially fine-tuned on new tasks or domains, they suffer from catastrophic forgetting (CF)—a phenomenon where new parameter updates overwrite previously learned knowledge.

Existing solutions generally fall into two camps:

  1. Data-based methods: These replay cached data from historical tasks. While effective, they raise serious storage overhead and data privacy concerns.
  2. Model-based methods: These regularize parameter updates or alter model architectures. However, they often restrict the optimization space, degrade performance across diverse tasks, or increase architectural complexity over time.
Figure 1: A taxonomy of previous approaches to catastrophic forgetting. Data-based methods (a) rely on stored samples from previous tasks, which are replayed alongside new data during fine-tuning. Model-based methods (b) mitigate forgetting by either constraining parameter updates or isolating task-specific knowledge. In (b), the left side illustrates regularization-based methods that optimize model parameters within the intersection of low-loss regions for both old and new tasks (e.g., Task A and Task B), instead of strictly minimizing the loss on the new task. This encourages a more stable update trajectory that retains previously learned knowledge while adapting to new tasks.

The authors of this paper tackle a core challenge: How can we identify and preserve useful task knowledge across multiple models in a completely data-free and task-agnostic manner?

Methods

The authors introduce RECALL (REpresentation-aligned Catastrophic-forgetting ALLeviation), a framework that treats an LLM's internal hidden states as a proxy for its learned knowledge. Instead of uniformly averaging weights (which can cause destructive interference), RECALL performs an adaptive, layer-by-layer fusion:

  1. Typical Dataset Selection: To keep compute requirements low, RECALL applies K-means clustering to the activations of a new dataset ($D_N$) and selects a small set of $m$ representative samples closest to the cluster centers.
  2. Representation Extraction: The representative samples are fed into the base model and the fine-tuned expert models to extract token-averaged hidden states for every layer.
  3. Similarity Calculation: Pairwise inter-model similarity is computed layer-by-layer using a Radial Basis Function (RBF) kernel on these hidden representations.
  4. Hierarchical Merging: These similarity scores are normalized via a Softmax function to generate layer-specific weights. Finally, a fine-grained, layer-by-layer linear interpolation fuses the parameters of the models.

Datasets

The framework was evaluated using Llama-2-7B-chat and Qwen2-7B-Instruct across five distinct NLP datasets unified into a Question-Answering (QA) format:

  • SST-2: Binary sentiment classification.
  • SQuAD2.0: Extractive reading comprehension containing both answerable and unanswerable questions.
  • MedMCQA: Multiple-choice medical entrance exam questions.
  • RACE: English reading comprehension exams for Chinese students.
  • IWSLT2017-en-fr: English-to-French machine translation.

Key Insights and Ideas

  • Representations as Knowledge Proxies: Internal hidden states inherently reflect how a model encodes and processes information, making them excellent, data-free metrics for aligning knowledge across models.
  • Non-Uniform Layer Dynamics: Hidden states form entirely different structural patterns as they progress from layer 0 to layer 32.
  • Specialization-Induced Divergence: Lower layers of fine-tuned models remain highly consistent across different tasks, preserving general language capabilities. Conversely, deeper layers diverge significantly to accommodate task-specific semantics. Naive uniform model merging ignores this reality, whereas RECALL naturally adapts to it.

Representation transformation across layers Representation drift between models fine-tuned on different tasks

Key Results

RECALL was tested across three distinct learning scenarios and consistently outperformed competitive baselines like DARE, LM-Cocktail, and Task Vector:

  • Single Model Merging: Fusing a single task-specific expert with the base model yielded the highest average performance (45.00) and demonstrated a +7.86% improvement in generalization to unseen tasks over the best baseline.
  • Multi-Model Fusion: When simultaneously merging five expert models without the base model, RECALL achieved an outstanding average score of 62.828 (compared to the uniform averaging baseline of 59.828).
  • Sequential Fine-Tuning: In a realistic continual learning setup, RECALL maintained stable performance on early tasks (e.g., SST-2) as new tasks were introduced, significantly flattening the forgetting curve compared to standard LoRA SFT and Elastic Weight Consolidation (EWC).

Limitations and Future Work

Despite its strong performance, the authors note several limitations:

  • Model Homogeneity: RECALL currently requires models to share identical architectures and tokenizers, making it inapplicable for merging heterogeneous model families.
  • Clustering Dependency: The final merging quality relies heavily on the selection and clustering quality of the small representative sample set.
  • Scalability Bottlenecks: While verified on five tasks, further investigation is required to see how well the representation alignment scales when combining dozens of tasks or when integrated with training-time regularization techniques.

Summary updated

BibTeX
@inproceedings{wang2025recall,
  author = {Bowen Wang and Haiyuan Wan and Liwen Shi and Chen Yang and Peng He and Yue Ma and Haochen Han and Wenhao Li and Tiao Tan and Yongjian Li and Fangming Liu and Yifan Gong and Sheng Zhang},
  title = {{RECALL: REpresentation-aligned Catastrophic-forgetting ALLeviation via Hierarchical Model Merging}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2025},
  url = {https://openreview.net/forum?id=mjzTJkemg1},
}
Figure