Source-linked AI summary

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

arXiv:2510.20479v1cs.CLcs.AI

TL;DR

Continual learning needs to preserve useful knowledge across models even when historical data and task boundaries are unavailable. RECALL uses hidden representations and clustered typical samples to guide hierarchical, layer-wise model merging. The authors report effectiveness across multiple scenarios, with improved knowledge retention and transferability.

  • Problem

    Without historical data or explicit task boundaries, identifying and preserving useful task knowledge across models is difficult.

    Source: §1 · pp. 1–2
  • Method

    RECALL compares models using hidden representations over clustered typical samples and uses the similarities to guide adaptive, hierarchical parameter merging.

    Source: §1 · p. 2, §3.1 · p. 4, §6 · p. 9
  • Results

    The authors report that RECALL is effective across multiple scenarios and improves knowledge retention and transferability across benchmarks.

    Source: §1 · p. 2, §6 · p. 9
  • Takeaways & Limitations

    RECALL provides a data-free approach to knowledge fusion and catastrophic-forgetting resistance through hierarchical model aggregation.

    Source: §6 · p. 9

    RECALL assumes access to multiple fine-tuned models on related tasks, with identical architectures and aligned tokenizers.

    Source: §7 · p. 9

Abstract

from arXiv · show

We unveil that internal representations in large language models (LLMs) serve as reliable proxies of learned knowledge, and propose RECALL, a novel representation-aware model merging framework for continual learning without access to historical data. RECALL computes inter-model similarity from layer-wise hidden representations over clustered typical samples, and performs adaptive, hierarchical parameter fusion to align knowledge across models. This design enables the preservation of domain-general features in shallow layers while allowing task-specific adaptation in deeper layers. Unlike prior methods that require task labels or incur performance trade-offs, RECALL achieves seamless multi-domain integration and strong resistance to catastrophic forgetting. Extensive experiments across five NLP tasks and multiple continual learning scenarios show that RECALL outperforms baselines in both knowledge retention and generalization, providing a scalable and data-free solution for evolving LLMs.

1 Introduction

Continual learning for LLMs must preserve prior knowledge as models adapt, but without historical data or explicit task boundaries it is difficult to identify what knowledge to retain. RECALL uses internal representations to guide model merging, and the authors report improvements in knowledge retention and transferability.

1 Introduction

  • Data-based methods replay stored samples, while model-based methods constrain updates or isolate task knowledge but may rely on task identifiers or increase model complexity.The paper aims to combine prior-knowledge retention without stored data with flexible adaptation across tasks.Source: §1 · p. 1, Figure 1 · p. 2
  • Without historical data or explicit task boundaries, identifying and preserving useful task knowledge across models is a central challenge.The paper frames data-free, task-agnostic knowledge preservation as the core question.Source: §1 · pp. 1–2
  • RECALL treats internal representations as proxies for learned knowledge and uses inter-model similarities to guide adaptive, layer-wise parameter merging without raw data.The authors argue that fine-grained integration expands the optimization space beyond traditional methods.Source: §1 · p. 2
  • Across datasets and benchmarks, the authors report consistent improvements in knowledge retention and transferability, including multi-domain merging and sequential fine-tuning scenarios.The framework is presented as requiring no task-specific modifications for traditional continual-learning benchmarks.Source: §1 · p. 2

2 Empirical Observations of Representation Dynamics in LLMs

The section examines how representations change across layers within a model and diverge across models fine-tuned on different tasks.

2 Empirical Observations of Representation Dynamics in LLMs

  • The analysis builds on prior evidence that different LLM layers encode distinct linguistic and semantic information (Tenney et al., 2019; Starace et al., 2023).It examines hidden representations as they evolve within models and diverge across models fine-tuned on different tasks.Source: §2 · p. 2

2.1 Layer-wise Representation Shift

  • Adjacent-layer RBF similarity varies non-monotonically, with noticeable drops in both early and late layers; hidden states also form distinct structures across layers.Figure 2 visualizes representations at layers 0, 15, and 32.Source: §2.1 · pp. 2–3, Figure 2 · p. 3

2.2 Specialization-induced Model Divergence

  • Across task-finetuned models given the same inputs, lower-layer representations remain relatively consistent while deeper states diverge into distinct trajectories and clusters.The paper warns that ignoring this misalignment during upper-layer merging may introduce semantic inconsistency or destructive interference.Source: §2.2 · p. 3, Figure 3 · p. 3

3 RECALL: REpresentation-aligned Catastrophic-forgetting ALLeviation

RECALL guides model merging with similarities between layer-wise data representations. It uses those similarities to align knowledge across models and mitigate catastrophic forgetting.

