Zero-Shot Fine-Grained Style Transfer: Leveraging Distributed Continuous Style Representations to Transfer To Unseen Styles

Eric Michael Smith, Diana Gonzalez-Rico, Emily Dinan, Y-Lan BoureauarXiv 2019

Abstract

This paper introduces a method for zero-shot fine-grained text style transfer by replacing discrete style labels with continuous, distributed representations (embeddings). By leveraging a pre-trained style space, the model can transfer text to nuanced sentiments it has never seen during training—such as turning an "annoyed" sentence into a "delighted" one—without any additional fine-tuning.

Introduction

Traditional text style transfer is often "binary" or extremely limited, focusing on coarse shifts like positive-to-negative sentiment or formal-to-informal prose. However, human language is far more nuanced. If you want to change a sentence from "angry" to "hopeful" or "ecstatic," most current models fail because they treat styles as a handful of isolated, discrete buckets.

Furthermore, these models typically cannot handle unseen styles. If a model was trained only on "happy" and "sad," it has no idea how to generate "nostalgic" text. This paper addresses the need for a more flexible, fine-grained control mechanism that can generalize across a continuous "map" of styles.

Methodology

The authors build upon a standard denoising autoencoder architecture with a back-translation objective. The core innovation lies in how they represent the target style:

  1. Continuous Style Embeddings: Instead of using a simple lookup table for a few discrete labels, they use a weight matrix ($W$) multiplied by a distributed embedding ($y_d$) from a pre-trained classifier (like fastText or BERT).
  2. The "Style Map": Because these embeddings come from a classifier trained on many labels, they capture the relationships between styles. "Happy" and "Delighted" end up closer together in this vector space than "Happy" and "Angry."
  3. Zero-Shot Transfer: During training, the model learns to associate regions of this continuous embedding space with specific textual transformations. At inference time, you can feed the model an embedding for a style it never saw during training (a "held-out" style). Because the model understands the underlying geometry of the style space, it can interpolate how that new style should look.
  4. Decoupled Classifier: By using an external classifier to generate the style representations, the style transfer model can be updated or applied to new domains more easily.

Datasets

The research utilizes two primary datasets:

  • Reddit Sentiment Dataset: A massive, custom-curated dataset of 31 million labeled samples from Reddit, covering 24 fine-grained sentiment labels (e.g., aggravated, curious, thankful, pumped).
  • EMPATHETICDIALOGUES: A smaller dataset (25k samples) containing situation descriptions and 32 sentiment labels. This was used to test how well a model pre-trained on Reddit could adapt to a new, smaller domain.

Results and Discussion

The model demonstrated high performance on seen styles, achieving over 90% target attribute accuracy on the 24-label Reddit task while maintaining reasonable fluency.

Quantitative evaluation of style transfer models on the Reddit dataset.

As shown in the quantitative results, there is a clear "Pareto frontier" between content preservation and style strength. As the model gets better at hitting the target sentiment (moving from Model 1 to Model 4), the self-BLEU score—which measures content similarity to the original—drops significantly.

Zero-Shot Performance

A key highlight of this work is the successful transfer to unseen styles. When trained on 20 labels and tested on 4 unseen labels (delighted, ecstatic, emotional, irritated), the model picked the correct target class over 50% of the time. While this is lower than the 90% for seen styles, it is vastly superior to the random chance baseline of 4%.

Zero-shot transfer performance on held-out target attributes compared to training attributes.

Key Insights

  • Disentanglement is Optional: Explicitly "stripping" style from content is not strictly necessary for high-quality transfer.
  • Bottlenecks Aid Generalization: A low-dimensional bottleneck (supervised embedding dimension of 8) forced the model to learn essential stylistic features, aiding generalization.
  • Implicit Style Specification: Continuous vectors allow for "style by example," where a target style is specified by a sentence rather than a label.

Limitations and Future Work

The "zero-shot" approach showed sensitivity when moving between disparate datasets (Reddit to Empathetic Dialogues) without fine-tuning. Additionally, "strong" transfer modes often resulted in significant content loss. Future work may explore using unlabeled data to extract style embeddings, further expanding the model's expressive range.

Summary updated

BibTeX
@misc{smith2019zero,
  author = {Eric Michael Smith and Diana Gonzalez-Rico and Emily Dinan and Y-Lan Boureau},
  title = {{Zero-Shot Fine-Grained Style Transfer: Leveraging Distributed Continuous Style Representations to Transfer To Unseen Styles}},
  year = {2019},
  eprint = {1911.03914},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1911.03914},
}
Figure