Abstract
This paper presents QuaSE (Quantifiable Sequence Editing), a framework for sequence editing under quantifiable guidance. Unlike traditional style transfer that handles categorical attributes (e.g., positive vs. negative), QuaSE enables precise control over continuous numerical outcomes, such as star ratings. By employing a Variational Autoencoder (VAE) with disentangled latent factors and a dual reconstruction loss trained on pseudo-parallel data, the model can edit specific keywords to reach a target value while preserving the original content. Experiments on Yelp review data demonstrate that QuaSE significantly outperforms existing methods in both numerical accuracy and content preservation.
Introduction
In Natural Language Processing (NLP), "post-editing" is a common technique used to improve text quality or adjust its tone. However, most existing methods are limited to categorical changes, such as binary sentiment polarity. Real-world attributes are often continuous or multi-valued; for example, a product review carries a specific rating from 1 to 5, and an advertisement has a specific click-through rate. The challenge is creating a model that can perceive which specific words contribute to these numerical outcomes and edit only those words to hit a precise target value without mangling the sentence's original meaning.
Methodology
The authors propose the QuaSE framework, based on a Variational Autoencoder (VAE) with several novel components designed to achieve precise control:
- Disentangled Latent Factors: The model uses separate encoders to split a sentence into a Content Factor ($Z$) and an Outcome Factor ($Y$). This separation ensures that the semantic meaning is isolated from the numerical attribute.
- Pseudo-Parallel Training: Since parallel data (the same sentence with different ratings) is rare, the authors automatically generate "pseudo-parallel" pairs—sentences with high word overlap but significantly different ratings.
- Dual Reconstruction Loss: The model is trained to reconstruct a sentence by taking the content factor from one sentence in a pseudo-parallel pair and the outcome factor from its partner. This forces the model to strictly separate "what is being said" from "how it is being rated."
During inference, the model takes an input sentence and a target numerical value ($R^*$). It searches the latent space for an outcome factor ($Y^*$) that corresponds to that specific value and combines it with the original content factor to generate the edited text.
Experimental Setup
The primary evaluation was conducted on a custom-processed dataset of approximately 600,000 sentences from the Yelp Dataset Challenge. Each sentence was assigned a numerical rating (1.0 to 5.0) using the Stanford CoreNLP sentiment analyzer as a proxy for ground truth. About 604,000 pseudo-parallel pairs were generated by matching sentences with a Jaccard Index $\ge 0.5$ and a rating difference $\ge 2.0$.
Results and Discussion
QuaSE was compared against state-of-the-art models, including S2BS (Sequence to Better Sequence) and TST (Text Style Transfer).
Quantitative Performance
QuaSE achieved significantly lower Mean Absolute Error (MAE) when attempting to hit target ratings. For a target rating of 2, QuaSE recorded an error of 0.6298, compared to S2BS's 0.9444. In manual evaluations for content preservation, QuaSE scored 1.38/2.0, notably higher than S2BS (0.70) and TST (1.02), proving its effectiveness at maintaining the original message while adjusting the tone.
Qualitative Success
Case studies demonstrate the model's ability to perform subtle, nuanced edits. For example, it can change "amazing" to "really good" to hit a neutral target (3.0), or creatively introduce words like "recommend" to boost a negative sentence to a 5.0 rating.
Conclusion
While QuaSE excelled at content preservation and hitting numerical targets, its fluency scores were slightly lower than baselines (2.48 vs 2.56 for TST). The authors suggest that the complex disentanglement components do not necessarily contribute to the naturalness of the language. Future work will explore more sophisticated decoders or reinforcement learning to improve grammatical quality without sacrificing numerical precision.
Summary updated