Lune

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 Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

6 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • A Distributional Approach to Controlled Text Generation cites Plug and Play Language Models: A Simple Approach to Controlled Text Generation
  • InfAlign: Inference-aware language model alignment cites Direct Preference Optimization: Your Language Model is Secretly a Reward Model
  • Whatever Remains Must Be True: Filtering Drives Reasoning in LLMs, Shaping Diversity cites A Distributional Approach to Controlled Text Generation
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers6

  1. Constrained Auto-Regressive Decoding Constrains Generative RetrievalShiguang Wu, Zhaochun Ren, Xin Xin, Jiyuan Yang et al.SIGIR 2025 · 3 citations
  2. On the Limits of Test-Time Compute: Sequential Reward Filtering for Better InferenceYue Yu, Qiwei Di, Quanquan Gu, Dongruo ZhouICML 2026 · 3 citations
  3. Whatever Remains Must Be True: Filtering Drives Reasoning in LLMs, Shaping DiversityGermán Kruszewski, Pierre Erbacher, Jos Rozen, Marc DymetmanICLR 2026 · 3 citations
  4. InfAlign: Inference-aware language model alignmentAnanth Balashankar, Ziteng Sun, Jonathan Berant, Jacob Eisenstein et al.ICML 2025
  5. CausalArmor: Efficient Indirect Prompt Injection Guardrails via Causal AttributionMinbeom Kim, Mihir Parmar, Phillip Wallis, Lesly Miculicich et al.ICML 2026

Builds on18

  1. 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
  2. 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
  3. Flow Network based Generative Models for Non-Iterative Diverse Candidate GenerationEmmanuel Bengio, Moksh Jain, Maksym Korablyov, Doina Precup et al.NeurIPS 2021 · 565 citations
  4. CommonGen: A Constrained Text Generation Challenge for Generative Commonsense ReasoningBill Yuchen Lin, Wangchunshu Zhou, Ming Shen, Pei Zhou et al.EMNLP Findings 2020 · 239 citations
  5. A Distributional Approach to Controlled Text GenerationMuhammad Khalifa, Hady Elsahar, Marc DymetmanICLR 2021 · 135 citations

Related papers

  1. Gradient-based Constrained Sampling from Language ModelsSachin Kumar, Biswajit Paria, Yulia TsvetkovEMNLP 2022 · 22 citations
  2. 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
  3. Controllable Text Generation with Neurally-Decomposed OracleTao Meng, Sidi Lu, Nanyun Peng, Kai-Wei ChangNeurIPS 2022 · 45 citations
  4. Approximately Aligned DecodingDaniel Melcer, Sujan Kumar Gonugondla, Pramuditha Perera, Haifeng Qian et al.NeurIPS 2025 · 3 citations
  5. Tractable Control for Autoregressive Language GenerationHonghua Zhang, Meihua Dang, Nanyun Peng, Guy Van den BroeckICML 2023 · 63 citations
Dusk over the sea between two cliffs drawn in fine vertical lines