Abstract
Text style transfer (TST) modifies a source sentence to match a target style while preserving its semantics. While existing models perform well on simple styles like sentiment and formality, they struggle with complex, entangled styles such as poetry and brand-specific tones, which require advanced operations to disentangle content and style. We propose a multi-agent self-check framework that contains a large language model (LLM) as a planner for disentangling subtasks and expert agents for executing the subtasks. This training-free multi-agent framework decomposes TST into manageable components, enabling iterative refinement through a self-check module that balances style adherence and content preservation. Experiments on both simple and complex style datasets show our framework significantly improves style strength and content preservation, with strong adaptability in few-shot settings.
Introduction
Text Style Transfer (TST) aims to alter the stylistic attributes of a sentence while maintaining its core factual content. While current AI systems excel at straightforward transformations—such as flipping the sentiment of a product review—they often falter when faced with complex entanglement. In styles like poetry or archaic prose, style and content are deeply interwoven; a single word may simultaneously convey meaning and satisfy stylistic constraints. Traditional "one-shot" generation models frequently suffer from "semantic drift," where the original message is lost in the pursuit of style, or they produce underwhelming stylistic changes to avoid losing content. This research addresses these limitations by moving beyond single-step generation.
Methodology: The Decoupled Multi-Agent Framework
The proposed framework shifts away from monolithic generation toward a modular, multi-agent approach. The system architecture consists of three primary components:
- The Planner (LLM): Utilizing an LLM (e.g., GPT-3.5) as a central strategist, the system analyzes the source sentence and target style to generate a subtask plan and an interaction plan. For instance, a plan for Shakespearean transfer might include steps to capture the core idea, apply Elizabethan syntax, and adopt specific vocabulary.
- Expert Agents: Specialized LLM agents are assigned to execute individual subtasks. This separation of concerns allows one agent to focus exclusively on content preservation while another focuses on stylistic nuances, preventing cognitive overload.
- Self-Check Interaction: To ensure harmony between style and content, a recursive module monitors agent outputs. If a stylistic modification compromises the original meaning, the self-check module triggers iterative refinement (up to five cycles) until both objectives are met.
This framework is notably training-free, leveraging in-context learning and few-shot prompting rather than requiring computationally expensive fine-tuning on large parallel datasets.
Experimental Setup
The framework was rigorously tested across a spectrum of styles:
- Simple Styles: Yelp (sentiment) and GYAFC (formality).
- Complex Styles: CDS (11 diverse styles including Poetry and Biblical text) and Shakespeare (modern to Shakespearean English).
The CDS dataset is particularly challenging as it is non-parallel, requiring the model to rely on its inherent reasoning capabilities rather than simple pattern matching.
Results and Discussion
The multi-agent framework consistently outperformed state-of-the-art (SOTA) fine-tuned models and standard LLM prompting across all benchmarks.
Key findings include:
- Superior Performance in Complex Styles: On the CDS dataset, the framework achieved a 2.8% increase in style strength and a 4.4% improvement in content preservation over existing methods.
- Shakespearean Transfer: The system reached a style strength of 73.9% and content preservation of 70.3%, significantly exceeding the performance of raw GPT-3.5.
- Model Agnostic Gains: Experiments with smaller base models like LLaMA-8B demonstrated that the multi-agent architecture provides a substantial performance boost regardless of the underlying model's size, highlighting the value of the task decomposition strategy.
Conclusion and Future Work
By decomposing complex style transfer into manageable subtasks and employing an iterative self-check mechanism, this framework effectively mitigates semantic drift and enhances stylistic intensity. While the approach introduces higher computational costs and latency due to multiple LLM calls, the quality gains for complex tasks are significant. Future research will focus on optimizing these costs and incorporating safety modules to prevent the generation of toxic content during the iterative refinement process.
Summary updated