Prompt-Based Length Controlled Generation with Reinforcement Learning

Renlong Jie, Xiaojun Meng, Lifeng Shang, Xin Jiang, Qun Liu
8/23/2023
cs.CLcs.AIcs.LG

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

Large language models (LLMs) like ChatGPT and GPT-4 have attracted great attention given their surprising performance on a wide range of NLP tasks. Length controlled generation of LLMs emerges as an important topic, which enables users to fully leverage the capability of LLMs in more real-world scenarios like generating a proper answer or essay of a desired length. In addition, the autoregressive generation in LLMs is extremely time-consuming, while the ability of controlling this generated length can reduce the inference cost by limiting the length. Therefore, we propose a prompt-based length control method to achieve high-accuracy length controlled generation. In particular, we adopt reinforcement learning with the reward signal given by either trainable or rule-based reward models, which further enhances the length-control ability of LLMs by rewarding outputs that follows pre-defined control instruction. To enable rule-based inference, we also introduce standard prompt extractor to collect the standard control information from users' input. Experiments show that our method significantly improves the accuracy of prompt-based length control for summarization task on popular datasets like CNNDM and NYT. Both the standard prompt extractor and the RL-tuned model have show strong generalization ability to unseen control prompt templates.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{jie2023promptbased,
  title  = {Prompt-Based Length Controlled Generation with Reinforcement Learning},
  author = {Renlong Jie and Xiaojun Meng and Lifeng Shang and Xin Jiang and Qun Liu},
  year   = {2023},
  eprint = {2308.12030},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2308.12030v2}
}

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

Discussion