参考:「芝麻街」Big Bird : Sparse Attention 再填新成员

 

背景:

原来的注意力机制复杂度高,q需要和每个key点乘,复杂度是n*n。

存在内存问题,自然也就存在token长度限制。

full attention  ->  small attention ?

big bird = longformer + random attention

三要点:

Random attention

Window attention

Global Attention

 

 三要点

Big Bird的稀疏注意力机制,将二次依赖降至线性,解决了BERT模型中的全注意力机制带来的序列长度二次依赖限制,同时兼顾更长的上下文。Big Bird主要由三个部分组成:

  • global attention:一组参与序列的所有部分的g全局token([cls])。 
  • random attention:对于每个查询 稀疏注意力 | Big Bird: Transformers for Longer Sequences ,每个查询将处理的r个随机key的集合。
  • window attention:一个本地邻居块w,以便每个节点处理其本地结构(attention自己和邻居)。

 

相关文章:

  • 2022-01-12
  • 2021-08-11
  • 2021-12-27
猜你喜欢
  • 2021-06-22
  • 2021-06-09
  • 2022-01-13
  • 2021-08-16
  • 2022-01-11
  • 2021-12-17
  • 2021-08-13
相关资源
相似解决方案