[论文解读] Von Mises-Fisher Loss for Training Sequence to Sequence Models with Continuous Outputs
本文用连续嵌入输出替代 softmax,并引入 von Mises-Fisher 损失来训练 seq2seq 模型,在训练速度更快的同时保持有竞争力的翻译质量,尤其在词汇表较大时。
The Softmax function is used in the final layer of nearly all existing sequence-to-sequence models for language generation. However, it is usually the slowest layer to compute which limits the vocabulary size to a subset of most frequent types; and it has a large memory footprint. We propose a general technique for replacing the softmax layer with a continuous embedding layer. Our primary innovations are a novel probabilistic loss, and a training and inference procedure in which we generate a probability distribution over pre-trained word embeddings, instead of a multinomial distribution over the vocabulary obtained via softmax. We evaluate this new class of sequence-to-sequence models with continuous outputs on the task of neural machine translation. We show that our models obtain upto 2.5x speed-up in training time while performing on par with the state-of-the-art models in terms of translation quality. These models are capable of handling very large vocabularies without compromising on translation quality. They also produce more meaningful errors than in the softmax-based models, as these errors typically lie in a subspace of the vector space of the reference translations.
研究动机与目标
- 动机:降低由于大词汇表导致的 seq2seq 模型中 softmax 的计算瓶颈。
- 提出一个连续输出架构,在预测时输出嵌入向量而不是词概率。
- 引入基于 von Mises-Fisher 分布的概率损失来训练这些模型。
- 在 IWSLT 和 WMT 数据集上对多语言进行翻译质量和训练效率的评估。
- 分析错误模式以及嵌入质量对翻译结果的影响。
提出的方法
- 用固定大小的嵌入向量表示每个输出单词,并在解码的每一步预测一个连续向量。
- 在嵌入空间中使用最近邻搜索将预测向量映射到解码时的单词。
- 定义基于 von Mises-Fisher 分布的概率损失,以最大化正确词嵌入的似然。
- 通过控制输出向量范数的项对损失进行正则化,以稳定训练。
- 实验不同的嵌入(word2vec、fastText)以及损失变体(NLLvMF_reg1、NLLvMF_reg1+reg2、MaxMargin、L2、Cosine)。
- 将解码器输入嵌入与预训练的目标嵌入相绑定,以减少参数并提高收敛速度。
实验结果
研究问题
- RQ1连续嵌入输出层能否在不牺牲翻译质量的情况下替代 seq2seq 模型中的 softmax?
- RQ2基于 vMF 的损失是否为嵌入输出提供理论上有依据的回归损失替代?
- RQ3通过嵌入最近邻实现的开放词汇解码在机器翻译任务中与像 BPE 这样的子词方法相比如何?
- RQ4嵌入质量和正则化对翻译性能和稀有词处理有何影响?
- RQ5这样的框架在维持训练效率的同时,能否扩展到更大词汇表和更大数据集?
主要发现
- 连续输出模型在训练上可比以 softmax 为基线快最多2.5倍。
- 表现最佳的损失(MaxMargin 和 NLLvMF 的变体)实现了有竞争力的 BLEU 分数,在某些语言对上超过了强大的 BPE 基线。
- 使用预训练的 fastText 嵌入并将解码器输入绑定到目标嵌入,可减少参数并加速收敛。
- 模型在稀有词翻译方面有改进,在没有完全匹配词时会产生语义相关或同义的翻译。
- 通过嵌入最近邻实现的开放词汇解码能够处理大词汇表,同时不降低质量或速度。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。