Neural machine translation by jointly learning to align and translate论文阅读笔记

Title

Neural machine translation by jointly learning to align and translate

(零)细节

  • 传统的phrase-based translation system,特点是consists of many small sub-components that are tuned separately

(一)摘要

  • 神经机器翻译是应用到机器翻译领域的新方法,当前的做法就是使用encoder-decoders架构,将a source sentence变成a fixed-length的vector。然后使用decoder生成翻译,通过联合训练来最大化输出翻译句子的概率。这种方式很难处理长句子,并且Cho et al证明随着句子长度的增加,basic编码器-解码器的性能确实会迅速下降。
  • 作者认为fixed-length的向量是继续提升encoder-decoder 框架性能的一个瓶颈(bottleneck),然后作者提出让模型能够去自动地search for parts of a source sentence that are relevant to predicting a target word。就是找到和翻译后的word最相关的源句中的关键部分。就像人把’the dog’翻译’狗’那样,作者提出的网络试图找到和"狗"最相关的源句部分就是"the dog"

(二)介绍

  • 本文提出的网络试图将input sentence编码成a sequence of vectors and chooses a subset of these vectors adaptively while decoding the translation,不需要将一个完整的句子squash into a fixed vector,能够更好地适应长句子。

  • 本文提出的网络提升了神经机器翻译的性能,尤其是针对长句子而言,同时文中还进行了qualitative analysis(定性分析),去在原句和翻译句之间构建linguistically plausible (soft-)alignment语言上合理的(软)对齐。

(三) 背景

  • 从统计学角度来看神经机器翻译

    在给定原句的情况下,希望找到一个目标句子 y \mathbf{y} y,目标函数为最大化条件概率
    arg ⁡ max ⁡ y p ( y ∣ x ) \arg \max _{\mathbf{y}} p(\mathbf{y} \mid \mathbf{x}) argymaxp(yx)

  • 从neural networks角度看神经机器翻译

    • (Cho et al., 2014a) and (Sutskever et al., 2014)使用neural neteworks去直接学习上面的条件分布,具体的做法,就是使用两个RNN将可变长度的源句子编码为固定长度的向量,并将该向量解码为可变长度的目标句子。
    • Sutskever et al. (2014)使用LSTM作为基本单元来进行翻译
    • Adding neural components to existing translation system进一步提升翻译性能。

3.1 RNN Encoder-Decoder

3.1.1 Encoder部分

h t = f ( x t , h t − 1 ) c = q ( { h 1 , ⋯   , h T x } ) \begin{array}{c} h_{t}=f\left(x_{t}, h_{t-1}\right) \\ c=q\left(\left\{h_{1}, \cdots, h_{T_{x}}\right\}\right) \end{array} ht=f(xt,ht1)c=q({h1,,hTx})

  • input sentence: x = ( x 1 , ⋯   , x T x ) \mathbf{x}=\left(x_{1}, \cdots, x_{T_{x}}\right) x=(x1,,xTx)

  • 编码成的vector c c c

  • h t ∈ R n h_{t} \in \mathbb{R}^{n} htRn为t时刻的隐状态

  • f f f q q q是非线性函数

    对于 Sutskever et al. (2014) 使用LSTM作为 f f f,并且 c c c就是 q ( { h 1 , ⋯   , h T } ) = h T q\left(\left\{h_{1}, \cdots, h_{T}\right\}\right)=h_{T} q({h1,,hT})=hT最后一个时刻的输出隐状态。

