arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2109.12188cs.CL
收藏

Transformers中注意稀疏度的预测

Predicting Attention Sparsity in Transformers

Instituto de Telecomunicações(电信研究所);Instituto Superior Técnico(高等技术学院);LUMLIS (Lisbon ELLIS Unit)(LUMLIS(里斯本ELLIS单元));Mila, Université de Montréal(蒙特利尔大学米拉研究所);Language Technologies Institute, Carnegie Mellon University(卡内基梅隆大学语言技术研究所);Unbabel(Unbabel公司);Kaufland e-commerce(考夫兰电子商务)

Marcos Treviso, António Góis, Patrick Fernandes, Erick Fonseca, André F. T. Martins

摘要:

Transformers相对于输入序列长度的二次复杂度激发了对softmax的有效稀疏近似的大量工作。entmax Transformers使用的另一种路径包括内置的精确稀疏注意力;然而这种方法仍然需要二次计算。在本文中,我们提出了Sparsefinder,一个简单的模型训练,以确定entmax的注意力的稀疏模式,然后再计算它。我们实验了我们的方法的三个变体,基于距离,量化和聚类,在两个任务:机器翻译(注意力在解码器)和掩蔽语言建模(编码器)。我们的工作提供了一个新的角度来研究模型的效率做广泛的分析之间的权衡预测注意图的稀疏性和召回。这允许沿着帕累托曲线在不同模型之间进行详细比较,这对于指导稀疏注意模型的未来基准非常重要。

英文摘要:

Transformers' quadratic complexity with respect to the input sequence length has motivated a body of work on efficient sparse approximations to softmax. An alternative path, used by entmax transformers, consists of having built-in exact sparse attention; however this approach still requires quadratic computation. In this paper, we propose Sparsefinder, a simple model trained to identify the sparsity pattern of entmax attention before computing it. We experiment with three variants of our method, based on distances, quantization, and clustering, on two tasks: machine translation (attention in the decoder) and masked language modeling (encoder-only). Our work provides a new angle to study model efficiency by doing extensive analysis of the tradeoff between the sparsity and recall of the predicted attention graph. This allows for detailed comparison between different models along their Pareto curves, important to guide future benchmarks for sparse attention models.

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

↑