Don't lose the message while paraphrasing: A study on content preserving style transfer

Nikolay Babakov, David Dale, Ilya Gusev, Irina Krotova, Alexander PanchenkoarXiv 2023

TL;DR

This paper introduces LEWIT, a supervised text style transfer model that excels at changing the "flavor" of a sentence (e.g., formal to informal) without corrupting critical factual information like addresses or product names. The authors also release PreserveDialogue, a new benchmark dataset specifically designed to evaluate how well models protect these essential "semantic slots" during paraphrasing.

What Problem Does This Paper Address?

Text Style Transfer (TST) aims to change the style of a sentence (like making it less toxic or more formal) while keeping the meaning the same. However, standard sequence-to-sequence models often suffer from "hallucinations" or deletions—they might change a specific address or a time slot while trying to sound more casual.

In goal-oriented dialogues (e.g., a chatbot helping you order pizza), this is a dealbreaker. If a model changes "1760 Polk Street" to "your place" to sound informal, the core message is lost. The authors argue that existing research hasn't focused enough on this content preservation aspect, particularly for named entities and specific task-related data.

Methods

The authors propose LEWIT (T5-based LEWIS), an improvement on the previous LEWIS model. While the original LEWIS was unsupervised and used BART, LEWIT operates in a supervised setting and leverages the T5 (Text-to-Text Transfer Transformer) architecture.

The LEWIT workflow consists of two main steps:

  1. Token Tagging: A RoBERTa-based tagger identifies which tokens in the source text should be kept, deleted, replaced, or where new tokens should be inserted.
  2. Gap Infilling: The model creates a template where important slots are preserved and other areas are masked. A T5 model, which is pre-trained specifically for "span corruption" (filling in missing gaps), then generates the style-appropriate text to fill those gaps.

The authors also tested several baselines, including:

  • Standard Seq2Seq: Fine-tuning T5 and GPT-2 directly on parallel data.
  • Constrained Beam Search: Forcing the model to include specific keywords during decoding.
  • Delexicalization: Replacing important slots with placeholders (like [ADDRESS]) during training and swapping the real values back in later.

Datasets

The study utilizes two primary datasets:

  • GYAFC (Grammarly’s Yahoo Answers Formality Corpus): A large dataset of 110k formal/informal pairs used for training the models.
  • PreserveDialogue (New): A specialized evaluation dataset created by the authors. It contains 1,100 sentence pairs derived from task-oriented dialogues. Crucially, it includes manual annotations for "important slots" (named entities) that must be preserved.
Examples of the PreserveDialogue dataset showing source text, important slots, and the target informal rewrite.

The pipeline for creating PreserveDialogue involved filtering existing datasets for significant style changes and manually rewriting pairs where the original meaning was corrupted, as shown below:

Fig. 1. The pipeline of collecting the PreserveDialogue dataset. The reference SGDD- TST dataset consists of formal-informal sentence pairs annotated with semantic sim- ilarity scores. The pairs are scored with the formality classifier model and the pairs with insignificant informality increase are dropped. The pairs with significant formality increase that have low semantic similarity scores are manually rewritten to be seman- tically similar. Finally, the important slots related to the formal sentence are extracted from the SGDD dataset.

Key Insights and Ideas

  • Edit-based > Rewrite-based: Methods that treat style transfer as a series of edits (keep this, change that) are significantly better at preserving facts than models that try to rewrite the entire sentence from scratch.
  • T5 is a Natural Fit: T5’s original training objective—filling in missing spans of text—makes it much more effective for the "infilling" stage of edit-based TST compared to models like BART.
  • The Preservation-Style Trade-off: There is a measurable tension between style accuracy and content preservation. Adding hard constraints (forcing specific words to appear) often slightly reduces the "naturalness" or style score but is necessary for factual reliability.

Key Results

The authors evaluated models using a "Joint" score, which is the product of Style Accuracy, Content Preservation, Slot Preservation, and Fluency.

  • LEWIT achieved the highest joint score (0.46) when important slots were known at inference time.
  • Even without knowing the slots beforehand (using a tagger to guess them), LEWIT outperformed all other baselines, including fine-tuned GPT-2 and standard T5.
  • Slot Preservation: LEWIT achieved near-perfect (0.98 to 1.00) slot preservation, whereas standard seq2seq models often dropped to 0.95 or lower, which is unacceptable for task-oriented systems.

Limitations and Future Work

The authors acknowledge that LEWIT's biggest limitation is its syntactic rigidity. Because it tries to stick closely to the structure of the source sentence to ensure preservation, it may produce less diverse or slightly less "natural" sounding sentences than a model allowed to rewrite from scratch.

Future work could explore ways to allow for more flexible sentence restructuring while still maintaining the ironclad guarantee that critical data slots remain untouched.

Summary updated

BibTeX
@misc{babakov2023don,
  author = {Nikolay Babakov and David Dale and Ilya Gusev and Irina Krotova and Alexander Panchenko},
  title = {{Don't lose the message while paraphrasing: A study on content preserving style transfer}},
  year = {2023},
  eprint = {2308.09055},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2308.09055},
}
Figure