通过注意力保留的MLP修剪解锁推理语言模型的结构化剪枝
研究论文 · 2026/10/16
结构化剪枝通过移除模型组件来生成更小的稠密模型,从而降低LLM推理成本。然而,现有方法可能导致长形式推理任务(如AIME)的推理性能崩溃。我们提出LayerTrim,一种无需训练的结构化剪枝方法,它识别冗余解码器层并选择性修剪其MLP特征,同时保留注意力和解码器深度。LayerTrim是首个无需梯度或恢复训练、旨在保持长形式推理的免训练结构化剪枝方法。在三个推理语言模型和五个基准测试中,LayerTrim在大多数评估设置中优于现有结构化剪枝方法,相比RESP平均准确率提升高达21.4个百分点。在Qwen3-14B上,LayerTrim相比稠密模型实现1.24倍更快的预填充和19.7%更低的峰值GPU内存,同时更好地保持推理能力。在评估的剪枝模型中,它还实现了最短的平均生成长度,同时保持最高的平均准确率。这些结果表明,LayerTrim通过结构压缩和减少token生成来提高推理效率。
该研究提出了一种无需训练的结构化剪枝方法,能在压缩模型的同时保持长形式推理能力,显著提升推理效率并降低计算成本,对部署推理语言模型具有重要实用价值。
Structured pruning reduces LLM inference costs by removing model components to produce smaller dense models. However, existing methods can cause reasoning performance to collapse on long-form reasoning tasks such as AIME. We propose LayerTrim, a training-free structured pruning method that identifies redundant decoder layers and selectively trims their MLP features while preserving attention and decoder depth. LayerTrim is the first training-free structured pruning method designed to preserve long-form reasoning without gradients or recovery training. Across three reasoning language models and five benchmarks, LayerTrim outperforms existing structured pruning methods in most evaluated settings, improving average accuracy by up to 21.4 percentage points over RESP. On Qwen3-14B, LayerTrim achieves 1.24times faster prefill and 19.7\% lower peak GPU memory than the dense model, while better preserving reasoning ability. It also achieves the shortest average generation length among evaluated pruned models, while retaining the highest average accuracy. These results demonstrate that LayerTrim improves reasoning efficiency through both structural compression and reduced token generation.