Gradient-Based Constrained Sampling from Language Models
Not on the map. Why?
Abstract (arXiv)
Large pretrained language models generate fluent text but are notoriously hard to controllably sample from. In this work, we study constrained sampling from such language models: generating text that satisfies user-defined constraints, while maintaining fluency and the model's performance in a downstream task. We propose MuCoLa -- a sampling procedure that combines the log-likelihood of the language model with arbitrary (differentiable) constraints in a single energy function, and then generates samples in a non-autoregressive manner. Specifically, it initializes the entire output sequence with noise and follows a Markov chain defined by Langevin Dynamics using the gradients of the energy function. We evaluate MuCoLa on text generation with soft and hard constraints as well as their combinations obtaining significant improvements over competitive baselines for toxicity avoidance, sentiment control, and keyword-guided generation.
Key facts. Cited by 64 papers in the map (data through 7 Oct 2026). Builds on 57 of its 95 references that are in the map. First posted on arXiv 25 May 2022.
Builds on
57 of 95 references.
References · 57
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2022Hierarchical Text-Conditional Image Generation with CLIP Latentscited by 6,539
- 2019BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehensioncited by 5,874
- 2019DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lightercited by 4,243
- 2019Generative Modeling by Estimating Gradients of the Data Distributioncited by 4,067
- 2019The Curious Case of Neural Text Degenerationcited by 2,881
- 2022Video Diffusion Modelscited by 2,280
- 2019Fine-Tuning Language Models from Human Preferencescited by 2,124
- 2020Don't Stop Pretraining: Adapt Language Models to Domains and Taskscited by 1,548
38 more
- 2017Get To The Point: Summarization with Pointer-Generator Networkscited by 1,281
- 2020RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language Modelscited by 1,235
- 2015A Diversity-Promoting Objective Function for Neural Conversation Modelscited by 1,068
- 2018Neural Network Acceptability Judgmentscited by 952
- 2019Plug and Play Language Models: A Simple Approach to Controlled Text Generationcited by 793
- 2019CTRL: A Conditional Transformer Language Model for Controllable Generationcited by 754
- 2019Universal Adversarial Triggers for Attacking and Analyzing NLPcited by 709
- 2019Defending Against Neural Fake Newscited by 553
- 2019The Woman Worked as a Babysitter: On Biases in Language Generationcited by 540
- 2019Neural Text Generation with Unlikelihood Trainingcited by 489
- 2021DExperts: Decoding-Time Controlled Text Generation with Experts and Anti-Expertscited by 434
- 2020GeDi: Generative Discriminator Guided Sequence Generationcited by 377
- 2016SeqGAN: Sequence Generative Adversarial Nets with Policy Gradientcited by 375
- 2021FUDGE: Controlled Text Generation With Future Discriminatorscited by 374
- 2021Knowledge Distillation in Iterative Generative Models for Improved Sampling Speedcited by 344
- 2021Understanding Factuality in Abstractive Summarization with FRANK: A Benchmark for Factuality Metricscited by 285
- 2018Analysis Methods in Neural Language Processing: A Surveycited by 276
- 2018Marian: Fast Neural Machine Translation in C++cited by 202
- 2021Societal Biases in Language Generation: Progress and Challengescited by 201
- 2018Fast Lexically Constrained Decoding with Dynamic Beam Allocation for Neural Machine Translationcited by 181
- 2021Noisy Channel Language Model Prompting for Few-Shot Text Classificationcited by 163
- 2022COLD Decoding: Energy-based Constrained Text Generation with Langevin Dynamicscited by 159
- 2021NeuroLogic A*esque Decoding: Constrained Text Generation with Lookahead Heuristicscited by 153
- 2020NeuroLogic Decoding: (Un)supervised Neural Text Generation with Predicate Logic Constraintscited by 146
- 2018Style Transfer Through Back-Translationcited by 124
- 2020A Distributional Approach to Controlled Text Generationcited by 117
- 2020Imitation Attacks and Defenses for Black-box Machine Translation Systemscited by 78
- 2022Controllable Natural Language Generation with Contrastive Prefixescited by 75
- 2019Training Neural Machine Translation To Apply Terminology Constraintscited by 73
- 2021Controlled Text Generation as Continuous Optimization with Multiple Constraintscited by 70
- 2022Mix and Match: Learning-free Controllable Text Generation using Energy Language Modelscited by 66
- 2020Back to the Future: Unsupervised Backprop-based Decoding for Counterfactual and Abductive Commonsense Reasoningcited by 65
- 2020PowerTransformer: Unsupervised Controllable Revision for Biased Language Correctioncited by 59
- 2021A Plug-and-Play Method for Controlled Text Generationcited by 55
- 2020CoCon: A Self-Supervised Approach for Controlled Text Generationcited by 47
- 2020Minimizing FLOPs to Learn Efficient Sparse Representationscited by 46
- 2020Adversarial Semantic Collisionscited by 42
- 2018Non-Autoregressive Neural Machine Translation with Enhanced Decoder Inputcited by 39
50 most cited of 57 All 57 (JSON)
Built on by
Citing papers per year: 2022: 2; 2023: 17; 2024: 18; 2025: 15; 2026: 12.
64 papers.
Sort:
By area:
- 2023Hard Prompts Made Easy: Gradient-Based Discrete Optimization for Prompt Tuning and Discoverycited by 329
- 2024Black-Box Access is Insufficient for Rigorous AI Auditscited by 123
- 2023Explore, Establish, Exploit: Red Teaming Language Models from Scratchcited by 111
- 2024Attacking Large Language Models with Projected Gradient Descentcited by 91
- 2024Decoding-Time Language Model Alignment with Multiple Objectivescited by 90
- 2023Controlled Text Generation with Natural Language Instructionscited by 87
- 2022Language Generation Models Can Cause Harm: So What Can We Do About It? An Actionable Surveycited by 80
- 2023Word Embeddings Are Steers for Language Modelscited by 70
- 2024Grammar-Aligned Decodingcited by 54
- 2023Controlled Text Generation via Language Model Arithmeticcited by 51
- 2022Toward Human Readable Prompt Tuning: Kubrick's The Shining is a good movie, and a good prompt too?cited by 49
- 2023ChatGPT vs Human-authored Text: Insights into Controllable Text Summarization and Sentence Style Transfercited by 49
38 more
- 2025Syntactic and Semantic Control of Large Language Models via Sequential Monte Carlocited by 45
- 2023KCTS: Knowledge-Constrained Tree Search Decoding with Token-Level Hallucination Detectioncited by 43
- 2024Constrained Decoding for Secure Code Generationcited by 35
- 2024DeepEdit: Knowledge Editing as Decoding with Constraintscited by 33
- 2024On the Challenges and Opportunities in Generative AIcited by 31
- 2023BOLT: Fast Energy-based Controlled Text Generation with Tunable Biasescited by 24
- 2023Generating Summaries with Controllable Readability Levelscited by 24
- 2023A Geometric Notion of Causal Probingcited by 23
- 2024QUEST: Quality-Aware Metropolis-Hastings Sampling for Machine Translationcited by 16
- 2025Constrained Discrete Diffusioncited by 16
- 2025REINFORCE Adversarial Attacks on Large Language Models: An Adaptive, Distributional, and Semantic Objectivecited by 15
- 2025Constrained Sampling for Language Models Should Be Easy: An MCMC Perspectivecited by 14
- 2025Self-Steering Language Modelscited by 13
- 2023Fast sampling from constrained spaces using the Metropolis-adjusted Mirror Langevin algorithmcited by 11
- 2023Learning to Generate Text in Arbitrary Writing Stylescited by 9
- 2024Growing a Tail: Increasing Output Diversity in Large Language Modelscited by 9
- 2024Effective Controllable Bias Mitigation for Classification and Retrieval using Gate Adapterscited by 8
- 2025Robust Multi-Objective Controlled Decoding of Large Language Modelscited by 8
- 2025TRACE Back from the Future: A Probabilistic Reasoning Approach to Controllable Language Generationcited by 8
- 2023Revisiting the Architectures like Pointer Networks to Efficiently Improve the Next Word Distribution, Summarization Factuality, and Beyondcited by 7
- 2024Controllable Text Generation in the Instruction-Tuning Eracited by 7
- 2025Inference-time Alignment in Continuous Spacecited by 7
- 2024Can Large Language Model Summarizers Adapt to Diverse Scientific Communication Goals?cited by 6
- 2024Is There No Such Thing as a Bad Question? H4R: HalluciBot For Ratiocination, Rewriting, Ranking, and Routingcited by 6
- 2026What's the plan? Metrics for implicit planning in LLMs and their application to rhyme generation and question answeringcited by 6
- 2023A Block Metropolis-Hastings Sampler for Controllable Energy-based Text Generationcited by 5
- 2024An Autoregressive Text-to-Graph Framework for Joint Entity and Relation Extractioncited by 5
- 2024Fluent dreaming for language modelscited by 5
- 2023P^3SUM: Preserving Author's Perspective in News Summarization with Diffusion Language Modelscited by 4
- 2024Non-Halting Queries: Exploiting Fixed Points in LLMscited by 4
- 2025Semantic Probabilistic Control of Language Modelscited by 4
- 2026nabla-Reasoner: LLM Reasoning via Test-Time Gradient Descent in Latent Spacecited by 4
- 2024Self-Control of LLM Behaviors by Compressing Suffix Gradient into Prefix Controllercited by 3
- 2025Sequence-level Large Language Model Training with Contrastive Preference Optimizationcited by 3
- 2025Constrained Adaptive Rejection Samplingcited by 3
- 2026Steering Language Models Before They Speak: Logit-Level Interventionscited by 3
- 2024LaSEr-Edit: Localized Span-level Error Editing with Energy-based Localizationcited by 2
- 2025MultiQ&A: An Analysis in Measuring Robustness via Automated Crowdsourcing of Question Perturbations and Answerscited by 2
50 most cited of 64 All 64 (JSON)
- 2026Provably Tractable NFA-Constrained Language Generation via HMMs30 Sep 2026
- 2026BayesPO: Bayesian Prompt Optimization via Parallel-Tempered Gradient-Guided Discrete MCMC17 Jul 2026
- 2026Structured Inference with Large Language Gibbs17 Jun 2026
- 2026Cross-Entropy Games and Frost Training26 May 2026
- 2026A Comparative Study of Controlled Text Generation Systems Using Level-Playing-Field Evaluation Principles12 May 2026
- 2026nabla-Reasoner: LLM Reasoning via Test-Time Gradient Descent in Latent Space5 Mar 2026
- 2026DRIV-EX: Counterfactual Explanations for Driving LLMs28 Feb 2026
- 2026LLMs + Security = Trouble9 Feb 2026
- 2026What's the plan? Metrics for implicit planning in LLMs and their application to rhyme generation and question answering28 Jan 2026
- 2026Steering Language Models Before They Speak: Logit-Level Interventions16 Jan 2026
- 2026Logic Tensor Network-Enhanced Generative Adversarial Network7 Jan 2026
- 2026Entropy-Aligned Decoding of LMs for Better Writing and Reasoning5 Jan 2026
38 more
- 2025Incorporating Structure and Chord Constraints in Symbolic Transformer-based Melodic Harmonization8 Dec 2025
- 2025C3TG: Conflict-aware, Composite, and Collaborative Controlled Text Generation12 Nov 2025
- 2025Constrained Adaptive Rejection Sampling2 Oct 2025
- 2025Constrained Sampling for Language Models Should Be Easy: An MCMC Perspective6 Jun 2025
- 2025Inference-time Alignment in Continuous Space26 May 2025
- 2025Semantic Probabilistic Control of Language Models4 May 2025
- 2025TRACE Back from the Future: A Probabilistic Reasoning Approach to Controllable Language Generation25 Apr 2025
- 2025Syntactic and Semantic Control of Large Language Models via Sequential Monte Carlo17 Apr 2025
- 2025Self-Steering Language Models9 Apr 2025
- 2025Palette of Language Models: A Solver for Controlled Text Generation14 Mar 2025
- 2025Constrained Discrete Diffusion12 Mar 2025
- 2025Robust Multi-Objective Controlled Decoding of Large Language Models11 Mar 2025
- 2025REINFORCE Adversarial Attacks on Large Language Models: An Adaptive, Distributional, and Semantic Objective24 Feb 2025
- 2025Sequence-level Large Language Model Training with Contrastive Preference Optimization23 Feb 2025
- 2025MultiQ&A: An Analysis in Measuring Robustness via Automated Crowdsourcing of Question Perturbations and Answers6 Feb 2025
- 2024Growing a Tail: Increasing Output Diversity in Large Language Models5 Nov 2024
- 2024Non-Halting Queries: Exploiting Fixed Points in LLMs8 Oct 2024
- 2024LaSEr-Edit: Localized Span-level Error Editing with Energy-based Localization30 Jun 2024
- 2024Decoding-Time Language Model Alignment with Multiple Objectives27 Jun 2024
- 2024Self-Control of LLM Behaviors by Compressing Suffix Gradient into Prefix Controller4 Jun 2024
- 2024Grammar-Aligned Decoding31 May 2024
- 2024QUEST: Quality-Aware Metropolis-Hastings Sampling for Machine Translation28 May 2024
- 2024Controllable Text Generation in the Instruction-Tuning Era2 May 2024
- 2024Constrained Decoding for Secure Code Generation30 Apr 2024
- 2024Is There No Such Thing as a Bad Question? H4R: HalluciBot For Ratiocination, Rewriting, Ranking, and Routing18 Apr 2024
- 2024On the Challenges and Opportunities in Generative AI28 Feb 2024
- 2024Attacking Large Language Models with Projected Gradient Descent14 Feb 2024
- 2024Effective Controllable Bias Mitigation for Classification and Retrieval using Gate Adapters29 Jan 2024
- 2024Black-Box Access is Insufficient for Rigorous AI Audits25 Jan 2024
- 2024Fluent dreaming for language models24 Jan 2024
- 2024DeepEdit: Knowledge Editing as Decoding with Constraints19 Jan 2024
- 2024Can Large Language Model Summarizers Adapt to Diverse Scientific Communication Goals?18 Jan 2024
- 2024An Autoregressive Text-to-Graph Framework for Joint Entity and Relation Extraction2 Jan 2024
- 2023Learning to Generate Text in Arbitrary Writing Styles28 Dec 2023
- 2023Fast sampling from constrained spaces using the Metropolis-adjusted Mirror Langevin algorithm14 Dec 2023
- 2023A Block Metropolis-Hastings Sampler for Controllable Energy-based Text Generation7 Dec 2023
- 2023Controlled Text Generation via Language Model Arithmetic24 Nov 2023
- 2023P^3SUM: Preserving Author's Perspective in News Summarization with Diffusion Language Models16 Nov 2023
50 newest of 64 All 64 (JSON)
- 2024DeepEdit: Knowledge Editing as Decoding with Constraintscited by 33
- 2025Self-Steering Language Modelscited by 13
- 2025TRACE Back from the Future: A Probabilistic Reasoning Approach to Controllable Language Generationcited by 8
- 2026nabla-Reasoner: LLM Reasoning via Test-Time Gradient Descent in Latent Spacecited by 4
- 2026Entropy-Aligned Decoding of LMs for Better Writing and Reasoningcited by 1
- 2026DRIV-EX: Counterfactual Explanations for Driving LLMscited by 1
- 2026nabla-Reasoner: LLM Reasoning via Test-Time Gradient Descent in Latent Space5 Mar 2026
- 2026DRIV-EX: Counterfactual Explanations for Driving LLMs28 Feb 2026
- 2026Entropy-Aligned Decoding of LMs for Better Writing and Reasoning5 Jan 2026
- 2025TRACE Back from the Future: A Probabilistic Reasoning Approach to Controllable Language Generation25 Apr 2025
- 2025Self-Steering Language Models9 Apr 2025
- 2024DeepEdit: Knowledge Editing as Decoding with Constraints19 Jan 2024
- 2024Attacking Large Language Models with Projected Gradient Descentcited by 91
- 2024Decoding-Time Language Model Alignment with Multiple Objectivescited by 90
- 2025REINFORCE Adversarial Attacks on Large Language Models: An Adaptive, Distributional, and Semantic Objectivecited by 15
- 2025Inference-time Alignment in Continuous Spacecited by 7
- 2025Sequence-level Large Language Model Training with Contrastive Preference Optimizationcited by 3
- 2025Inference-time Alignment in Continuous Space26 May 2025
- 2025REINFORCE Adversarial Attacks on Large Language Models: An Adaptive, Distributional, and Semantic Objective24 Feb 2025
- 2025Sequence-level Large Language Model Training with Contrastive Preference Optimization23 Feb 2025
- 2024Decoding-Time Language Model Alignment with Multiple Objectives27 Jun 2024
- 2024Attacking Large Language Models with Projected Gradient Descent14 Feb 2024
- 2023Hard Prompts Made Easy: Gradient-Based Discrete Optimization for Prompt Tuning and Discoverycited by 329
- 2024Black-Box Access is Insufficient for Rigorous AI Auditscited by 123
- 2023Controlled Text Generation with Natural Language Instructionscited by 87
- 2022Language Generation Models Can Cause Harm: So What Can We Do About It? An Actionable Surveycited by 80
- 2023Word Embeddings Are Steers for Language Modelscited by 70
- 2024Grammar-Aligned Decodingcited by 54
- 2023Controlled Text Generation via Language Model Arithmeticcited by 51
- 2022Toward Human Readable Prompt Tuning: Kubrick's The Shining is a good movie, and a good prompt too?cited by 49
- 2023ChatGPT vs Human-authored Text: Insights into Controllable Text Summarization and Sentence Style Transfercited by 49
- 2025Syntactic and Semantic Control of Large Language Models via Sequential Monte Carlocited by 45
- 2023KCTS: Knowledge-Constrained Tree Search Decoding with Token-Level Hallucination Detectioncited by 43
- 2024Constrained Decoding for Secure Code Generationcited by 35
12 most cited of 49 All 49 (JSON)
- 2026Provably Tractable NFA-Constrained Language Generation via HMMs30 Sep 2026
- 2026BayesPO: Bayesian Prompt Optimization via Parallel-Tempered Gradient-Guided Discrete MCMC17 Jul 2026
- 2026Structured Inference with Large Language Gibbs17 Jun 2026
- 2026Cross-Entropy Games and Frost Training26 May 2026
- 2026A Comparative Study of Controlled Text Generation Systems Using Level-Playing-Field Evaluation Principles12 May 2026
- 2026LLMs + Security = Trouble9 Feb 2026
- 2026What's the plan? Metrics for implicit planning in LLMs and their application to rhyme generation and question answering28 Jan 2026
- 2026Steering Language Models Before They Speak: Logit-Level Interventions16 Jan 2026
- 2026Logic Tensor Network-Enhanced Generative Adversarial Network7 Jan 2026
- 2025Incorporating Structure and Chord Constraints in Symbolic Transformer-based Melodic Harmonization8 Dec 2025
- 2025C3TG: Conflict-aware, Composite, and Collaborative Controlled Text Generation12 Nov 2025
- 2025Constrained Adaptive Rejection Sampling2 Oct 2025
12 newest of 49 All 49 (JSON)