Controllable Generation from Pre-trained Language Models via Inverse Prompting

Xu Zou, Da Yin, Qingyang Zhong, Ming Ding, Hongxia Yang +2 more
3/19/2021
cs.CLcs.AIcs.LG

Official code: THUDM/iPrompt (123 stars, Python, last commit 2022-12-14).

Abstract

Large-scale pre-trained language models have demonstrated strong capabilities of generating realistic text. However, it remains challenging to control the generation results.

Show full abstract

Previous approaches such as prompting are far from sufficient, which limits the usage of language models. To tackle this challenge, we propose an innovative method, inverse prompting, to better control text generation. The core idea of inverse prompting is to use generated text to inversely predict the prompt during beam search, which enhances the relevance between the prompt and the generated text and provides better controllability. Empirically, we pre-train a large-scale Chinese language model to perform a systematic study using human evaluation on the tasks of open-domain poem generation and open-domain long-form question answering. Our results show that our proposed method substantially outperforms the baselines and that our generation quality is close to human performance on some of the tasks. Narrators can try our poem generation demo at https://pretrain.aminer.cn/apps/poetry.html, while our QA demo can be found at https://pretrain.aminer.cn/app/qa. For researchers, the code is provided in https://github.com/THUDM/InversePrompting.

View on arXivView PDF

Code Implementations(1)

THUDM/iPromptOfficial100%

Code, Data and Demo for Paper: Controllable Generation from Pre-trained Language Models via Inverse Prompting

12320Python, C++Mar 18, 20213 years ago

Similar Papers

Cite this paper

@article{zou2021controllable,
  title  = {Controllable Generation from Pre-trained Language Models via Inverse Prompting},
  author = {Xu Zou and Da Yin and Qingyang Zhong and Ming Ding and Hongxia Yang and Zhilin Yang and Jie Tang},
  year   = {2021},
  eprint = {2103.10685},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2103.10685}
}

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

Discussion