iamkissg
  • PaperHighlights
  • 2019
    • 03
      • Not All Contexts Are Created Equal Better Word Representations with Variable Attention
      • Learning Context-Sensitive Word Embeddings with Neural Tensor Skip-Gram Model
      • Approximating CNNs with Bag-of-local-Features models works surprisingly well on ImageNet
      • pair2vec: Compositional Word-Pair Embeddings for Cross-Sentence Inference
      • Contextual Word Representations: A Contextual Introduction
      • Not All Neural Embeddings are Born Equal
      • High-risk learning: acquiring new word vectors from tiny data
      • Learning word embeddings from dictionary definitions only
      • Dependency-Based Word Embeddings
    • 02
      • Improving Word Embedding Compositionality using Lexicographic Definitions
      • From Word Embeddings To Document Distances
      • Progressive Growing of GANs for Improved Quality, Stability, and Variation
      • Retrofitting Word Vectors to Semantic Lexicons
      • Bag of Tricks for Image Classification with Convolutional Neural Networks
      • Multi-Task Deep Neural Networks for Natural Language Understanding
      • Snapshot Ensembles: Train 1, get M for free
      • EDA: Easy Data Augmentation Techniques for Boosting Performance on Text Classification Tasks
      • Counter-fitting Word Vectors to Linguistic Constraints
      • AdaScale: Towards Real-time Video Object Detection Using Adaptive Scaling
      • Learning semantic similarity in a continuous space
      • Progressive Neural Networks
      • BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
      • Language Models are Unsupervised Multitask Learners
    • 01
      • Querying Word Embeddings for Similarity and Relatedness
      • Data Distillation: Towards Omni-Supervised Learning
      • A Rank-Based Similarity Metric for Word Embeddings
      • Dict2vec: Learning Word Embeddings using Lexical Dictionaries
      • Graph Convolutional Networks for Text Classification
      • Improving Distributional Similarity with Lessons Learned from Word Embeddings
      • Real-time Personalization using Embeddings for Search Ranking at Airbnb
      • Glyce: Glyph-vectors for Chinese Character Representations
      • Auto-Encoding Dictionary Definitions into Consistent Word Embeddings
      • Distilling the Knowledge in a Neural Network
      • Uncovering divergent linguistic information in word embeddings with lessons for intrinsic and extrin
      • The (Too Many) Problems of Analogical Reasoning with Word Vectors
      • Linear Ensembles of Word Embedding Models
      • Intrinsic Evaluation of Word Vectors Fails to Predict Extrinsic Performance
      • Dynamic Meta-Embeddings for Improved Sentence Representations
  • 2018
    • 11
      • Think Globally, Embed Locally — Locally Linear Meta-embedding of Words
      • Learning linear transformations between counting-based and prediction-based word embeddings
      • Learning Word Meta-Embeddings by Autoencoding
      • Learning Word Meta-Embeddings
      • Frustratingly Easy Meta-Embedding – Computing Meta-Embeddings by Averaging Source Word Embeddings
    • 6
      • Universal Language Model Fine-tuning for Text Classification
      • Semi-supervised sequence tagging with bidirectional language models
      • Consensus Attention-based Neural Networks for Chinese Reading Comprehension
      • Attention-over-Attention Neural Networks for Reading Comprehension
      • Baseline Needs More Love: On Simple Word-Embedding-Based Models and Associated Pooling Mechanisms
      • Convolutional Neural Networks for Sentence Classification
      • Deep contextualized word representations
      • Neural Architectures for Named Entity Recognition
      • Improving Language Understanding by Generative Pre-Training
      • A Sensitivity Analysis of (and Practitioners’ Guide to) Convolutional Neural Networks for Sentence C
      • Teaching Machines to Read and Comprehend
    • 5
      • Text Understanding with the Attention Sum Reader Network
      • Effective Approaches to Attention-based Neural Machine Translation
      • Distance-based Self-Attention Network for Natural Language Inference
      • Deep Residual Learning for Image Recognition
      • U-Net: Convolutional Networks for Biomedical Image Segmentation
      • Memory Networks
      • Neural Machine Translation by Jointly Learning to Align and Translate
      • Convolutional Sequence to Sequence Learning
      • An Empirical Evaluation of Generic Convolutional and Recurrent Networks for Sequence Modeling
      • Graph Attention Networks
      • Attention is All You Need
      • DiSAN: Directional Self-Attention Network for RNN/CNN-Free Language Understanding
      • A Structured Self-attentive Sentence Embedding
      • Hierarchical Attention Networks for Document Classification
      • Grammar as a Foreign Language
      • Show, Attend and Tell: Neural Image Caption Generation with Visual Attention
      • Transforming Auto-encoders
      • Self-Attention with Relative Position Representations
    • 1
      • 20180108-20180114
  • 2017
    • 12
      • 20171218-2017124 论文笔记
    • 11
      • 20171127-20171203 论文笔记 1
      • 20171106-20171126 论文笔记
      • 20171030-20171105 论文笔记 1
  • Paper Title as Note Title
Powered by GitBook
On this page
  • TL;DR
  • Key Points
  • Notes/Questions

Was this helpful?

  1. 2018
  2. 5

Effective Approaches to Attention-based Neural Machine Translation

TL;DR

