arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2309.01775cs.LGcs.NE
收藏

门控循环神经网络发现注意力机制

Gated recurrent neural networks discover attention

ETH Zürich(苏黎世联邦理工学院)

Nicolas Zucchet, Seijin Kobayashi, Yassir Akram, Johannes von Oswald, Maxime Larcher, Angelika Steger, João Sacramento

AI总结:

本研究揭示,配备线性循环层和乘法门控的现代RNN能精确实现自注意力,且梯度下降训练使其在上下文学习任务中采用与Transformer相同的基于注意力的算法,凸显了乘法交互的关键作用。

摘要:

近期的架构发展使得循环神经网络(RNNs)在特定序列建模任务上能够达到甚至超越Transformer的性能。这些现代RNN具有一个显著的设计模式:线性循环层通过具有乘法门控的前馈路径相互连接。在此,我们展示了配备这两种设计元素的RNN如何精确实现(线性)自注意力,即Transformer的主要构建模块。通过对一组训练好的RNN进行逆向工程,我们发现梯度下降在实践中发现了我们的构造。特别是,我们检查了在已知Transformer擅长的简单上下文学习任务上训练的RNN,发现梯度下降在我们的RNN中灌输了与Transformer使用的相同的基于注意力的上下文学习算法。我们的发现强调了神经网络中乘法交互的重要性,并表明某些RNN可能正在幕后意外地实现注意力机制。

英文摘要:

Recent architectural developments have enabled recurrent neural networks (RNNs) to reach and even surpass the performance of Transformers on certain sequence modeling tasks. These modern RNNs feature a prominent design pattern: linear recurrent layers interconnected by feedforward paths with multiplicative gating. Here, we show how RNNs equipped with these two design elements can exactly implement (linear) self-attention, the main building block of Transformers. By reverse-engineering a set of trained RNNs, we find that gradient descent in practice discovers our construction. In particular, we examine RNNs trained to solve simple in-context learning tasks on which Transformers are known to excel and find that gradient descent instills in our RNNs the same attention-based in-context learning algorithm used by Transformers. Our findings highlight the importance of multiplicative interactions in neural networks and suggest that certain RNNs might be unexpectedly implementing attention under the hood.

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

↑