arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2205.12548cs.CLcs.LG
收藏

RLPrompt:用强化学习优化离散文本文本格式

RLPrompt: Optimizing Discrete Text Prompts with Reinforcement Learning

Carnegie Mellon University(卡内基梅隆大学);UC San Diego(加州大学圣地亚哥分校);MIT(麻省理工学院);Mohamed bin Zayed University of Artificial Intelligence(穆罕默德·本·扎耶德人工智能大学);Petuum Inc.(Petuum公司)

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

摘要:

在使大型预训练的语言模型(LM)能够执行各种NLP任务方面,特别是当只有很少的下游数据可用时,编译已经取得了令人印象深刻的成功。然而,自动为每个任务找到最佳提示是具有挑战性的。大多数现有的工作采取调整软提示(例如,嵌入),其缺乏可解释性、跨LM的可重用性以及当梯度不可访问时的适用性。另一方面,离散提示难以优化,并且通常通过“枚举”(例如,释义)-然后选择”的策略,不系统地探索提示空间。提出了一种基于强化学习(RL)的高效离散提示优化方法RLPrompt。RLPrompt制定了一个参数有效的策略网络,该网络在带奖励的训练后生成所需的离散提示。为了克服大型LM环境中奖励信号的复杂性和随机性,我们引入了有效的奖励稳定性,大大提高了训练效率。RLPrompt可灵活地应用于不同类型的LM,例如掩码(例如,BERT)和从左到右模型(例如,GPT),用于分类和生成任务。在Few-Shot分类和无监督文本风格转换上的实验表明,该方法优于现有的各种微调或提示方法。有趣的是,所得到的优化提示通常是不合语法的胡言乱语文本;并且令人惊讶的是,这些胡言乱语提示可以在不同的LM之间转移以保持显著的性能,这表明LM提示可能不遵循人类语言模式。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