Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

GPT Understands, Too

  • Problem Hand-written discrete prompts give unstable results: a one-word change in the pattern can move knowledge-probing precision@1 by about 20 points.
  • Method Keeps the discrete prompt template and adds trainable continuous prompt embeddings next to its tokens, optionally produced by an LSTM or MLP prompt encoder, and optimizes them by backpropagation with the task objective.
  • Results With a frozen model on LAMA, P-Tuning reached 50.6% precision@1 on LAMA-34k against 43.3% for the best discrete search result, and 64.2% on LAMA-29k against 45.2%.

Figure 2: An example of prompt search for “The capital of Britain is [MASK]”. Given the context (blue zone,
“Britain”) and target (red zone, “[MASK]”), the ora…

Figure 2 : An example of prompt search for “The capital of Britain is [MASK]”. Given the context (blue zone, “Britain”) and target (red zone, “[MASK]”), the orange zone refer to the prompt. In (a), the prompt generator only receives discrete rewards; on the contrary, in (b) the continuous prompt embeddings and prompt encoder can be optimized in a differentiable way.

Original paper · CC BY 4.0 · Xiao Liu, Yanan Zheng, Zhengxiao Du, Ming Ding, Yujie Qian, Zhilin Yang, Jie Tang · GPT Understands, Too · Original paper figure · Extracted the figure area from page 3 of the original PDF.

Why hand-written prompts are fragile

Prompting adapts a pretrained language model by adding natural language patterns to its input, and it has improved many NLU tasks. The practical difficulty is writing a pattern that works well, because small wording changes can shift the outcome a great deal. Table 1 shows this on LAMA with a frozen BERT-base-cased model: the original pattern reaches 31.3 precision@1 without P-Tuning, while adding the phrase 'or state' drops the score to 19.8.

Changing only the last two patterns in the LAMA set causes a drop of 20 points in performance.

Automatic search methods based on corpus mining, gradient guidance or generative models try to find better patterns, but the chosen prompt is still a discrete token sequence and remains sensitive to its wording. The authors also argue that searching in discrete space cannot fully use gradients from backpropagation, which may leave the search at suboptimal solutions.

This motivates trying continuous prompts that can be optimized directly.

Continuous prompt embeddings next to discrete tokens

P-Tuning starts from a discrete prompt and keeps its tokens. It concatenates continuous prompt embeddings with those tokens and feeds the combined sequence to the language model. The intended effect is that the learnable part can absorb the effect of small edits to the discrete prompt, which should make training less sensitive to wording.

Let M be a pretrained language model with hidden size h and vocabulary size |V|. For a labeled input x with label y, the goal is to estimate \(f_M(x)=\hat{p}(y|x)\), with the parameters of M either finetuned or frozen. A discrete template places the input x and the label slot y among discrete prompt tokens, so the task becomes filling a blank in a text sequence.

For a relation such as the capital of a country, the template 'The capital of [INPUT] is [LABEL].' turns the pair (Britain, London) into a sentence with [MASK] in the label position. Prompt tokens and input tokens are mapped to embeddings through the pretrained embedding layer, and the continuous prompt vectors enter this same sequence.

A prompt encoder models the dependency among the continuous prompt embeddings before they enter the model. The paper uses an LSTM or an MLP for this step. Prior work had proposed an MLP as the encoder, and the authors compare LSTM, MLP and EMB, where EMB optimizes the word embeddings directly with no extra parameters. Where the continuous tokens are inserted is a separate design choice that the few-shot experiments vary.

Which parameters move during training

On LAMA the language model is frozen, and only the discrete or continuous prompts are tuned. On SuperGLUE the language model is tuned. The authors jointly optimize the language model parameters together with the continuous prompts, which lets the same method be evaluated with both frozen and tuned models. Table 2 summarizes this split: the frozen LAMA setting and the tuned fully-supervised and few-shot settings.

For the LAMA prompt training the learning rate is 1e-5 with the Adam optimizer, and the number of continuous tokens is 3 at each inserted position. For bidirectional models the template is (3, sub, org_prompt, 3, obj, 3), and for unidirectional GPT models it is (3, sub, org_prompt, 3, obj). These choices were made on the development sets.

Small datasets (COPA, WSC, CB, RTE) are trained for 20 epochs and larger ones (WiC, BoolQ, MultiRC) for 10, with early stopping.

