[论文解读] Fast Decoding in Sequence Models using Discrete Latent Variables
本论文提出了一种潜在变换器(Latent Transformer),将目标序列自动编码成更短的离散潜在序列,从而实现并行化解码并在神经机器翻译中以可竞争的BLEU获得更快的解码速度。
Autoregressive sequence models based on deep neural networks, such as RNNs, Wavenet and the Transformer attain state-of-the-art results on many tasks. However, they are difficult to parallelize and are thus slow at processing long sequences. RNNs lack parallelism both during training and decoding, while architectures like WaveNet and Transformer are much more parallelizable during training, yet still operate sequentially during decoding. Inspired by [arxiv:1711.00937], we present a method to extend sequence models using discrete latent variables that makes decoding much more parallelizable. We first auto-encode the target sequence into a shorter sequence of discrete latent variables, which at inference time is generated autoregressively, and finally decode the output sequence from this shorter latent sequence in parallel. To this end, we introduce a novel method for constructing a sequence of discrete latent variables and compare it with previously introduced methods. Finally, we evaluate our model end-to-end on the task of neural machine translation, where it is an order of magnitude faster at decoding than comparable autoregressive models. While lower in BLEU than purely autoregressive models, our model achieves higher scores than previously proposed non-autoregressive translation models.
研究动机与目标
- 为自回归序列模型提供快速解码的动机。
- 提出离散潜在瓶颈以压缩目标序列。
- 开发端到端可训练的 Latent Transformer,利用离散潜在变量。
- 在神经机器翻译上进行评估,并与自回归和非自回归基线进行比较。
提出的方法
- 引入离散潜在瓶颈(Gumbel-Softmax、改进的语义散列、VQ-VAE,以及分解向量量化)以将 y 编码为 l,其中 m < n。
- 训练一个 Latent Transformer,由自编码器 ae(y, x) 产生 l,潜在预测器 lp(x) 从 x 自回归地产生 l,以及解码器 ad(l, x) 并行重建 y。
- 使用基于 Transformer 的 lp 进行自回归潜在预测,以及基于 x 和 l 的并行 ad 解码器。
- 优化联合目标 lr + llp,其中 lr 是自编码器重构损失,llp 是潜在预测损失。
- 实验不同的离散化瓶颈和 DVQ 变体,以应对大型潜在字母表并避免代码字坍塌。
实验结果
研究问题
- RQ1离散潜在变量是否能将目标序列压缩到足以实现并行解码而翻译质量不会有严重损失?
- RQ2哪些离散化瓶颈(Gumbel-Softmax、改进的语义散列、VQ-VAE、DVQ 及 DVQ 变体)为神经机器翻译带来最佳的速度与质量权衡?
- RQ3Latent Transformer 在 BLEU 和解码时延方面与自回归和非自回归基线相比如何?
主要发现
| 模型 | BLEU | Latency_b1 (ms) | Latency_b64 (ms) |
|---|---|---|---|
| LT Improved Semhash | 19.8 | 105 ms | 8 ms |
| LT VQ-VAE | 2.78 | 148 ms | 7 ms |
| LT s-DVQ | 19.7 | 177 ms | 7 ms |
| LT p-DVQ | 19.8 | 182 ms | 8 ms |
- Latent Transformer 在翻译任务中的解码速度比自回归模型快一个数量级。
- 使用 DVQ 或改进的语义散列在更快解码的同时获得较强的 BLEU,并在若干设置中超过了手调非自回归方法。
- 单独的 VQ-VAE 在此任务上表现不佳,而具有两次分解的分解 DVQ 可最大化潜在使用量和性能。
- 当潜在序列长度为 n/m = 8 时,LT 的 BLEU 得分约为 19.7–19.8,解码时延具有竞争力。
- 使用 LT 方法对前 k 个翻译进行再分数评估可在不使用束搜索的情况下缩小与自回归基线的差距。
- 通过调整比率 n/m 和潜在字母表大小 K,此方法实现了速度与准确性之间的权衡。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。