FuseGPT: Learnable Layers Fusion of Generative Pre-trained Transformers

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

Abstract

Generative Pre-trained Transformers (GPTs) have demonstrated remarkable performance across diverse domains through the extensive scaling of model parameters. Recent works observe the redundancy across the transformer blocks and develop compression methods by structured pruning of the unimportant blocks. However, such straightforward elimination will always provide irreversible performance degradation. In this paper, we propose FuseGPT, a novel methodology to recycle the pruned transformer blocks to further recover the model performance. Firstly we introduce a new importance detection metric, Macro Influence (MI), to detect the long-term influence of each transformer block by calculating their loss of information after removal. Then we propose group-level layers fusion, which adopts the parameters in layers of the unimportant blocks and injects them into the corresponding layers inside the neighboring blocks. The fusion is not one-off but through iterative parameter updates by lightweight group-level fine-tuning. Specifically, these injected parameters are frozen but weighted with learnable rank decomposition matrices to reduce the overhead during fine-tuning. Our approach not only works well on large language models but also on large multimodal models. The experiments have shown that, by using modest amounts of data, FuseGPT can outperform previous works in both perplexity and zero-shot task performance.

Introduction

As Large Language Models (LLMs) scale to hundreds of billions of parameters, deploying them on consumer-grade hardware becomes increasingly challenging. Structured pruning—the removal of entire transformer blocks—is a common strategy to reduce memory footprint and accelerate inference. However, traditional pruning methods suffer from two major limitations: irreversible performance loss due to simple layer deletion, and the "Rank Shift" phenomenon, where the relative importance of remaining layers changes dynamically as the architecture is pruned.

Methodology: Knowledge Grafting

FuseGPT reframes model compression as an evolutionary redistribution of knowledge, or "knowledge grafting," rather than simple deletion. The process follows a four-step iterative pipeline.

The iterative four-step pipeline of FuseGPT, encompassing metric computation, selection, learnable fusion, and distillation.
  1. Macro Influence (MI) Metric: Instead of static importance scores, FuseGPT uses MI to quantify the impact of removing a specific block on the final output. This metric is recalculated iteratively to account for the "Rank Shift" phenomenon.
  2. Learnable Manifold Grafting: To avoid the destructive interference common in simple linear weight merging, FuseGPT grafts the weights of pruned blocks onto their neighbors using a low-rank coefficient matrix ($C = AB^T$). This allows the model to adaptively learn which features to preserve.
  3. Local Distillation: A lightweight distillation process ensures the fused neighborhood mimics the original sequence's behavior. This fine-tuning is restricted to a small "fusion window," minimizing computational overhead.
  4. Weight Folding: Post-training, the learned coefficients are mathematically integrated into the weights, resulting in a slimmer model with zero additional inference-time cost.

Experimental Evaluation

The researchers evaluated FuseGPT across several model families, including LLaMA-2/3, Mistral, Qwen, and Phi, using small subsets of WikiText-2 (1024 samples) for calibration. Performance was measured via perplexity on WikiText-2 and C4, alongside zero-shot reasoning benchmarks such as PIQA, HellaSwag, and MMLU. The method was also extended to multimodal models like LLaVA-1.5.

Key Results and Insights

FuseGPT demonstrates significant improvements over existing state-of-the-art (SOTA) pruning techniques.

Perplexity comparison on WikiText and C4 datasets. FuseGPT consistently achieves lower (better) perplexity than baselines like ShortGPT and SliceGPT across different sparsity levels.
  • Superior Performance: At 25% sparsity, FuseGPT on LLaMA-3-8B outperformed baselines that only pruned 20% of layers. It improved zero-shot reasoning scores by up to 4.5 points over existing methods.
  • Efficiency: The method achieves a 1.33× inference speedup and a 25% reduction in memory usage. The entire compression process for a 7B parameter model takes less than one GPU-hour.
  • Compatibility: FuseGPT is orthogonal to quantization. When combined with 4-bit GPTQ, it achieves 52.1% total compression with negligible quality loss.

The "Rank Shift" discovery highlights that one-shot pruning is fundamentally limited because the network's topology is a moving target. By treating pruned layers as "donors" rather than "trash," FuseGPT retains subtle weight distributions critical for zero-shot reasoning.

Conclusion

FuseGPT offers a robust alternative to traditional pruning by treating redundant layers as valuable knowledge sources. While the iterative nature of the process is more computationally intensive than one-shot methods, the performance gains and efficiency at inference time make it a highly practical solution for model compression. Future work may explore global fusion strategies, grafting knowledge to distant but functionally similar layers across the network.

Summary updated

BibTeX
@misc{pei2024fusegpt,
  author = {Zehua Pei and Hui-Ling Zhen and Xianzhi Yu and Sinno Jialin Pan and Mingxuan Yuan and Bei Yu},
  title = {{FuseGPT: Learnable Layers Fusion of Generative Pre-trained Transformers}},
  year = {2024},
  eprint = {2411.14507},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.14507},
}
Figure