Incorporating Pseudo-Parallel Data for Quantifiable Sequence Editing

Yi Liao, Lidong Bing, Piji Li, Shuming Shi, Wai Lam, Tong Zhang

Abstract

We propose the task of Quantifiable Sequence Editing (QuaSE): editing an input sequence to generate an output sequence that satisfies a given numerical outcome value measuring a certain property of the sequence, while preserving the core content of the input. For example, adjusting a review sentence to meet a specific rating or an advertisement to hit a target click-through rate. The primary challenge is identifying and editing only outcome-related wordings. Our proposed framework disentangles two latent factors—outcome and content—using a Variational Autoencoder (VAE) architecture. By leveraging pseudo-parallel sentences and modeling their content similarity and outcome differences, we enable better disentanglement and more precise editing. A dual reconstruction structure further enhances performance by exploiting the couplings of latent factors. Experiments on a Yelp review dataset demonstrate that our framework significantly outperforms baselines in both numerical accuracy and content preservation.

Introduction

Traditional text generation often produces repetitive or generic outputs. While style transfer techniques exist to change categorical attributes (e.g., negative to positive sentiment), they lack the granularity required for real-world applications where guidance is often quantifiable. An advertiser might need to adjust a headline for a specific engagement score, or a user might want to fine-tune the intensity of a review.

Quantifiable Sequence Editing (QuaSE) addresses this by treating sequence properties as continuous numerical values. The core difficulty lies in "disentanglement": the model must distinguish between words that contribute to the numerical score (the "outcome") and words that describe the subject matter (the "content").

Proposed Framework

The QuaSE framework is built upon Variational Autoencoders (VAEs) and introduces several novel mechanisms to achieve precise editing:

  1. Latent Factor Disentanglement: The model employs two separate encoders to produce an outcome factor ($Y$) and a content factor ($Z$).
  2. Pseudo-Parallel Training: To compensate for the lack of true parallel data, the model uses "pseudo-parallel" pairs—sentences with high word overlap but significantly different ratings.
  3. Wording-Outcome Alignment: A regression network aligns the differences in wording between pseudo-parallel sentences with the differences in their latent outcome factors. This teaches the model which specific word changes (e.g., "terrible" to "satisfactory") correspond to numerical shifts.
  4. Dual Reconstruction: The model performs "cross-reconstruction," attempting to generate a sentence using the content factor of one sentence and the outcome factor of its pseudo-parallel partner. This forces the encoders to strictly separate content from outcome.
The QuaSE framework architecture utilizing latent factor disentanglement and pseudo-parallel training.

Experimental Setup

The model was evaluated using a dataset of Yelp Review Sentences, comprising approximately 599,000 sentences with ratings from 1 to 5. From this, 604,000 pseudo-parallel pairs were derived, defined as sentences sharing high Jaccard similarity but having a rating difference of at least 2.0.

Key Results

Our framework was compared against Sequence to Better Sequence (S2BS) and Text Style Transfer (TST) baselines.

Numerical Accuracy

QuaSE achieved significantly lower Mean Absolute Error (MAE) across all target ratings compared to the baselines. For instance, when targeting a rating of 2.0, our model achieved an error of 0.6298, whereas S2BS resulted in 0.9444.

Mean Absolute Error (MAE) and Edit Distance across target ratings (T=1 to T=5).

Content Preservation and Sentiment Transfer

In human evaluations, QuaSE scored 1.38/2.0 for content preservation, vastly outperforming TST (1.02) and S2BS (0.70). This indicates that our disentanglement strategy successfully prevents "content bleed," where the model accidentally changes the subject of the sentence while adjusting the sentiment. Additionally, in binary sentiment transfer tests (Negative to Positive), QuaSE achieved an accuracy of 88.36%, surpassing the specialized TST model's 72.80%.

Conclusion

The QuaSE framework demonstrates that treating sentiment as a continuous scale allows for granular control over text editing. By explicitly modeling wording differences through pseudo-parallel data, the model achieves superior disentanglement. While the complex dual reconstruction can occasionally impact fluency, the model's ability to subtly adjust intensity—such as changing "amazing" to "really good" for mid-range targets—marks a significant advancement in controllable text generation. Future work will explore applying this framework to other quantifiable metrics like politeness or engagement rates.

Summary updated

BibTeX
@inproceedings{liao2018incorporating,
  author = {Yi Liao and Lidong Bing and Piji Li and Shuming Shi and Wai Lam and Tong Zhang},
  title = {{Incorporating Pseudo-Parallel Data for Quantifiable Sequence Editing}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2018},
  doi = {10.18653/v1/d18-1420},
}
Figure