Gradient-Free Prompt Tuning for Black-Box Language Models
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Fine-tuning large pre-trained language models (PLMs) for downstream tasks is challenging due to their computation- and memory-intensive nature, and the limitations of accessing internal representations or propagating gradients through them, especially in black-box API settings.
Innovation Solution
The proposed solution involves reliable gradient-free and likelihood-free prompt tuning techniques, which draw prompt embedding samples from a prior distribution, accept samples based on a distance function, resample and perturb embeddings, and propagate them through the pre-trained model without requiring gradient computation or accessing internal representations.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If fine-tuning is used to adapt PLMs to downstream tasks, then model performance is improved, but computation and memory requirements increase significantly
Solution Approach 1:
The patent segments the model into two parts: a frozen pre-trained language model (PLM) containing billions of parameters, and a small prompt embedding layer with only a few hundred parameters. By segmenting and only training the small prompt embedding layer while keeping the large PLM frozen, the method achieves downstream task adaptation without requiring computation and memory resources proportional to the entire model size, thus resolving the contradiction between performance improvement and resource consumption.
Solution Approach 2:
The patent extracts only the essential adaptation components (prompt embedding parameters) from the full model, separating them from the frozen PLM. This extraction allows the model to be adapted to downstream tasks by training only the extracted prompt parameters rather than the entire model, significantly reducing computation and memory requirements while maintaining performance improvement.
2Reliability
If fine-tuning is used to adapt PLMs to downstream tasks, then model performance is improved, but access to internal representations and gradient propagation becomes unavailable in black-box settings
Solution Approach 1:
The patent introduces an intermediary approach by formulating prompt tuning as a simulation-based inference problem. Instead of directly accessing internal representations or gradients (which are unavailable in black-box settings), the method uses the PLM's output predictions as observations to infer the optimal prompt embedding parameters through iterative resampling and perturbation. This intermediary approach enables adaptation without requiring direct access to model internals, resolving the contradiction between performance improvement and ease of operation in black-box settings.
Solution Approach 2:
The patent replaces the mechanical gradient propagation system with a statistical inference system. Instead of using gradient-based optimization that requires access to internal representations, the method uses simulation-based inference with iterative resampling and perturbation of prompt embeddings, evaluating performance through the PLM's black-box predictions. This substitution enables adaptation in black-box settings where gradient access is unavailable.
3Ease of operation
If gradient-free methods are used for prompt tuning, then accessibility in black-box settings is improved, but optimization reliability and convergence may be compromised
Solution Approach 1:
The patent implements feedback mechanisms through iterative resampling and perturbation processes. In each iteration, prompt embedding samples are generated, evaluated through the black-box PLM, and used to update the distribution of prompt parameters. The perturbation kernel adapts based on previous iterations, and the process continues until convergence criteria are met. This feedback loop ensures reliable optimization by continuously refining prompt parameters based on actual model performance, resolving the contradiction between accessibility and optimization reliability.
Solution Approach 2:
The patent performs preliminary actions by drawing initial prompt embedding samples from a prior distribution before the main optimization process. These initial samples serve as a starting point for iterative refinement. The perturbation kernel is also pre-configured with appropriate parameters. These preliminary preparations enable the optimization process to converge reliably by starting from a reasonable initial state and systematically improving through iterative feedback, thus resolving the contradiction between black-box accessibility and optimization reliability.
Data Source
AI summary
Prompt embedding samples are drawn from a prior distribution and are passed into a pretrained model to receive a corresponding token label prediction for a batch of text data. Prompt embedding samples are accepted from a distribution of a first iteration; the accepted samples satisfy a condition of a distance function between a ground truth label and the corresponding token label prediction being less than a first tolerance. Embeddings are resampled from the accepted prompt embedding samples with probability proportional to weights and the resampled embeddings are perturbed via a perturbation kernel to obtain a new sample. The perturbed resampled embeddings are propagated through the pretrained model, and those that satisfy a condition are projected, where the second tolerance is decayed by one step per iteration. The projected resampled embeddings are concatenated with an embedding of a given input and inferencing is performed.


