Style Transfer from Non-Parallel Text by Cross-Alignment

Tianxiao Shen, Tao Lei, Regina Barzilay, Tommi S. Jaakkola

Abstract

This paper presents a novel approach to text style transfer that eliminates the need for parallel corpora. By framing style transfer as a decipherment task, the authors propose a cross-aligned auto-encoder that disentangles latent content from style. Through adversarial training and distributional alignment, the model learns to map sentences from different domains into a shared content space. Experimental results on sentiment modification and decipherment tasks demonstrate that this method significantly outperforms traditional variational auto-encoders and existing baselines.

Introduction

The field of natural language processing has seen remarkable progress in tasks like machine translation, largely driven by the availability of massive parallel datasets. However, for many real-world applications—such as adjusting the formality of a text or altering its sentiment—parallel data is exceedingly rare. The fundamental challenge lies in disentanglement: isolating the "content" (the core meaning) from the "style" (the linguistic expression) without having examples of the same content expressed in multiple styles.

Methodology

The core of the proposed solution is the Cross-Aligned Auto-encoder. This architecture utilizes an encoder ($E$) to map an input sentence to a style-independent content vector ($z$). A generator ($G$) then takes this vector along with a target style indicator to reconstruct or transform the sentence.

Conceptual framework of the cross-aligned auto-encoder showing the mapping between style-specific domains and a shared latent space.

To achieve effective disentanglement, the authors employ two primary strategies:

  1. Distributional Alignment: The model assumes that while the styles differ, the underlying distribution of content remains consistent across corpora.
  2. Cross-Alignment via Discriminators: This adversarial approach uses "style discriminators" to ensure that sentences generated in a target style are indistinguishable from authentic sentences in that domain.
  3. Professor-Forcing: To overcome the non-differentiable nature of discrete text, the authors use the Professor-Forcing algorithm to align the sequences of hidden states in the Recurrent Neural Network (RNN), stabilizing the adversarial training process.

Experimental Evaluation

The model was evaluated across three distinct tasks:

  • Sentiment Modification: Utilizing a filtered set of Yelp restaurant reviews (250K negative, 350K positive sentences).
  • Word Substitution Decipherment: A synthetic task involving the recovery of original text from a 1-to-1 substitution cipher.
  • Word Order Recovery: A task requiring the model to restore grammatical order to shuffled "bag of words" inputs.

Results and Analysis

The Cross-Aligned Auto-encoder demonstrated superior performance across all benchmarks. In the sentiment transfer task, it achieved an accuracy of 78.4%, a dramatic improvement over the 23.2% achieved by a standard Variational Auto-encoder (VAE).

Sentiment transfer accuracy comparison between the proposed cross-aligned auto-encoder and baseline models.

In the decipherment task, the model achieved a BLEU score of 57.4 on 100% word substitution, whereas baseline models failed to produce meaningful results. Furthermore, the model was uniquely capable of significant grammatical reordering in the word order recovery task, reaching a BLEU score of 26.1.

Discussion and Limitations

A key insight of this work is the conceptualization of style transfer as a "decipherment" problem, where different styles are viewed as different codes for the same underlying thoughts. However, the model relies on the assumption of identical content distributions between corpora; if the datasets cover vastly different topics, the shared latent space may not form correctly. Additionally, the current implementation is optimized for relatively short sentences (up to 15 words), and scaling to longer, more complex text remains an area for future research.

Despite these limitations, this research established a robust framework for unsupervised domain transfer in text, proving that sophisticated transformations can be learned without the need for perfectly paired data.

Summary updated

BibTeX
@inproceedings{shen2017style,
  author = {Tianxiao Shen and Tao Lei and Regina Barzilay and Tommi S. Jaakkola},
  title = {{Style Transfer from Non-Parallel Text by Cross-Alignment}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2017},
  url = {https://openreview.net/forum?id=Bk4sTdb_ZH},
}
Figure