arXiv:2605.18865cs.LGcs.AI2026-05

通过稀疏注意力指导,用简单模块替代Transformer中复杂注意力层。

From Sparsity to Simplicity: Enabling Simpler Sequential Replacements via Sparse Attention Distillation

论文配图:From Sparsity to Simplicity: Enabling Simpler Sequential Replacements via Sparse Attention Distillation
图 1 · 摘自论文原文
  • 基于注意力稀疏性,分层蒸馏替换复杂注意力模块。
  • 稀疏层替换比密集层替换精度下降更小,最大降幅仅1.2%。
  • 适合追求轻量化推理、部署低延迟模型的研究与工程人员。

自注意力是大规模Transformer预训练的核心,但其二次方的标记交互开销导致推理成本高昂。用更简单的序列模块替代注意力虽具吸引力,但直接替换常导致性能显著下降,尤其在大模型中。本文从稀疏性视角重新审视注意力替换:观察到Transformer各层存在多样化的稀疏模式,预训练模型将复杂的标记依赖分解为多种复杂度不同的序列映射,部分层可被更简单的序列模块近似替换而不损失性能。通过即插即用的分层蒸馏框架,在预训练视觉Transformer上评估该假设。在固定训练预算下进行分组替换实验,结果表明:替换稀疏注意力层带来的精度下降远小于替换密集层。进一步采用AViT风格的令牌保留机制对预训练ViT施加显式稀疏性,并开展稀疏引导的蒸馏,发现教师模型稀疏性越高,学生-教师差距越小。所提方法通过注意力稀疏性引导,实现参数量和延迟的降低,有效完成高效注意力替换。

原文摘要 · Abstract (English)

Self-attention serves as the core foundation of large-scale transformer pretraining, but its quadratic token interaction cost makes inference expensive. Replacing attention with simpler sequential modules is appealing, yet naive substitution is often lossy, especially at larger scales. This paper revisits attention replacement through the lens of sparsity. Based on the observation of diverse sparsity patterns across transformer layers, we posit that pretrained transformers decompose the complex token dependency across tokens into various sequence-to-sequence mappings of diverse complexities, where some layer functionalities can be approximated and replaced with much simpler sequential modules without loss. We evaluate this premise using a plug-and-play layer-wise distillation framework to approximate and replace attention functionalities in pretrained vision transformer models. Controlled group-wise replacements under a fixed training budget reveal a clear pattern: substituting layers with sparser attention incurs substantially smaller accuracy drops than replacing denser ones. We further impose explicit attention sparsity on the pretrained ViT via AViT-style token retention and perform sparsity-guided distillation for sequential replacing models, where we see increasing teacher sparsity consistently reduces the student-teacher gap. The proposed method achieves efficient attention replacement for reduced parameter size and latency through the guidance of attention sparsity.

注意力替换稀疏性轻量化蒸馏

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。