Gradient-Free Prompt Tuning for Black-Box Language Models

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering 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

Engineering Contradiction:
Improvemodel performanceVSAvoidcomputation and memory requirements
Core Design Contradiction:
ReliabilityVSUse of energy by moving object

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.

Inventive Principle:
Principle #1Segmentation

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.

Inventive Principle:
Principle #2Taking out (Extraction)

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

Engineering Contradiction:
Improvemodel performanceVSAvoidaccess to internal representations and gradients
Core Design Contradiction:
ReliabilityVSEase of operation

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.

Inventive Principle:
Principle #24Intermediary (Mediator)

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.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

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

Engineering Contradiction:
Improveaccessibility in black-box settingsVSAvoidoptimization reliability and convergence
Core Design Contradiction:
Ease of operationVSReliability

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.

Inventive Principle:
Principle #23Feedback

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.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS20250156638A1Reliable gradient-free and likelihood-free prompt tuning
Publication Date: 2025.05.15 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US20250156638A1 patent drawing
  • US20250156638A1 patent drawing
  • US20250156638A1 patent drawing

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.