iclr 2022 Compositional attention: Disentangling search and retrieval

Mittal S, Raparthy S C, Rish I, et al. Compositional attention: Disentangling search and retrieval[J]. arXiv preprint arXiv:2110.09419, 2021.

目录

  • Mittal S, Raparthy S C, Rish I, et al. Compositional attention: Disentangling search and retrieval[J]. arXiv preprint arXiv:2110.09419, 2021.
    • Motivation
    • 主要贡献
    • Multi-head attention中的不足
      • Multi-head Attention as a rigid pairing of Searches and Retrievals
    • COMPOSITIONAL ATTENTION - DISENTANGLING SEARCH AND RETRIEVAL
      • Compositional Attention allow us to do what?
    • Experiments

Motivation

作者认为,在multi-head attention中存在redundant parameters的问题。比如在下面这张图中,对于retrieve location的操作在multi-head attention中进行了两次,这造成了参数的冗余。

为了解决这个问题,They propose Compositional Attention, where the search and retrieval operations can be flexibly composed: the key-query search mechanism is no longer bound to a fifixed value retrieval matrix, instead it is dynamically selected from a shared pool of value matrices accessible by several compositional attention heads. This results in increased flexibility and improved performance.

iclr 2022 Compositional attention: Disentangling search and retrieval_第1张图片

主要贡献

这篇文章的主要贡献有三点:

  • 指出了multi-head attention中的不足
  • 提出了解决方法Compositional attention
  • 利用自己的方法解决了multi-head attention中出现的问题,并能够很好地解决OOD Generalization中出现的问题。
  • 讨论了一下Compositional attention的计算复杂度

Multi-head attention中的不足

Key-Value Attention: Given a set of queries and key-value pairs, key-value attention computes a scaled cosine similarity metric between each query and the set of keys. This similarity score determines the contribution of each value in the output for the corresponding query.

你看,在multi-head attention中,不也是先计算query与key之间的映射,然后再通过value进行检索的吗?为什么这样的方法就会造成信息的冗余呢?

我们可以先把multi-head attention分为两个阶段:search、 retrieval。

  • search过程指的是根据query+key的过程
  • retrieval指的是对value中的值进行组合的过程

Multi-head Attention as a rigid pairing of Searches and Retrievals

作者任务在mutil-head attention中存在两种类型的冗余:

  • Search Redundancy

    which leads to learning of redundant query-key matrices

  • Retrieval Redundancy

    which leads to learning of redundant value matrices

iclr 2022 Compositional attention: Disentangling search and retrieval_第2张图片

要想实现c这种检测,value的向量是需要能够投影出来location的信息,q和k的向量需要映射为color的信息。这在原来的方法中是不能进行替换的,而是通过多头的方式来进行检查c这个任务,但这并不能 factorize knowledge more efficiently

虽然目前我还没有看完这篇文章,但是我猜测这篇文章的方法呢,是利用了多个value的投影,在这个retrieval的阶段,又多了一次选择,而不是仅仅通过mutli-head的方式进行选择。

除了限制了知识更有效的利用,使用这种rigid可能会限制知识的重新组合、导致冗余的参数并潜在的限制了OoD泛化。

COMPOSITIONAL ATTENTION - DISENTANGLING SEARCH AND RETRIEVAL

这篇文章中提出了一个全新的attention mechanism,释放了原来那种静态的search-retrieval并支持一种更灵活地、动态的mapping。具体上,为了做到这些,Compositional attention放弃了head这个概念。

iclr 2022 Compositional attention: Disentangling search and retrieval_第3张图片

Compositional Attention allow us to do what?

解决了前面提到的fixed search-retrieval pairing的问题

We highlight that Compositional Attention disentangles search and retrieval and solves the redundancies of multi-head attention

a. 可以设置S和R,分别表示Search-Retrieval的数量

b. 可以动态地共享retrieval的结果给所有的search

c. 从假设上来讲,Compositional Attention的pair容量是相当于S*R个multi-head attention(fixed pair)

Experiments

后面就是一套实验,用来证明这篇文章的方法确实别Multi-head Attention要好。

你可能感兴趣的:(我的科研之路~,人工智能,深度学习)