让大模型按需计算,每令牌动态裁剪注意力与前馈通道。
WIDE: Boosting Adaptive LLM Inference via Token-level Dynamic Width Pruning

- 按令牌粒度动态选择注意力头和前馈通道组,实现细粒度计算分配。
- 50%裁剪率下,推理速度提升55.1%,解码阶段最高达4.95倍加速。
- 支持预填充与解码全流程,适合实际部署场景的高效推理优化。
剪枝是提升大模型效率的有力方法。现有静态结构化剪枝虽硬件友好,但输入无关的计算分配常导致激进稀疏下的显著精度下降。近期动态稀疏方法通过适应输入提升质量保留,但仍多限于粗粒度结构决策,实际推理场景中加速效果有限。为此,我们提出WIDE,首个端到端可微的令牌级动态宽度剪枝框架,适用于预填充与解码场景。WIDE通过允许每个令牌动态选择注意力头组和前馈通道组,将动态剪枝从层级扩展至神经元块级粒度。采用两阶段训练流程,学习有效的令牌级稀疏执行模式,显著优于现有方法的质量保留能力。为使细粒度动态剪枝实用,我们进一步提出剪枝-内核协同设计框架,将动态稀疏加速分解为掩码重排、硬件无关块跳过和硬件依赖块内跳过,支持跨粒度高效执行。在50%稀疏下,相比仅校准的最先进动态深度剪枝,性能提升55.1%;在预填充与解码负载下,分别实现高达1.98倍和4.95倍的理论内核级加速,以及1.68倍和1.55倍的端到端加速。代码已开源。
原文摘要 · Abstract (English)
Pruning is a promising approach for improving the efficiency of LLMs. Existing static structured pruning methods are hardware-friendly and can deliver practical throughput gains, but their input-agnostic computation allocation often causes substantial accuracy degradation under aggressive sparsity. Recent dynamic sparsity methods improve quality retention by adapting computation to individual inputs, yet they remain largely limited to coarse-grained structural decisions and their practical acceleration under real-world inference scenarios remains challenging. To address these challenges, we present WIDE, the first end-to-end differentiable token-level dynamic width pruning framework designed for both prefill and decode scenarios. WIDE enables fine-grained computation allocation by allowing each token to dynamically select attention-head groups and FFN-channel groups, extending dynamic pruning beyond layer-level decisions to neuron-block-level granularity. Through a two-stage training pipeline, WIDE learns effective token-wise sparse execution patterns and achieves substantially better quality retention than existing approaches. To make such fine-grained dynamic pruning practical, we further propose a pruning--kernel co-design framework that decomposes dynamic sparsity acceleration into mask reordering, hardware-agnostic block-level skipping, and hardware-dependent intra-block skipping, enabling efficient execution across different granularities. At 50% sparsity, WIDE provides 55.1% performance boost when compared to the state-of-the-art dynamic depth pruning under calibration-only settings. Under prefill and decoding inference workloads, WIDE achieves close-to-theoretical kernel-level speedups of up to 1.98x for prefill and 4.95x for decoding, as well as 1.68x and 1.55x end-to-end acceleration. Our code is available at https://github.com/EIT-NLP/LLM-Pruning/tree/main/WIDE.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。