揭示激活稀疏性与损失平坦性的内在联系,提出可提升稀疏性的训练优化方法。
Towards the Connection between Activation Sparsity and Flat Minima

- 发现MLP激活稀疏性由损失曲面平坦度决定,可通过调整梯度与输入归一化来控制。
- 提出导数稀疏性概念,在反向传播中支持剪枝,比激活稀疏更稳定。
- 三种即插即用方法使推理稀疏性提升36%以上,训练稀疏性提升50%以上。
标准训练的Transformer中MLP模块的激活稀疏性为降低计算成本提供了机会。现有研究认为该现象源于训练过程的隐式偏差而非数据特性,但依赖强假设,难以适用于大规模深度模型。本文发现损失曲面平坦性与激活稀疏性密切相关,可作为深度网络自然成立的弱假设。具体而言:1)激活稀疏性等于“增强平坦度”(加权平坦度之和)与输入范数及激活梯度乘积的比值;该比值随训练下降,导致稀疏激活。2)提出导数稀疏性概念,在ReLU下退化为激活稀疏性,且支持反向传播剪枝,稳定性更高。基于此,通过减小分子、增大分母的三类方法可有效促进稀疏性。ImageNet-1K和C4上的实验表明,相比原生Transformer,推理稀疏性提升至少36%,训练稀疏性提升至少50%,在推断与训练阶段均具显著降本潜力。
原文摘要 · Abstract (English)
The observation that activation sparsity emerges in MLP blocks of standardly trained Transformers offers an opportunity to drastically reduce computation costs without sacrificing performance. To theoretically explain this phenomenon, existing works have shown that activation sparsity does not result from the data properties or data fitting but from the implicit bias of the training process. However, these connections are obtained with strong assumptions, which cannot be applied to deep models standardly trained with a large number of steps. Different from these works, we find that the flatness of loss landscapes is also closely related to the MLP activation sparsity and can serve as a weaker and naturally emerging assumption standard deep networks. Specifically, we find that 1) the MLP activation sparsity equals a ratio between "augmented flatness" (a weighted sum of flatness measures) and the product of the input norm and activation gradient of the MLP. We empirically find that this ratio decreases during training, leading to sparse activations. 2) We also propose the notion of derivative sparsity, which reduces to activation sparsity under ReLU, but further enables pruning in the backward propagation and is more stable than activation sparsity. With the theoretical findings, we can further encourage activation sparsity by decreasing the numerator and increasing the denominator of the ratio using three methods. These plug-and-play modifications can effectively reduce the ratio and produce sparser activations. Experiments on ImageNet-1K and C4 demonstrate relative improvements of at least 36% on inference sparsity and at least 50% on training sparsity over vanilla Transformers, indicating further potential cost reduction in both inference and training
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。