Controllable Text Generation for Large Language Models: A Survey

Xun Liang, Hanyu Wang, Yezhaohui Wang, Shichao Song, Jiawei Yang, Simin Niu, Jie Hu, Dan Liu, Shunyu Yao, Feiyu Xiong, Zhiyu LiarXiv 2024 · DOI

As Large Language Models (LLMs) transition from general-purpose chatbots to specialized tools in law, medicine, and creative industries, the demand for precision has shifted. It is no longer enough for a model to be knowledgeable; it must be steerable. This survey provides a comprehensive map of the techniques used to dictate how LLMs generate text, a field known as Controllable Text Generation (CTG).

The Core Challenge: The Control-Quality Trade-off

Standard LLMs are probabilistic engines that predict the next token based on massive datasets. However, these predictions do not always align with specific human constraints, such as avoiding certain vocabulary, following a strict poetic meter, or maintaining a specific empathetic tone.

The central tension in CTG is the "Control-Quality Trade-off." While researchers aim for perfect instruction following, strict constraints often degrade the model’s natural fluency, leading to repetitive or incoherent outputs. Effective CTG requires balancing the meeting of control conditions (security, sentiment, topic) with the maintenance of text quality (fluency, diversity, practicality).

A Dual Taxonomy of CTG Tasks and Methods

To organize this rapidly evolving field, the survey introduces a dual-taxonomy that categorizes CTG based on the nature of the control and the stage of intervention.

A comprehensive overview of the CTG landscape, mapping control dimensions, tasks, and intervention methods.

1. Control Tasks: Hard vs. Soft

  • Content/Linguistic (Hard Control): Focuses on structural constraints like vocabulary usage, sentence length, and specific formats.
  • Attribute/Semantic (Soft Control): Focuses on high-level qualities such as sentiment, topic, style, and safety.

2. Intervention Stages

Methods are further categorized by where they occur in the model pipeline:

  • Training Stage: Includes computationally intensive methods like Retraining with control codes (e.g., CTRL) or Fine-Tuning with specialized datasets or Reinforcement Learning (RLHF).
  • Inference Stage: The current research frontier, focusing on "plug-and-play" methods. These include Prompt Engineering, Latent Space Manipulation (injecting steering vectors into hidden layers), and Decoding-time Interventions (modifying token probability distributions during generation).

Evolution and Growth of the Field

The field has seen exponential growth since the release of GPT-2 in 2019, with the number of CTG-related papers nearly doubling every year. This surge reflects a move away from expensive model retraining toward more practical, inference-time solutions like FUDGE and DExperts, which allow a single base model to serve multiple specialized tasks.

The exponential growth of CTG research and the timeline of landmark steering methods.

Key Insights

  • Orthogonality of Control: Controllability is a dimension distinct from capability. A model can possess high logical reasoning skills yet fail to adopt a specific persona or follow formatting constraints.
  • Attribute Coupling: Models often struggle with spurious correlations—for instance, failing to generate "negative scientific text" because they have primarily associated scientific topics with positive or neutral sentiments.
  • The Shift to Latent Space: Modern research is moving toward modifying "thoughts" (internal activations) rather than just text or weights. By adding "steering vectors" (e.g., an honesty vector) to hidden layers, researchers can shift model behavior without any fine-tuning.

Limitations and Future Directions

Despite significant progress, several hurdles remain. Attribute Interference occurs when models fail to satisfy multiple simultaneous constraints (e.g., length, sentiment, and topic). Furthermore, many high-performing decoding-time methods suffer from high latency, making them difficult to deploy in real-time environments.

Future research must bridge the "real-world gap," moving beyond simple binary controls (like positive/negative sentiment) toward complex, multi-faceted tasks like narrative structure and pragmatic social functions, while prioritizing the computational efficiency required for production use.

Summary updated

BibTeX
@misc{liang2024controllable,
  author = {Xun Liang and Hanyu Wang and Yezhaohui Wang and Shichao Song and Jiawei Yang and Simin Niu and Jie Hu and Dan Liu and Shunyu Yao and Feiyu Xiong and Zhiyu Li},
  title = {{Controllable Text Generation for Large Language Models: A Survey}},
  year = {2024},
  eprint = {2408.12599},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2408.12599},
}
Figure