Guaranteed Generation from Large Language Models
Minbeom Kim, Thibaut Thonet, Jos Rozen, Hwaran Lee, Kyomin Jung, Marc Dymetman
Abstract
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.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 1cd81d60-e1d9-4443-8486-14f4cd187d0dCited by top-tier papers6
- Constrained Auto-Regressive Decoding Constrains Generative RetrievalShiguang Wu, Zhaochun Ren, Xin Xin, Jiyuan Yang et al.SIGIR 2025 · 3 citations
- On the Limits of Test-Time Compute: Sequential Reward Filtering for Better InferenceYue Yu, Qiwei Di, Quanquan Gu, Dongruo ZhouICML 2026 · 3 citations
- Whatever Remains Must Be True: Filtering Drives Reasoning in LLMs, Shaping DiversityGermán Kruszewski, Pierre Erbacher, Jos Rozen, Marc DymetmanICLR 2026 · 3 citations
- InfAlign: Inference-aware language model alignmentAnanth Balashankar, Ziteng Sun, Jonathan Berant, Jacob Eisenstein et al.ICML 2025
- CausalArmor: Efficient Indirect Prompt Injection Guardrails via Causal AttributionMinbeom Kim, Mihir Parmar, Phillip Wallis, Lesly Miculicich et al.ICML 2026
Builds on16
- Direct Preference Optimization: Your Language Model is Secretly a Reward ModelRafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D. Manning et al.NeurIPS 2023 · 10,924 citations
- Plug and Play Language Models: A Simple Approach to Controlled Text GenerationSumanth Dathathri, Andrea Madotto, Janice Lan, Jane Hung et al.ICLR 2020 · 1,166 citations
- Flow Network based Generative Models for Non-Iterative Diverse Candidate GenerationEmmanuel Bengio, Moksh Jain, Maksym Korablyov, Doina Precup et al.NeurIPS 2021 · 565 citations
- A Distributional Approach to Controlled Text GenerationMuhammad Khalifa, Hady Elsahar, Marc DymetmanICLR 2021 · 135 citations
- Controlled Decoding from Language ModelsSidharth Mudgal, Jong Lee, Harish Ganapathy, YaGuang Li et al.ICML 2024 · 130 citations
Related papers
- Gradient-based Constrained Sampling from Language ModelsSachin Kumar, Biswajit Paria, Yulia TsvetkovEMNLP 2022 · 22 citations
- Unlocking Anticipatory Text Generation: A Constrained Approach for Large Language Models DecodingLifu Tu, Semih Yavuz, Jin Qu, Jiacheng Xu et al.EMNLP 2024 · 2 citations
- Controllable Text Generation with Neurally-Decomposed OracleTao Meng, Sidi Lu, Nanyun Peng, Kai-Wei ChangNeurIPS 2022 · 45 citations
- Approximately Aligned DecodingDaniel Melcer, Sujan Kumar Gonugondla, Pramuditha Perera, Haifeng Qian et al.NeurIPS 2025 · 3 citations
- Tractable Control for Autoregressive Language GenerationHonghua Zhang, Meihua Dang, Nanyun Peng, Guy Van den BroeckICML 2023 · 63 citations
