Learning to Generate Multiple Style Transfer Outputs for an Input Sentence

Kevin Lin, Ming-Yu Liu, Ming-Ting Sun, Jan Kautz

Abstract

Text style transfer refers to the task of rephrasing a given text in a different style. While various methods have been proposed to advance the state of the art, they often assume the transfer output follows a delta distribution, and thus their models cannot generate different style transfer results for a given input text. To address the limitation, we propose a one-to-many text style transfer framework. In contrast to prior works that learn a one-to-one mapping that converts an input sentence to one output sentence, our approach learns a one-to-many mapping that can convert an input sentence to multiple different output sentences, while preserving the input content. This is achieved by applying adversarial training with a latent decomposition scheme. Specifically, we decompose the latent representation of the input sentence to a style code that captures the language style variation and a content code that encodes the language style-independent content. We then combine the content code with the style code for generating a style transfer output. By combining the same content code with a different style code, we generate a different style transfer output. Extensive experimental results with comparisons to several text style transfer approaches on multiple public datasets using a diverse set of performance metrics validate effectiveness of the proposed approach.

Introduction

Text style transfer (TST) involves rewriting a sentence to alter its stylistic attributes—such as sentiment (negative to positive) or formality—while maintaining its underlying semantic content. Traditionally, TST models have been designed as one-to-one mappings, assuming a single "correct" transfer for any given input. However, natural language is inherently diverse; a single negative sentiment can be expressed in numerous positive ways.

Existing models often assume the output follows a "delta distribution," effectively searching for a unique point estimate. This research addresses this limitation by formulating TST as a one-to-many mapping, enabling the generation of multimodal outputs that better reflect the richness of human expression and provide users with a range of stylistic choices.

Architecture and Methodology

The proposed framework is built upon a convolutional sequence-to-sequence (ConvS2S) architecture enhanced with an attention mechanism and a latent decomposition scheme. The core strategy involves disentangling a sentence into two distinct latent representations:

  1. Content Code ($c$): Captures style-independent meaning.
  2. Style Code ($s$): Captures stylistic variations extracted from a reference corpus.
The one-to-many style transfer architecture demonstrates how different style references ($x_2$) can transform the same input content ($x_1$) into diverse outputs ($y_{1 \to 2}$).

Training Objectives

To train the model without parallel data, the authors employ several critical loss functions:

  • Reconstruction Loss: Ensures the encoders can faithfully represent the original sentence.
  • Back-translation Loss: Implements cycle-consistency; transferring a sentence to a target style and back should recover the original content.
  • Adversarial Loss: A discriminator ensures that generated latent codes are indistinguishable from real codes in the target style space, forcing the generator to produce authentic stylistic nuances.

Latent Decomposition and Diversity

A key innovation of this work is treating style as a distribution rather than a fixed label. By sampling different style codes from the target dataset, the model can generate a variety of outputs for a single input sentence.

Conceptual diagram of the latent space decomposition, where a single content code $c_1$ is paired with multiple style samples from the target distribution $S_2$ to produce a variety of outputs in $X_2$.

This approach highlights the "style-content trade-off." As stylistic intensity increases, content preservation may decrease. The authors' latent decomposition method finds a superior balance on this Pareto frontier compared to previous state-of-the-art methods. Furthermore, to handle the non-differentiable nature of discrete word selection (e.g., beam search), the authors utilized a learned non-linear projection (MLP) to bridge the decoder and encoder during back-propagation.

Experimental Results

The model was evaluated on the Amazon and Yelp restaurant review datasets. Performance was measured against baselines such as Cross-Alignment Auto-Encoders (CAE) and Back-Translation for Style Transfer (BTS).

  • Diversity: On the Amazon dataset, the proposed model achieved a diversity score of 46.31, a massive improvement over the 2.60 achieved by the standard CAE model.
  • Human Evaluation: In studies conducted via Amazon Mechanical Turk, human evaluators preferred the outputs of this model for their superior fluency, diversity, and overall quality.
  • Ablation Studies: Results confirmed that reconstruction, back-translation, and style classification losses are all essential for high-quality, diverse transfers.

Conclusion

While the one-to-many framework marks a significant advancement, challenges remain in preserving content for exceptionally long sentences and handling highly complex grammatical structures. Future research will explore extending this framework to other domains, such as author-specific imitation and formality transfer, further unlocking the potential of diverse automated text generation.

Summary updated

Abstract

Text style transfer refers to the task of rephrasing a given text in a different style. While various methods have been proposed to advance the state of the art, they often assume the transfer output follows a delta distribution, and thus their models cannot generate different style transfer results for a given input text. To address the limitation, we propose a one-to-many text style transfer framework. In contrast to prior works that learn a one-to-one mapping that converts an input sentence to one output sentence, our approach learns a one-to-many mapping that can convert an input sentence to multiple different output sentences, while preserving the input content. This is achieved by applying adversarial training with a latent decomposition scheme. Specifically, we decompose the latent representation of the input sentence to a style code that captures the language style variation and a content code that encodes the language style-independent content. We then combine the content code with the style code for generating a style transfer output. By combining the same content code with a different style code, we generate a different style transfer output. Extensive experimental results with comparisons to several text style transfer approaches on multiple public datasets using a diverse set of performance metrics validate effectiveness of the proposed approach.
BibTeX
@inproceedings{lin2020learning,
  author = {Kevin Lin and Ming-Yu Liu and Ming-Ting Sun and Jan Kautz},
  title = {{Learning to Generate Multiple Style Transfer Outputs for an Input Sentence}},
  booktitle = {NGT @ ACL},
  year = {2020},
  url = {https://openreview.net/forum?id=pE0vGC5Je5},
}
Figure