A Hierarchical Reinforced Sequence Operation Method for Unsupervised Text Style Transfer

Chen Wu, Xuancheng Ren, Fuli Luo, Xu Sun

Introduction

Text style transfer—the task of altering the style of a sentence while preserving its semantic content—is a significant challenge in natural language processing. Most existing methods rely on "black-box" sequence-to-sequence (seq2seq) models that attempt to rewrite entire sentences. However, these models often suffer from low interpretability, poor content preservation, and a lack of control over the trade-off between style and meaning.

To overcome these hurdles, we present Point-Then-Operate (PTO), a hierarchical reinforcement learning framework. PTO shifts the paradigm from global rewriting to surgical editing, identifying specific words to modify while leaving the rest of the sentence untouched.

Methodology: The Point-Then-Operate Framework

The PTO framework employs a two-agent hierarchy to separate the tasks of identifying where to edit and deciding how to edit.

The PTO architecture featuring the Pointer and Operator agents along with the reward mechanisms.

The Two-Agent Hierarchy

  • High-Level Agent (The Pointer): Uses an attention-based pointer network to scan the sentence and select the optimal position for an edit.
  • Low-Level Agent (The Operators): Once a position is chosen, this agent selects an action from a toolkit including Insert Front, Insert Behind, Replace, Delete Current, Delete Front, Delete Behind, and Skip.

Training and Rewards

In the absence of parallel data, PTO is trained via reinforcement learning using three key rewards:

  1. Fluency Reward: Utilizes a pre-trained language model to ensure the output remains natural.
  2. Style Polarity Reward: Uses a classifier to reward changes that increase the confidence of the target style.
  3. Content Preservation Reward: Employs a self-supervised reconstruction task to ensure the model can "undo" its changes, proving the underlying meaning is preserved.

The Iterative Editing Process

PTO functions as an iterative editor. In each step, it points to a word and operates on it. This process continues until the model decides to stop or the style transfer is complete.

An example of the iterative PTO process transforming a positive review into a negative one through specific word replacements and insertions.

To prevent over-editing or infinite loops, the model uses a masking mechanism during inference that temporarily hides recently modified words from the Pointer agent.

Evaluation and Results

The model was evaluated on the Yelp and Amazon review datasets. For Amazon, the authors utilized a cross-domain setting, training on Yelp vocabulary to handle the high volume of noisy or neutral labels in product reviews.

PTO significantly outperformed previous state-of-the-art methods:

  • Content Preservation: On Yelp, PTO achieved a BLEU score of 29.86, nearly 7 points higher than the best baseline.
  • Style Accuracy: It maintained a high style accuracy of 91.5% on Yelp while keeping the sentence coherent.
  • Human Evaluation: Human judges rated PTO highest for both fluency (4.39/5) and content preservation (4.56/5).

Key Insights and Discussion

The core innovation of PTO is the realization that style is often concentrated in specific words like adjectives or negations. By performing surgical edits, the model naturally preserves the "content" of the sentence. This approach also offers "interpretability by design," allowing researchers to see exactly which operations led to the style change.

Furthermore, PTO allows for controllable trade-offs. By adjusting the termination condition, users can tune the balance between style intensity and content preservation.

Limitations and Future Work

The model currently struggles with neutral inputs that lack clear stylistic markers. Additionally, the masking strategy can fail when stylized words are adjacent, as editing one might mask the other. Future work will explore expanding the operator toolkit and refining the pointing mechanism for complex structures like sarcasm.

Summary updated

BibTeX
@inproceedings{wu2019hierarchical,
  author = {Chen Wu and Xuancheng Ren and Fuli Luo and Xu Sun},
  title = {{A Hierarchical Reinforced Sequence Operation Method for Unsupervised Text Style Transfer}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2019},
  doi = {10.18653/v1/p19-1482},
}
Figure