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

论Transformer的最优记忆容量

On the Optimal Memorization Capacity of Transformers

The University of Tokyo(东京大学)

Tokio Kajitsuka, Issei Sato

AI总结:

本文证明Transformer在下一词元预测和序列到序列设置下分别以$\tilde{O}(\sqrt{N})$和$\tilde{O}(\sqrt{nN})$参数达到最优记忆容量,表明自注意力高效识别序列而前馈网络是关联标签的瓶颈。

摘要:

机器学习领域的最新研究日益关注Transformer的记忆容量,但其效率尚未得到充分理解。我们证明,在下一词元预测设置下,对于长度为n的N条输入序列,Transformer可以用$\tilde{O}(\sqrt{N})$个参数记忆标签,且这一结果在对数因子意义下被证明是最优的。这表明,得益于参数共享的优势,Transformer能够高效地进行记忆,且几乎不受输入长度n的影响。我们还分析了序列到序列设置下的记忆容量,发现$\tilde{O}(\sqrt{nN})$个参数不仅充分,而且至少对于使用hardmax的Transformer而言是必要的。这些结果表明,虽然自注意力机制能够高效地识别输入序列,但在将标签与每个词元关联时,前馈网络成为了瓶颈。

英文摘要:

Recent research in the field of machine learning has increasingly focused on the memorization capacity of Transformers, but how efficient they are is not yet well understood. We demonstrate that Transformers can memorize labels with $\tilde{O}(\sqrt{N})$ parameters in a next-token prediction setting for $N$ input sequences of length $n$, which is proved to be optimal up to logarithmic factors. This indicates that Transformers can efficiently perform memorization with little influence from the input length $n$ owing to the benefit of parameter sharing. We also analyze the memorization capacity in the sequence-to-sequence setting, and find that $\tilde{O}(\sqrt{nN})$ parameters are not only sufficient, but also necessary at least for Transformers with hardmax. These results suggest that while self-attention mechanisms can efficiently identify input sequences, the feed-forward network becomes a bottleneck when associating a label to each token.

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

↑