Gradient-based Constrained Sampling from Language Models
By Sachin Kumar, Biswajit Paria, Yulia Tsvetkov. 2022
77 citations recorded by the source corpus.
Large pretrained language models are successful at generating fluent text but are notoriously hard to controllably sample from. In this work, we study constrained sampling from such language models, i.e., generating text that satisfies user-defined constraints, while maintaining fluency and 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 this energy. 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.
Subfields: Artificial Intelligence, Natural Language Processing, Generative Models
How researchers see this paper
The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.
In Artificial Intelligence
- Yulia Tsvetkov
- Vidhisha Balachandran
- Sachin Kumar
- Antonios Anastasopoulos
- Lucille Njoo
- Micah Goldblum
- Jonas Geiping
- Yuxin Wen
In Natural Language Processing
- Yulia Tsvetkov
- Sachin Kumar
- Vidhisha Balachandran
- Antonios Anastasopoulos
- Lucille Njoo
- Micah Goldblum
- Tom Goldstein
- Jonas Geiping
In Generative Models
Citations in the corpus
- Language Generation Models Can Cause Harm: So What Can We Do About It? An Actionable Survey (2022, methodology): “They have been applied for reducing toxicity (Kumar et al., 2022), and improving fidelity in translation systems (Kumar et al.”
- Hard Prompts Made Easy: Gradient-Based Discrete Optimization for Prompt Tuning and Discovery (2023, methodology): “FluentPrompt differs from AutoPrompt by utilizing Langevin dynamics (Kumar et al., 2022) to optimize the prompt embeddings, as well as adding a fluency penalty.”