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

作为超网络的注意力

Attention as a Hypernetwork

ETH Zürich(苏黎世联邦理工学院);Google(谷歌公司);Google DeepMind(谷歌DeepMind)

Simon Schug, Seijin Kobayashi, Yassir Akram, João Sacramento, Razvan Pascanu

AI总结:

本文将多头注意力重构为超网络,发现低维潜在代码可复用并预测未见组合中的子任务,且非线性值网络改造可提升抽象推理的组合泛化。

摘要:

Transformer在某些情况下能够泛化到新颖的问题实例:这些实例的组成部分可能在训练期间遇到过,但其组合方式并未遇到过。这种组合泛化能力背后的机制是什么?通过将多头注意力重新表述为超网络,我们揭示出一个可组合的低维潜在代码指定了键-查询特定的操作。我们通过实验发现,该潜在代码能够预测网络在未见过的任务组合上执行的子任务,这表明训练期间获得的潜在代码被复用来解决未见过的问题实例。为了进一步检验多头注意力的内在超网络支持组合泛化这一假设,我们消融研究了使超网络生成的线性值网络变为非线性是否会增强组合性。我们发现这一修改改善了抽象推理任务上的组合泛化。具体而言,我们引入了Raven渐进矩阵人类智力测试的符号版本,这使我们能够精确控制训练和评估期间遇到的问题组合。我们在该任务上证明,扩大模型规模和数据规模如何使Transformer实现组合泛化,并产生功能结构化的潜在空间。

英文摘要:

Transformers can under some circumstances generalize to novel problem instances whose constituent parts might have been encountered during training, but whose compositions have not. What mechanisms underlie this ability for compositional generalization? By reformulating multi-head attention as a hypernetwork, we reveal that a composable, low-dimensional latent code specifies key-query specific operations. We find empirically that this latent code is predictive of the subtasks the network performs on unseen task compositions, revealing that latent codes acquired during training are reused to solve unseen problem instances. To further examine the hypothesis that the intrinsic hypernetwork of multi-head attention supports compositional generalization, we ablate whether making the hypernetwork-generated linear value network nonlinear strengthens compositionality. We find that this modification improves compositional generalization on abstract reasoning tasks. In particular, we introduce a symbolic version of the Raven's Progressive Matrices human intelligence test, which gives us precise control over the problem compositions encountered during training and evaluation. We demonstrate on this task how scaling model size and data enables compositional generalization in transformers and gives rise to a functionally structured latent space.

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

↑