COLD Decoding: Energy-based Constrained Text Generation with Langevin Dynamics

COLD Decoding: Energy-based Constrained Text Generation with Langevin Dynamics
复制标题

DOI:
--
复制
发表时间:
2022-02
期刊:
ArXiv
影响因子:
--
通讯作者:
Lianhui Qin;S. Welleck;Daniel Khashabi;Yejin Choi
Lianhui Qin;S. Welleck;Daniel Khashabi;Yejin Choi
中科院分区:
其他
文献类型:
--
作者:
Lianhui Qin;S. Welleck;Daniel Khashabi;Yejin Choi

文献摘要

被引文献

相似文献

许多文本生成应用程序需要结合不同的约束来控制生成文本的语义或样式。这些约束可以是硬约束(例如,确保输出中包含某些关键字),也可以是软约束(例如,将输出与左上下文或右上下文联系起来)。在本文中,我们提出了基于能量的约束解码与朗格万动力学(COLD),解码框架将约束生成统一为通过能量函数指定约束,然后通过基于梯度的采样对约束进行有效的可微推理。COLD解码是一个灵活的框架,可以直接应用于现成的从左到右语言模型,而不需要任何特定于任务的微调,正如三个具有挑战性的文本生成应用程序所演示的那样:词汇约束生成、溯因推理和反事实推理。我们在这些约束生成任务上的实验表明,我们的方法在自动和人工评估方面都是有效的。
Many applications of text generation require incorporating different constraints to control the semantics or style of generated text. These constraints can be hard (e.g., ensuring certain keywords are included in the output) and soft (e.g., contextualizing the output with the left- or right-hand context). In this paper, we present Energy-based Constrained Decoding with Langevin Dynamics (COLD), a decoding framework which unifies constrained generation as specifying constraints through an energy function, then performing efficient differentiable reasoning over the constraints through gradient-based sampling. COLD decoding is a flexible framework that can be applied directly to off-the-shelf left-to-right language models without the need for any task-specific fine-tuning, as demonstrated through three challenging text generation applications: lexically-constrained generation, abductive reasoning, and counterfactual reasoning. Our experiments on these constrained generation tasks point to the effectiveness of our approach, both in terms of automatic and human evaluation.