arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2304.14293cs.CLcs.AIcs.LG
收藏

基于自然语言指令的受控文本生成

Controlled Text Generation with Natural Language Instructions

ETH Zürich(苏黎世联邦理工学院)

Wangchunshu Zhou, Yuchen Eleanor Jiang, Ethan Wilcox, Ryan Cotterell, Mrinmaya Sachan

AI总结:

本文提出 InstructCTG 框架,将文本约束自动提取并表述为自然语言指令及示范来微调语言模型,在不改变解码过程的情况下灵活实现多约束受控生成,并支持少样本适应新约束。

摘要:

大型语言模型能够生成流畅的文本,并且可以遵循自然语言指令,在无需针对任务进行专门训练的情况下解决广泛的任务。然而,众所周知,很难控制它们的生成以满足不同应用所需的各种约束。在本工作中,我们提出了 InstructCTG,这是一个受控文本生成框架,通过以约束的自然语言描述和示范作为条件来纳入不同约束。具体而言,我们首先结合现成的 NLP 工具和简单的启发式方法,提取自然文本中潜在的约束。随后,我们将这些约束用语言表述为自然语言指令,以构成弱监督训练数据。通过在文本前添加约束的自然语言描述和少量示范,我们对预训练语言模型进行微调,使其纳入各种类型的约束。与现有的基于搜索或基于评分的方法相比,InstructCTG 对不同约束类型更加灵活,并且由于它不修改解码过程,因此对生成质量和速度的影响要小得多。此外,InstructCTG 借助指令微调语言模型的少样本任务泛化和上下文学习能力,使模型无需重新训练即可适应新的约束。

英文摘要:

Large language models generate fluent texts and can follow natural language instructions to solve a wide range of tasks without task-specific training. Nevertheless, it is notoriously difficult to control their generation to satisfy the various constraints required by different applications. In this work, we present InstructCTG, a controlled text generation framework that incorporates different constraints by conditioning on natural language descriptions and demonstrations of the constraints. In particular, we first extract the underlying constraints of natural texts through a combination of off-the-shelf NLP tools and simple heuristics. We then verbalize the constraints into natural language instructions to form weakly supervised training data. By prepending natural language descriptions of the constraints and a few demonstrations, we fine-tune a pre-trained language model to incorporate various types of constraints. Compared to existing search-based or score-based methods, InstructCTG is more flexible to different constraint types and has a much smaller impact on the generation quality and speed because it does not modify the decoding procedure. Additionally, InstructCTG allows the model to adapt to new constraints without re-training through the use of few-shot task generalization and in-context learning abilities of instruction-tuned language models.

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

↑