[论文解读] Adding Interpretable Attention to Neural Translation Models Improves Word Alignment
该论文在基于 Transformer 的神经机器翻译模型之上添加了一个对齐层,并引入一个注意力优化过程,以产生高质量的单词对齐,在多个数据集上无需监督对齐数据即可达到与 Giza++ 相当的效果。
Multi-layer models with multiple attention heads per layer provide superior translation quality compared to simpler and shallower models, but determining what source context is most relevant to each target word is more challenging as a result. Therefore, deriving high-accuracy word alignments from the activations of a state-of-the-art neural machine translation model is an open challenge. We propose a simple model extension to the Transformer architecture that makes use of its hidden representations and is restricted to attend solely on encoder information to predict the next word. It can be trained on bilingual data without word-alignment information. We further introduce a novel alignment inference procedure which applies stochastic gradient descent to directly optimize the attention activations towards a given target word. The resulting alignments dramatically outperform the naive approach to interpreting Transformer attention activations, and are comparable to Giza++ on two publicly available data sets.
研究动机与目标
- 动机:说明从神经机器翻译注意力机制中推导出准确的单词对齐的必要性。
- 提出一个对齐层,该层仅对编码器表示进行注意,以预测下一个目标词。
- 通过在不使用单词对齐数据的情况下对现有翻译模型进行微调,实现对齐的无监督训练。
- 引入推理时基于 SGD 的注意力激活优化,用于对齐给定的目标词。
- 在公开数据集上将对齐质量与 FastAlign 和 Giza++ 进行比较评估。
提出的方法
- 在解码器之上扩展 Transformer,添加一个使用编码器注意力且不使用跳跃连接的对齐层。
- 将编码器信息表示为对齐层中多头注意力的键/值。
- 通过在保持基础模型固定的情况下微调预训练的翻译模型来训练对齐层。
- 推理阶段,通过 SGD 优化注意力激活以最大化目标词的似然性。
- 尝试使用不同的编码器表示(词嵌入、编码器输出,或它们的组合)作为对齐层的键/值。
- 在德英、英法和罗英数据上,与基线统计对齐工具(FastAlign、Giza++)进行对比。
实验结果
研究问题
- RQ1在 Transformer 顶层的无监督对齐层是否能够在没有单词对齐数据的情况下产生具有竞争力的单词对齐?
- RQ2为给定目标词优化注意力激活是否能提升对齐质量?
- RQ3不同的编码器表示作为键/值如何影响对齐精度?
- RQ4在多种语言对及方向上,所提出的方法与 FastAlign 和 Giza++ 的比较如何?
主要发现
| 方法 | DeEn | EnDe | 双向 |
|---|---|---|---|
| 平均 | 66.5% | 57.0% | 50.9% |
| 词 | 36.9% | 41.1% | 31.4% |
| 编码 | 39.2% | 35.7% | 28.6% |
| 添加 | 31.5% | 34.7% | 27.1% |
| 随机+SGD | 65.9% | 69.9% | 61.3% |
| 添加+SGD | 26.6% | 30.4% | 21.2% |
| Giza++ | 21.0% | 23.1% | 21.4% |
| FastAlign | 28.4% | 32.0% | 27.0% |
- 使用 SGD 注意力优化的对齐层在 AER 上相较于简单的注意力平均取得了显著改进。
- 将编码器输出用作键/值,与词嵌入或它们的组合一起,提供了最佳结果,在某些设置下大致与 FastAlign 相当。
- 对两个翻译方向的对齐进行对称化进一步提升结果,在两个数据集上达到接近 Giza++ 的性能。
- 在德英数据上,Add+SGD 设置在单向/组合形式下的 AER 为 26.6%(DeEn)和 30.4%(EnDe),接近 Giza++ 的性能。
- 在 En-Fr 和 Ro-En 上,该方法通过对齐层和 SGD 优化,持续提升 AER,在某些方向甚至接近或优于 FastAlign。
- 该方法是无监督的,能够通过微调现有翻译模型进行训练,且易于实现。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。