Style Transfer Through Back-Translation

Shrimai Prabhumoye, Yulia Tsvetkov, Ruslan Salakhutdinov, Alan W Black

TL;DR

Text style transfer often struggles to change the "how" of a sentence without accidentally altering the "what." This paper introduces a novel approach that uses machine translation as a natural filter to strip away stylistic markers, creating a neutral, meaning-preserving latent representation. By combining this back-translation step with style-specific decoders and adversarial classifiers, the model achieves state-of-the-art performance in transferring gender, sentiment, and political slant while significantly improving text fluency.

What Problem Does This Paper Address?

Text style transfer aims to alter the stylistic attributes of a sentence (e.g., changing a sentence from a negative to a positive sentiment, or shifting its political tone) while keeping the underlying meaning intact.

While deep generative models like Variational Autoencoders (VAEs) and cross-aligned autoencoders have shown promise, they face a fundamental challenge: disentanglement. It is incredibly difficult to separate the semantic content of a sentence from how it is expressed. As a result, existing models often fail to preserve the original intent, frequently generating ungrammatical text or altering key facts.

Methods

The authors propose a pipeline called Back-translation for Style Transfer (BST). The key innovation is using machine translation as a semantic anchor to sanitize the text of its original style.

The pipeline consists of three main phases:

  1. Meaning-Grounded Representation: An input sentence in language $e$ (English) is translated into a target language $f$ (French) using a standard machine translation model. This translated sentence is then passed through the encoder of a back-translation model ($f \rightarrow e$). The resulting hidden state serves as the latent representation $z$. Because machine translation naturally obfuscates author-specific traits while preserving core semantics, $z$ becomes a relatively style-neutral representation of the meaning.
  2. Style-Specific Generation: Instead of using a single decoder, the framework trains separate decoders for each target style (e.g., one for Democratic style, one for Republican style).
  3. Adversarial Classification Feedback: To ensure the generated text actually reflects the desired style, the output of the decoders is passed to a pre-trained Convolutional Neural Network (CNN) style classifier. The classifier's loss acts as a feedback mechanism to guide the generator. To overcome the non-differentiability of discrete text tokens during backpropagation, the authors use a continuous softmax approximation with temperature annealing.
Figure 1: Style transfer pipeline: to rephrase a sentence and reduce its stylistic characteristics, the sen- tence is back-translated. Then, separate style-specific generators are used for style transfer.

Datasets

The authors evaluate their method across three distinct style dimensions:

  • Gender: Yelp reviews annotated for author gender, filtered to keep sentences strongly indicative of a specific gender.
  • Political Slant: A novel dataset introduced in this paper consisting of top-level Facebook comments on posts by US Congress members, labeled by the politician's party affiliation (Democratic vs. Republican).
  • Sentiment: A standard Yelp review dataset split into positive and negative sentences.

Key Insights and Ideas

  • Translation as a Style Filter: The most elegant insight is that translation is inherently lossy regarding style but high-fidelity regarding meaning. Translating a sentence to another language and back acts as a natural normalizer, stripping away demographic markers, politeness levels, and political nuances.
  • Leveraging Pre-trained Agnostic Models: Instead of forcing a model to learn disentanglement from scratch on small, style-specific datasets, the authors leverage massive, style-agnostic parallel corpora used for machine translation to ground the semantics.
  • The Sentiment Paradox: The authors note that sentiment modification is uniquely challenging compared to demographic attributes like gender or political slant. Sentiment is often deeply embedded in the propositional content itself (e.g., changing "crap fries" to "good fries" inherently changes the object's description), making true style-content disentanglement conceptually muddy for sentiment tasks.

Key Results

The BST model was compared against a state-of-the-art baseline, the Cross-Aligned Autoencoder (CAE).

  • Style Transfer Accuracy: BST achieved an absolute improvement of 12% on political slant transfer and up to 7% on sentiment modification over the baseline.
  • Fluency and Meaning Preservation: Human evaluators consistently preferred BST over the baseline for fluency across all tasks. Crucially, BST excelled at handling longer, more complex sentences, where traditional autoencoders typically degrade into gibberish. Annotators preferred the BST model for 47.27% of long sentences compared to just 12.5% for the CAE baseline.

Limitations and Future Work

While BST marks a significant step forward, the authors point out a few limitations:

  • Meaning Preservation Trade-off: In tasks like sentiment transfer, maximizing style accuracy often comes at the cost of meaning preservation because the two are so tightly linked.
  • Dependence on MT Quality: The quality of the latent representation relies heavily on the underlying machine translation system. If the translation system introduces errors, the style transfer decoders cannot recover the original meaning.
  • Future Directions: The authors suggest exploring multi-language pivoting (translating through multiple target languages sequentially) to create even cleaner, more robust style-neutral representations. They also envision applying this technique to text debiasing and author anonymization.

Summary updated

BibTeX
@inproceedings{prabhumoye2018style,
  author = {Shrimai Prabhumoye and Yulia Tsvetkov and Ruslan Salakhutdinov and Alan W Black},
  title = {{Style Transfer Through Back-Translation}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2018},
  doi = {10.18653/v1/p18-1080},
}
Figure