[论文解读] RLPrompt: Optimizing Discrete Text Prompts with Reinforcement Learning
RLPrompt 提出了一种基于强化学习的方法,用于优化冻结的大规模语言模型的离散文本提示,实现了无梯度、可迁移且可解释的提示调优。它通过训练一个策略网络来生成有效提示,这些提示通常表现为语法错误的胡话,但能在不同模型和任务间泛化,在少样本和零样本设置下优于现有的提示方法与微调方法。
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.
研究动机与目标
- 为解决在不依赖大规模语言模型梯度的情况下高效优化离散文本提示的挑战。
- 开发一种方法,生成可解释、可重用且可在不同语言模型间迁移的提示。
- 通过基于奖励的强化学习,在低数据(少样本)和无数据(零样本)场景下实现有效的提示优化。
- 通过引入可学习的、基于策略的离散提示生成器,克服软提示调优、手动提示和启发式枚举的局限性。
- 证明非语言性、'胡话'式的提示仍能实现高性能,并在不同模型间实现良好迁移。
提出的方法
- RLPrompt 将离散提示优化建模为强化学习问题,其中策略网络生成离散提示标记。
- 使用现成的强化学习算法训练策略网络,奖励信号来自语言模型在下游任务上的输出。
- 引入奖励稳定机制,以应对来自黑箱语言模型环境的复杂且随机的奖励信号。
- 该方法使用一个小而参数高效的策略网络(例如多层感知机)插入到冻结的紧凑语言模型(如 distilGPT-2)中。
- 该方法支持掩码语言模型(如 BERT)和自回归语言模型(如 GPT)在分类和生成任务中的应用。
- 通过基于弱信号定义奖励函数,实现在无标注数据时的零样本提示。
实验结果
研究问题
- RQ1强化学习能否在不依赖语言模型梯度的情况下有效优化离散文本提示?
- RQ2经过优化的离散提示是否能在不同语言模型间泛化,即使其语法错误或语义无意义?
- RQ3基于强化学习的离散提示优化是否能在少样本和零样本学习设置下超越现有方法?
- RQ4奖励稳定化对基于强化学习的提示优化中训练效率和收敛性有何影响?
- RQ5为何非语言连贯的提示仍能在下游任务中实现高性能?
主要发现
- RLPrompt 在少样本文本分类任务中达到最先进性能,优于人工提示、软提示调优和 AutoPrompt。
- 在无监督文本风格迁移任务中,RLPrompt 超过所有基线方法,包括人工设计和语法约束提示,在莎士比亚风格迁移任务中达到 28.3% 的 GM 得分。
- 优化后的提示通常为语法错误的胡话(例如,'Fixed ( $-$ contrasts ( $-$ contrasts Dutch English excellent Correct )'),但仍具有高度有效性。
- 这些无意义的提示表现出强大的可迁移性:当应用于不同语言模型(如 GPT-2 和 BERT)时,仍能保持显著性能。
- 该方法通过利用弱监督和奖励塑形,在零样本设置下实现高性能,即使没有标注数据。
- 奖励稳定化显著提升了训练效率和收敛性,使复杂、高维提示空间中的稳定强化学习训练成为可能。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。