[论文解读] Diformer: Directional Transformer for Neural Machine Translation
Diformer 提出了一种统一的 Transformer 架构,通过方向语言模型(DLM)目标联合建模从左到右、从右到左以及直接(非自回归)生成方向,同时保留了自回归(AR)和非自回归(NAR)模型的原始依赖假设。该方法在 WMT 基准测试中达到最先进性能,统一模型的性能优于现有统一模型超过 1.5 BLEU 分,且与独立的 SOTA AR 和 NAR 模型相当。
Autoregressive (AR) and Non-autoregressive (NAR) models have their own superiority on the performance and latency, combining them into one model may take advantage of both. Current combination frameworks focus more on the integration of multiple decoding paradigms with a unified generative model, e.g. Masked Language Model. However, the generalization can be harmful to the performance due to the gap between training objective and inference. In this paper, we aim to close the gap by preserving the original objective of AR and NAR under a unified framework. Specifically, we propose the Directional Transformer (Diformer) by jointly modelling AR and NAR into three generation directions (left-to-right, right-to-left and straight) with a newly introduced direction variable, which works by controlling the prediction of each token to have specific dependencies under that direction. The unification achieved by direction successfully preserves the original dependency assumption used in AR and NAR, retaining both generalization and performance. Experiments on 4 WMT benchmarks demonstrate that Diformer outperforms current united-modelling works with more than 1.5 BLEU points for both AR and NAR decoding, and is also competitive to the state-of-the-art independent AR and NAR models.
研究动机与目标
- 解决统一 AR-NAR 模型中因训练目标冲突导致的性能差距问题。
- 在单一框架内保留自回归(AR)和非自回归(NAR)解码的原始依赖假设。
- 实现在无需单独预训练或微调阶段的情况下,同时训练多种解码方向(L2R、R2L、直连)的联合训练。
- 通过自重排序提升 NAR 解码性能,利用模型的双向能力。
- 在不牺牲泛化能力或增加训练成本的前提下,实现 AR 和 NAR 推理模式下的竞争力表现。
提出的方法
- 引入方向变量,用于控制推理过程中每个 token 的生成方向(L2R、R2L 或直连)。
- 制定方向语言模型(DLM)目标,使每个 token 的预测基于当前方向的上下文条件。
- 使用最大相对距离至少为 8 的相对位置嵌入,以维持长距离依赖建模能力。
- 在单次前向传播中联合训练三种方向(L2R、R2L、直连),避免多阶段训练,降低计算成本。
- 在推理阶段应用自重排序,通过方向模型重新评估束搜索候选,尤其在 NAR 解码中效果显著。
- 利用蒸馏的单语数据提升训练稳定性和性能,尤其对 NAR 和 R2L 方向有益。
实验结果
研究问题
- RQ1统一的 Transformer 模型是否能在支持多种解码方向的同时,保持 AR 和 NAR 模型的性能?
- RQ2通过共享 DLM 目标联合训练 L2R、R2L 和直连生成方向,是否相比通用条件建模能减少性能退化?
- RQ3引入方向变量在多大程度上影响模型维持 AR 和 NAR 设置下原始依赖假设的能力?
- RQ4自重排序在不增加额外推理成本的情况下,能在多大程度上提升 NAR 解码性能?
- RQ5知识蒸馏是否在不同生成方向之间有效平衡模型容量,尤其是在使用原始单语数据训练时?
主要发现
- 在四个 WMT 基准测试中,Diformer 在 AR 和 NAR 解码上均比现有统一建模方法高出超过 1.5 BLEU 分。
- 在 WMT14 En→De 上,Diformer 使用 L2R 解码达到 28.58 BLEU,使用蒸馏数据时达到 28.35,优于先前的统一模型。
- 该模型在使用自重排序进行 NAR 解码时,性能与最先进的独立 AR 和 NAR 模型相当,尤其表现出色。
- 自重排序显著提升了 NAR 性能,且与束搜索大小和迭代次数正相关,尤其在掩码预测和优先易例策略下表现突出。
- 在原始数据上将所有 token 固定为 R2L 方向训练时,仍能恢复 L2R 性能,表明原始数据增加了非 L2R 方向的训练难度。
- 最大距离 k ≥ 8 的相对位置编码至关重要,且由于 NAR 解码依赖双向上下文,其对位置信息更为敏感。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。