TL;DR
CASS (Contribution-Aware Structured Sparsity) is a novel framework that improves model merging by identifying and preserving the specific functional components—attention heads and FFN neurons—that actually contribute to a task. By treating Transformers as modular structures rather than unstructured "bags of parameters," CASS significantly reduces parameter interference and consistently boosts the performance of multi-task models across vision and language benchmarks.
What Problem Does This Paper Address?
Fine-tuning a large foundation model for every new task is computationally expensive and creates a storage nightmare. Model merging offers a solution: take several task-specific "expert" models and blend them into a single multi-task model without retraining from scratch.
However, merging often fails due to parameter interference. When you combine updates from different tasks, they often conflict, leading to a "diluted" model that performs worse than the individual experts. Existing solutions like TIES-Merging or DARE attempt to fix this by pruning task vectors based on weight magnitude or random dropping. The authors argue these methods are flawed because they treat the model as a flat list of parameters, ignoring the fact that Transformers are organized into structured functional units like attention heads and feed-forward (FFN) neurons.
Methods
The authors propose CASS, which operates on the principle that task-specific knowledge is concentrated in a sparse subset of "active" components.
- Unified Summation Form: They first mathematically prove that both Multi-Head Attention (MHA) and FFN layers can be viewed as a sum of independent additive contributions to the model's "residual stream." This provides the algebraic basis for filtering at the component level.
- Contribution Scoring: CASS uses a small, unlabeled "probe set" (as few as 8 samples) to calculate a Contribution Score for each component.
- For FFN neurons, it measures the magnitude of their additive contribution.
- For Attention heads, it uses a "task-selectivity" score to identify heads that deviate from the global average, helping to distinguish task-specific heads from general-purpose ones.
- Two Application Modes:
- CASS-Merging: A post-hoc "denoising filter." It masks task vectors before they are merged using standard operators (like Task Arithmetic or TIES).
- CASS-Tuning: A proactive training-time extension. It applies the masks to gradients during fine-tuning, forcing different tasks to occupy structurally separate subspaces from the start.
Datasets
The researchers evaluated CASS across three diverse benchmarks:
- Vision: FusionBench, using ViT-B/32 and ViT-B/16 architectures across 20 image classification tasks (e.g., MNIST, CIFAR, Oxford-Pets).
- Language (Encoder-only): RoBERTa-base evaluated on 8 tasks from the GLUE benchmark.
- Language (Decoder-only): Qwen2.5 (0.5B and 1.5B) evaluated on 4 capabilities: Coding (Magicoder), Instruction Following (Tulu-3), Mathematics (DART-Math), and Safety (WildGuard).
Key Insights and Ideas
- Functional Sparsity is Real: Their analysis shows that over 80% of neurons have negligible contributions to any specific task. Task-relevant activity is highly concentrated.
- Structural Disjointness: Crucially, the "loud" components for different tasks are largely disjoint. As shown in their Jaccard similarity analysis, the overlap between active neurons for different tasks is near zero. Interference happens primarily when we force the "loud" updates of one task to mix with the "silent" background of another.
- Selectivity > Magnitude: For attention heads, simply looking at weight magnitude is misleading because many heads are "generalists" active across all tasks. Measuring relative selectivity is a much more effective way to find task-specific components.
Key Results
- Universal Improvement: CASS-Merging consistently improved all eight baseline merging methods tested. For example, it boosted Task Arithmetic by +4.97% on vision tasks (ViT-B/16).
- Robustness: The method is remarkably stable regarding the size of the probe set. Performance remained steady whether using 8 or 1024 samples.
- Out-of-Distribution (OOD) Gains: CASS-merged models showed better generalization on held-out tasks and better preserved general knowledge (measured by MMLU) compared to standard merging.
- Efficiency: Generating the masks takes only a few seconds on a single GPU, making it a lightweight pre-filter for any merging pipeline.
Limitations and Future Work
- Fixed Sparsity Ratios: The study used a uniform 20% retention ratio for all tasks and layers. The authors acknowledge that different tasks or layers might benefit from adaptive, task-dependent sparsity levels.
- Model Scale: While successful on models up to 1.5B parameters, the authors note that validating CASS on much larger foundation models (7B+ scale) is a necessary next step.
- Adaptive Selection: Future work could involve developing strategies to automatically determine the optimal number of active heads and neurons for a given task.
Summary updated