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 is a core challenge in Natural Language Processing (NLP), requiring the rephrasing of a sentence to alter its stylistic attributes—such as sentiment or formality—while maintaining its underlying semantic content. Historically, this task has been framed as a one-to-one mapping problem, where a model aims to find a single optimal output for a given input. However, human language is inherently multimodal; a single idea can be expressed in numerous stylistically distinct ways. Existing models that assume a "delta distribution" for outputs often produce generic results and lack the flexibility needed for creative applications.

The One-to-Many Framework

To overcome the limitations of one-to-one models, this research introduces a framework capable of generating multiple, diverse style-transferred outputs for a single input sentence. The transition from a point-based translation to a distribution-based generative sampling task is central to this approach.

Conceptual diagram comparing traditional one-to-one mapping (left) with the proposed one-to-many text style transfer (right).

As illustrated in the figure above, while traditional methods map an input $X_1$ to a single point $C_1$ in the target domain, the proposed framework leverages a latent content representation $C$ and samples from a target style distribution $S_2$ to produce a variety of valid outputs in $X_2$.

Methodology: Latent Decomposition and Adversarial Training

The framework relies on latent decomposition to separate a sentence into two independent components: a Content Code ($c$), which captures style-independent meaning, and a Style Code ($s$), which captures stylistic variation.

Architecture of the one-to-many style transfer model. By pairing a fixed content code ($c_1$) with different sampled style codes ($s_2$), the model generates diverse outputs ($y_{1 \to 2}$).

The generation process involves extracting the content code from the input and combining it with a style code sampled from the target domain. Training is conducted on non-parallel corpora using a combination of four loss functions:

  1. Reconstruction Loss: Ensures the model can reconstruct the original sentence from its latent codes.
  2. Back-translation Loss: Enforces cycle consistency by ensuring a transferred sentence can be mapped back to its original form.
  3. Style Classification Loss: Encourages the style encoder to capture relevant stylistic markers.
  4. Adversarial Loss: Uses Generative Adversarial Networks (GANs) to ensure that generated latent codes are indistinguishable from real codes in the target domain.

To handle the technical hurdle of non-differentiable beam search during training, the researchers implemented a Multilayer Perceptron (MLP) bridge that projects feature activations between encoders and decoders, allowing for standard back-propagation.

Experimental Results

The model was evaluated on the Yelp and Amazon review datasets. Performance was measured using both automated metrics and human evaluation.

  • Diversity: The model significantly outperformed baselines in output diversity, as measured by self-BLEU scores. For instance, on the Yelp dataset, the model achieved a diversity score of 58.29, compared to 48.36 for the most competitive baseline.
  • Quality and Fluency: Human evaluators on Amazon Mechanical Turk preferred the proposed model's outputs for fluency (72.22%) and overall quality (51.01%) over previous state-of-the-art methods.
  • Qualitative Variety: The model successfully demonstrated the ability to generate distinct variations, such as transforming "I will never go to this restaurant again" into "I will definitely go to this restaurant again" or "I would love to visit this restaurant again!"

Conclusion

By shifting the focus from one-to-one translation to one-to-many generative sampling, this framework provides a more flexible and creative approach to text style transfer. While challenges remain in handling highly complex syntax and very long sentences, the use of latent decomposition and adversarial training marks a significant step toward more human-like linguistic flexibility in NLP models.

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