Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

RLPrompt: Optimizing Discrete Text Prompts with Reinforcement Learning

About

Prompting has shown impressive success in enabling large pretrained language models (LMs) to perform diverse NLP tasks, especially when only few downstream data are available. Automatically finding the optimal prompt for each task, however, is challenging. Most existing work resorts to tuning soft prompt (e.g., embeddings) which falls short of interpretability, reusability across LMs, and applicability when gradients are not accessible. Discrete prompt, on the other hand, is difficult to optimize, and is often created by "enumeration (e.g., paraphrasing)-then-selection" heuristics that do not explore the prompt space systematically. This paper proposes RLPrompt, an efficient discrete prompt optimization approach with reinforcement learning (RL). RLPrompt formulates a parameter-efficient policy network that generates the desired discrete prompt after training with reward. To overcome the complexity and stochasticity of reward signals by the large LM environment, we incorporate effective reward stabilization that substantially enhances the training efficiency. RLPrompt is flexibly applicable to different types of LMs, such as masked (e.g., BERT) and left-to-right models (e.g., GPTs), for both classification and generation tasks. Experiments on few-shot classification and unsupervised text style transfer show superior performance over a wide range of existing finetuning or prompting methods. Interestingly, the resulting optimized prompts are often ungrammatical gibberish text; and surprisingly, those gibberish prompts are transferrable between different LMs to retain significant performance, indicating LM prompting may not follow human language patterns.

Mingkai Deng, Jianyu Wang, Cheng-Ping Hsieh, Yihan Wang, Han Guo, Tianmin Shu, Meng Song, Eric P. Xing, Zhiting Hu• 2022

Related benchmarks

TaskDatasetResultRank
Text ClassificationSST-2 (test)
Accuracy91.5
185
Topic ClassificationAG-News
Accuracy80.2
173
Sentiment AnalysisSST-2
Accuracy87
156
Subjectivity ClassificationSubj (test)
Accuracy82.2
125
Text ClassificationMR (test)
Accuracy87.1
99
Sentiment AnalysisIMDB
Accuracy87.6
57
Topic ClassificationYahoo (test)
Accuracy48.6
36
Text ClassificationYelp P. (test)
Accuracy94.7
34
Sentiment AnalysisYelp
Accuracy95.1
30
Text ClassificationAG's News (test)
A-rate77.5
13
Showing 10 of 11 rows

Other info

Follow for update