P-Tuning v2: Prompt Tuning Can Be Comparable to Fine-tuning Universally Across Scales and Tasks

Xiao Liu, Kaixuan Ji, Yicheng Fu, Weng Lam Tam, Zhengxiao Du +2 more
10/14/2021
cs.CL

Official code: THUDM/P-tuning-v2 (2,077 stars, Apache-2.0, last commit 2023-11-16).

Abstract

Prompt tuning, which only tunes continuous prompts with a frozen language model, substantially reduces per-task storage and memory usage at training. However, in the context of NLU, prior work reveals that prompt tuning does not perform well for normal-sized pretrained models. We also find that existing methods of prompt tuning cannot handle hard sequence labeling tasks, indicating a lack of universality. We present a novel empirical finding that properly optimized prompt tuning can be universally effective across a wide range of model scales and NLU tasks. It matches the performance of finetuning while having only 0.1%-3% tuned parameters. Our method P-Tuning v2 is an implementation of Deep Prompt Tuning \cite{li2021prefix,qin2021learning} optimized and adapted for NLU. Given the universality and simplicity of P-Tuning v2, we believe it can serve as an alternative to finetuning and a strong baseline for future research.Our code and data are released at https://github.com/THUDM/P-tuning-v2.

View on arXivView PDF

Code Implementations(1)

THUDM/P-tuning-v2Official100%
Apache-2.0

An optimized deep prompt tuning strategy comparable to fine-tuning across scales and tasks

2,077212Shell, PythonOct 14, 20212 years agoApache-2.0
natural-language-processingp-tuningparameter-efficient-learningpretrained-language-modelprompt-tuning

Similar Papers

Cite this paper

@article{liu2021ptuning,
  title  = {P-Tuning v2: Prompt Tuning Can Be Comparable to Fine-tuning Universally Across Scales and Tasks},
  author = {Xiao Liu and Kaixuan Ji and Yicheng Fu and Weng Lam Tam and Zhengxiao Du and Zhilin Yang and Jie Tang},
  year   = {2021},
  eprint = {2110.07602},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2110.07602}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2110.07602.svg)](https://codeofpaper.com/paper/2110.07602)

Discussion