OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Models

P Tuning V2

P Tuning V2 is an open-source Python research codebase and data release for deep prompt tuning of pretrained language models, with related code for neural text-retrieval experiments.

Independent OpenViST project profile, based on linked sources.

P Tuning V2 — OpenViST project profile in AI Models.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when you need research code and documented examples for experimenting with deep prompt tuning, especially on language-understanding benchmarks or sequence-tagging tasks.

Who it is for

  • Researchers reproducing or adapting parameter-efficient prompt-tuning experiments.
  • Developers exploring prompt tuning for language-understanding benchmarks or sequence-tagging tasks.
  • Researchers investigating parameter-efficient neural text retrieval through the linked PT-Retrieval code.

Documented uses

  • Set up the documented Python and PyTorch environment for the repository.
  • Run a supplied training script, such as the RoBERTa RTE example.
  • Prepare the provided sequence-tagging datasets for experiments.
  • Study deep prompt tuning with pretrained transformer backbones.
Before you choose

Requirements & limits

The GitHub repository is public and declares an Apache-2.0 license.

  • The README provides environment setup and a concrete RoBERTa-for-RTE training script.
  • Reported results are reimplementations on BERT-large and RoBERTa-large; reproduction guidance warns that environment and package differences can require hyperparameter search.
  • SuperGLUE and SQuAD data are obtained through Hugging Face Datasets, while the NER and SRL bundle is a separate non-official download.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Set up the P Tuning V2 environment

Create the Python environment and install the packages listed by the repository.

Before you start

  • Anaconda3
  • The P Tuning V2 repository and its requirements.txt

Steps

  1. Create and activate the environment with Python 3.8.5: conda create -n pt2 python=3.8.5, then conda activate pt2.

  2. Install the listed PyTorch packages and CUDA toolkit using the repository's conda command.

  3. Install the remaining Python packages with pip install -r requirements.txt.

Expected outcome

The documented conda environment and repository Python dependencies are installed.

Guide limitations

  • The README's reproduction notes describe an Ubuntu and NVIDIA GPU setup; the environment setup alone does not reproduce a training result.
  • The README notes that package and server differences can affect hyperparameter selection.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
16 October 2026
Original website title
THUDM/P-tuning-v2 · Official homepage title · retained in its source language