arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2109.09707cs.CLcs.AI
收藏

一种即插即用的受控文本生成方法

A Plug-and-Play Method for Controlled Text Generation

ETH Zürich(苏黎世联邦理工学院);University of Cambridge(剑桥大学)

Damian Pascual, Beni Egressy, Clara Meister, Ryan Cotterell, Roger Wattenhofer

摘要:

大型预训练的语言模型已经多次显示出它们生成流畅文本的能力。然而,即使从一个提示开始,生成也可以朝着许多看似合理的方向继续。当前的解码方法的目标是控制生成,例如,为了确保包括特定的单词,或者需要额外的模型或微调,或者当手头的任务在语义上不受约束时工作不佳,例如,故事世代在这项工作中,我们提出了一种即插即用的解码方法,用于控制语言生成,这是如此简单和直观,它可以用一句话来描述:给定一个主题或关键字,我们增加了一个转移到概率分布在我们的词汇语义相似的话。我们展示了如何退火这种分布可以用来强加硬约束语言生成,没有其他的即插即用的方法是目前能够与SOTA语言生成器。尽管这种方法很简单,但我们看到它在实践中表现得非常好:从GPT-2解码可以产生多样化和流畅的句子,同时保证给定引导词的外观。我们进行了两项用户研究,结果表明:(1)我们的方法在人类评估中优于竞争方法;(2)强制引导词出现在生成的文本中对生成的文本的流畅性没有影响。

英文摘要:

Large pre-trained language models have repeatedly shown their ability to produce fluent text. Yet even when starting from a prompt, generation can continue in many plausible directions. Current decoding methods with the goal of controlling generation, e.g., to ensure specific words are included, either require additional models or fine-tuning, or work poorly when the task at hand is semantically unconstrained, e.g., story generation. In this work, we present a plug-and-play decoding method for controlled language generation that is so simple and intuitive, it can be described in a single sentence: given a topic or keyword, we add a shift to the probability distribution over our vocabulary towards semantically similar words. We show how annealing this distribution can be used to impose hard constraints on language generation, something no other plug-and-play method is currently able to do with SOTA language generators. Despite the simplicity of this approach, we see it works incredibly well in practice: decoding from GPT-2 leads to diverse and fluent sentences while guaranteeing the appearance of given guide words. We perform two user studies, revealing that (1) our method outperforms competing methods in human evaluations; and (2) forcing the guide words to appear in the generated text has no impact on the fluency of the generated text.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