We propose a method for arbitrary textual style transfer (TST)--the task of transforming a text into any given style--utilizing general-purpose pre-trained language models. Our method, Prompt-and-Rerank, is based on a mathematical formulation of the TST task, decomposing it into three constituent components: textual similarity, target style strength, and fluency. Specifically, our method first uses zero-shot or few-shot prompting to obtain a set of candidate generations in the target style, and then re-ranks these candidates according to a combination of the three components above. Empirically, our method enables small pre-trained language models to perform on par with state-of-the-art large-scale models while consuming two orders of magnitude less compute and memory. Finally, we conduct a systematic investigation of the effect of model size and prompt design (e.g., prompt paraphrasing and delimiter-pair choice) on style transfer quality across seven diverse textual style transfer datasets.
翻译:我们提出了一个任意的文本样式转换(TST)方法 — 将文本转换为任何特定风格的通用预培训语言模型的任务。 我们的方法,即快速和重新排序,是以TST任务的数学公式为基础,将其分解成三个组成部分:文本相似性、目标样式强度和流畅。 具体地说,我们的方法首先使用零发或几发提示来获得目标样式的一组候选世代,然后根据上述三个组成部分的组合重新排序这些候选人。 简便地说,我们的方法使经过培训的小型语言模型能够在与最新大规模模型相同的情况下运行,同时消耗两个数量级的大小较少的计算和记忆。 最后,我们系统地调查模型大小和迅速设计(例如,迅速的副划线和定界器选择)对七种不同的文本样式传输数据集的风格转换质量的影响。