Skip to main content
QUICK REVIEW

[论文解读] Black-box Prompt Learning for Pre-trained Language Models

Shizhe Diao, Zhichao Huang|arXiv (Cornell University)|Jan 21, 2022
Topic ModelingComputer Science被引用 30
一句话总结

本文提出 Black-Box Discrete Prompt Learning (BDPL),通过离散提示优化并使用方差约简的策略梯度,仅利用 API 输出来适配冻结的预训练语言模型(不可访问参数或梯度)。BDPL 在云端设备设置的多个数据集上取得显著改进,并在少样本、数据量和预算约束下展示出良好的可迁移性与鲁棒性。

ABSTRACT

The increasing scale of general-purpose Pre-trained Language Models (PLMs) necessitates the study of more efficient adaptation across different downstream tasks. In this paper, we establish a Black-box Discrete Prompt Learning (BDPL) to resonate with pragmatic interactions between the cloud infrastructure and edge devices. Particularly, instead of fine-tuning the model in the cloud, we adapt PLMs by prompt learning, which efficiently optimizes only a few parameters of the discrete prompts. Moreover, we consider the scenario that we do not have access to the parameters and gradients of the pre-trained models, except for its outputs given inputs. This black-box setting secures the cloud infrastructure from potential attack and misuse to cause a single-point failure, which is preferable to the white-box counterpart by current infrastructures. Under this black-box constraint, we apply a variance-reduced policy gradient algorithm to estimate the gradients of parameters in the categorical distribution of each discrete prompt. In light of our method, the user devices can efficiently tune their tasks by querying the PLMs bounded by a range of API calls. Our experiments on RoBERTa and GPT-3 demonstrate that the proposed algorithm achieves significant improvement on eight benchmarks in a cloud-device collaboration manner. Finally, we conduct in-depth case studies to comprehensively analyze our method in terms of various data sizes, prompt lengths, training budgets, optimization objectives, prompt transferability, and explanations of the learned prompts. Our code will be available at https://github.com/shizhediao/Black-Box-Prompt-Learning.

研究动机与目标

  • 在由于云端 API 限制导致无法获取模型参数/梯度时,推动并解决对大型 PLM 的高效自适应问题。
  • 提出一个离散提示学习框架(BDPL),在不通过反向传播穿透模型的情况下优化提示。
  • 证明 BDPL 在多样任务和数据情景中提升性能,同时保持数据隐私和成本效益。

提出的方法

  • 将提示学习框架设定为通过对每个提示位置的独立类别分布进行离散令牌选择。
  • 使用方差约简的策略梯度估计量来优化提示令牌分布,以应对高方差梯度估计问题。
  • 将学习到的离散提示前置于输入序列前,并冻结 PLM;仅使用梯度无关优化更新提示分布。
  • 使用基于 PMI 的 n-gram 构建候选提示词汇表,以在表达能力和可控性之间取得平衡。
  • 对提示分布进行投影随机梯度下降更新,强制满足概率简单形约束。
  • 提供一个考虑成本的实验设置,将 BDPL 与白盒和其他黑盒基线在 GPT-3 和 RoBERTa-Large 上进行对比。

实验结果

研究问题

  • RQ1在黑盒设定(不可访问 PLM 参数/梯度)的条件下,离散提示令牌是否能够达到具有竞争力或更优的任务表现?
  • RQ2数据量、提示长度和训练预算如何影响 BDPL 的性能与稳定性?
  • RQ3BDPL 学得的提示在不同任务和领域之间的可迁移性如何?
  • RQ4在少样本情形下,BDPL 如何与现有的黑盒和白盒提示方法进行比较?
  • RQ5通过消融和案例研究,BDPL 在数据规模、提示和目标方面能产生哪些洞察?

主要发现

  • BDPL 在基线黑盒方法上实现显著提升,并在 GPT-3 微调的情况下在十一份数据集上达到具竞争力的结果。
  • BDPL 可以匹配或超越若干白盒提示基线方法,并且在少样本设置中由于降低过拟合而具有优势。
  • BDPL 在少样本和领域迁移场景下表现出强鲁棒性,且其离散提示可直接与预测 API 兼容。
  • BDPL 对数据量敏感,数据增加时有提升,在预算约束下提示长度最佳约在约五十个标记。
  • BDPL 的提示在情感分析任务中展现可迁移性,在应用到未见目标领域时仍保持收益。
  • 在跨任务的鲁棒性与可扩展性方面,BDPL 提供了一种对云端设备协作中扩大模型规模的有效替代方案。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。