3 RECALL: REpresentation-aligned Catastrophic-forgetting ALLeviation

  • RECALL merges models by comparing layer-wise representations to align knowledge, enhancing multi-domain abilities and mitigating catastrophic forgetting.Its merging procedure calculates weights independently between layers and performs hierarchical merging.Source: §3 · p. 3, §3.3 · p. 5

3.1 Data Representation

  • For a new task, RECALL clusters its dataset and selects samples nearest the cluster centers to represent the data for model comparison.It averages token hidden states into representation vectors; the selected samples reduce the number of forward inferences needed for analysis.Source: §3.1 · p. 4, §3 · p. 4

3.2 Similarity Calculation

  • At each layer, RECALL uses RBF similarity between model representations and averages scores across typical samples.σ is a scaling factor in the similarity calculation.Source: §3.2 · pp. 4–5

3.3 Hierarchical Merging

  • Softmax-normalized representation similarities determine each model’s merging weight for a given layer.The weights are applied to that layer’s parameters during representation-aligned merging.Source: §3.3 · p. 5
  • RECALL performs weighted parameter interpolation layer by layer to produce the final merged parameter vector.The method extends interpolation to groups of parameters and associates weights with models at each layer.Source: §3.3 · p. 5

4 Experiments

Experiments evaluate RECALL across five datasets, single- and multi-expert merging, and sequential fine-tuning; reported results favor RECALL on benchmark averages and resistance to forgetting.

4.1 Experimental Setup

  • Experiments use five datasets spanning classification, single-choice questions, and generation, recast as QA, and compare against SFT, averaging, DARE, LM-Cocktail, task-vector, and EWC baselines.The setup uses Llama-2-7B-chat with LoRA fine-tuning and layer-specific merging weights based on clustered typical samples.Source: §4.1 · pp. 5–6

4.2.2 Multiple Fine-tuned Models Merging

  • RECALL achieves the best overall performance in both settings, with and without the base model, reaching averages of 56.93 and 62.83, respectively, and outperforms other methods without the base model.In supplementary Qwen2-7B-Instruct experiments, RECALL demonstrated strong knowledge fusion ability and resistance to catastrophic forgetting.Source: §4.2.2 · p. 6

4.2.1 Single Fine-tuned Model Merging

  • 45.00 average performance and 38.92 unseen-task performance (+7.86% over the best baseline): RECALL beats all baselines across single-model merging settings.It maintains top-tier results across fine-tuning sources and excels on MEDMCQA and IWSLT2017-EN-FR.Source: §4.2.1 · p. 6, Table 1 · p. 7

4.3 Sequential Fine-tuning Scenario

  • On SST-2, LoRA SFT drops sharply, EWC trends downward, and RECALL remains comparatively stable during sequential fine-tuning.Figure 5 plots performance on the current task immediately after learning it against task index.Source: §4.3 · pp. 6–7, Figure 5 · p. 7

5 Related works

Related work covers data- and model-based continual learning, parameter-merging strategies, and studies of how representations encode and retain knowledge.

5 Related works

  • Data-based continual-learning methods use stored or generated earlier-task samples, while model-based approaches constrain parameter updates or isolate task-specific modules.Recent LLM approaches adapt these paradigms using parameter-efficient tuning modules.Source: §5 · pp. 7–8

5.1 Model Merging

5.2 Probing Representations

  • Probing studies describe layer-specific linguistic and semantic features, their shifts during adaptation, latent knowledge, and limited representation-level forgetting.These findings motivate analyzing representations to study model behavior and knowledge integration.Source: §5.2 · pp. 8–9

6 Conclusions

The conclusion connects representation drift with knowledge differences and forgetting, then presents RECALL as a data-free method for layer-wise alignment and model aggregation.

  • Exploratory experiments examine representation drift across layers and models and relate it to knowledge differences and catastrophic forgetting.Source: §6 · p. 9
  • RECALL aligns representations across model layers through hierarchical aggregation, without requiring past data.Source: §6 · p. 9
  • The paper reports evaluating RECALL across multiple scenarios and examining its details through ablations and other tests.Source: §6 · p. 9

7 Limitations

RECALL’s scope depends on having multiple fine-tuned models for related tasks, and its merging setup has sample-selection and model-compatibility constraints. Scaling and integration with training-time regularization remain open areas for investigation.

7 Limitations

  • RECALL assumes access to multiple fine-tuned models on related tasks, which may not be available in real-world deployment.Source: §7 · p. 9
  • The quality of selected representative samples can influence merging outcomes, despite clustering and similarity computations using only a small sample set.Source: §7 · p. 9
  • RECALL is tailored to models with identical architectures and aligned tokenizers; heterogeneous model families and multilingual settings pose additional challenges.Source: §7 · p. 9
  • Further investigation is needed to assess scaling RECALL to dozens of tasks.Source: §7 · p. 9
  • Integrating RECALL with training-time regularization for tighter lifelong-learning integration remains an open research direction.Source: §7 · p. 9

