COLD解码:基于能量的Langevin动力学约束文本生成
COLD Decoding: Energy-based Constrained Text Generation with Langevin Dynamics
摘要:
文本生成的许多应用需要结合不同的约束来控制生成文本的语义或样式。这些约束可以是硬的(例如,确保某些关键字包括在输出中)和软(例如,将输出与左手或右手上下文相关联)。在本文中,我们提出了基于能量的约束解码与朗之万动力学(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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。