Multi-Aspect Controllable Text Generation with Disentangled Counterfactual Augmentation (2024)

Abstract: Multi-aspect controllable text generation aims to control the generated texts in attributes from multiple aspects (e.g., “positive” from sentiment and “sport” from topic). Existing works neglect attribute correlations formed by the intertwining of different attributes. Particularly, the stereotype formed by imbalanced attribute correlations significantly affects multi-aspect control. In this paper, we propose MAGIC, a new multi-aspect controllable text generation method with disentangled counterfactual augmentation. We alleviate the issue of imbalanced attribute correlations during training using counterfactual feature vectors in the attribute latent space by disentanglement. During inference, we enhance attribute correlations by target-guided counterfactual augmentation to further improve multi-aspect control. Experiments show that MAGIC outperforms state-of-the-art baselines in both imbalanced and balanced attribute correlation scenarios.

## introduction controllable text generation (ctg) aims to generate texts adhering to given constraints reliably. the development of generative ai based on large language models (llms) draws increasing attention to ctg @xcite @xcite . due to the demand for diverse attribute control, recent studies focus on a more practical and challenging setting, multi-aspect controllable text generation (mctg). different kinds of methods have been proposed @xcite , including weighted decoding @xcite , optimization in the language space @xcite , optimization in the latent semantic @xcite . @xcite the statistical data of yelp are from @xcite . due to the difficulty of directly obtaining training data that satisfy arbitrary attribute combinations, existing methods @xcite @xcite reuse datasets with single-aspect annotations for mctg, where each training sample only expresses a single attribute in one aspect. this neglects the fact that a sentence often couples multiple attributes due to the complexity of natural language. the co-occurrence of attributes within one sentence forms patterns corresponding to attribute correlations, serving as crucial dependencies for a generative model in inference. meanwhile, the training corpus is derived from real life, where preferences in real life make certain combinations of attributes more common, leading to an imbalance in attribute correlations. as an example shown in figure 1 , in the agnews dataset, since news with the topics of "world" and "business" are prone to correlating with negative elements @xcite , such as war or inflation, combinations of these topics and negative sentiment are more prevalent. in the yelp dataset consisting of restaurant reviews with sentiment and food types, negative reviews also dominate @xcite . the imbalance in attribute correlations can lead the model to associate specific attributes, forming a stereotype that impacts multiaspect control. an mctg model can better fit attributes with higher co-occurrence frequencies, allowing it to learn the semantic information of these attributes more comprehensively. however, the model may neglect the learning of attributes with low co-occurrence frequencies, which hurts the control of these attribute combinations. to resolve the problem, we propose a multiaspect controllable text generation method with disentangled counterfactual augmentation, called magic. specifically, we introduce attribute disentanglement with latent space optimization. it can disentangle the control factors of different attributes in the texts and generate the latent vectors with counterfactual features in the attribute latent space. during training, we employ counterfactual latent vectors to balance attribute correlations, thereby constructing a more semantically balanced attribute latent space. during inference, we enhance attribute correlations by the counterfactual latent vectors to improve multi-aspect control. we experiment on three-aspect control including sentiment, topic, and detoxification. we evaluate the relevance scores of attributes and assess the text quality in the scenarios of imbalanced and balanced attribute correlations. the results indicate that magic can leverage attribute correlations and mitigate the imbalance issues, which leads to steady and superior performance in both imbalanced and balanced scenarios than state-ofthe-art baselines on multi-aspect control. we further demonstrate the effectiveness of each module in magic through analytical experiments. our main contributions are outlined as follows: ## methodology the structure of our magic is illustrated in figure 2. our magic employs an encoder-decoder framework based on prefix tuning to avoid the training costs in fine-tuning llm. we implement multiaspect control revolving around the attribute latent space. the encoder projects sampled sentences into the attribute latent space. several constraints are used to accurately model the attribute semantics. we conduct resampling and incorporate latent vectors with counterfactual features to assist the construction of the attribute latent space and avoid the impact caused by the imbalanced attribute correlations. the vectors with counterfactual features are generated by our designed attribute disentanglement module. we also adopt a target-guided attribute correlation enhanced generation strategy to further improve multi-aspect control. ## conclusion in this paper, we consider attribute correlation and propose a novel method, magic, for multi-aspect control with disentangled counterfactual augmentation. we alleviate the issue of imbalanced attribute correlations during training and further improve multi-aspect control using counterfactual vectors in the attribute latent space by disentanglement. experiments on the three-aspect control task support the effectiveness of magic. we also conduct detailed analytical experiments to study the effects of each strategy in magic. in the future, we will explore the impact of attribute correlations formed during pre-training.