[Paper Review] Black-box Prompt Learning for Pre-trained Language Models
The paper proposes Black-Box Discrete Prompt Learning (BDPL) to adapt frozen pre-trained language models via discrete prompts optimized with a variance-reduced policy gradient, using only API outputs (no access to parameters or gradients). BDPL achieves significant improvements across multiple datasets in cloud-device settings and demonstrates transferability and robustness under few-shot, data size, and budget constraints.
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.
Motivation & Objective
- Motivate and address efficient adaptation of large PLMs when model parameters/gradients are inaccessible due to cloud APIs.
- Propose a discrete prompt learning framework (BDPL) that optimizes prompts without backpropagating through the model.
- Show that BDPL improves performance across diverse tasks and data regimes while preserving data privacy and cost efficiency.
Proposed method
- Frame prompt learning as discrete token selection via independent categorical distributions for each prompt position.
- Optimize prompt token distributions with a variance-reduced policy gradient estimator to handle high-variance gradient estimates.
- Prepend learned discrete prompts to input sequences and freeze the PLM; update only prompt distributions using gradient-free optimization.
- Construct a candidate prompt vocabulary using PMI-based n-grams to balance expressiveness and manageability.
- Train with a projected stochastic gradient descent update on the prompt distributions, enforcing probability simplex constraints.
- Provide a cost-aware experimental setup comparing BDPL against white-box and other black-box baselines on GPT-3 and RoBERTa-Large.
Experimental results
Research questions
- RQ1Can discrete prompt tokens optimized in a black-box setting (no access to PLM parameters/gradients) yield competitive or superior task performance?
- RQ2How do data size, prompt length, and training budget affect BDPL performance and stability?
- RQ3What is the transferability of BDPL-learned prompts across tasks and domains?
- RQ4How does BDPL compare to existing black-box and white-box prompting methods under few-shot regimes?
- RQ5What insights (data size, prompts, objectives) emerge from ablations and case studies of BDPL?
Key findings
- BDPL achieves significant improvement over baseline black-box methods and competitive results with GPT-3 fine-tuning across eleven datasets.
- BDPL matches or exceeds several white-box prompt-based methods and can outperform some due to reduced overfitting in few-shot settings.
- BDPL demonstrates strong performance under few-shot and domain-shift scenarios, and its discrete prompts enable direct compatibility with prediction APIs.
- BDPL shows data-size sensitivity, with improvements as data increases and an optimal prompt length around fifty tokens under budget constraints.
- BDPL prompts exhibit transferability in sentiment tasks, maintaining benefits when applied to unseen target domains.
- Across tasks, BDPL maintains robustness and scalability, offering an effective alternative to increasing model size for cloud-device collaborations.
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.