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

语言模型即服务的黑盒调优

Black-Box Tuning for Language-Model-as-a-Service

Fudan University(复旦大学);East China Normal University(华东师范大学);Peng Cheng Laboratory(鹏城实验室)

Tianxiang Sun, Yunfan Shao, Hong Qian, Xuanjing Huang, Xipeng Qiu

摘要:

非常大的预训练语言模型(PTM),如GPT-3通常作为服务发布。它允许用户设计特定于任务的提示,以通过一些黑盒API查询PTM。在这样的场景中,我们称之为语言模型即服务(LMaaS),PTM的梯度通常不可用。我们可以通过只访问模型推理API来优化任务提示吗?本文提出了黑盒调优框架,通过无导数优化来优化输入文本前的连续提示。而不是优化在原来的高维提示空间,这是传统的无导数优化棘手,我们进行优化,在一个随机生成的子空间,由于大PTM的固有维数低。实验结果表明,在少量标记样本上使用RoBERTa的黑盒调整不仅显著优于手动提示和GPT-3的上下文学习,而且还优于基于梯度的同行,即,提示微调和完整的模型调整。

英文摘要:

Extremely large pre-trained language models (PTMs) such as GPT-3 are usually released as a service. It allows users to design task-specific prompts to query the PTMs through some black-box APIs. In such a scenario, which we call Language-Model-as-a-Service (LMaaS), the gradients of PTMs are usually unavailable. Can we optimize the task prompts by only accessing the model inference APIs? This paper proposes the black-box tuning framework to optimize the continuous prompt prepended to the input text via derivative-free optimization. Instead of optimizing in the original high-dimensional prompt space, which is intractable for traditional derivative-free optimization, we perform optimization in a randomly generated subspace due to the low intrinsic dimensionality of large PTMs. The experimental results show that the black-box tuning with RoBERTa on a few labeled samples not only significantly outperforms manual prompt and GPT-3's in-context learning, but also surpasses the gradient-based counterparts, i.e., prompt tuning and full model tuning.

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

↑