Quark: Controllable Text Generation with Reinforced Unlearning

Ximing Lu, Sean Welleck, Jack Hessel, Liwei Jiang, Lianhui Qin +3 more
5/26/2022
cs.CLcs.LG
rl

Official code: GXimingLu/Quark (76 stars, Python, last commit 2023-11-03).

Abstract

Large-scale language models often learn behaviors that are misaligned with user expectations. Generated text may contain offensive or toxic language, contain significant repetition, or be of a different sentiment than desired by the user.

Show full abstract

We consider the task of unlearning these misalignments by fine-tuning the language model on signals of what not to do. We introduce Quantized Reward Konditioning (Quark), an algorithm for optimizing a reward function that quantifies an (un)wanted property, while not straying too far from the original model. Quark alternates between (i) collecting samples with the current language model, (ii) sorting them into quantiles based on reward, with each quantile identified by a reward token prepended to the language model's input, and (iii) using a standard language modeling loss on samples from each quantile conditioned on its reward token, while remaining nearby the original language model via a KL-divergence penalty. By conditioning on a high-reward token at generation time, the model generates text that exhibits less of the unwanted property. For unlearning toxicity, negative sentiment, and repetition, our experiments show that Quark outperforms both strong baselines and state-of-the-art reinforcement learning methods like PPO (Schulman et al. 2017), while relying only on standard language modeling primitives.

View on arXivView PDF

Code Implementations(1)

GXimingLu/QuarkOfficial100%
7610PythonOct 12, 20223 years ago

Similar Papers

Cite this paper

@article{lu2022quark,
  title  = {Quark: Controllable Text Generation with Reinforced Unlearning},
  author = {Ximing Lu and Sean Welleck and Jack Hessel and Liwei Jiang and Lianhui Qin and Peter West and Prithviraj Ammanabrolu and Yejin Choi},
  year   = {2022},
  eprint = {2205.13636},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2205.13636}
}

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

Discussion