Abstract
Unsupervised text style transfer (TST) often suffers from content migration and style misclassification due to the adversarial nature of gradient-guided optimization. This paper proposes a novel framework utilizing contrastive learning to ensure content invariance and a Siamese-structure classifier to provide robust style guidance. By clustering similar content in latent space and employing a comparison-based classifier, the model achieves state-of-the-art performance on benchmark datasets like Yelp and Amazon, effectively balancing style transfer accuracy with semantic preservation.
Introduction
Text Style Transfer (TST) aims to alter the stylistic attributes of a sentence (e.g., sentiment) while preserving its core semantic content. In the absence of parallel corpora, researchers typically rely on unsupervised methods. However, existing "gradient-guided" approaches face two major challenges:
- Content Migration: Without explicit semantic constraints, models often drift away from the original meaning during the transformation process.
- Style Misclassification: Gradient-guided optimization can act as a "white-box adversarial attack," where the optimizer finds mathematical shortcuts to trick the style classifier without actually performing a meaningful stylistic change. This leads to high classification scores but poor transfer quality.
Methodology
The proposed framework addresses these issues through a Transformer-based Auto-Encoder integrated with two key components designed to stabilize the latent representation during editing.
Contrastive Learning for Content Invariance
To anchor semantic meaning, the authors employ a contrastive paradigm. "Pseudo-parallel" pairs are generated by retrieving semantically similar sentences from the dataset using SBERT and FAISS, supplemented by dropout perturbations. The model is trained to minimize the distance between these similar-content embeddings in the latent space, ensuring that stylistic shifts do not result in semantic drift.
Siamese-Structure Style Classifier
Instead of a standard probabilistic classifier, the authors introduce a Siamese network. This classifier determines style by comparing the current sentence embedding against a set of labeled reference examples. This comparison-based approach is significantly harder to "attack" during the gradient-optimization phase, forcing the model to genuinely adapt stylistic features to achieve a high similarity score with the target style.
Inference via Gradient Guidance
During inference, the model encodes the source sentence and uses the gradient from the Siamese classifier to iteratively "nudge" the latent representation toward the target style. The modified representation is then passed through the decoder to generate the transferred sentence.
Experimental Setup
The model was evaluated on two benchmark datasets:
- Yelp: Restaurant reviews labeled as positive or negative.
- Amazon: Product reviews labeled as positive or negative. Both datasets provide non-parallel training data and human-written references for testing.
Results and Discussion
The proposed model, $OURS_{C+S}$, demonstrates superior performance across multiple metrics compared to strong baselines like CrossAlign and GBT.
As shown in the results for the Yelp dataset, the model achieved a transfer accuracy of 91.0%, significantly outperforming the previous best gradient-guided method (GBT at 88.2%). Furthermore, the model maintained high BLEU and WMD scores, indicating effective content preservation. Human evaluations corroborated these findings, with $OURS_{C+S}$ receiving the highest ratings for style accuracy and content fidelity.
Conclusion and Future Work
While the model achieves state-of-the-art accuracy and content preservation, there remains a slight trade-off in language fluency (measured by Perplexity). The authors suggest that the Transformer architecture's sensitivity during latent editing may contribute to this. Future work will focus on refining the Transformer structure specifically for gradient-based latent editing to bridge the fluency gap and further mitigate the risk of importing irrelevant content from reference samples if the content distributions of the two styles are too divergent.
Summary updated