arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2212.10466cs.CL
收藏

具有语言约束的可控文本生成

Controllable Text Generation with Language Constraints

Princeton University(普林斯顿大学)

Howard Chen, Huihan Li, Danqi Chen, Karthik Narasimhan

摘要:

我们认为,在语言模型中的文本生成的任务与自然语言中指定的约束。为此,我们首先创建了一个具有挑战性的基准Cognac,它为模型提供了一个包含示例文本的主题,以及要避免的文本约束。与以前的工作不同,我们的基准测试包含来自Wordnet和Wikidata等数据库的知识密集型约束,它允许直接评估,同时在广泛的属性级别和狭窄的词汇级别控制之间取得平衡。我们发现,即使是国家的最先进的语言模型,如GPT-3经常失败的任务,并提出了一个解决方案,利用语言模型自己的内部知识来指导生成。我们的方法,称为CognacGen,首先查询的语言模型生成一个指定的主题或约束的指导条款,并使用指导修改模型的令牌生成概率。我们提出了三种形式的指导(二进制验证,前k令牌,文本示例),并采用前缀调整方法来提取指导,以解决不同的自然语言的约束。通过广泛的实证评估,我们证明了CognacGen可以成功地推广到看不见的指令,并在生成符合约束的文本方面优于竞争基线。

英文摘要:

We consider the task of text generation in language models with constraints specified in natural language. To this end, we first create a challenging benchmark Cognac that provides as input to the model a topic with example text, along with a constraint on text to be avoided. Unlike prior work, our benchmark contains knowledge-intensive constraints sourced from databases like Wordnet and Wikidata, which allows for straightforward evaluation while striking a balance between broad attribute-level and narrow lexical-level controls. We find that even state-of-the-art language models like GPT-3 fail often on this task, and propose a solution to leverage a language model's own internal knowledge to guide generation. Our method, called CognacGen, first queries the language model to generate guidance terms for a specified topic or constraint, and uses the guidance to modify the model's token generation probabilities. We propose three forms of guidance (binary verifier, top-k tokens, textual example), and employ prefix-tuning approaches to distill the guidance to tackle diverse natural language constraints. Through extensive empirical evaluations, we demonstrate that CognacGen can successfully generalize to unseen instructions and outperform competitive baselines in generating constraint conforming text.

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

↑