Directed Beam Search: Plug-and-Play Lexically Constrained Language Generation

12/31/2020
by   Damian Pascual, et al.
0

Large pre-trained language models are capable of generating realistic text. However, controlling these models so that the generated text satisfies lexical constraints, i.e., contains specific words, is a challenging problem. Given that state-of-the-art language models are too large to be trained from scratch in a manageable time, it is desirable to control these models without re-training them. Methods capable of doing this are called plug-and-play. Recent plug-and-play methods have been successful in constraining small bidirectional language models as well as forward models in tasks with a restricted search space, e.g., machine translation. However, controlling large transformer-based models to meet lexical constraints without re-training them remains a challenge. In this work, we propose Directed Beam Search (DBS), a plug-and-play method for lexically constrained language generation. Our method can be applied to any language model, is easy to implement and can be used for general language generation. In our experiments we use DBS to control GPT-2. We demonstrate its performance on keyword-to-phrase generation and we obtain comparable results as a state-of-the-art non-plug-and-play model for lexically constrained story generation.

READ FULL TEXT

page 6

page 9

research
04/15/2023

Tractable Control for Autoregressive Language Generation

Despite the success of autoregressive large language models in text gene...
research
06/25/2020

THEaiTRE: Artificial Intelligence to Write a Theatre Play

We present THEaiTRE, a starting project aimed at automatic generation of...
research
08/03/2023

Ambient Adventures: Teaching ChatGPT on Developing Complex Stories

Imaginative play is an area of creativity that could allow robots to eng...
research
09/20/2021

A Plug-and-Play Method for Controlled Text Generation

Large pre-trained language models have repeatedly shown their ability to...
research
05/23/2023

Cascaded Beam Search: Plug-and-Play Terminology-Forcing For Neural Machine Translation

This paper presents a plug-and-play approach for translation with termin...
research
05/07/2020

A Tale of Two Perplexities: Sensitivity of Neural Language Models to Lexical Retrieval Deficits in Dementia of the Alzheimer's Type

In recent years there has been a burgeoning interest in the use of compu...
research
09/15/2021

Transformer-based Lexically Constrained Headline Generation

This paper explores a variant of automatic headline generation methods, ...

Please sign up or login with your details

Forgot password? Click here to reset