StylePTB: A Compositional Benchmark for Fine-grained Controllable Text Style Transfer

Yiwei Lyu, Paul Pu Liang, Hai Pham, Eduard H. Hovy, Barnabás Póczos, Ruslan Salakhutdinov, Louis-Philippe Morency

Abstract

Text style transfer (TST) has traditionally focused on high-level, binary attributes like sentiment or formality. However, these attributes are often composed of multiple fine-grained linguistic changes. We introduce StylePTB, a large-scale benchmark featuring 21 atomic stylistic building blocks across lexical, syntactic, semantic, and thematic domains. StylePTB provides paired data for both individual and composed transfers, challenging models to achieve precise, multi-attribute control. We also propose Compositional Style GPT (CS-GPT), which utilizes transfer tokens to perform simultaneous stylistic transformations.

Introduction: From Monolithic to Atomic Style

Most existing research in text style transfer treats style as a monolithic, entangled attribute—for instance, converting a "negative" review into a "positive" one. In reality, high-level styles like "formality" are compositions of many smaller, fine-grained changes, such as removing slang, shifting from active to passive voice, or reordering prepositional phrases.

The field has lacked a benchmark for fine-grained controllability. Current models often struggle to perform specific structural changes or to compose multiple stylistic changes simultaneously. StylePTB addresses this by decomposing style into fundamental linguistic units, allowing for a more modular approach to text generation.

Figure 1: Comparison between high-level style transfer (e.g., negative to positive) and fine-grained compositional style transfer using atomic building blocks.

Fine-Grained Style Constructs

The authors define 21 fine-grained style constructs categorized into four representational levels:

  1. Lexical: Synonym/antonym replacements and frequency-based word substitutions.
  2. Syntax: Tense changes, active/passive voice shifts, and prepositional phrase (PP) reordering.
  3. Semantics: Information removal (adjectives, adverbs, or substatements) and information addition.
  4. Thematics: Emphasizing specific verbs or adjectives by restructuring the sentence.

The StylePTB Dataset

Built upon the Penn Treebank (PTB), the StylePTB dataset contains 59,767 sentence pairs for 21 individual styles and 35,887 pairs for 32 different compositions of styles. While 18 of the transfers were generated using automated rule-based scripts, three "hard" transfers—Information Addition, Adjective Emphasis, and Verb Emphasis—were manually rewritten by human annotators.

Figure 4: Statistical distribution of the StylePTB dataset, including (a) sentence lengths, (b) parts of speech, and (c) the top 30 most frequent tokens.

Validation of the dataset shows its relevance to real-world tasks: 72% of transfers in the GYAFC (formality) dataset and 82% of Yelp (sentiment) transfers can be decomposed into the atomic styles defined in StylePTB.

Compositional Style GPT (CS-GPT)

To model these transfers, the authors introduce CS-GPT. This model extends a pre-trained GPT-2 by prepending specific "transfer tokens" ($\Delta_i$) to the source sentence. Each token represents a specific stylistic change. During training, the model learns to associate these tokens with corresponding transformations. This architecture allows the model to perform multiple transfers at once by activating multiple tokens simultaneously.

Key Results and Insights

  • The Difficulty of Syntax: While current models perform well on lexical swaps, they struggle significantly with syntactic and thematic changes (e.g., moving a prepositional phrase or changing emphasis), which require global sentence restructuring.
  • Compositional Success: CS-GPT significantly outperformed standard baselines on multi-step transfers. For example, on a "ToFuture + ActiveToPassive" task, CS-GPT achieved a CiDER score of 1.800, nearly doubling the performance of a standard GPT-2 (0.866).
  • Zero-Shot Failure: Models trained only on individual styles fail to compose them effectively at test time, suggesting that compositionality is not an emergent property in current architectures and requires explicit training on multi-step transfers.
  • Bias Mitigation: A novel application of fine-grained TST is reducing social bias. By surgically replacing biased nouns or removing stereotypical descriptors, the authors demonstrated more effective bias reduction in GPT-2 generated text compared to coarse-grained methods.

Conclusion

StylePTB shifts the focus of text style transfer toward a modular "dictionary" of fine-grained constructs. While models like CS-GPT show promise in handling multi-step transfers, significant challenges remain in thematic and semantic addition tasks. This benchmark encourages future research into better disentangled representations and more robust zero-shot compositionality in natural language generation.

Summary updated

BibTeX
@inproceedings{lyu2021styleptb,
  author = {Yiwei Lyu and Paul Pu Liang and Hai Pham and Eduard H. Hovy and Barnabás Póczos and Ruslan Salakhutdinov and Louis-Philippe Morency},
  title = {{StylePTB: A Compositional Benchmark for Fine-grained Controllable Text Style Transfer}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.naacl-main.171},
}
Figure