Multiple Text Style Transfer by using Word-level Conditional Generative Adversarial Network with Two-Phase Training

Chih-Te Lai, Yi-Te Hong, Hong-You Chen, Chi-Jen Lu, Shou-De LinEMNLP 2019

Abstract

The objective of non-parallel text style transfer, or controllable text generation, is to alter specific attributes (e.g. sentiment, mood, tense, politeness, etc) of a given text while preserving its remaining attributes and content. Generative adversarial network (GAN) is a popular model to ensure the transferred sentences are realistic and have the desired target styles. However, training GAN often suffers from mode collapse problem, which causes that the transferred text is little related to the original text. In this paper, we propose a new GAN model with a word-level conditional architecture and a two-phase training procedure. By using a style-related condition architecture before generating a word, our model is able to maintain style-unrelated words while changing the others. By separating the training procedure into reconstruction and transfer phases, our model is able to learn a proper text generation process, which further improves the content preservation. We test our model on polarity sentiment transfer and multiple-attribute transfer tasks. The empirical results show that our model achieves comparable evaluation scores in both transfer accuracy and fluency but significantly outperforms other state-of-the-art models in content compatibility on three real-world datasets.

Introduction

Text style transfer aims to modify specific attributes of a sentence—such as converting a negative review to a positive one—while maintaining the underlying content. A significant challenge in this field is the lack of parallel data, where the same sentence exists in multiple styles. While Generative Adversarial Networks (GANs) are frequently employed for this task, they often suffer from "content leaking," where the model prioritizes the target style at the expense of the original meaning, sometimes resulting in incoherent output. Furthermore, existing models struggle with multi-attribute transfer (e.g., simultaneously changing sentiment and tense) and training instability.

This research introduces an adversarial training framework designed to enhance content preservation through two primary innovations: a word-level conditional architecture and a two-phase training procedure. This approach allows for granular control over style-specific vocabulary while anchoring the model's ability to reconstruct the original content.

Methodology

The proposed framework utilizes an encoder-decoder architecture enhanced by two key structural strategies:

  1. Word-level Conditional Architecture: Unlike traditional models that condition the decoder only at the start of generation, this model embeds the target style into a vector and concatenates it with the hidden state at every time step. This continuous conditioning helps the model identify exactly which words require modification to satisfy the style requirements.
  2. Two-Phase Training: To mitigate the conflict between style transfer and content preservation, training is divided into two distinct phases. In the Reconstruction Phase, the model functions as a standard auto-encoder, learning to accurately reconstruct input sentences. In the Transfer Phase, adversarial losses are introduced to shift the style, leveraging the content mapping established in the first phase.
Overview of the model framework showing the encoder (E), decoder (G), and dual discriminators.

The architecture employs dual discriminators—a CNN and a bi-directional GRU—to provide comprehensive feedback on both local keyword patterns and global sequence structure, ensuring more fluent and accurate generation.

Experimental Results

The model was evaluated on standard benchmarks including YelpSent (sentiment), AmaSent/AmaProd (sentiment and product categories), and YelpTense (sentiment and tense).

A standout result of this work is the significant improvement in content preservation, as measured by BLEU scores. On the YelpSent dataset, the proposed model achieved a BLEU score of 35.5, substantially higher than previous state-of-the-art models which ranged from 0.1 to 14.7. Similar trends were observed in the AmaSent dataset.

Performance comparison on YelpSent and AmaSent datasets highlighting superior BLEU scores.

In multi-attribute tasks, the model maintained high accuracy. For instance, on YelpTense, it achieved 96.1% tense accuracy and 79.9% sentiment accuracy with a BLEU score of 32.2. Human evaluations further validated these findings, with participants rating the model significantly higher for content preservation (4.01/5.0) compared to competitors like CAAE (3.14) or DAR (1.17).

Discussion and Conclusion

By conditioning at the word level, the model learns to surgically replace style-heavy words while preserving neutral, content-bearing vocabulary. The two-phase training provides stability, preventing the adversarial process from disrupting the model's foundational content preservation capabilities.

While the model excels in content compatibility, its fluency (measured by perplexity) remains slightly higher than real-world data, though it remains competitive. Future work will focus on handling complex sentence structures that require more extensive editing and developing more robust metrics to evaluate the trade-off between style accuracy and content preservation.

Summary updated

BibTeX
@inproceedings{lai2019multiple,
  author = {Chih-Te Lai and Yi-Te Hong and Hong-You Chen and Chi-Jen Lu and Shou-De Lin},
  title = {{Multiple Text Style Transfer by using Word-level Conditional Generative Adversarial Network with Two-Phase Training}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2019},
  url = {https://openreview.net/forum?id=KsCn3UTSRa},
}
Figure