From Pruning to Grafting: Dynamic Knowledge Redistribution via Learnable Layer Fusion

Zehua Pei, Hui-Ling Zhen, Xianzhi Yu, Sinno Jialin Pan, Mingxuan Yuan, Bei Yu

TL;DR

FuseGPT reframes structured pruning for Large Language Models (LLMs) as a "prune-and-fuse" process rather than simple removal. By iteratively identifying redundant blocks and "grafting" their knowledge onto neighbors via learnable low-rank adapters, it achieves a new state-of-the-art on the compression-accuracy frontier, delivering significant speedups with minimal performance loss.

What Problem Does This Paper Address?

Deploying Generative Pre-trained Transformers (GPTs) is notoriously resource-intensive. While structured pruning—removing entire transformer blocks—is hardware-friendly and leads to direct inference speedups, it often causes irreversible performance degradation.

The authors identify two fatal flaws in existing pruning strategies:

  1. The Linearity Myth: Most methods assume that if two layers produce similar outputs, their weights can be merged via simple linear averaging. The authors prove this often leads to "destructive interference" and feature collapse.
  2. Static Importance: Traditional methods rank block importance once and prune everything in one shot. However, the authors observe a "Rank Shift" phenomenon: removing one block fundamentally changes the functional importance of the remaining blocks.

Methods

FuseGPT introduces a dual-strategy, iterative pipeline to address these issues:

  • Macro Influence (MI): Instead of static heuristics, the authors propose MI, a dynamic metric that measures how much the final model output changes when a specific block is removed. This is re-evaluated in every iteration to account for Rank Shift.
  • Learnable Manifold Grafting: Rather than discarding a "redundant" block, its knowledge is grafted onto its neighbors. This is done using a learnable low-rank coefficient matrix ($C = AB^T$) that performs an element-wise redistribution of the pruned weights into the surviving layers.
  • Local Distillation: To minimize computational costs, FuseGPT performs "local healing." It isolates a small window of blocks around the pruning site and uses a lightweight distillation process (MSE/KL divergence) to align the fused student blocks with the original teacher representations.
  • Weight Folding: Crucially, after distillation, the learnable factors are mathematically folded back into the static weights. This ensures the final compressed model has zero additional inference overhead.
Figure 1. The overall pipeline of the FuseGPT. The process is iterative to address rank shift. (1) Metric: We compute Macro Influence combining similarity and sensitivity. (2) Selection: The least influential block is selected and grouped with neighbors. (3) Fusion: Knowledge is grafted using learnable low-rank matrices (A, B) and interpolation factor λ. (4) Distillation: Only the local group is fine-tuned using MSE loss to align student and teacher representations.

Datasets

The authors evaluated FuseGPT across a wide range of model families, including LLaMA (2, 3, 3.1), Mistral, Qwen, and Phi.

  • Calibration/Fine-tuning: They used extremely small subsets of WikiText-2 (as few as 32 samples for calibration and 1024 for fine-tuning).
  • Evaluation: Performance was measured using perplexity on WikiText-2 and C4, and zero-shot accuracy on reasoning benchmarks like PIQA, WinoGrande, HellaSwag, ARC, and MMLU.
  • Multimodal: The method was also tested on LLaVA-1.5 using benchmarks like MMMU and GQA.

Key Insights and Ideas

  • Pruning is Redistribution: The core philosophy shifts from "what can we throw away?" to "how can we redistribute this knowledge?"
  • Rank Shift is Real: As shown in the paper's pilot studies, a block that seems redundant in a dense model might become critical once its neighbor is removed. Iterative re-evaluation is non-negotiable for high-sparsity pruning.
  • Linear Merging Fails: The authors found a very weak correlation ($r=0.23$) between activation similarity and successful linear fusion. This justifies the need for learnable fusion rather than closed-form averaging.
Pilot studies showing (a) the weak correlation between similarity and fusion success, and (b) the significant rank shift in block importance after a single removal.

Key Results

FuseGPT consistently outperforms prior state-of-the-art methods like ShortGPT, SliceGPT, and SLEB:

  • Superior Pareto Frontier: At 25% sparsity, FuseGPT often achieves lower perplexity than competing methods at only 20% sparsity.
  • Reasoning Gains: On LLaMA-3-8B, it improved zero-shot reasoning by up to 4.5 points over prior methods.
  • Hardware Efficiency: It delivers a 1.33× inference speedup and a 25% reduction in memory footprint at 25% sparsity.
  • Orthogonality: When combined with 4-bit GPTQ quantization, it achieves 52.1% total compression with negligible quality loss.
  • Speed: The entire compression process for a 7B model takes under one GPU-hour.
Table 1. Perplexity results on WikiText-2 and C4 datasets. Sam- ples are randomly selected from the WikiText-2 training set for calibration. Lower is better.

Limitations and Future Work

The authors acknowledge a few constraints:

  • Computational Intensity: While faster than full fine-tuning, the iterative nature is more demanding than one-shot pruning methods.
  • Local Fusion: Currently, knowledge is only grafted onto immediate neighbors. The authors suggest that "global fusion"—grafting knowledge onto distant but functionally similar blocks—could be a promising future direction.
  • Scaling: While tested up to 13B models, the behavior at the "frontier" scale (70B+ parameters) remains to be fully explored.

Summary updated

BibTeX
@misc{pei2024from,
  author = {Zehua Pei and Hui-Ling Zhen and Xianzhi Yu and Sinno Jialin Pan and Mingxuan Yuan and Bei Yu},
  title = {{From Pruning to Grafting: Dynamic Knowledge Redistribution via Learnable Layer Fusion}},
  year = {2024},
  eprint = {2411.14507},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.14507},
}
Figure