本文对 attention model 进行了研究, 提出了 2 类 attention model: global attention 和 local attention 和 3 种 alignment function. 顾名思义, global attention 考虑 source 的所有状态; 而 local attention 仅考虑局部状态, 减少了计算开销. Local attention 需要估计对齐点, 文中介绍了 2 种方法:

  1. 按位置递增法 ($p_t=t$);

  2. 预测法 ($p_t=S\cdot \sigma(v_p^T tanh(W_p h_t))$).

文章提出的 3 种 alignment function 分别是:

  1. dot ($h_t^T \overline{h_s}$);

  2. general ($h_t^T W_a \overline{h_s}$);

  3. concat ($v_a^T tanh(W_a[h_t;\overline{h_s}])$).

此外, 文中还介绍了 input-feeding approach, 该方法考虑 past alignment information 来帮助当前的对齐决策. 具体做法是将前一时刻的 attention vector $\tilde{h_{t-1}}$ 与当前时刻 decoder 的输入拼接作为最终 decoder 的输入.

Key Points

  • 提出了 2 类 attention model: global attention 和 local attention. 前者在 source 的所有状态上考虑 attention distribution; 后者只考虑局部范围内的 attention distribution.

  • 提出了 3 种计算 decoder 状态 $h_t$ 和 encoder 状态 $h_s$ 的对齐程度方法:

    1. dot: $score(h_t, \overline{h_s})=h_t^T \overline{h_s}$;

    2. general: $score(h_t, \overline{h_s})=h_t^T W_a \overline{h_s}$;

    3. concat: $score(h_t, \overline{h_s})=v_a^T tanh(W_a[h_t;\overline{h_s}])$.

  • (实际上, 文中还提到了一种基于位置来计算对齐程度的方法 location-based function: $score(h_t, \overline{h_s})=W_a h_t$. 这甚至都没有考虑 source 的状态, 笔者不认为这算对齐.)

  • 如上所示, 本文的 attention 计算流程是: $ht\rightarrow a_t \rightarrow c_t \rightarrow \tilde{h_t}$. (Bahdanau 那篇是 $h{t-1} \rightarrow a_t \rightarrow c_t \rightarrow h_t$.)

  • Local attention 是 soft attention 和 hard attention 的折中方法. 所谓 soft attention 就是 global attention, 只是本文为和 local 做区分换了个名字, 通过对所有相似度做 softmax, 每对 source-target 状态都有相似概率, attention 连续可微; 而 hard attention 就是简单粗暴地取一个 source 状态, attention 不连续可微, 无法使用 BP 算法.

  • Local attention 的具体方法是: 为每个 target word 生成一个对齐位置 $p_t$, 然后取其左右大小为 D 的窗口计算 $c_t$. 由于 D 是固定的, alignment vector $a_t$ 的是一个定长向量.

  • 文中介绍了 2 种生成对齐位置的方法:

    1. Monotonic alignment: 此时假设 source 和 target 序列是单调对齐的, 简单地说, target在 t+1 时刻对齐的 source 状态不会出现在 t 时刻之前;

    2. Predictive alignment: 此时使用一个预测模型来预测对齐位置. $p_t=S\cdot \sigma(v_p^T tanh(W_p h_t))$ (此处$\sigma$ 是 sigmoid 函数, S 是输入序列的长度). 然后以 $p_t$ 为中心, 以 截断高斯分布 truncated gaussian distribution 作为 attention distribution 计算 alignment vector: $a_t(s)=align(h_t, \overline{h_s}exp(-\frac{(s-p_t)^2}{2\sigma^2})$ (文中并没有将 $p_t$ 处理成整数, 但 $s$ 确是落在窗口内的整数)

  • 受传统 MT 维护一个 coverage set 以追踪已经翻译的单词的启发, 文章提出了 input-feeding approach, 即在对齐决策时, 考虑过去已经使用过的对齐信息. 具体做法很简单, 就是将上一时刻的 attention vector $\tilde{h_{t-1}}$ 和当前时刻 decoder 的输入共同作为 decoder 的输入.

  • 一些实验发现包括:

    • perplexity 确实与翻译质量强相关;

    • input-feeding approach 是有帮助的;

    • attention model 对 unknown words 也能学到有用的对齐信息 (基于使用 \ 替换低频词的实验结果比不使用该技术的结果更好):

    • global attention + dot 效果不错, general 与 local attention 更搭;

    • attention model 对于名字的对齐效果特好 (中文姓在前名在后, 英文名在前姓在后, 这样的关系);

  • 下图分别是 global attention model 与 local attention model:

Notes/Questions

  • 本文一些存疑的地方:

    • 文章提到论文 \ 在目标函数中使用一个 additional constraint 来确保模型对图片所有部分有相同的关注度. 那篇我还没看, 该方法的目的与效果有待后续补充. 但本文说 input-feeding approach 能提供对于 additional constraints 的灵活选择, 语焉不详, 没理解.

    • 不知道该如何评价 attention model 对学习名字的超强能力. 在我看来, 名字是一个专有名字, 是一个整体, 该能力的用处有多大, 见仁见智吧.

    • 文中使用了 alignment error rate, AER 指标来评估对齐的质量, 但具体做法没有介绍, 给了一个分数就了事了, 最后得出结论: AER 与翻译质量相关度不大. 让人着摸不透. 不如 Bahdanau 那篇上图来得直观.

PreviousText Understanding with the Attention Sum Reader NetworkNextDistance-based Self-Attention Network for Natural Language Inference

Last updated 5 years ago

Was this helpful?

global attention model
loca attention model