Source-linked AI summary

A Recipe For Arbitrary Text Style Transfer with Large Language Models

Emily Reif, Daphne Ippolito, Ann Yuan, Andy Coenen, Chris Callison-Burch, Jason Wei

arXiv:2109.03910v4cs.CL

TL;DR

Text style transfer traditionally requires labeled data or target-style exemplars, limiting the styles that can be addressed. The paper proposes augmented zero-shot learning, which uses large-language-model prompting with rewriting demonstrations and reports promising performance across standard and arbitrary transformations, while remaining less controllable than trained methods on tasks with available training data.

  • Problem

    Existing style-transfer methods require substantial labeled data or target-style exemplars, limiting support for arbitrary styles.

  • Method

    Augmented zero-shot learning prompts large language models with sentence-rewriting demonstrations, without fine-tuning or target-style exemplars.

  • Results

    Augmented zero-shot learning achieves strong performance on standard and non-standard style-transfer tasks and performs almost as highly as human-written ground truth in three evaluations.

  • Takeaways & Limitations

    The prompting paradigm expands style transfer beyond styles with annotated data to arbitrary transformations such as making text melodramatic or inserting a metaphor.

  • Takeaways & Limitations

    Compared with trained methods, augmented zero-shot learning offers less fine-grained control over transferred style properties when task-specific training data exists.

Abstract

from arXiv · show

In this paper, we leverage large language models (LMs) to perform zero-shot text style transfer. We present a prompting method that we call augmented zero-shot learning, which frames style transfer as a sentence rewriting task and requires only a natural language instruction, without model fine-tuning or exemplars in the target style. Augmented zero-shot learning is simple and demonstrates promising results not just on standard style transfer tasks such as sentiment, but also on arbitrary transformations such as "make this melodramatic" or "insert a metaphor."

1 Introduction

The paper introduces augmented zero-shot learning, a prompting method that frames style transfer as sentence rewriting without target-style exemplars. It aims to support arbitrary styles while remaining label-free, training-free, and intuitively controllable.

  • Existing style-transfer methods typically require labeled parallel or non-parallel data, while label-free approaches still require target-style exemplar sentences.
  • Augmented zero-shot learning uses a single prompt containing demonstrations of sentence-rewriting operations rather than examples specific to the requested style.
  • The method supports arbitrary transformations such as making a sentence comic or inserting the word balloon.
  • The proposed recipe is label-free, training-free, and intuitively controllable, and it targets a wider range of styles than existing work.
  • Human evaluation covers standard and non-standard style-transfer tasks, while automatic evaluation compares sentiment transfer with prior methods.

2 Augmented zero-shot prompting

Augmented zero-shot prompting extends ordinary zero-shot prompting by priming a large language model with varied rewriting demonstrations. This removes the need for task-specific exemplars and supports a broad range of sentence transformations.

  • Zero-shot prompting directly asks a language model to perform a task in natural language, but it can suffer from failure modes such as malformed responses.
  • Augmented zero-shot learning replaces style-specific exemplars with examples of varied sentence-rewriting operations in one prompt.
  • The method preserves the requested sentence transformation in a common output format while avoiding task-specific exemplars.
  • Supported transformations include making text more melodramatic, inserting a metaphor, and including the word balloon.

3 Experimental Setup

The experiments evaluate augmented zero-shot learning on six non-standard styles and two standard tasks using human and automatic evaluation. Models include LaMDA variants and GPT-3, with prompts adapted to the model setting.

  • The non-standard evaluation uses six styles and 50 Reddit Writing Prompts validation sentences selected after excluding unsuitable examples.
  • Human evaluation is used for non-standard styles because not all styles have readily available classifiers.
  • Standard evaluations cover sentiment on Yelp polarity and formality on the GYAFC dataset, enabling comparison with prior supervised methods.
  • The primary model is LaMDA, with both its pretrained and dialog-finetuned versions evaluated; GPT-3 experiments test generalization to another large language model.
  • Prompts are shown for LLM and GPT-3, while the LLM-Dialog prompt is formulated as a conversation between a requester and a rewriter.

4 Results

