SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2207.07087 · 2022

Parameter-Efficient Prompt Tuning Makes Generalized and Calibrated Neural Text Retrievers

arXiv · PDF · Open in the Atlas

Code that ran

3 of 7 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 1 has no contract verdict; 1 failure of our instrument; 4 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/2207.07087.json · badge: /api/ran/2207.07087.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
thudm/p-tuning-v2 canonical (classifier label)
classifier basis not recorded on the link
3 ran · 4 no recorded run
FunctionStatusWhere it lives
build_relative_position Ran
ran, honoured the contract we drafted
thudm/p-tuning-v2/model/deberta.py
code served (permissive licence) · get_code("00b3090f89b698e1")
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 Tensor, ndim 3, dtype family int, shape (1, 4, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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

torch.manual_seed(0)

ARGS = {
    "query_size": 4,
    "key_size": 3,
    "device": torch.device("cpu")
}
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 Tensor, ndim 3, dtype family int, shape (1, 4, 3) — shape (1, 4, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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
c2p_dynamic_expand Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
thudm/p-tuning-v2/model/deberta.py
code served (permissive licence) · get_code("ea37553c09194184")
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 Tensor, ndim 4, dtype family float, shape (2, 3, 4, 5) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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

torch.manual_seed(0)

# Analyze the function:
# - c2p_pos: needs .expand() method, so it's a tensor
# - query_layer: needs .size(0), .size(1), .size(2) methods, so it's a tensor
# - relative_pos: needs .size(-1) method, so it's a tensor

# The expand call uses query_layer.size(0), query_layer.size(1), query_layer.size(2), relative_pos.size(-1)
# So we need:
# - query_layer: shape [batch_size, seq_len, hidden_dim, ...]
# - relative_pos: shape [..., rel_dim]
# - c2p_pos: needs to be broadcastable to [batch_size, seq_len, hidden_dim, rel_dim]

# Using distinct sizes for clarity:
batch_size = 2
seq_len = 3
hidden_dim = 4
rel_dim = 5

query_layer = torch.randn(batch_size, seq_len, hidden_dim)
relative_pos = torch.randn(2, 3, rel_dim)
c2p_pos = torch.randn(1, 1, 1, rel_dim)  # broadcastable tensor

ARGS = {
    "c2p_pos": c2p_pos,
    "query_layer": query_layer,
    "relative_pos": relative_pos,
}
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 Tensor, ndim 4, dtype family float, shape (2, 3, 4, 5) — shape (2, 3, 4, 5) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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
gen_ctx_vectors Ran
ran on a synthesized input
thudm/p-tuning-v2/PT-Retrieval/batch_dense_retrieval_colbert.py
code served (permissive licence) · get_code("e8385f1730656c04")
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 ndarray, ndim 2, dtype family float, shape (4, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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
import numpy as np
from typing import List, Tuple

torch.manual_seed(0)

# Create a mock inference object that has a docFromText method
class MockInference:
    def docFromText(self, texts: List[str], bsize: int = 32, keep_dims: bool = True):
        # Return a tensor of embeddings with shape (batch_size, embedding_dim)
        batch_size = len(texts)
        embedding_dim = 4
        # Create a tensor on CPU
        embs = torch.randn(batch_size, embedding_dim)
        return embs

# Create mock args object with batch_size
class MockArgs:
    def __init__(self):
        self.batch_size = 2

# Create sample ctx_rows data
# Each row is a tuple of (object_id, str1, str2)
ctx_rows = [
    (0, "title one", "content one"),
    (1, "title two", "content two"),
    (2, "title three", "content three"),
    (3, "title four", "content four"),
]

# Build the ARGS dictionary
ARGS = {
    "ctx_rows": ctx_rows,
    "inference": MockInference(),
    "args": MockArgs(),
    "insert_title": True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (4, 4) — shape (4, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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
build_relative_position Not yet run
unverified (harvested, no recorded run)
thudm/p-tuning-v2/model/debertaV2.py
code served (permissive licence) · get_code("0df39601dd0d5745")
How it ran

no invocation recorded.

get_mask Not yet run
unverified (harvested, no recorded run)
thudm/p-tuning-v2/model/deberta.py
code served (permissive licence) · get_code("05732f1a5126672d")
How it ran

no invocation recorded.

get_model_deprecated Not yet run
unverified (harvested, no recorded run)
thudm/p-tuning-v2/model/utils.py
code served (permissive licence) · get_code("4745b1d300a6b522")
How it ran

no invocation recorded.

make_log_bucket_position Not yet run
unverified (harvested, no recorded run)
thudm/p-tuning-v2/model/debertaV2.py
code served (permissive licence) · get_code("29371b9c270911e1")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 6 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 0 the same month, 6 later) and 1 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
get_mask 10 other papers
3 dated earlier, 7 later
1906.03158 (2019-06)
Matching the Blanks: Distributional Similarity for Relation Learning
2110.00976 (2021-10)
LexGLUE: A Benchmark Dataset for Legal Language Understanding in English
2206.08155 (2022-06)
Zero-Shot Video Question Answering via Frozen Bidirectional Language Models
and 7 more not named here
build_relative_position 7 other papers
1 dated earlier, 6 later
2206.08155 (2022-06)
Zero-Shot Video Question Answering via Frozen Bidirectional Language Models
2210.12360 (2022-10)
Prompt-Tuning Can Be Much Better Than Fine-Tuning on Cross-lingual Understanding With Multilingual Language Models
2211.05414 (2022-11)
ADEPT: A DEbiasing PrompT Framework
and 4 more not named here
make_log_bucket_position 7 other papers
2 dated earlier, 5 later · 1 only as an assembly brick
2006.03654 (2020-06)
DeBERTa: Decoding-enhanced BERT with Disentangled Attention
2206.08155 (2022-06)
Zero-Shot Video Question Answering via Frozen Bidirectional Language Models
2210.12360 (2022-10)
Prompt-Tuning Can Be Much Better Than Fine-Tuning on Cross-lingual Understanding With Multilingual Language Models
and 4 more not named here
build_relative_position 6 other papers
1 dated earlier, 5 later
2006.03654 (2020-06)
DeBERTa: Decoding-enhanced BERT with Disentangled Attention
2208.10160 (2022-08)
PANDA: Prompt Transfer Meets Knowledge Distillation for Efficient Model Adaptation
2210.12360 (2022-10)
Prompt-Tuning Can Be Much Better Than Fine-Tuning on Cross-lingual Understanding With Multilingual Language Models
and 3 more not named here
c2p_dynamic_expand 6 other papers
1 dated earlier, 5 later
2006.03654 (2020-06)
DeBERTa: Decoding-enhanced BERT with Disentangled Attention
2208.10160 (2022-08)
PANDA: Prompt Transfer Meets Knowledge Distillation for Efficient Model Adaptation
2210.12360 (2022-10)
Prompt-Tuning Can Be Much Better Than Fine-Tuning on Cross-lingual Understanding With Multilingual Language Models
and 3 more not named here
get_model_deprecated 4 other papers
4 later
2210.12360 (2022-10)
Prompt-Tuning Can Be Much Better Than Fine-Tuning on Cross-lingual Understanding With Multilingual Language Models
2211.05414 (2022-11)
ADEPT: A DEbiasing PrompT Framework
2023.acl-long.750 (2023 (year only))
MVP-Tuning: Multi-View Knowledge Retrieval with Prompt Tuning for Commonsense Reasoning
and 1 more not named here

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

Prompt tuning attempts to update few task-specific parameters in pre-trained models. It has achieved comparable performance to fine-tuning of the full parameter set on both language understanding and generation tasks. In this work, we study the problem of prompt tuning for neural text retrievers. We introduce parameter-efficient prompt tuning for text retrieval across in-domain, cross-domain, and cross-topic settings. Through an extensive analysis, we show that the strategy can mitigate the two issues -- parameter-inefficiency and weak generalizability -- faced by fine-tuning based retrieval methods. Notably, it can significantly improve the out-of-domain zero-shot generalization of the retrieval models. By updating only 0.1% of the model parameters, the prompt tuning strategy can help retrieval models achieve better generalization performance than traditional methods in which all parameters are updated. Finally, to facilitate research on retrievers' cross-topic generalizability, we curate and release an academic retrieval dataset with 18K query-results pairs in 87 topics, making it the largest topic-specific one to date.

For agents

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

get_harvested_code_for_paper("2207.07087")
get_code_for_paper("2207.07087")
have("2207.07087")

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

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

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

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

Connect an agent — have() is free.