Lune

ICLR2025Top-tier venue

Controlled LLM Decoding via Discrete Auto-regressive Biasing

Patrick Pynadath, Ruqi Zhang

Abstract

Controlled text generation allows for enforcing user-defined constraints on large language model outputs, an increasingly important field as LLMs become more prevalent in everyday life. One common approach uses energy-based decoding, which defines a target distribution through an energy function that combines multiple constraints into a weighted average. However, these methods often struggle to balance fluency with constraint satisfaction, even with extensive tuning of the energy function's coefficients. In this paper, we identify that this suboptimal balance arises from sampling in continuous space rather than the natural discrete space of text tokens. To address this, we propose Discrete Auto-regressive Biasing, a controlled decoding algorithm that leverages gradients while operating entirely in the discrete text domain. Specifically, we introduce a new formulation for controlled text generation by defining a joint distribution over the generated sequence and an auxiliary bias sequence. To efficiently sample from this joint distribution, we propose a Langevin-within-Gibbs sampling algorithm using gradient-based discrete MCMC. Our method significantly improves constraint satisfaction while maintaining comparable or better fluency, all with even lower computational costs. We demonstrate the advantages of our controlled decoding method on sentiment control, language detoxification, and keyword-guided generation. We make our code available at the following url: https://github.com/patrickpynadath1/dab .

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.

1 top-tier paper has 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

  • COLD Decoding: Energy-based Constrained Text Generation with Langevin Dynamics cites Plug and Play Language Models: A Simple Approach to Controlled Text Generation
  • COLD Decoding: Energy-based Constrained Text Generation with Langevin Dynamics cites BERTScore: Evaluating Text Generation with BERT
  • C³TG: Conflict-aware, Composite, and Collaborative Controlled Text Generation cites Plug and Play Language Models: A Simple Approach to Controlled Text Generation
  • C³TG: Conflict-aware, Composite, and Collaborative Controlled Text Generation cites COLD Decoding: Energy-based Constrained Text Generation with Langevin Dynamics
  • COLD-Attack: Jailbreaking LLMs with Stealthiness and Controllability cites Plug and Play Language Models: A Simple Approach to Controlled Text Generation
  • COLD-Attack: Jailbreaking LLMs with Stealthiness and Controllability cites COLD Decoding: Energy-based Constrained Text Generation with Langevin Dynamics
  • RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language Models cites Plug and Play Language Models: A Simple Approach to Controlled Text Generation
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers1

  1. C³TG: Conflict-aware, Composite, and Collaborative Controlled Text GenerationYu Li, Zhe Yang, Yi Huang, Xin Liu et al.AAAI 2026

Builds on20

  1. BERTScore: Evaluating Text Generation with BERTTianyi Zhang, Varsha Kishore, Felix Wu, Kilian Q. Weinberger et al.ICLR 2020 · 8,443 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. RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language ModelsSamuel Gehman, Suchin Gururangan, Maarten Sap, Yejin Choi et al.EMNLP Findings 2020 · 692 citations
  4. COLD Decoding: Energy-based Constrained Text Generation with Langevin DynamicsLianhui Qin, Sean Welleck, Daniel Khashabi, Yejin ChoiNeurIPS 2022 · 217 citations
  5. COLD-Attack: Jailbreaking LLMs with Stealthiness and ControllabilityXingang Guo, Fangxu Yu, Huan Zhang, Lianhui Qin et al.ICML 2024 · 173 citations

Related papers

  1. Principled Gradient-Based MCMC for Conditional Sampling of TextLi Du, Afra Amini, Lucas Torroba Hennigen, Xinyan Velocity Yu et al.ICML 2024 · 6 citations
  2. Gradient-based Constrained Sampling from Language ModelsSachin Kumar, Biswajit Paria, Yulia TsvetkovEMNLP 2022 · 22 citations
  3. A Distributional Approach to Controlled Text GenerationMuhammad Khalifa, Hady Elsahar, Marc DymetmanICLR 2021 · 135 citations
  4. Improving Controllable Text Generation with Position-Aware Weighted DecodingYuxuan Gu, Xiaocheng Feng, Sicheng Ma, Jiaming Wu et al.ACL Findings 2022 · 12 citations
  5. Critic-Guided Decoding for Controlled Text GenerationMinbeom Kim, Hwanhee Lee, Kang Min Yoo, Joonsuk Park et al.ACL Findings 2023 · 9 citations
Dusk over the sea between two cliffs drawn in fine vertical lines