3.1.2 Decoder部分
  • 输入为context vector c c c以及所有之前预测的words{ y 1 , . . . , y t ′ − 1 {y_1,...,y_{t^{'}-1}} y1,...,yt1},

  • p ( y ) p(\mathbf{y}) p(y)利用条件概率进行分解
    p ( y ) = ∏ t = 1 T p ( y t ∣ { y 1 , ⋯   , y t − 1 } , c ) p(\mathbf{y})=\prod_{t=1}^{T} p\left(y_{t} \mid\left\{y_{1}, \cdots, y_{t-1}\right\}, c\right) p(y)=t=1Tp(yt{y1,,yt1},c)
    利用RNN可以将条件概率进行建模:
    p ( y t ∣ { y 1 , ⋯   , y t − 1 } , c ) = g ( y t − 1 , s t , c ) p\left(y_{t} \mid\left\{y_{1}, \cdots, y_{t-1}\right\}, c\right)=g\left(y_{t-1}, s_{t}, c\right) p(yt{y1,,yt1},c)=g(yt1,st,c)

  • 也可以使用其他的architectures 比如a hybrid of an RNN以及a de-convolutional neural network can be used (Kalchbrenner and Blunsom, 2013)

(四)Learning to align and translate

  • 整体框架:
    在这里插入图片描述

    encoder由双向RNN组成,解码器在翻译过程中serching trough a source sentence

4.1 Decoder:General Description

​ 使用RNN解码器框架来代替条件概率定义:
p ( y i ∣ y 1 , … , y i − 1 , x ) = g ( y i − 1 , s i , c i ) p\left(y_{i} \mid y_{1}, \ldots, y_{i-1}, \mathbf{x}\right)=g\left(y_{i-1}, s_{i}, c_{i}\right) p(yiy1,,yi1,x)=g(yi1,si,ci)
​ 其中 s i s_i si为解码器RNN的隐状态, s i = f ( s i − 1 , y i − 1 , c i ) s_{i}=f\left(s_{i-1}, y_{i-1}, c_{i}\right) si=f(si1,yi1,ci),不同于之前架构的地方时,原来 y i y_i yi是基于固定向量 c c c的,而现在 y i y_i yi是基于 c i c_i ci的。而这里 c i c_i ci又是依赖于 ( h 1 , . . h T x ) (h_1,..h_{T_x}) (h1,..hTx)的, c i c_i ci的计算方式为:
c i = ∑ j = 1 T x α i j h j c_{i}=\sum_{j=1}^{T_{x}} \alpha_{i j} h_{j} ci=j=1Txαijhj
其中
α i j = exp ⁡ ( e i j ) ∑ k = 1 T x exp ⁡ ( e i k ) e i j = a ( s i − 1 , h j ) \begin{array}{c} \alpha_{i j}=\frac{\exp \left(e_{i j}\right)}{\sum_{k=1}^{T_{x}} \exp \left(e_{i k}\right)} \\ e_{i j}=a\left(s_{i-1}, h_{j}\right) \end{array} αij=k=1Txexp(eik)exp(eij)eij=a(si1,hj)
e i , j e_{i,j} ei,jis an alignment model which scores how well the inputs around position j and the output at position i match. The score is based on the RNN hidden state s i − 1 s_{i−1} si1(just before emitting y i y_i yi, Eq. (4)) and the j-th annotation h j h_j hj of the input sentence.

  • 文中参数化the alignment model α \alpha α作为一个feedforward neural network which is jointly trained with
    all the other components of the proposed system.这里似乎没有介绍 α \alpha α的3种形式。

4.2 ENCODER: BIDIRECTIONAL RNN FOR ANNOTATING SEQUENCES

  • 采用双向RNN作为编码器:
    • forward RNN f ⃗ \vec{f} f 产生的隐状态为: ( h ⃗ 1 , … , h ⃗ T x ) \left(\vec{h}_{1}, \ldots, \vec{h}_{T_{x}}\right) (h 1,,h Tx)
    • backward RNN f ← \overleftarrow{f} f 产生的隐状态为: ( h ← 1 , ⋯   , h ← T x ) \left(\overleftarrow{h}_{1}, \cdots, \overleftarrow{h}_{T_{x}}\right) (h 1,,h Tx)
  • 最终得到的状态向量为: h j = [ h ⃗ j ⊤ ; h ← j ⊤ ] ⊤ h_{j}=\left[\vec{h}_{j}^{\top} ; \overleftarrow{h}_{j}^{\top}\right]^{\top} hj=[h j;h j]

(五)实验设置

论文最后做对比,挑一个不如我们模型的,而且还是最近的模型,对于两个模型使用相同的训练过程和相同的数据集。

5.1 数据集

  • WMT ’14
  • 预处理操作:
    • 我们使用Axelrod等人(2011)的数据选择方法,将组合语料库的大小减少到348M个单词
    • We do not use any monolingual data other than the mentioned parallel corpora(只使用这个), although it may be possible to use a much larger monolingual corpus to pretrain an encoder
    • 将news-test-2012和news-test-2013concatenate作为验证(validation)集
    • evaluate the models on the test set (news-test-2014) 测试集
    • 我们使用每种语言中最常用的30,000个单词来训练我们的模型。任何未包含在候选列表中的单词都会被映射到一个特殊的标记([UNK])。我们不会对数据进行任何其他特殊的预处理。比如lowercasing或者stemming

5.2 模型

  • RNN Encoder–Decoder(前人模型) (RNNencdec, Cho et al.) Train了两个模型,length up to 50 words(RNNencdec-30)以及length up to 30 words(RNNencdec-50

  • RNNsearch(本文模型) Train了两个模型,length up to 30 words(RNNsearch-30)以及length up to 50 words(RNNsearch-50

  • encoder采用1000个隐状态的双向RNN,decoder有1000 hidden units

  • In both cases, we use a multilayer network with a single maxout (Goodfellow et al., 2013) hidden layer to compute the conditional probability of each target word (Pascanu et al., 2014).

  • a minibatch stochastic gradient descent (SGD) algorithm together with Adadelta,batch_size大小为80,训练了5天

  • 训练完成后使用beam search最大条件概率

(六)结果

6.1 定量结果

在这里插入图片描述

这里面的Moses是conventional phrase-based translation system (Moses)传统基于短语的翻译系统

在这里插入图片描述

从图中可以看出RNNsearch-30和RNNsearch-50对句子的长度都更稳健。尤其是RNNsearch50,即使句子长度为50或更长,也没有表现出性能下降

6.2 定性分析

6.2.1 Alignment

在这里插入图片描述
通过图可以看出,在生成目标词时,源句中的哪些位置被认为更重要。我们沿着每个矩阵的对角线看到很强的权重

6.2.2 Long Sentences

在这里插入图片描述

​ 从图2中可以清楚地看到,在翻译长句方面,所提出的模型比传统模型好得多。这可能是因为RNNsearch不需要将一个长句子完美地编码成一个固定长度的向量,而只需要精确地编码输入句子中围绕特定单词的部分

对比两个模型的翻译结果,法语俺也不懂,就不放上去了,作者想要说明的就是本文提出的模型确实要比前人的好。

(七)相关工作

7.1 learning to align

A similar approach of aligning an output symbol with an input symbol was proposed recently by
Graves (2013) in the context of handwriting synthesis.

本文工作和他们工作的区别是:the modes of the weights of the annotations only move in one directionGraves (2013).

我们的工作是 requires computing the annotation weight of every word in the source sentence for each word in the translation。不过这样对于输入输出句子长度有限制(也就是This drawback is not severe with the task of translation in which most of input and output sentences are only 15–40 words. However, this may limit the applicability of the proposed scheme to other tasks.)。

7.2 Neural Network for machine Translation

和我们工作不同路子的神经机器翻译:

  • Bengio et al. (2003)

  • Schwenk (2012)

  • Kalchbrenner and Blunsom (2013) and Devlin et al. (2014)

(八)总结

  • 总结就是升级版的摘要信息。就是🐮🍺,这脑子忒好

注:在写论文阅读笔记的时候,我觉得用一些原句能够更好地反应作者的意图
注:Markdown上插入的表情有点丑,这是牛🐮,这是啤酒🍺

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值