SynDec: A Synthesize-then-Decode Approach for Arbitrary Textual Style Transfer via Large Language Models
Han Sun, Zhen Sun, Zongmin Zhang, Linzhao Jia, Wei Shao, Min Zhang
TL;DR
This work tackles arbitrary textual style transfer with LLMs by addressing prompt engineering and inherent stylistic biases. It introduces SynDec, a two-stage framework that first synthesize high-quality prompts via semantic-structural sampling, pattern analysis, and few-shot reranking, then amplifies their influence during decoding through contrastive decoding with a negative sample. Empirical results across six benchmarks show SynDec achieving state-of-the-art accuracy on five tasks (e.g., up to 99% for Elizabethan-to-modern transfer) and robust performance in multi-style scenarios, complemented by comprehensive ablations and expert evaluations. The approach reduces manual prompt crafting and mitigates LLM biases, offering a practical pathway for reliable arbitrary TST with large language models.
Abstract
Large Language Models (LLMs) are emerging as dominant forces for textual style transfer. However, for arbitrary style transfer, LLMs face two key challenges: (1) considerable reliance on manually-constructed prompts and (2) rigid stylistic biases inherent in LLMs. In this paper, we propose a novel Synthesize-then-Decode (SynDec) approach, which automatically synthesizes high-quality prompts and amplifies their roles during decoding process. Specifically, our approach synthesizes prompts by selecting representative few-shot samples, conducting a four-dimensional style analysis, and reranking the candidates. At LLM decoding stage, the TST effect is amplified by maximizing the contrast in output probabilities between scenarios with and without the synthesized prompt, as well as between prompts and negative samples. We conduct extensive experiments and the results show that SynDec outperforms existing state-of-the-art LLM-based methods on five out of six benchmarks (e.g., achieving up to a 9\% increase in accuracy for modern-to-Elizabethan English transfer). Detailed ablation studies further validate the effectiveness of SynDec.
