Semi-supervised Text Style Transfer: Cross Projection in Latent Space

Mingyue Shang, Piji Li, Zhenxin Fu, Lidong Bing, Dongyan Zhao, Shuming Shi, Rui Yan

Introduction

Text style transfer (TST) aims to modify the stylistic attributes of a sentence—such as formality or literary era—while preserving its underlying semantic content. Historically, this task has been hindered by two primary challenges: the scarcity of high-quality parallel corpora and the "disentanglement trap." Most unsupervised methods attempt to separate sentences into style-independent content representations and style-specific representations. However, perfectly disentangling these components is notoriously difficult with current neural architectures.

This paper proposes a middle ground: Cross Projection in Latent Space (CPLS). Instead of relying on flawed disentanglement, CPLS employs a semi-supervised approach that maps between style-specific latent spaces, leveraging both limited parallel data and abundant non-parallel data.

Methodology: Cross Projection in Latent Space

The core innovation of CPLS is the rejection of a shared "content" space. Instead, the model allows each style to maintain its own distinct latent manifold.

The CPLS architecture utilizes style-specific encoders and decoders, bridged by differentiable projection functions $f(\cdot)$ and $g(\cdot)$ to map between latent spaces.

The framework consists of three main components:

  1. Denoising Auto-Encoders (DAE): Separate DAEs are trained for each style using non-parallel data, allowing encoders to learn robust representations for their respective domains.
  2. Differentiable Projection Functions: Functions $f$ and $g$ act as bridges, mapping latent vectors from Style A's space to Style B's space and vice versa.
  3. Semi-supervised Training:
    • Supervised Mode: When parallel data is available, the model minimizes the distance between the projected vector and the ground-truth target's latent vector, optimized via Negative Log-Likelihood (NLL) loss.
  4. Unsupervised Mode (Cycle Projection): For non-parallel data, a cycle-consistency strategy is used. A sentence is projected from Style A to B and back to A, with the model ensuring the final reconstruction matches the original input.

Experimental Setup

The researchers evaluated CPLS on two distinct tasks:

  • English Formality Transfer: Utilizing the GYAFC (parallel) and Yahoo Answers L6 (non-parallel) datasets to transfer between formal and informal English.
  • Chinese Literal Style Transfer: A novel task transferring between Ancient Chinese Poetry (Tang Dynasty) and Modern Chinese. The authors released a new dataset for this purpose, crawling parallel pairs from Gushiwen.

Key Results

CPLS demonstrated superior performance across both automatic metrics and human evaluations.

Quantitative results showing CPLS outperforming baselines across multiple metrics (Accuracy, BLEU, GLEU) for both English and Chinese style transfer tasks.

In the English Informal-to-Formal task, CPLS achieved a BLEU score of 48.60, significantly higher than the supervised sequence-to-sequence (S2S) baseline of 33.90. For the more challenging Chinese style transfer task, which involves a large edit distance between ancient and modern forms, CPLS consistently outperformed baselines in content preservation.

Human evaluations corroborated these findings, with volunteers rating CPLS higher in content preservation, style strength, and fluency. The model was particularly effective at avoiding "hallucinations" in the Ancient-to-Modern Chinese task, a common failure mode for other architectures.

Conclusion and Future Work

The success of CPLS suggests that learning transformations between style-specific manifolds is more effective than seeking a single style-neutral manifold. By using differentiable bridges, the entire pipeline can be optimized end-to-end.

Future research may explore scaling this projection method to multi-style transfer or applying it to low-resource machine translation. However, limitations remain, such as the sensitivity of automatic classifiers to sentence length and the requirement for domain similarity between parallel and non-parallel data sources.

Summary updated

BibTeX
@inproceedings{shang2019semi,
  author = {Mingyue Shang and Piji Li and Zhenxin Fu and Lidong Bing and Dongyan Zhao and Shuming Shi and Rui Yan},
  title = {{Semi-supervised Text Style Transfer: Cross Projection in Latent Space}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2019},
  doi = {10.18653/v1/d19-1499},
}
Figure