Directed Beam Search: Plug-and-Play Lexically Constrained Language Generation
Not on the map. Why?
Abstract (arXiv)
Large pre-trained language models are capable of generating realistic text. However, controlling these models so that the generated text satisfies lexical constraints, i.e., contains specific words, is a challenging problem. Given that state-of-the-art language models are too large to be trained from scratch in a manageable time, it is desirable to control these models without re-training them. Methods capable of doing this are called plug-and-play. Recent plug-and-play methods have been successful in constraining small bidirectional language models as well as forward models in tasks with a restricted search space, e.g., machine translation. However, controlling large transformer-based models to meet lexical constraints without re-training them remains a challenge. In this work, we propose Directed Beam Search (DBS), a plug-and-play method for lexically constrained language generation. Our method can be applied to any language model, is easy to implement and can be used for general language generation. In our experiments we use DBS to control GPT-2. We demonstrate its performance on keyword-to-phrase generation and we obtain comparable results as a state-of-the-art non-plug-and-play model for lexically constrained story generation.
Key facts. Cited by 12 papers in the map (data through 14 Oct 2026). First posted on arXiv 31 Dec 2020.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 1; 2022: 5; 2023: 2; 2024: 1; 2025: 3.
12 papers.
- 2022COLD Decoding: Energy-based Constrained Text Generation with Langevin Dynamicscited by 161
- 2023Sequential Monte Carlo Steering of Large Language Models using Probabilistic Programscited by 80
- 2021Plug-and-Blend: A Framework for Controllable Story Generation with Blended Control Codescited by 19
- 2022Long-term Control for Dialogue Generation: Methods and Evaluationcited by 5
- 2025Supervised Optimism Correction: Be Confident When LLMs Are Surecited by 5
- 2022PCAE: A Framework of Plug-in Conditional Auto-Encoder for Controllable Text Generationcited by 4
- 2022Controllable Citation Sentence Generation with Language Modelscited by 4
- 2023PlaSma: Making Small Language Models Better Procedural Knowledge Models for (Counterfactual) Planningcited by 4
- 2025Advancing Decoding Strategies: Enhancements in Locally Typical Sampling for LLMscited by 4
- 2024KpopMT: Translation Dataset with Terminology for Kpop Fandomcited by 2
- 2025Incorporating Structure and Chord Constraints in Symbolic Transformer-based Melodic Harmonizationcited by 2
- 2022Efficient and Training-Free Control of Language Generationcited by 0
- 2025Incorporating Structure and Chord Constraints in Symbolic Transformer-based Melodic Harmonization8 Dec 2025
- 2025Advancing Decoding Strategies: Enhancements in Locally Typical Sampling for LLMs3 Jun 2025
- 2025Supervised Optimism Correction: Be Confident When LLMs Are Sure10 Apr 2025
- 2024KpopMT: Translation Dataset with Terminology for Kpop Fandom10 Jul 2024
- 2023Sequential Monte Carlo Steering of Large Language Models using Probabilistic Programs5 Jun 2023
- 2023PlaSma: Making Small Language Models Better Procedural Knowledge Models for (Counterfactual) Planning31 May 2023
- 2022Controllable Citation Sentence Generation with Language Models14 Nov 2022
- 2022PCAE: A Framework of Plug-in Conditional Auto-Encoder for Controllable Text Generation7 Oct 2022
- 2022Long-term Control for Dialogue Generation: Methods and Evaluation15 May 2022
- 2022Efficient and Training-Free Control of Language Generation12 May 2022
- 2022COLD Decoding: Energy-based Constrained Text Generation with Langevin Dynamics23 Feb 2022
- 2021Plug-and-Blend: A Framework for Controllable Story Generation with Blended Control Codes23 Mar 2021