SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.01691 · ICLR · 2024

Zero-Shot Continuous Prompt Transfer: Generalizing Task Semantics Across Language Models

Lili Mou, Zijun Wu, Yongkang Wu

arXiv · PDF · Open in the Atlas

Code that ran

6 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; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 6 failures of our instrument; 1 no recorded run), measured 2026-11-23; 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/2310.01691.json · badge: /api/ran/2310.01691.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
manga-uofa/ptfer canonical (classifier label)
classifier basis: classifier_2025
6 ran · 1 no recorded run
FunctionStatusWhere it lives
build_vocab Ran
ran; our contract draft was wrong, not the code
manga-uofa/ptfer/rel2abs_util.py
code served (permissive licence) · get_code("ead1e18ac3c34c55")
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 tuple. 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

class MockTokenizer:
    def __init__(self):
        self.vocab = {
            "hello": 0,
            "world": 1,
            "test": 2,
            "pytorch": 3,
            "[UNK]": 4,
            "[PAD]": 5
        }
    
    def get_vocab(self):
        return self.vocab

tokenizer = MockTokenizer()

ARGS = {
    "tokenizer": tokenizer
}
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 tuple — a tuple output has no array shape of its own; none is 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
get_model_tokenizer Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
manga-uofa/ptfer/rel2abs_util.py
code served (permissive licence) · get_code("2362a13baa9e9ffb")
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 tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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
from unittest.mock import MagicMock
from transformers import RobertaConfig, RobertaTokenizer, RobertaModel

torch.manual_seed(0)

# Create a simple mock model_name
model_name = "roberta-base"

# The function calls AutoConfig.from_pretrained(model_name) and checks isinstance
# We need to mock this to return a valid config without downloading
# Since we can't actually download, we'll use a real small config

# Create a minimal RobertaConfig
config = RobertaConfig(
    vocab_size=1000,
    hidden_size=64,
    num_hidden_layers=2,
    num_attention_heads=2,
    intermediate_size=128,
    max_position_embeddings=512,
)

# Create a minimal RobertaTokenizer (mock)
tokenizer = MagicMock(spec=RobertaTokenizer)
tokenizer.__class__ = RobertaTokenizer

# Create a minimal RobertaModel (mock)
base_model = MagicMock(spec=RobertaModel)
base_model.__class__ = RobertaModel

# Patch the from_pretrained methods to return our objects without network access
import transformers
original_auto_config = transformers.AutoConfig.from_pretrained
original_roberta_tokenizer = RobertaTokenizer.from_pretrained
original_roberta_model = RobertaModel.from_pretrained

def mock_auto_config(model_name):
    return config

def mock_roberta_tokenizer(model_name):
    return tokenizer

def mock_roberta_model(model_name):
    return base_model

transformers.AutoConfig.from_pretrained = mock_auto_config
RobertaTokenizer.from_pretrained = mock_roberta_tokenizer
RobertaModel.from_pretrained = mock_roberta_model

ARGS = {
    "model_name": "roberta-base"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
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
get_new_token Ran
ran; our contract draft was wrong, not the code
manga-uofa/ptfer/gpt_code/run_optiprompt_gpt.py
code served (permissive licence) · get_code("bd56b56f8b83a772")
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) and returned str. 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 numpy as np

MAX_NUM_VECTORS = 10

def get_new_token(vid):
    assert vid > 0 and vid <= MAX_NUM_VECTORS
    return '[V%d]' % vid

ARGS = {
    'vid': 5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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_template Ran
ran; our contract draft was wrong, not the code
manga-uofa/ptfer/gpt_code/run_optiprompt_gpt.py
code served (permissive licence) · get_code("25892385a6c19443")
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) and returned str. 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 numpy as np

class Args:
    def __init__(self):
        self.init_manual_template = False
        self.num_vectors = 3

ARGS = {
    'args': Args()
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
select_random_samples Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
manga-uofa/ptfer/rel2abs_util.py
code served (permissive licence) · get_code("0531f7a649f4aece")
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 (2, 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 numpy as np

# Create a matrix with shape (5, 4)
# 5 rows (samples), 4 columns (features/embeddings)
matrix = np.array([
    [1.0, 2.0, 3.0, 4.0],
    [5.0, 6.0, 7.0, 8.0],
    [9.0, 10.0, 11.0, 12.0],
    [13.0, 14.0, 15.0, 16.0],
    [17.0, 18.0, 19.0, 20.0]
], dtype=np.float32)

# Create indices array with shape (2,)
# These are row indices to select from the matrix
indices = np.array([1, 3], dtype=np.int64)

ARGS = {
    "matrix": matrix,
    "indices": indices
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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 (2, 4) — shape (2, 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
vocab_cleaning Ran
ran; our contract draft was wrong, not the code
manga-uofa/ptfer/rel2abs_util.py
code served (permissive licence) · get_code("e8706736226f9587")
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 list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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)

# vocab_cleaning takes a vocab parameter which is a list of tokens (strings)
# The function processes each token by replacing special characters
# So we need a list of strings containing the characters that will be replaced

vocab = [
    "Ġhello",
    "▁world",
    "Ġtest▁token",
    "normal",
    "Ġ▁mixed"
]

ARGS = {
    "vocab": vocab
}
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 list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
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
get_abs_anchors Not yet run
unverified (harvested, no recorded run)
manga-uofa/ptfer/rel2abs_util.py
code served (permissive licence) · get_code("b8e969454cbb6b8f")
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, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 0 later) and 6 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_new_token 1 other paper
1 dated earlier
2109.07154 (2021-09)
Can Language Models be Biomedical Knowledge Bases?

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-23.

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 in natural language processing (NLP) has become an increasingly popular method for adapting large language models to specific tasks. However, the transferability of these prompts, especially continuous prompts, between different models remains a challenge. In this work, we propose a zero-shot continuous prompt transfer method, where source prompts are encoded into a relative space and the corresponding target prompts are searched for transferring to target models. Experimental results confirm the effectiveness of our method, showing that "task semantics" in continuous prompts can be generalized across various language models. Moreover, we find that combining "task semantics" from multiple source models can further enhance the performance of transfer. 1

For agents

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

get_harvested_code_for_paper("2310.01691")
get_code_for_paper("2310.01691")
have("2310.01691")

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

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

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

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

Connect an agent — have() is free.