SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2109.04332 · 2021

PPT: Pre-trained Prompt Tuning for Few-shot Learning

arXiv · PDF · Open in the Atlas

Code that ran

4 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 0 failures of our instrument; 2 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2109.04332.json · badge: /api/ran/2109.04332.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
thu-coai/ppt canonical (classifier label)
classifier basis not recorded on the link
4 ran · 2 no recorded run
FunctionStatusWhere it lives
add_fp16_config_args Ran
ran on a synthesized input
thu-coai/ppt/arguments.py
code served (permissive licence) · get_code("f71c3558b3ba2b4a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ArgumentParser. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import argparse
import torch

torch.manual_seed(0)

parser = argparse.ArgumentParser(description='Test parser')

ARGS = {
    'parser': parser
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArgumentParser — a ArgumentParser output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ArgumentParser output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
add_model_config_args Ran
ran on a synthesized input
thu-coai/ppt/arguments.py
code served (permissive licence) · get_code("9ad766f0b3dedc25")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ArgumentParser. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import argparse

torch_manual_seed_result = __import__('torch').manual_seed(0)

parser = argparse.ArgumentParser()

ARGS = {
    'parser': parser,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArgumentParser — a ArgumentParser output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ArgumentParser output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
init_method_normal Ran
ran on a synthesized input
thu-coai/ppt/model/enc_dec_modeling.py
code served (permissive licence) · get_code("448c7945683d52e4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# The function init_method_normal takes a std parameter (standard deviation)
# and returns an initializer function that applies normal distribution initialization
# The std parameter should be a float value

ARGS = {
    "std": 0.02
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
to_python_float Ran
ran, honoured the contract we drafted
thu-coai/ppt/fp16/loss_scaler.py
pointer only (licence: MIT); the stored copy get_code serves, from lengsicong/tell2design, is pointer only (licence: NONE) · get_code("6b5d363ab4dbf012")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from lengsicong/tell2design, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

add_training_args Not yet run
unverified (harvested, no recorded run)
thu-coai/ppt/arguments.py
code served (permissive licence) · get_code("95e7a1a7057d3b47")
How it ran

no invocation recorded.

enc_dec_get_params_for_prompt_optimization Not yet run
unverified (harvested, no recorded run)
thu-coai/ppt/model/enc_dec_modeling.py
code served (permissive licence) · get_code("1a8240d2d4ec2de1")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 6 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 6 later) and 0 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
to_python_float 9 other papers
2 dated earlier, 7 later
1904.00962 (2019-04)
Large Batch Optimization for Deep Learning: Training BERT in 76 minutes
1909.03329 (2019-09)
LAMOL: LAnguage MOdeling for Lifelong Language Learning
2022.acl-long.576 (2022 (year only))
PPT: Pre-trained Prompt Tuning for Few-shot Learning
and 6 more not named here
init_method_normal 2 other papers
2 later
2022.acl-long.576 (2022 (year only))
PPT: Pre-trained Prompt Tuning for Few-shot Learning
2203.09313 (2022-03)
EVA2.0: Investigating Open-Domain Chinese Dialogue Systems with Large-Scale Pre-Training
add_fp16_config_args 1 other paper
1 later
2022.acl-long.576 (2022 (year only))
PPT: Pre-trained Prompt Tuning for Few-shot Learning
add_model_config_args 1 other paper
1 later
2022.acl-long.576 (2022 (year only))
PPT: Pre-trained Prompt Tuning for Few-shot Learning
add_training_args 1 other paper
1 later
2022.acl-long.576 (2022 (year only))
PPT: Pre-trained Prompt Tuning for Few-shot Learning
enc_dec_get_params_for_prompt_optimization 1 other paper
1 later
2022.acl-long.576 (2022 (year only))
PPT: Pre-trained Prompt Tuning for Few-shot Learning

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Prompts for pre-trained language models (PLMs) have shown remarkable performance by bridging the gap between pre-training tasks and various downstream tasks. Among these methods, prompt tuning, which freezes PLMs and only tunes soft prompts, provides an efficient and effective solution for adapting large-scale PLMs to downstream tasks. However, prompt tuning is yet to be fully explored. In our pilot experiments, we find that prompt tuning performs comparably with conventional full-model fine-tuning when downstream data are sufficient, whereas it performs much worse under few-shot learning settings, which may hinder the application of prompt tuning in practice. We attribute this low performance to the manner of initializing soft prompts. Therefore, in this work, we propose to pre-train prompts by adding soft prompts into the pre-training stage to obtain a better initialization. We name this Pre-trained Prompt Tuning framework "PPT". To ensure the generalization of PPT, we formulate similar classification tasks into a unified task form and pre-train soft prompts for this unified task. Extensive experiments show that tuning pre-trained prompts for downstream tasks can reach or even outperform full-model fine-tuning under both full-data and few-shot settings. Our approach is effective and efficient for using large-scale PLMs in practice.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2109.04332")
get_code_for_paper("2109.04332")
have("2109.04332")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2109.04332.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2109.04332.svg)](https://syntology.ai/paper/2109.04332)

Connect an agent — have() is free.