[论文解读] CoNT: Contrastive Neural Text Generation
CoNT 引入一个对比学习框架用于神经文本生成,使用自生成的负样本、N-pairs 损失以及解码时的学习序列相似性,在多种生成任务上取得了最先进的结果。
Recently, contrastive learning attracts increasing interests in neural text generation as a new solution to alleviate the exposure bias problem. It introduces a sequence-level training signal which is crucial to generation tasks that always rely on auto-regressive decoding. However, previous methods using contrastive learning in neural text generation usually lead to inferior performance. In this paper, we analyse the underlying reasons and propose a new Contrastive Neural Text generation framework, CoNT. CoNT addresses bottlenecks that prevent contrastive learning from being widely adopted in generation tasks from three aspects -- the construction of contrastive examples, the choice of the contrastive loss, and the strategy in decoding. We validate CoNT on five generation tasks with ten benchmarks, including machine translation, summarization, code comment generation, data-to-text generation and commonsense generation. Experimental results show that CoNT clearly outperforms the conventional training framework on all the ten benchmarks with a convincing margin. Especially, CoNT surpasses previous the most competitive contrastive learning method for text generation, by 1.50 BLEU on machine translation and 1.77 ROUGE-1 on summarization, respectively. It achieves new state-of-the-art on summarization, code comment generation (without external data) and data-to-text generation.
研究动机与目标
- 促使对比学习以缓解自回归文本生成中的暴露偏差。
- 设计一个框架:(i) 从模型预测中采样对比负样本,(ii) 使用带有序列级分数的 N-pairs 边距损失,以及 (iii) 将学习到的相似度分数整合到解码中。
- 展示在多个生成任务中相对于MLE基线和先前对比方法的改进。
- 证明 CoNT 在若干基准上达到新的最先进结果,并在推理阶段保持高效。
提出的方法
- 通过多样化束搜索从模型自身预测中采样负样本/对比样本。
- 采用 N-pairs 对比损失,使用序列级 oracle 分数(如 BLEU)和与源表示的余弦相似度对对比样本进行排序。
- 使用基于边距的损失:L_N-Pairs = sum max{0, cos(z_x, z_y^-) − cos(z_x, z_y^+) + xi} 其中 xi 反映基于排名的边距。
- 通过最大化 cos 相似度和传统似然的混合来将学习到的相似度分数整合到解码中:y* = argmax_y { alpha * cos(z_x, z_y) + (1 - alpha) * p(y|x)}。
- 生成自生成的负样本并将其与同批次中的负样本结合,形成对比集。
- 提供在解码时平衡序列相似性与语言模型似然性的推理过程。
实验结果
研究问题
- RQ1是否从模型自身预测生成的样本比仅从同批次中选择负样本提供更具信息性的负样本?
- RQ2以序列级分数的 N-pairs 边距损失是否在对比文本生成中优于 InfoNCE?
- RQ3将学习到的序列相似性整合到解码中是否能在标准MLE损失之上提升生成质量?
- RQ4CoNT 在翻译、摘要、代码注释生成、数据到文本,以及常识生成等任务上的表现如何?
- RQ5相较于传统MLE和先前对比方法,在训练效率方面应用 CoNT 的权衡如何?
主要发现
- CoNT 大幅改进了 MLE 基线,并在十个基准上优于先前的对比方法。
- 在 WMT’16 Ro-En 上,CoNT 结合 N-Pairs 损失与解码相似性达到 30.91 BLEU,超越此前最佳对比方法 1.50 BLEU。
- 在 IWSLT’14 De-En 上,序列相似性解码相较于 vanilla beam search 提升最高可达 0.86 BLEU。
- 在 XSum 摘要任务上,CoNT 与 PEGASUS 基模型建立了新的最先进结果。
- 在代码注释生成(CodeT5 主干)上,CoNT 将 Python 和 Java 的 BLEU 提升至 20.56。
- 在数据到文本(WikiBio)上,CoNT 超过 R2D2,并在使用基础模型的情况下接近更大规模的 T5 变体。
- 在常识生成(CommonGen)任务中,CoNT 使用 T5-base 在 CIDEr 和 SPICE 指标上优于若干更大规模的基线。
- CoNT 在数据到文本和常识生成任务上与大型预训练模型(如 T5-large/3B)达到同等表现,同时保持效率。
- 人类评估表明,在翻译和摘要任务中,CoNT 的输出比 MLE 和朴素对比学习更受偏好。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。