Distilling Text Style Transfer With Self-Explanation From LLM s (2024)

Abstract: Text Style Transfer (TST) seeks to alter the style of text while retaining its core content. Given the constraints of limited parallel datasets for TST, we propose CoTeX, a framework that leverages large language models (LLMs) alongside chain-of-thought (CoT) prompting to facilitate TST. CoTeX distills the complex rewriting and reasoning capabilities of LLMs into more streamlined models capable of working with both non-parallel and parallel data. Through experimentation across four TST datasets, CoTeX is shown to surpass traditional supervised fine-tuning and knowledge distillation methods, particularly in low-resource settings. We conduct a comprehensive evaluation, comparing CoTeX against current unsupervised, supervised, in-context learning (ICL) techniques, and instruction-tuned LLMs. Furthermore, CoTeX distinguishes itself by offering transparent explanations for its style transfer process.

## introduction tst aims to rephrase a source text s with the desired style τ while preserving its core meaning and ensuring fluency of the generated text t @xcite . the term "style" can encompass the personal characteristics of an author, such as age, and pragmatic use like formality or toxicity. to develop tst systems using supervised methods, several human-annotated datasets have emerged @xcite . for instance, @xcite introduced a corpus for formality style transfer, transforming informal language to its formal counterpart and vice versa. nonetheless, supervised parallel data, crucial for training deep neural networks, is scarce and costly to obtain. hence, unsupervised methodologies (shen et al., 2017; liu ⋆ work done during internship at google. @xcite have been proposed to manage stylistic attributes without relying on parallel data. @xcite and @xcite create pseudoparallel data from unlabeled samples via diverse data augmentation with task-specific knowledge. works by @xcite ; @xcite ; @xcite employ an auxiliary style classifier to steer the transfer direction. meanwhile, @xcite and @xcite deploy multiple style-specific models to produce various styles individually. of late, llms have demonstrated exceptional prowess across diverse nlp tasks. studies like @xcite ; @xcite have found that extremely large lms, with over 100b parameters, are adept at tst with icl. drawing from these findings, our paper uses llms to generate pseudo-parallel data and distills the tst skills of the llm into a compact student model. moreover, we enhance distillation and efficiency using cot prompting. llms have demonstrated impressive performance across various tasks and reasoning capabilities. cot prompting @xcite is a promising technique that extracts these reasoning skills and enhances accuracy in target tasks. however, deploying these enormous llms poses computational and practical challenges. recent studies @xcite @xcite have thus turned to offline knowledge distillation (kd) @xcite to condense these reasoning capabilities into a smaller model. using cot rationales can also increase distillation efficiency with less data @xcite . concurrently, @xcite examine cot prompting combined with domain expert feedback for improved formality transfer. nevertheless, the potential of cot prompting and kd to enrich a broader range of tst tasks remains underexplored. in this paper, we present cotex framework, using cot prompting to improve tst. it identifies cues for tst and clarifies the rewriting process ( § 2). we then distill the reasoning and style transfer abilities of llms into compact models. we exploit cot prompting to enhance tst, applicable to scenarios both with and without parallel data, and show the effectiveness of cotex in lowresource settings. our primary findings include: ## results we now present your experimental results. cotex-tb and cotex-ta denote models trained using datasets created through target-blind and targetaware methods, respectively. low-resource settings. we first examine co-tex's impact in low-resource context. figure 3 shows cotex's performance in both target-blind and target-aware settings across varying training data sizes. in both formality transfer datasets, cotex-tb outperforms sft-t5 and distill-t5. this advantage is noticeable with limited data, specifically under 10k. for instance, using just 1k samples from the informal-formal (e&m) dataset, the bleu scores for sft, cotex-tb, and cotex-ta are 55.13, 68.62, and 65.40, respectively. we find that both cotex-tb and cotex-ta outperform or match the llm's performance on the two formality datasets. in translating shakespearean to modern english, cotex-tb exhibits significant superiority over sft-t5 and distill-t5 across all data sizes. we believe that such an enhancement can be attributed to the high quality of llm generations. llm with few-shot in-context learning obtains a bleu score of 32.43. though cotex-tb under- utilizing the full dataset. training student models with cotex on all training samples of each dataset, we present comparative results in tables 1. 5 given that many unsupervised tst studies have not reported bleu scores, we compute bleu scores for their public outputs using our evaluation scripts to ensure a fair comparison. cotex-tb surpasses previous unsupervised methods, the sota icl method prompt&rank, and instruction-tuned llms across both domains within the formality transfer dataset. although cotex-ta does not exceed the performance of sota supervised methods, semifst, for formality transfer, it is noteworthy that our method does not depend on task-specific data augmentation strategies or knowledge, offering greater flexibility. in the detoxification task, our results are compared with the top-performing model from logacheva et al. (2022b). cotex-ta outperforms previous supervised methods, while cotex-tb falls slightly source text just want to know have you been to the doc yet cotex generation the original text is informal. the use of all caps and the absence of punctuation are informal. the use of "doc" is a misspelling of "doctor". ## related work when parallel tst datasets are available, numerous studies @xcite @xcite have utilized a sequence-to-sequence framework for supervised training tst models. to improve model efficacy, multitask learning @xcite , lexically constrained decoding @xcite , and task-specific data augmentation @xcite have been incorporated. addressing the scarcity of parallel data, unsupervised methods have been developed for tst, employing methodologies like disentanglement of latent representations @xcite @xcite , proto-type editing @xcite , style rewriting using attribute-specific lms @xcite , and reinforcement learning @xcite . our cotex framework explores both parallel and non-parallel data landscapes. the advent of llms has introduced icl for executing tst with few-shot prompts, bypassing the need for model parameter updates @xcite . yet, these methods typically lack interpretability. in parallel, @xcite employ cot prompting alongside domain expert feedback to enhance formality transfer and interpretability. our cotex extends to broader range of tst directions, aiming to utilize cot to provide rewriting explanations and minimize the requirement for human intervention. ## conclusion we introduced cotex, a novel approach for tst. through cot prompting, we elicit the rationals for the style rewriting process from llms and then distill both the tst and reasoning capabilities into smaller task-specific models. cotex demonstrated its efficiency and effectiveness with and without utilizing parallel data, especially in low-resource scenarios. the cot reasoning from cotex bolstered the explainability of tst models.