PPL-MCTS: Constrained Textual Generation Through Discriminator-Guided MCTS Decoding

Antoine Chaffin, Vincent Claveau, Ewa Kijak
9/28/2021
cs.CL

Official code: NohTow/PPL-MCTS (66 stars, Python, last commit 2022-10-25).

Abstract

Large language models (LM) based on Transformers allow to generate plausible long texts. In this paper, we explore how this generation can be further controlled at decoding time to satisfy certain constraints (e.g. being non-toxic, conveying certain emotions, using a specific writing style, etc.) without fine-tuning the LM.

Show full abstract

Precisely, we formalize constrained generation as a tree exploration process guided by a discriminator that indicates how well the associated sequence respects the constraint. This approach, in addition to being easier and cheaper to train than fine-tuning the LM, allows to apply the constraint more finely and dynamically. We propose several original methods to search this generation tree, notably the Monte Carlo Tree Search (MCTS) which provides theoretical guarantees on the search efficiency, but also simpler methods based on re-ranking a pool of diverse sequences using the discriminator scores. These methods are evaluated, with automatic and human-based metrics, on two types of constraints and languages: review polarity and emotion control in French and English. We show that discriminator-guided MCTS decoding achieves state-of-the-art results without having to tune the language model, in both tasks and languages. We also demonstrate that other proposed decoding methods based on re-ranking can be really effective when diversity among the generated propositions is encouraged.

View on arXivView PDF

Code Implementations(1)

NohTow/PPL-MCTSOfficial100%

Repository for the code of the "PPL-MCTS: Constrained Textual Generation Through Discriminator-Guided Decoding" paper, NAACL'22

669PythonNov 5, 20214 years agoNOASSERTION
bertgpt-2nlptransformers

Similar Papers

Cite this paper

@article{chaffin2021pplmcts,
  title  = {PPL-MCTS: Constrained Textual Generation Through Discriminator-Guided MCTS Decoding},
  author = {Antoine Chaffin and Vincent Claveau and Ewa Kijak},
  year   = {2021},
  eprint = {2109.13582},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2109.13582}
}

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

Discussion