The study evaluates augmented zero-shot learning on non-standard and standard style-transfer tasks using human and automatic measures. The method performs comparably to human-written outputs and prior methods, while outperforming vanilla zero-shot learning and approaching five-shot accuracy.

  • 4.1 Non-Standard Styles: Six professional raters evaluated outputs for six non-standard styles across transfer strength, semantic preservation, and fluency.Each style compared the proposed method with three baselines on 50 sentences, with three raters per tuple.
  • 4.1 Non-Standard Styles: Our method was rated almost as highly as human-written ground truth across all three non-standard-style evaluations.The zero-shot baseline failed to return a valid response 25.4% of the time, compared with 0.6% for augmented zero shot.
  • 4.1 Non-Standard Styles: 85% of “balloon” and “park” transformations successfully inserted the target word.“More descriptive” and “include a metaphor” outputs were longer than originals by 252% and 146%, respectively.
  • 4.2 Standard Styles: For sentiment and formality transfer, outputs were rated comparably to human-written responses and two prior methods.The prior methods were Unsup. MT and Dual RL, evaluated using the same human-rating setup.
  • 4.2 Standard Styles: Augmented zero-shot prompting achieved high accuracy and low perplexity, while BLEU scores remained low because outputs tended to add information.The approach generalized to GPT-3 175B, benefited substantially from larger models, and nearly reached five-shot accuracy.

5 Potential of Arbitrary Styles

A user study explored how writers might request arbitrary rewrites through an AI-assisted story-writing editor. The collected requests covered diverse transformations defined by users.

  • 5 Potential of Arbitrary Styles: Thirty creative-writing participants generated 333 rewrite requests using an editor with a freeform “rewrite as” feature.Participants wrote 100–300 word stories before submitting requests.
  • 5 Potential of Arbitrary Styles: Requests ranged from making text “about mining” to making it “less diabolical.”The examples illustrate diverse user-specified rewrite goals.

6 Limitations and Failure Modes

The method has several qualitative failure modes, including hallucinated content, inherent style trends, reduced controllability relative to trained methods, safety concerns, and unparsable outputs.

  • Unparsable answers: Large language models may produce outputs that cannot be automatically parsed into usable answers, including conversational responses instead of rewrites.The authors use delimiters to reduce these errors and assign zero when no valid delimited response is available.
  • Hallucinations: Hallucinated content occurred frequently during style transfer, which may be useful for creative writing but undesirable for summarization.
  • Inherent style trends: Outputs may inherently trend toward styles such as “more formal” and “more melodramatic,” even for the paraphrase baseline.
  • Less reliable than trained methods: For tasks with training data, trained methods are more reliable and offer finer-grained controllability than augmented zero-shot learning.The method has lower BLEU scores than trained methods despite comparable transfer accuracy.
  • Large LM safety concerns: Large-language-model safety concerns also apply to this style-transfer method, whose broader use can expose a broader range of failure modes.

7 Conclusions

The paper introduces augmented zero-shot learning as a simple prompting paradigm for text style transfer. It reports promising performance while expanding the range of styles beyond those with annotated data.

  • Augmented zero-shot learning shows promising performance despite its simplicity.
  • The prompting paradigm expands possible styles beyond the limited set for which annotated data exists.
  • The authors hope nontask-specific prompting will inspire inference-only methods for other NLP tasks.

A Prompt Selection

The paper compares prompt-wording choices for sentiment transfer, focusing on delimiters and dialogue-template phrasing because prompting performance can depend on exact wording.

  • The authors compare four prompt variations for sentiment style transfer.
  • Curly braces were selected as delimiters because they likely occur in training data while rarely appearing in input sentences.
  • A second-person dialogue template yielded better results because it more closely resembled the training data.

B Low BLEU for LLM Outputs

The model’s outputs received low BLEU against human references despite high semantic similarity, reflecting lexical differences rather than necessarily poor style-transfer quality. Candidate selection offers a way to increase lexical similarity when desired.

  • Low BLEU scores coexisted with high semantic similarity in human evaluations.
  • The authors attribute this gap to model outputs using different wording from human annotations while preserving source-sentence meaning.
  • The model produced sixteen possible continuations, enabling selection of the candidate with the highest BLEU against the source when lexical similarity is preferred.

C Further Related Work

Prior style-transfer systems commonly require parallel or non-parallel training data, while newer label-free methods still use style exemplars or specialized models. The paper situates augmented prompting within efforts to broaden supported styles and reduce data requirements.

  • Experimental materials: The appendix includes prompt specifications, user-request results, accepted suggestions, candidate-selection results, and input-output length statistics.
  • Data requirements: Earlier approaches require parallel corpora, whereas newer systems often use non-parallel monostyle data, which can remain difficult to collect for arbitrary styles.
  • Research direction: Surveys call for methods that support more styles while reducing training-data requirements.
  • Label-free transfer: Label-free methods reduce labeled-data requirements but use exemplars or extracted style representations, unlike the paper’s out-of-the-box large-LM approach.
Loading 2109.03910v4…