High-Layer Attention Pruning with Rescaling

Songtao Liu, Peng Liu
7/2/2025
cs.CLcs.LG

Official code: SongtaoLiu0823/HARP (0 stars, last commit 2026-01-31).

Abstract

Pruning is a highly effective approach for compressing large language models (LLMs), significantly reducing inference latency. However, conventional training-free structured pruning methods often employ a heuristic metric that indiscriminately removes some attention heads across all pruning layers, without considering their positions within the network architecture. In this work, we propose a novel pruning algorithm that strategically prunes attention heads in the model's higher layers. Since the removal of attention heads can alter the magnitude of token representations, we introduce an adaptive rescaling parameter that calibrates the representation scale post-pruning to counteract this effect. We conduct comprehensive experiments on a wide range of LLMs, including LLaMA3.1-8B, Mistral-7B-v0.3, Qwen2-7B, and Gemma2-9B. Our evaluation includes both generation and discriminative tasks across 27 datasets. The results consistently demonstrate that our method outperforms existing structured pruning methods. This improvement is particularly notable in generation tasks, where our approach significantly outperforms existing baselines.

View on arXivView PDF

Code Implementations(1)

[TMLR 2026] High-Layer Attention Pruning with Rescaling

00Shell, PythonJan 15, 20268 months ago

Similar Papers

Cite this paper

@article{liu2025highlayer,
  title  = {High-Layer Attention Pruning with Rescaling},
  author = {Songtao Liu and Peng Liu},
  year   = {2025},
  eprint = {2507.01900},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2507.01900v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2507.01900.svg)](https://codeofpaper.com/paper/2507.01900)

Discussion