arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2210.06313cs.LGcs.CLcs.CVstat.ML

懒神经元现象:Transformer中激活稀疏性的涌现研究

The Lazy Neuron Phenomenon: On Emergence of Activation Sparsity in Transformers

Google Research(谷歌研究院)

Zonglin Li, Chong You, Srinadh Bhojanapalli, Daliang Li, Ankit Singh Rawat, Sashank J. Reddi, Ke Ye, Felix Chern, Felix Yu, Ruiqi Guo, Sanjiv Kumar

AI总结:

该研究发现Transformer等架构中普遍存在激活稀疏性现象,其与数据集特性无关,且可通过Top-k阈值化增强稀疏性,从而提升模型效率、鲁棒性与置信度校准效果。

摘要:

本文研究了Transformer架构机器学习模型中激活图呈稀疏性的奇特现象。激活图指的是多层感知器(MLPs)经ReLU激活函数后的中间输出,而稀疏性是指MLP的每个输入中平均仅有极少的条目为非零(例如T5-Base为3.0%,ViT-B16为6.3%)。此外,层数更多、MLP隐藏维度更宽的更大规模Transformer,其非零条目占比更低,稀疏性更强。通过大量实验,我们证明稀疏性的涌现是一种普遍现象:在自然语言处理和视觉任务中均有出现,在训练和评估数据上均存在,适用于各种配置的Transformer,在所有深度的层中都能观测到,在MLP-mixers和2层MLPs等其他架构中也同样存在。我们发现,使用随机标签、随机输入的训练数据集甚至无限量数据时,稀疏性依然会涌现,这表明稀疏性并非某一特定数据集族的产物。我们探讨了稀疏性如何直接为Transformer提供一种大幅减少浮点运算(FLOP)次数、提升效率的途径。此外,我们得出了或许令人意外的结论:通过k值较小的Top-k阈值化强制实现更稀疏的激活,能为Transformer带来一系列此前缺失的理想特性,即对噪声训练数据的敏感度更低、对输入损坏的鲁棒性更强,以及预测置信度的校准效果更好。

英文摘要:

This paper studies the curious phenomenon for machine learning models with Transformer architectures that their activation maps are sparse. By activation map we refer to the intermediate output of the multi-layer perceptrons (MLPs) after a ReLU activation function, and by sparse we mean that on average very few entries (e.g., 3.0% for T5-Base and 6.3% for ViT-B16) are nonzero for each input to MLP. Moreover, larger Transformers with more layers and wider MLP hidden dimensions are sparser as measured by the percentage of nonzero entries. Through extensive experiments we demonstrate that the emergence of sparsity is a prevalent phenomenon that occurs for both natural language processing and vision tasks, on both training and evaluation data, for Transformers of various configurations, at layers of all depth levels, as well as for other architectures including MLP-mixers and 2-layer MLPs. We show that sparsity also emerges using training datasets with random labels, or with random inputs, or with infinite amount of data, demonstrating that sparsity is not a result of a specific family of datasets. We discuss how sparsity immediately implies a way to significantly reduce the FLOP count and improve efficiency for Transformers. Moreover, we demonstrate perhaps surprisingly that enforcing an even sparser activation via Top-k thresholding with a small value of k brings a collection of desired but missing properties for Transformers, namely less sensitivity to noisy training data, more robustness to input corruptions, and better calibration for their prediction confidence.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