p-tuning-v2

P-tuning v2 is a deep prompt tuning strategy designed as an alternative to full model fine-tuning.

github.com/THUDM/P-tuning-v2
p-tuning-v2 homepage screenshot

About p-tuning-v2

P-tuning v2 is an open-source repository with source code and data for deep prompt tuning, which applies continuous prompts to each layer input of a pretrained transformer while backbone parameters remain frozen. It includes training scripts, hyper-parameter search scripts, and implementations for SuperGLUE subsets, SQuAD 1.1/2.0, and sequence tagging datasets including CoNLL and OntoNotes.

Reimplementation is provided for BERT-large and RoBERTa-large using Ubuntu, RTX 3090 GPUs, CUDA 11.1 and specific package versions. Selected hyperparameters can be sensitive to environment and package differences, and sequence tagging data is supplied as a non-official archive for use at own risk.

Key features

  • Applies continuous prompts to every layer input of transformer
  • Freezes backbone model parameters during tuning
  • Provides training scripts for SuperGLUE, SQuAD, NER, SRL tasks
  • Includes hyper-parameter search scripts and result collection tools
  • Downloads SuperGLUE and SQuAD via Hugging Face Datasets API
  • Includes code for neural text retrievers from EMNLP 2023 findings paper
Best for: Researchers and developers using BERT-large or RoBERTa-large who want a parameter-efficient alternative to full fine-tuning.
Good for
  • Keeps backbone pretrained model parameters frozen during tuning
  • Described as achieving results comparable to fine-tuning on small/medium models and sequence tagging tasks
  • Provides training scripts, search scripts, and reported results for multiple datasets
Watch out for
  • Selected hyperparameters can be sensitive to server environment and package version
  • Original experiments used NVIDIA DGX-A100 servers, which may be difficult to acquire
  • Sequence tagging datasets are provided as a non-official archive to use at own risk

p-tuning-v2 at a glance

Type
Open-source project
Pricing
Not confirmed. Check the site
Open source
Yes · Source code
Language
English
Last checked
Oct 5, 2026 · Online when checked
Listed
Oct 5, 2026

p-tuning-v2 alternatives

Tools and sites you could use instead, ranked by how closely they match.

All 24 alternatives

Popular in ML Training & Optimization

Well-known listings from the same topic.

All 75

p-tuning-v2 FAQ

Why do SuperGLUE numbers differ between P-tuning v1 and P-tuning v2?
In v1 SuperGLUE experiments backbone parameters were jointly tuned with prompt embeddings for comparison to PET, while v2 freezes backbone parameters following a parameter-efficient setting.
What should I do if I cannot reproduce the reported results?
Check for environment mismatch and run hyper-parameter search in your environment using the example scripts in search_script and search.py.
Where do the datasets come from?
SuperGLUE and SQuAD are downloaded through Hugging Face Datasets APIs embedded in the code, while sequence tagging data comes from a separate non-official archive.
Is something wrong or out of date?

Tell us and an editor will check it.

Own this website?

Claim the listing and suggest updates yourself. An editor checks every claim first.

Claim this listing