arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2210.03841cs.CL
收藏

打破BERT:评估和优化稀疏注意力

Breaking BERT: Evaluating and Optimizing Sparsified Attention

Google Research(谷歌研究院)

Siddhartha Brahma, Polina Zablotskaia, David Mimno

摘要:

Transformers允许所有标记对之间的注意,但有理由相信,这些连接中的大多数--以及它们的二次时间和记忆--可能不是必需的。但是是哪几个呢?我们评估的影响稀疏模式与一系列的烧蚀实验。首先,我们将基于语法、词汇相似性和标记位置的掩码与随机连接进行比较,并测量哪些模式降低性能最少。我们发现,在三个常见的微调任务中,即使使用至少78%稀疏的注意力,如果应用于稍后的Transformer层,也不会对性能产生什么影响,但是在整个网络中应用稀疏性会显着降低性能。其次,我们改变了稀疏度的三个模式支持以前的工作,并发现连接到相邻的令牌是最重要的。最后,我们把稀疏性作为一个可优化的参数,并提出了一个算法来学习度的相邻连接,给出了一个细粒度的控制精度稀疏性权衡,同时接近现有方法的性能。

英文摘要:

Transformers allow attention between all pairs of tokens, but there is reason to believe that most of these connections - and their quadratic time and memory - may not be necessary. But which ones? We evaluate the impact of sparsification patterns with a series of ablation experiments. First, we compare masks based on syntax, lexical similarity, and token position to random connections, and measure which patterns reduce performance the least. We find that on three common finetuning tasks even using attention that is at least 78% sparse can have little effect on performance if applied at later transformer layers, but that applying sparsity throughout the network reduces performance significantly. Second, we vary the degree of sparsity for three patterns supported by previous work, and find that connections to neighbouring tokens are the most significant. Finally, we treat sparsity as an optimizable parameter, and present an algorithm to learn degrees of neighboring connections that gives a fine-grained control over the accuracy-sparsity trade-off while approaching the performance of existing methods.

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

↑