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

大语言模型的保证生成

Guaranteed Generation from Large Language Models

Seoul National University(首尔国立大学);NAVER Labs Europe(NAVER欧洲实验室);NAVER AI Lab(NAVER人工智能实验室);Sogang University(成均馆大学)

Minbeom Kim, Thibaut Thonet, Jos Rozen, Hwaran Lee, Kyomin Jung, Marc Dymetman

AI总结:

本文提出GUARD方法,通过结合自回归提议分布与拒绝采样,在保证大语言模型生成输出严格满足约束的同时尽可能保留原始分布,并显著提升推理效率。

摘要:

随着大语言模型(LLMs)在各种应用中的使用日益广泛,控制文本生成以满足特定约束或需求的需求也在不断增长。这引出了一个关键问题:是否有可能在生成的输出中保证严格的约束满足,同时尽可能保留原始模型的分布?我们首先定义了理想分布——即与原始模型最接近、且始终满足所表达约束的分布——作为保证生成的最终目标。然后我们陈述了一个根本性限制,即仅通过自回归训练无法达到该目标。这促使我们必须结合训练时方法和推理时方法来强制执行此类保证。基于这一见解,我们提出了GUARD,这是一种简单而有效的方法,它将自回归提议分布与拒绝采样相结合。通过GUARD的理论性质,我们展示了控制特定提议分布与目标理想分布之间的KL散度如何同时优化推理速度和分布接近度。为了验证这些理论概念,我们在两个具有难以满足约束的文本生成设置上进行了大量实验:一个词汇约束场景和一个情感反转场景。这些实验表明,GUARD实现了完美的约束满足,同时几乎保留了理想分布,并大幅提高了推理效率。GUARD提供了一种有原则的方法,在不损害大语言模型生成能力的前提下强制执行严格保证。

英文摘要:

As large language models (LLMs) are increasingly used across various applications, there is a growing need to control text generation to satisfy specific constraints or requirements. This raises a crucial question: Is it possible to guarantee strict constraint satisfaction in generated outputs while preserving the distribution of the original model as much as possible? We first define the ideal distribution - the one closest to the original model, which also always satisfies the expressed constraint - as the ultimate goal of guaranteed generation. We then state a fundamental limitation, namely that it is impossible to reach that goal through autoregressive training alone. This motivates the necessity of combining training-time and inference-time methods to enforce such guarantees. Based on this insight, we propose GUARD, a simple yet effective approach that combines an autoregressive proposal distribution with rejection sampling. Through GUARD's theoretical properties, we show how controlling the KL divergence between a specific proposal and the target ideal distribution simultaneously optimizes inference speed and distributional closeness. To validate these theoretical concepts, we conduct extensive experiments on two text generation settings with hard-to-satisfy constraints: a lexical constraint scenario and a sentiment reversal scenario. These experiments show that GUARD achieves perfect constraint satisfaction while almost preserving the ideal distribution with highly improved inference efficiency. GUARD provides a principled approach to enforcing strict guarantees for LLMs without compromising their generative capabilities.

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

↑