Learning to Generate Text in Arbitrary Writing Styles

Aleem Khan, Andrew Wang, Sophia Hager, Nicholas Andrews
12/28/2023
cs.CL

No confident code implementation found for this paper. 2 possible matches can be shown below.

Abstract

Prior work in style-controlled text generation has focused on tasks such as emulating the style of prolific literary authors, producing formal or informal text, and mitigating toxicity of generated text. Plentiful demonstrations of these styles are available, and as a result modern language models are often able to emulate them, either via prompting or discriminative control. However, in applications such as writing assistants, it is desirable for language models to produce text in an author-specific style on the basis of a potentially small writing sample. For example, someone writing in a particular dialect may prefer writing suggestions that retain the same dialect. We find that instruction-tuned language models can struggle to reproduce author-specific style demonstrated in a prompt. Instead, we propose to guide a language model to generate text in a target style using contrastively-trained representations that capture stylometric features. Our approach (StyleMC) combines an author-adapted language model with sequence-level inference to improve stylistic consistency, and is found to be effective in a variety of conditions, including unconditional generation and style transfer. Additionally, we find that the proposed approach can serve as an effective anonymization method, by editing a document to mask authorship while preserving the original meaning

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 2 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{khan2023learning,
  title  = {Learning to Generate Text in Arbitrary Writing Styles},
  author = {Aleem Khan and Andrew Wang and Sophia Hager and Nicholas Andrews},
  year   = {2023},
  eprint = {2312.17242},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2312.17242v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2312.17242.svg)](https://codeofpaper.com/paper/2312.17242)

Discussion