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

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

Abstract

Text style transfer aims to alter the stylistic attributes of a sentence while preserving its semantic content. A major challenge in this field is the scarcity of parallel datasets. This paper introduces Cross Projection in Latent Space (CPLS), a semi-supervised framework that learns a differentiable bridge between style-specific latent spaces. By leveraging both small-scale parallel data and large-scale nonparallel data, CPLS avoids the pitfalls of unsupervised disentanglement and achieves superior content preservation.

Introduction

The primary hurdle in text style transfer is the lack of aligned pairs (e.g., the same sentence in both formal and informal styles). While massive corpora of individual styles exist, parallel data is rare. Traditional approaches often rely on unsupervised disentanglement, attempting to separate a sentence into a style-independent "content" representation and a style-specific "attribute" representation. However, perfectly isolating style from content is theoretically and practically difficult.

CPLS departs from this paradigm. Instead of seeking a shared, style-neutral space, it treats different styles as residing in distinct latent spaces. The core idea is to learn a projection function that maps a representation from one style's space to another, effectively "translating" the style while maintaining the underlying meaning.

Methodology: Cross Projection in Latent Space

The CPLS framework is built upon a sequence-to-sequence (S2S) architecture with style-specific components.

The CPLS architecture uses style-specific encoders and decoders, connected by a projection function that maps between latent spaces.

1. Denoising Auto-Encoders (DAE)

The model first learns the internal structure of each style using nonparallel data. Separate encoders and decoders are trained for each style to reconstruct noisy inputs, ensuring the latent spaces capture the essential features of their respective domains.

2. The Projection Function

To perform style transfer, CPLS introduces a projection function $f(\cdot)$ (and its inverse $g(\cdot)$). This function maps a latent vector from the source style space (e.g., Style A) to the target style space (e.g., Style B).

3. Semi-supervised Training

The model is trained using a combination of supervised and unsupervised objectives:

  • Supervised (Cross Projection): Using the limited parallel data, the model minimizes the distance between the projected vector of a source sentence and the actual latent vector of its parallel target.
  • Unsupervised (Cycle Projection): For nonparallel data, a cycle-consistency loss is applied. A sentence is projected from Style A to Style B and then back to Style A. The model is optimized to ensure the final reconstruction matches the original input, similar to back-translation techniques.

Experimental Setup

The authors evaluated CPLS on two diverse datasets:

  1. Chinese Literal Style Dataset: A novel dataset pairing ancient Tang dynasty poetry with modern Chinese interpretations (approx. 3,362 parallel pairs).
  2. English Formality Dataset (GYAFC): A standard benchmark for formal/informal English transfer (5,000 parallel pairs).

CPLS was compared against several baselines, including a standard supervised S2S model, DAR (Data Augmentation via Retrieval), and SLS (Shared Latent Space).

Results and Discussion

CPLS consistently outperformed baselines in both automated metrics and human evaluation.

Quantitative evaluation showing CPLS achieving superior BLEU and GLEU scores across multiple style transfer tasks.

Key Findings

  • Superior Content Preservation: CPLS showed significant gains in BLEU scores. For instance, in the informal English transfer task ("to Inf.en"), it achieved a BLEU of 27.25, compared to 18.34 for the S2S baseline.
  • Effectiveness of Small Parallel Data: The results demonstrate that even a small amount of parallel data can effectively "anchor" the latent spaces, providing a much stronger signal for alignment than unsupervised methods alone.
  • Human Preference: Blind human evaluations confirmed that CPLS outputs were more successful at retaining original meaning while adopting the target style compared to other semi-supervised approaches.

Conclusion

The Cross Projection in Latent Space (CPLS) model offers a robust alternative to style-content disentanglement. By learning to bridge distinct latent spaces, it effectively utilizes limited parallel data to guide the transfer process. Future work may explore more complex projection functions and the application of this framework to multimodal tasks.

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