Activated Parameter Locating via Causal Intervention for Model Merging

Fanshuang Kong, Richong Zhang, Ziqiao WangarXiv 2024 · OpenReview

Abstract

Model merging combines multiple homologous models into one model, achieving convincing generalization without the necessity of additional training. A key challenge in this problem is resolving parameter redundancies and conflicts across multiple models. Existing models have demonstrated that dropping a portion of delta parameters can alleviate conflicts while maintaining performance. However, these methods often drop parameters either randomly or based on magnitude, overlooking task-specific information embedded in fine-tuned models. In this paper, we propose an Activated Parameter Locating (APL) method that utilizes causal intervention to estimate parameter importance, enabling more precise parameter drops and better conflict mitigation. Moreover, to reduce the computational complexity associated with a large number of parameter partitions, we also introduce a theoretically supported gradient approximation strategy for APL. Experiments on model merging within both in-domain and out-of-domain settings, along with associated analyses, showcase the effectiveness of APL.

Introduction

Model merging represents a significant step toward efficient AI development, enabling the combination of multiple specialized models into a single multitask architecture without the prohibitive costs of additional training. However, the primary obstacle to successful merging is parameter conflict. When merging several models, their "delta parameters"—the specific weight updates learned during fine-tuning—often overlap and interfere with one another.

Current state-of-the-art techniques, such as Dare or Ties, attempt to mitigate this by pruning a large percentage of delta parameters. These methods typically rely on random selection or numerical magnitude to determine which weights to keep. This research argues that magnitude is an unreliable proxy for importance; a small weight change can be functionally critical, while a large one may be redundant.

Methodology

The proposed Activated Parameter Locating (APL) method shifts the focus from statistical heuristics to causal intervention to identify task-critical parameters.

Conceptual overview of APL vs. previous merging methods.

The APL framework consists of several key components:

  1. Causal Tracing: To determine parameter significance, the system performs two inference passes. A "clean run" uses the standard fine-tuned model, while a "corrupted run" replaces specific parameter partitions with original pre-trained weights. The resulting performance delta quantifies the "causal importance" of those parameters.
  2. Importance-Guided Dropping: APL employs a $tanh$ activation function to calibrate drop ratios. Parameters identified as having high causal importance are preserved, while those with low importance are pruned more aggressively.
  3. Gradient Approximation: To address the computational cost of causal tracing across millions of parameters, the authors introduced a gradient approximation strategy. They demonstrate that the inner product of the task vector and the pre-trained model’s gradient serves as a high-fidelity, low-cost proxy for causal importance.
  4. MI-Task Arithmetic: Model-level importance scores are used to weight the merging process, ensuring that models with more unique task-relevant information have a greater influence on the final merged weights.

Experimental Setup

The effectiveness of APL was evaluated using Llama-2-chat-7B as the base model across diverse benchmarks:

  • In-domain Tasks: AG News, Hellaswag, MNLI, MRPC, SST2, and Winogrande.
  • Out-of-domain Evaluation: The MMLU benchmark, covering 57 tasks across STEM and the humanities.
  • Cross-Architecture Validation: The logic was also tested on RoBERTa-base using the GLUE dataset to ensure generalizability beyond Large Language Models (LLMs).

Results

APL demonstrates superior performance and robustness compared to existing baselines, particularly at high compression levels.

Performance of APL across various drop ratios compared to baselines.
  • Superior Merging Performance: In in-domain settings, APL combined with Model Importance (MI-Task Arithmetic) achieved an average accuracy of 76.25%, surpassing the previous state-of-the-art Ties method (75.54%).
  • Robustness at High Compression: As shown in Figure 3, APL maintains significantly higher accuracy than random dropping (Dare) even when 99.5% of delta parameters are removed. This confirms its ability to pinpoint the "essential" neurons for a given task.
  • Generalization: On the MMLU benchmark, APL outperformed the LM-Cocktail baseline (48.88% vs 48.21%), indicating that precise pruning enhances zero-shot generalization.
  • Efficiency: The gradient approximation variant (w/GA) yielded results nearly identical to full causal tracing while drastically reducing computational overhead.

Discussion and Insights

The study provides several key insights into the nature of fine-tuned models:

  • Magnitude vs. Importance: The results confirm that the magnitude of a parameter change does not correlate strongly with its task importance. This explains why random dropping often outperforms magnitude-based pruning.
  • Task-Specific "Hotspots": Visualization of layer-level importance revealed that similar tasks activate similar layers, while distinct tasks rely on different network regions. APL effectively exploits these task-specific "hotspots."
  • Few-Shot Efficiency: APL requires as few as 5 samples per task to accurately estimate importance, making it highly practical for scenarios with limited data availability.

Limitations

While APL is highly effective, it does require a small amount of task-specific data, unlike data-free methods like Ties. Future research may explore applying these causal importance maps to merge models with different architectures or those trained on divergent data distributions.

Summary updated

BibTeX
@misc{kong2024activated,
  author = {Fanshuang Kong and Richong Zhang and Ziqiao Wang},
  title = {{Activated Parameter Locating via Causal Intervention for Model Merging}},
  year = {2024},
  eprint = {2408.09485},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2408.09485},
}
Figure