【论文笔记】Attention is all you need

在阅读本文之前,关于self-attention的详细介绍,比较全面的transformer总结看之前copy的这篇文章
有了self-attention的基础之后再看这篇论文,感觉就容易了。
论文:Attention is all you need。

1-2 Introduction & Background

RNN:This inherently sequential nature precludes parallelization within training examples, which becomes critical at longer sequence lengths, as memory constraints limit batching across examples.
解决(治标不治本,因为根本上序列计算的限制还在):

  1. factorization tricks.
  2. conditional computation.

也使用过CNN来as basic building block, such as:ByteNet, ConvS2S. But: makes it more diffucult to learn dependencies between distant positions.(计算量与观测序列X和输出序列Y的长度成正比)

历史

名称 解释 局限
seq2seq
encoder-decoder 传统,一般配合RNN
RNN\LSTM\GRU 方向:单向双向;depth:单层or multi-layer; RNN难以应付长序列、无法并行实现、对齐问题;神经网络需要能够将源语句的所有必要信息压缩成固定长度的向量
CNN 可以并行计算、变长序列样本 占内存、很多trick、大数据量上参数调整不容易
Attention Mechanism 关注向量子集、解决对齐问题

提到的点:
self-attention;
recurrent attention mechanism.
transduction models

3 Model Architecture

大部分的encoder-decoder structure:
输入序列:输入序列 x = (x1,…,xn), N个
encoder输出的连续表示:z = (z1,…,zn),N个
docoder的outputs: y=(y1,…,ym),M个
一次一个元素。consuming the previously generated symbols as additional input when generating the next.
transformer模型架构
transforme模型架构2
The Transformer follows this overall architecture using stacked self-attention and point-wise, fully connected layers for both the encoder and decoder.

3.1 Encoder and Decoder Stacks

transformer
transformer结构

Encoder: a stack of N = 6 identical layers.Each layer has two sub-layers:(从下到上)

  1. multi-head self-attention mechanism.
  2. simple, position-wise fully conntected feed-forward network(以下叫ffnn).

多模态的自注意力机制是指在多模态数据中,每个模态内部使用自注意力机制来提取模态内部的信息,并使用跨模态的注意力机制来融合不同模态之间的信息。通过将多模态融合推迟到模型的后期,可以更充分地提取单个模态内部的信息,因为不同模态的数据结构和分布差异很大,使用相同的处理方式可能不合理。在单个模态内部,仍然使用原始的自注意力机制,但在跨模态的融合中,使用各个模态的部分信息来进行跨注意力。除此之外,还可以限制层内不同模态注意力的流动,通过引入一组潜在的融合单元,形成"注意力瓶颈",跨模态的交互必须通过这些单元进行。这样既可以降低计算量,处理部分冗余信息,也可以使模型集中处理每个模态中最相关的输入,并只与其他模态共享必要的输入。因此,多模态自注意力机制在模型中起到了重要的作用。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [【多模态】《Attention Bottlenecks for Multimodal Fusion》论文阅读笔记](https://blog.csdn.net/qq_36643449/article/details/124968439)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [【论文阅读】Attention Bottlenecks for Multimodal Fusion---多模态融合,音视频分类,注意力机制](https://blog.csdn.net/me_yundou/article/details/121070837)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [Attention is all you need:关于transformer中的self-attention](https://blog.csdn.net/hands_up_down/article/details/122022802)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
>