Lune

ACL Findings2023

Controlled Text Generation with Hidden Representation Transformations

Vaibhav Kumar, Hana Koorehdavoudi, Masud Moshtaghi, Amita Misra, Ankit Chadha, Emilio Ferrara

Abstract

We propose CHRT (Control Hidden Representation Transformation) -a controlled language generation framework that steers large language models to generate text pertaining to certain attributes (such as toxicity). CHRT gains attribute control by modifying the hidden representation of the base model through learned transformations. We employ a contrastive-learning framework to learn these transformations that can be combined to gain multi-attribute control. The effectiveness of CHRT is experimentally shown by comparing it with seven baselines over three attributes. CHRT outperforms all the baselines in the task of detoxification, positive sentiment steering, and text simplification while minimizing the loss in linguistic qualities. Further, our approach has the lowest inference latency of only 0.01 seconds more than the base model, making it the most suitable for high-performance production environments. We open-source our code and release two novel datasets to further propel controlled language generation research.

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 · 2 top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Cited by top-tier papers2

  1. Contrastive Perplexity for Controlled Generation: An Application in Detoxifying Large Language ModelsTassilo Klein, Moin NabiACL 2025
  2. GenDis: Generative-Discriminative Dual-View Co-Training for Generalized Category DiscoveryXi Chen, Chuan Qin, Jinpeng Li, Shasha Hu et al.ACL 2026

Builds on20

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. The Curious Case of Neural Text DegenerationAri Holtzman, Jan Buys, Li Du, Maxwell Forbes et al.ICLR 2020 · 4,112 citations
  3. SimCSE: Simple Contrastive Learning of Sentence EmbeddingsTianyu Gao, Xingcheng Yao, Danqi ChenEMNLP 2021 · 2,496 citations
  4. Approximate Nearest Neighbor Negative Contrastive Learning for Dense Text RetrievalLee Xiong, Chenyan Xiong, Ye Li, Kwok-Fung Tang et al.ICLR 2021 · 1,547 citations
  5. 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

Related papers

  1. Controlled Text Generation for Large Language Model with Dynamic Attribute GraphsXun Liang, Hanyu Wang, Shichao Song, Mengting Hu et al.ACL Findings 2024 · 26 citations
  2. Click: Controllable Text Generation with Sequence Likelihood Contrastive LearningChujie Zheng, Pei Ke, Zheng Zhang, Minlie HuangACL Findings 2023 · 5 citations
  3. Language Detoxification with Attribute-Discriminative Latent SpaceJin Myung Kwak, Minseon Kim, Sung Ju HwangACL 2023 · 2 citations
  4. Prompt Compression and Contrastive Conditioning for Controllability and Toxicity Reduction in Language ModelsDavid Wingate, Mohammad Shoeybi, Taylor SorensenEMNLP Findings 2022 · 26 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