Reliable gradient-free and likelihood-free prompt tuning
Abstract
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.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 15 · Forward citations: 0.
Claims (15 — 3 Independent, 12 Dependent)
- Claim 1Independent Claim
A method comprising: drawing, using at least one hardware processor, prompt embedding samples from a prior distribution and passing the prompt embedding samples into a pretrained model to receive a corresponding token label prediction for a batch of text data; accepting, using the at least one hardware processor, prompt embedding samples from a distribution of a first iteration that satisfy a condition of a distance function between a ground truth label and a corresponding token label prediction being less than a first tolerance; resampling, using the at least one hardware processor, in a next iteration, embeddings from the accepted prompt embedding samples with probability proportional to weights and perturbing the resampled embeddings via a perturbation kernel to obtain a new sample; propagating, using the at least one hardware processor, the perturbed resampled embeddings through the pretrained model; projecting, to a higher dimension than a dimension of the resampled embeddings, using the at least one hardware processor, the resampled embeddings that satisfy a condition of the distance function between the ground truth label and the corresponding token label prediction being less than a second tolerance, where the second tolerance is decayed by one step per iteration; concatenating the projected resampled embeddings with an embedding of a given input; and performing inferencing by inputting the concatenated embeddings into the pretrained model.
- Claim 2Depends on #1
The method of claim 1, wherein a number of the prompt embedding samples is designated as S and wherein the second tolerance is decayed by one step per iteration by subtracting an inverse of a total number of training data from the second tolerance.
- Claim 3Depends on #2
The method of claim 2, wherein accuracy is used as the distance function.
- Claim 4Depends on #2
The method of claim 2, wherein a final collection of prompt embedding samples form an approximation to a posterior.
- Claim 5Depends on #2
The method of claim 2, wherein the given input is a text string and the inferencing operation determines a sentiment of the text string.
- Claim 6Independent Claim
A computer program product, comprising: one or more tangible computer-readable storage media and program instructions stored on at least one of the one or more tangible computer-readable storage media, the program instructions executable by a processor, the program instructions comprising: drawing, using at least one hardware processor, prompt embedding samples from a prior distribution and passing the prompt embedding samples into a pretrained model to receive a corresponding token label prediction for a batch of text data; accepting, using the at least one hardware processor, prompt embedding samples from a distribution of a first iteration that satisfy a condition of a distance function between a ground truth label and the corresponding token label prediction being less than a first tolerance; resampling, using the at least one hardware processor in a next iteration, embeddings from the accepted prompt embedding samples with probability proportional to weights and perturbing the resampled embeddings via a perturbation kernel to obtain a new sample; propagating, using the at least one hardware processor, the perturbed resampled embeddings through the pretrained model; projecting to a higher dimension than a dimension of the resampled embeddings, using the at least one hardware processor, the resampled embeddings that satisfy a condition of the distance function between the ground truth label and the corresponding token label prediction being less than a second tolerance, where the second tolerance is decayed by one step per iteration; concatenating the projected resampled embeddings with an embedding of a given input; and performing inferencing by inputting the concatenated embeddings into the pretrained model.
- Claim 7Depends on #6
The computer program product of claim 6, wherein a number of the prompt embedding samples is designated as S and wherein the second tolerance is decayed by one step per iteration by subtracting an inverse of a total number of training data from the second tolerance.
- Claim 8Depends on #7
The computer program product of claim 7, wherein accuracy is used as the distance function.
- Claim 9Depends on #7
The computer program product of claim 7, wherein a final collection of prompt embedding samples form an approximation to a posterior.
- Claim 10Depends on #7
The computer program product of claim 7, wherein the given input is a text string and the inferencing operation determines a sentiment of the text string.
- Claim 11Independent Claim
A system comprising: a memory; and at least one processor, coupled to said memory, and operative to perform operations comprising: drawing, using at least one hardware processor, prompt embedding samples from a prior distribution and passing the prompt embedding samples into a pretrained model to receive a corresponding token label prediction for a batch of text data; accepting, using the at least one hardware processor, prompt embedding samples from a distribution of a first iteration that satisfy a condition of a distance function between a ground truth label and the corresponding token label prediction being less than a first tolerance; resampling, using the at least one hardware processor in a next iteration, embeddings from the accepted prompt embedding samples with probability proportional to weights and perturbing the resampled embeddings via a perturbation kernel to obtain a new sample; propagating, using the at least one hardware processor, the perturbed resampled embeddings through the pretrained model; projecting to a higher dimension than a dimension of the resampled embeddings, using the at least one hardware processor, the resampled embeddings that satisfy a condition of the distance function between the ground truth label and the corresponding token label prediction being less than a second tolerance, where the second tolerance is decayed by one step per iteration; concatenating the projected resampled embeddings with an embedding of a given input; and performing inferencing by inputting the concatenated embeddings into the pretrained model.
- Claim 12Depends on #11
The system of claim 11, wherein a number of the prompt embedding samples is designated as S and wherein the second tolerance is decayed by one step per iteration by subtracting an inverse of a total number of training data from the second tolerance.
- Claim 13Depends on #12
The system of claim 12, wherein accuracy is used as the distance function.
- Claim 14Depends on #12
The system of claim 12, wherein a final collection of prompt embedding samples form an approximation to a posterior.
- Claim 15Depends on #12
The system of claim 12, wherein the given input is a text string and the inferencing operation determines a sentiment of the text string.
Technical Overview & Description
STATEMENT REGARDING PRIOR DISCLOSURES BY THE INVENTOR OR A JOINT INVENTOR The following disclosure is submitted under 35 U.S.C. 102 (b)(1)(A): Shen M, Ghosh S, Sattigeri P, Das S, Bu Y, Wornell G. Reliable gradient-free and likelihood-free prompt tuning. arXiv preprint arXiv: 2305.00593. 2023 Apr. 30. BACKGROUND The present invention relates generally to the electrical, electronic and computer arts and, more particularly, to machine learning. Pretrained language models (PLMs) often demonstrate impressive performance. The conventional approach to adapting PLMs to downstream tasks involves fine-tuning the model (model tuning), but such fine-tuning can be computation- and memory-intensive, as a PLM usually contains billions of parameters. For example, a generative pretrained transformer (GPT-3) has 175 billion parameters. A better strategy is prompt tuning, which aims to learn a small number of prompt parameters, such as a real vector of prompt embeddings with 20,000 parameters, while keeping the large PLM frozen. Due to privacy or commercial constraints, large pre-trained language models (PLMs) are often offered as black-box application programming interfaces (APIs). Fine-tuning such models for downstream tasks is challenging, however, because one can neither access the model's internal representations nor propagate gradients through it. BRIEF SUMMARY Principles of the invention provide techniques for reliable gradient-free and likelihood-free prompt tuning. In one aspect, an exemplary method includes the operations of: drawing, using at least one hardware processor, prompt embedding samples from a prior distribution and passing the prompt embedding samples into a pretrained model to receive a corresponding token label prediction for a batch of text data; accepting, using the at least one hardware processor, prompt embedding samples from a distribution of a first iteration that satisfy a condition of a distance function between a ground truth label and a corresponding
Cited By — Indexed Forward Citations (0 of 0 total)
No indexed citing patents in this generation yet. Ingest USPTO/PatentsView bulk citation tables via patents-ingest to expand the local forward citation graph.
References Cited — Backward Prior Art (15)
Non-Patent Literature (10)
- Shen M, Ghosh S, Sattigeri P, Das S, Bu Y, Wornell G. Reliable gradient-free and likelihood-free prompt tuning. arXiv preprint arXiv:2305.00593. Apr. 30, 2023. 14 pages (Grace Period Disclosure).
- Lester et al.,
- “
- The power of scale for parameter-efficient prompt tuning
- ”
- , https://arxiv.org/pdf/2104.08691, Sep. 2, 2021, 15 pages.
- Liu et al.,
- “
- P-Tuning v2: Prompt Tuning Can Be Comparable to Fine-tuning Universally Across Scales and Tasks
- ”