PREADD: Prefix-Adaptive Decoding for Controlled Text Generation

Jonathan Pei, Kevin Yang, Dan Klein
7/6/2023
cs.CL

No official code found. Best implementation: jonnypei/acl23-preadd (12 stars, MIT, last commit 2023-07-25).

Abstract

We propose Prefix-Adaptive Decoding (PREADD), a flexible method for controlled text generation. Unlike existing methods that use auxiliary expert models to control for attributes, PREADD does not require an external model, instead relying on linearly combining output logits from multiple prompts. Specifically, PREADD contrasts the output logits generated using a raw prompt against those generated using a prefix-prepended prompt, enabling both positive and negative control with respect to any attribute encapsulated by the prefix. We evaluate PREADD on three tasks -- toxic output mitigation, gender bias reduction, and sentiment control -- and find that PREADD outperforms not only prompting baselines, but also an auxiliary-expert control method, by 12% or more in relative gain on our main metrics for each task.

View on arXivView PDF

Code Implementations(1)

MIT
121Shell, PythonMay 26, 20233 years agoMIT

Similar Papers

Cite this paper

@article{pei2023preadd,
  title  = {PREADD: Prefix-Adaptive Decoding for Controlled Text Generation},
  author = {Jonathan Pei and Kevin Yang and Dan Klein},
  year   = {2023},
  eprint = {2307.03214},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2307.03214v1}
}

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/2307.03214.svg)](https://codeofpaper.com/paper/2307.03214)

Discussion