Lune

ACL Findings2024

Controlled Text Generation for Large Language Model with Dynamic Attribute Graphs

Xun Liang, Hanyu Wang, Shichao Song, Mengting Hu, Xunzhi Wang, Zhiyu Li, Feiyu Xiong, Bo Tang

Abstract

Controlled Text Generation (CTG) aims to produce texts that exhibit specific desired attributes. In this study, we introduce a pluggable CTG framework for Large Language Models (LLMs) named Dynamic Attribute Graphs-based controlled text generation (DATG) 1 . This framework utilizes an attribute scorer to evaluate the attributes of sentences generated by LLMs and constructs dynamic attribute graphs.

DATG modulates the occurrence of key attribute words and key anti-attribute words, achieving effective attribute control without compromising the original capabilities of the model. We conduct experiments across four datasets in two tasks: toxicity mitigation and sentiment transformation, employing five LLMs as foundational models. Our findings highlight a remarkable enhancement in control accuracy, achieving a peak improvement of 19.29% over baseline methods in the most favorable task across four datasets. Additionally, we observe a significant decrease in perplexity, markedly improving text fluency.

CONTENT WARNING: This document, for the purpose of illustrating tasks related to toxicity in CTG, may contain examples that are offensive. Please read selectively.

Ask Lune

Ask anything. The answer quotes the paper.

Lune reads all of it and the papers around it, then shows you the passages behind every answer.

Questions to start from

Lune answers from

the full paper · 4 top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Cited by top-tier papers4

  1. UHGEval: Benchmarking the Hallucination of Chinese Large Language Models via Unconstrained GenerationXun Liang, Shichao Song, Simin Niu, Zhiyu Li et al.ACL 2024 · 15 citations
  2. From Chaos to Cure: A Prefix Heuristics Guided Model-Agnostic Adaptive Detoxification FrameworkYuhu Shang, Xiang Cheng, Yimeng Ren, Huijia Wu et al.AAAI 2026
  3. Why Is My Transaction Risky? Understanding Smart Contract Semantics and Interactions in the NFT EcosystemYujing Chen, Xuanming Liu, Zhiyuan Wan, Zuobin Wang et al.ASE 2025
  4. Controlling Distributional Bias in Multi-Round LLM Generation via KL-Optimized Fine-TuningYanbei Jiang, Amr Keleg, Ryandito Diandaru, Jey Han Lau et al.ACL 2026

Builds on19

  1. Finetuned Language Models are Zero-Shot LearnersJason Wei, Maarten Bosma, Vincent Y. Zhao, Kelvin Guu et al.ICLR 2022 · 4,966 citations
  2. LIMA: Less Is More for AlignmentChunting Zhou, Pengfei Liu, Puxin Xu, Srinivasan Iyer et al.NeurIPS 2023 · 1,486 citations
  3. 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
  4. AutoPrompt: Eliciting Knowledge from Language Models with Automatically Generated PromptsTaylor Shin, Yasaman Razeghi, Robert L. Logan IV, Eric Wallace et al.EMNLP 2020 · 1,162 citations
  5. RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language ModelsSamuel Gehman, Suchin Gururangan, Maarten Sap, Yejin Choi et al.EMNLP Findings 2020 · 692 citations

Related papers

  1. C³TG: Conflict-aware, Composite, and Collaborative Controlled Text GenerationYu Li, Zhe Yang, Yi Huang, Xin Liu et al.AAAI 2026
  2. Controlled Text Generation with Hidden Representation TransformationsVaibhav Kumar, Hana Koorehdavoudi, Masud Moshtaghi, Amita Misra et al.ACL Findings 2023 · 1 citation
  3. Click: Controllable Text Generation with Sequence Likelihood Contrastive LearningChujie Zheng, Pei Ke, Zheng Zhang, Minlie HuangACL Findings 2023 · 5 citations
  4. Successor Features for Efficient Multi-Subject Controlled Text GenerationMeng Cao, Mehdi Fatemi, Jackie C. K. Cheung, Samira ShabanianICML 2024 · 2 citations
  5. Attribute Alignment: Controlling Text Generation from Pre-trained Language ModelsDian Yu, Zhou Yu, Kenji SagaeEMNLP Findings 2021 · 26 citations
Dusk over the sea between two cliffs drawn in fine vertical lines