Factual probing with a frozen model

LAMA-TREx covers 41 Wikidata relations and 34,039 test triples in the original set, called LAMA-34k, which covers all BERT vocabularies. LAMA-29k is a subset restricted to answers covered by the intersection of the GPT and BERT vocabularies, so that the same answers can be compared across model families. Answers are single tokens, and each relation has a handcrafted prompt that the paper uses as the discrete baseline.

The baselines are the original manual prompts, the LPAQA and AutoPrompt discrete searches, and the same pretrained models. The text ties these numbers to a claim that P-Tuning beats manual prompts by more than 20 points and searched prompts by 9 points on LAMA, using the same pretrained models.

The per-model block of Table 3 pairs manual-prompt precision with P-Tuning precision for several models. BERT-base rises from 31.7 to 52.3, and GPT2-xl from 22.8 to 54.4. The caption divides the table into LAMA-34k and LAMA-29k sides, so the subset behind each row should be read from the table itself. The authors read the gap over LPAQA and AutoPrompt on same-size models as support for their view that discrete prompts may not be optimal.

Fully-supervised SuperGLUE results

The evaluation uses seven of the eight SuperGLUE tasks, because ReCoRD has no discrete prompt, so P-Tuning cannot be applied to it. The tasks are BoolQ, MultiRC, CB, RTE, WiC, WSC and COPA. Each model is compared against standard classification fine-tuning (CLS-FT) and PET-FT, which fine-tunes with manual discrete prompts.

On BERT-Base, P-Tuning averages 68.4 against 67.1 for PET-FT and 66.2 for CLS-FT, on the SuperGLUE development set. The authors report that P-Tuning gives the best result on 5 of 7 tasks with BERT-Base and on 4 of 7 with BERT-Large, and that the exceptions are WiC and MultiRC. Because the Table 4 columns mix accuracy, F1 and exact match, the per-task counts are taken from the text rather than recounted from the table.

For BERT-Large, P-Tuning averages 74.6 against 73.1 for PET-FT and 72.5 for CLS-FT. For GPT2-Base the average is 70.4 for P-Tuning and 70.2 for PET-FT, against 63.0 for CLS-FT, and for GPT2-Medium it is 75.6, against 74.9 and 63.1. The authors also say P-Tuning achieves the best performance on all tasks for the two GPT2 models.

The authors note that P-Tuning gives little gain over CLS-FT on WiC and MultiRC, which have larger training sets, and that its benefit is larger on low-resource tasks. The averages are reported on the development set, not a held-out test set.

Few-shot SuperGLUE with ALBERT

The motivation is that GPT-3 with handcrafted prompts still struggles on some challenging tasks such as natural language inference. Few-shot results vary a lot with data order, random seed and prompt pattern, so the evaluation must separate method gains from variance. The FewNLU procedure uses random data splits and selects models on a small labeled set, which limits overfitting to a large development set.

The few-shot benchmark is FewGLUE, and the base model is ALBERT-xxLarge. PET uses its published manual prompts. For P-Tuning, the same manual prompts are kept and continuous prompt tokens are inserted at different positions and counts, giving a set of candidate patterns. The best candidate is chosen with the FewNLU validation strategy.

On ALBERT, P-Tuning beats PET on average by more than 1 point and PromptTuning by more than 13 points. The authors take this as evidence that learning continuous prompt tokens lets pretrained models do better on NLU tasks with few examples. The comparison covers ALBERT-xxLarge only, so the gain is not shown for other base models in this few-shot setting.

Spread across prompt patterns

The stability analysis looks at how much results change across prompt patterns, which is the sensitivity that Table 1 first exposed. On LAMA with BERT-base-cased on LAMA-TREx P17, the standard deviation over manual patterns falls from 10.1 to 0.46 when continuous prompts are appended to the manual prompts. The standard deviation is taken over results of different patterns, not over random seeds.

In the few-shot setting, P-Tuning raises the score of the weakest pattern, P#5, and yields a smaller spread across patterns than PET-FT. The authors read this as P-Tuning making training less sensitive to the choice of discrete pattern.

Prompt encoder and placement

