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

基于语言模型算术的受控文本生成

Controlled Text Generation via Language Model Arithmetic

ETH Zurich(苏黎世联邦理工学院)

Jasper Dekoninck, Marc Fischer, Luca Beurer-Kellner, Martin Vechev

AI总结:

本研究提出无需训练的模型算术推理框架,可组合调控大语言模型实现精准受控文本生成,兼容推测采样实现高效推理,在毒性降低任务上性能优于现有方法并已开源。

摘要:

随着大语言模型(LLMs)的部署愈发广泛,针对词汇、风格和角色的定制化需求变得愈发重要。本研究提出模型算术(model arithmetic),这是一种全新的推理框架,无需对模型进行(重新)训练,也无需高度特定的数据集,即可实现大语言模型的组合与偏向调控。此外,相较于直接提示工程和以往的受控文本生成(CTG)技术,该框架能对生成文本实现更精准的控制。借助模型算术,我们可将以往的CTG技术表述为简单公式,并自然将其拓展为全新的、更有效的形式。进一步地,我们证明推测采样(speculative sampling,一种高效的LLM采样技术)可拓展应用于我们的场景,这使得多模型组合的文本生成效率极高,相较于单模型仅产生边际开销。我们的实证评估表明,模型算术可实现生成文本的细粒度控制,且在毒性降低任务上的表现优于当前最优水平。我们已在https://github.com/eth-sri/language-model-arithmetic 发布了该框架的开源易用实现。

英文摘要:

As Large Language Models (LLMs) are deployed more widely, customization with respect to vocabulary, style, and character becomes more important. In this work, we introduce model arithmetic, a novel inference framework for composing and biasing LLMs without the need for model (re)training or highly specific datasets. In addition, the framework allows for more precise control of generated text than direct prompting and prior controlled text generation (CTG) techniques. Using model arithmetic, we can express prior CTG techniques as simple formulas and naturally extend them to new and more effective formulations. Further, we show that speculative sampling, a technique for efficient LLM sampling, extends to our setting. This enables highly efficient text generation with multiple composed models with only marginal overhead over a single model. Our empirical evaluation demonstrates that model arithmetic allows fine-grained control of generated text while outperforming state-of-the-art on the task of toxicity reduction. We release an open source easy-to-use implementation of our framework at https://github.com/eth-sri/language-model-arithmetic.

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

↑