[Paper Review] RLPrompt: Optimizing Discrete Text Prompts with Reinforcement Learning
RLPrompt proposes a reinforcement learning-based method to optimize discrete text prompts for frozen large language models, enabling gradient-free, transferable, and interpretable prompt tuning. It trains a policy network to generate effective prompts that often appear as ungrammatical gibberish yet generalize across models and tasks, outperforming existing prompting and fine-tuning methods in few-shot and zero-shot settings.
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.
Motivation & Objective
- To address the challenge of optimizing discrete text prompts efficiently without relying on gradients from large language models.
- To develop a method that generates interpretable, reusable, and transferable prompts across different language models.
- To enable effective prompt optimization in low-data (few-shot) and no-data (zero-shot) scenarios using reward-based RL.
- To overcome limitations of soft prompt tuning, manual prompting, and heuristic enumeration by introducing a learnable, policy-based discrete prompt generator.
- To demonstrate that non-linguistic, 'gibberish' prompts can achieve high performance and transfer across models.
Proposed method
- RLPrompt formulates discrete prompt optimization as a reinforcement learning problem, where a policy network generates discrete prompt tokens.
- The policy network is trained using off-the-shelf RL algorithms with rewards derived from the language model's output on downstream tasks.
- A reward stabilization mechanism is introduced to handle the complex and stochastic reward signals from the black-box language model environment.
- The method uses a small, parameter-efficient policy network (e.g., an MLP) inserted into a frozen compact language model like distilGPT-2.
- The approach supports both masked LMs (e.g., BERT) and autoregressive LMs (e.g., GPTs) for classification and generation tasks.
- It enables zero-shot prompting by defining reward functions based on weak signals when no labeled data is available.
Experimental results
Research questions
- RQ1Can reinforcement learning effectively optimize discrete text prompts without requiring gradients from the language model?
- RQ2Do optimized discrete prompts generalize across different language models, even when they appear ungrammatical or nonsensical?
- RQ3Can RL-based discrete prompt optimization outperform existing methods in few-shot and zero-shot learning settings?
- RQ4What is the impact of reward stabilization on training efficiency and convergence in RL-based prompt optimization?
- RQ5Why do non-linguistically coherent prompts still achieve high performance on downstream tasks?
Key findings
- RLPrompt achieves state-of-the-art performance on few-shot text classification tasks, outperforming manual prompts, soft prompt tuning, and AutoPrompt.
- In unsupervised text style transfer, RLPrompt surpasses all baselines, including manually crafted and fluency-constrained prompts, with a 28.3% GM score on Shakespeare-style transfer.
- The optimized prompts are often ungrammatical gibberish (e.g., 'Fixed ( $-$ contrasts ( $-$ contrasts Dutch English excellent Correct )'), yet remain highly effective.
- These non-sensical prompts show strong transferability: they retain significant performance when applied to different language models, such as GPT-2 and BERT.
- The method achieves high performance in zero-shot settings by leveraging weak supervision and reward shaping, even without labeled data.
- Reward stabilization significantly improves training efficiency and convergence, enabling stable RL training in complex, high-dimensional prompt spaces.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.