The encoder ablation uses ALBERT in the few-shot setting and compares LSTM, MLP and EMB. On WiC accuracy LSTM scores 56.27, MLP 55.25 and EMB 53.96. On CB accuracy the values are 81.70 for LSTM, 88.39 for MLP and 82.59 for EMB. On CB F1 the values are 77.41, 84.24 and 67.27, and on BoolQ accuracy 75.41, 76.46 and 76.87.

EMB, which has no extra parameters, has the largest spread on WiC and CB, and the authors describe it as unstable on those tasks. On BoolQ the three encoders are close, with EMB slightly ahead of LSTM and MLP.

Average score is highest with four tokens in the middle (pattern 7, 86.76) and drops to 78.40 with eight tokens (pattern 8). Pattern 4, with one token inserted between the premise and the question, has the highest accuracy at 89.73.

Combining with automatically searched prompts

The question is whether continuous prompts can add to discrete patterns that an automatic search has already produced. The LM-BFF (Auto) baseline uses its top-3 searched patterns under the same evaluation procedure, and P-Tuning uses the same discrete patterns with continuous tokens added.

On MNLI P-Tuning reaches 58.70 against 57.53 for LM-BFF (Auto), and on MRPC 69.49 against 68.26. On SST-2 P-Tuning is slightly lower, at 92.78 against 92.89, so the gain is not uniform across the three tasks.

How the approach differs from prior work

GPT-3 uses in-context examples as its form of prompting, and cloze patterns remove the constraint that the masked token is at the end of the sentence. Discrete search methods mine corpora, use gradients or use generative models, and the paper's approach differs in using continuous prompt embeddings that the authors find complementary to discrete prompts.

Prefix-tuning adds continuous prompts at the start of the sequence in each layer, but it targets generation tasks rather than NLU.

Concurrent NLU work with continuous prompts focuses on knowledge probing, and Lester et al. showed that tuning only continuous prompts with a frozen large model can match full-model tuning. The authors state that no concurrent work had shown continuous prompts improving performance with a tuned model, and they also point to hybrid continuous-discrete prompts and a prompt encoder as design features of their own.

Work on knowledge in pretrained models, including probing of parse structure and attention heads, motivates treating these models as stores of linguistic and factual information.

Limitations

In the fully-supervised setting the gain over CLS-FT on WiC and MultiRC is small, and the authors connect this to the larger training sets on those tasks. For fully-supervised SuperGLUE the gap between discrete prompts is small and training is already stable without P-Tuning, so stabilization is shown only for LAMA and few-shot SuperGLUE.

The few-shot comparison uses only ALBERT-xxLarge as the base model. The LAMA experiments keep the language model frozen and evaluate single-token answers, so they say nothing about multi-token answers or tuned models on LAMA. The SuperGLUE results are reported on the development set.

Paper info

Authors
Xiao Liu, Yanan Zheng, Zhengxiao Du, Ming Ding, Yujie Qian, Zhilin Yang, Jie Tang
Venue
arXiv · Preprint
First published
2021-3-18
Added
2026-11-6
Updated
2023-10-25
Version
v2
arXiv
2103.10385
Category
cs.CL · cs.LG
Original paper terms
CC BY 4.0
What we show
Paper info, commentary and permitted figures from the original paper

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Abstract

Prompting a pretrained language model with natural language patterns has been proved effective for natural language understanding (NLU). However, our preliminary study reveals that manual discrete prompts often lead to unstable performance -- e.g., changing a single word in the prompt might result in substantial performance drop. We propose a novel method P-Tuning that employs trainable continuous prompt embeddings in concatenation with discrete prompts. Empirically, P-Tuning not only stabilizes training by minimizing the gap between various discrete prompts, but also improves performance by a sizeable margin on a wide range of NLU tasks including LAMA and SuperGLUE. P-Tuning is generally effective for both frozen and tuned language models, under both the fully-supervised and few-shot settings.

Quote from the paper

Xiao Liu, Yanan Zheng, Zhengxiao Du, Ming Ding, Yujie Qian, Zhilin Yang, Jie Tang (2021). GPT Understands, Too. arXiv:2103.10385v2. https://arxiv.org/abs/2103.10385v2

BibTeX
@misc{liu2021understands,
  title = {{GPT Understands, Too}},
  author = {Xiao Liu and Yanan Zheng and Zhengxiao Du and Ming Ding and Yujie Qian and Zhilin Yang and Jie Tang},
  year = {2021},
  eprint = {2103.10385},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2103.10385v2}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up