A Datasets and Fine-Tuning Settings

The experiments fine-tune LLaMA-2-7B on five datasets spanning diverse domains and tasks. They use LoRA-based task-specific models, with dataset-tailored hyperparameters and a LLaMA-2-7B-chat base model.

A Datasets and Fine-Tuning Settings

A.1 Dataset Statistics and Prompt Format

  • The dataset suite comprises SST-2 sentiment reviews, SQuAD2.0 answerable and unanswerable questions, MedMCQA medical multiple-choice questions, RACE exam reading comprehension, and IWSLT2017-en-fr English-to-French TED-talk translation.Source: §A.1 · p. 12

A.2 Fine-Tuning Hyperparameters

  • Five task-specific models use LoRA on LLaMA-2-7B, with distinct dataset-tailored hyperparameters; LLaMA-2-7B-chat is the base model.Source: §A.2 · p. 12

B Experimental Framework

The experimental framework uses instruction tuning, benchmark evaluation, and efficient inference tools. Supplementary materials provide SFT instruction samples and show that representation similarity varies across layers and tasks.

B Experimental Framework

  • Instruction tuning uses llama-factory with parameter-efficient methods including LoRA and QLoRA; OpenCompass evaluates performance, and vLLM supports inference.Source: B Experimental Framework · p. 12

C Instruction and Clustering Sample Details

D Supplementary Similarity Curves

  • Within a single LLM, adjacent-layer cosine similarity drops in both early and late layers, indicating non-uniform representation transformation.Source: Figure 6 · p. 12
  • Across task-fine-tuned LLMs, same-layer representation similarity stays high early and falls deeper; similar tasks align more in middle and upper layers than different domains.MedMCQA and IWSLT diverge especially in deeper layers, while SST-2 and RACE show higher alignment in middle and upper layers.Source: Figure 7 · p. 12, D Supplementary Similarity Curves · pp. 12–13

E Sequential Fine-Tuning Results

Sequential fine-tuning across five tasks degrades performance on earlier tasks as subsequent updates accumulate. This experiment uses a fixed task order without revisiting previous data to quantify forgetting.

E Sequential Fine-Tuning Results

  • The SeqFT baseline trains one model on multiple datasets in a fixed order without revisiting prior data, evaluating all seen datasets after each step.The sequence covers five diverse tasks: sentiment classification, question answering, medical QA, reading comprehension, and machine translation.Source: E Sequential Fine-Tuning Results · p. 13
  • Performance on earlier tasks gradually deteriorates as subsequent tasks are learned, illustrating catastrophic forgetting in sequential fine-tuning.Source: E Sequential Fine-Tuning Results · p. 13

F Comparison of Similarity Metrics

The comparison selects RBF Kernel as the strongest alignment metric across evaluation datasets. RECALL’s algorithm uses representative samples and layer-wise similarities to guide hierarchical model merging, with sampling reducing feature-extraction and similarity costs when the dataset is much larger than the typical sample set.

F Comparison of Similarity Metrics

  • The study compares five similarity measures by computing layer-wise expert-model alignment scores, normalizing the weights, and applying the same hierarchical fusion strategy.The measures are cosine similarity, Euclidean distance converted to similarity, CKA, MMD, and RBF Kernel.Source: F Comparison of Similarity Metrics · pp. 13–14
  • RBF Kernel achieves the highest average performance across tasks and the highest performance across all evaluation datasets in the similarity-metric comparison.The results support using RBF Kernel as RECALL’s default alignment metric.Source: F Comparison of Similarity Metrics · p. 14, Table 8 · p. 15

G RECALL Algorithm Details

  • RECALL selects typical samples by clustering dataset representations and choosing samples nearest to cluster centers, then extracts their representations from each expert model.The algorithm fine-tunes the source model on the task dataset before clustering its representations and extracting corresponding representations from expert models.Source: G RECALL Algorithm Details · p. 15
  • At each layer, RECALL computes similarities between the main model and other models, normalizes them into merging weights, and merges layer parameters hierarchically.The algorithm describes similarity computation, weight normalization, and parameter merging as consecutive steps.Source: G RECALL Algorithm Details · pp. 14–15
  • When n ≫ m, typical-sample selection greatly reduces memory and time for feature extraction and similarity calculation.The reported complexity for K-means selection is O(E(n + k)) space and O(tknE) time for one pass; its overall cost is O(E(n + k)l) space and O(tknEl) time.Source: G RECALL Algorithm Details · p. 15
  • Hierarchical merging uses an independent floating-point weight for each model at each layer while merging parameters individually, and consumption grows linearly with model scale.The merging step has O(lN) space and O(N) time complexity.Source: G RECALL Algorithm Details · p. 15
Loading 2510.20479v1…