Although the Self-Attention mechanism is a primary contributor to the inference latency of large language models (LLMs), many Self-Attention layers can be removed with little loss in accuracy. We attribute this to the Attention Suppression Hypothesis: during pre-training, deeper Self-Attention layers learn to suppress their outputs, making them redundant. Leveraging this insight, we propose GatePrune, a one-shot, data-free method that scores and removes redundant Self-Attention layers from pre-trained weights alone-with zero calibration data, zero forward passes, and no fine-tuning. Free of the calibration-set dependence of data-driven methods, GatePrune can prune a 13B-parameter model in 30s only on a CPU when the model does not fit in GPU memory. It removes up to 40% of the Self-Attention layers at a cost of at most 1.5 percentage points in average zero-shot accuracy, while speeding up inference by $1.30\times$ and accelerating pruning by $\mathbf{1000\times}$.
翻译:暂无翻译