Multi-Aspect Controllable Text Generation with Disentangled Counterfactual Augmentation

Yi Liu, Xiangyu Liu, Xiangrong Zhu, Wei Hu

Abstract

Generating text that satisfies multiple constraints (e.g., "positive sentiment" + "business topic") is difficult because attributes are often "stereotyped" in training data—for example, world news is frequently negative. We introduce MAGIC, a framework that uses disentangled counterfactual augmentation to break these correlations. By intervening in the latent semantic space, MAGIC allows models to generate high-quality text even for rare attribute combinations, outperforming state-of-the-art baselines in both balanced and imbalanced scenarios.

Introduction

Controllable Text Generation (CTG) has evolved from simple single-attribute tasks to Multi-Aspect Controllable Text Generation (MCTG), where a model must satisfy several attributes simultaneously. The core challenge in MCTG is attribute correlation imbalance. In real-world datasets, certain attributes are naturally intertwined; for instance, "World" and "Business" topics in news articles are overwhelmingly associated with negative sentiment. Models trained on such data develop "stereotypes," struggling to generate "off-palette" combinations like positive world news. Existing methods often ignore these dependencies, leading to poor performance when users request rare attribute pairings.

Methodology

The proposed MAGIC (Multi-aspect Attribute Generation with Intervention and Counterfactuals) framework is built on a prefix-tuning autoencoder architecture. This approach avoids the high cost of fine-tuning entire Large Language Models (LLMs) while providing precise control.

The MAGIC framework architecture, illustrating the training phase with counterfactual augmentation and the inference phase with target-guided search.

Key Innovations:

  1. Attribute Disentanglement Module: Uses Multi-Layer Perceptrons (MLPs) to decouple a sentence's latent representation into separate "control factors" for different aspects (e.g., topic vs. sentiment).
  2. Counterfactual Augmentation: During training, the model creates synthetic latent vectors. If it encounters a "Negative World News" vector, it swaps the negative factor for a positive one to create a synthetic "Positive World News" feature, balancing the latent space.
  3. Target-Guided Augmentation: During inference, MAGIC uses an iterative intersection retrieval algorithm to find the specific point in the latent space that best satisfies all target attributes.
  4. Intervention Losses: Specific mathematical constraints ($L_{intv}^R$ and $L_{intv}^D$) ensure that changing one attribute does not inadvertently flip another.

Experimental Results

MAGIC was evaluated using the IMDb, AGNews, and Jigsaw Toxic Comment datasets. To test robustness, researchers simulated an imbalanced setting using AGNews, where the ratio of negative to positive sentiment for each topic was set to 7:3.

Average relevance scores for MAGIC compared to baselines (GeDi, Tailor, Discrete) across various topics in both balanced and imbalanced settings.

MAGIC consistently outperformed state-of-the-art baselines like GeDi, MacLaSa, and PriorControl. In the challenging imbalanced setting, MAGIC achieved a 7.4% improvement in average attribute relevance over the next best baseline. Topic control saw a significant jump of 12.8% compared to PriorControl. Furthermore, MAGIC showed comparable overall relevance to ChatGPT (92.6% vs 92.5%) but demonstrated significantly better control over specific topics like "World" and "Business," where ChatGPT's zero-shot performance was relatively poor.

Conclusion and Future Work

MAGIC demonstrates that intervening in the latent semantic space is more effective for complex, multi-aspect constraints than token-level masking. While the model currently requires substantial training data and relies on pre-trained classifiers, it provides a robust solution for breaking data-driven stereotypes. Future work will focus on testing these techniques on larger LLMs and reducing the dependency on large-scale labeled data.

Summary updated

BibTeX
@inproceedings{liu2024multi,
  author = {Yi Liu and Xiangyu Liu and Xiangrong Zhu and Wei Hu},
  title = {{Multi-Aspect Controllable Text Generation with Disentangled Counterfactual Augmentation}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.acl-long.500},
}
Figure