SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2207.11680 · 2022

No More Fine-Tuning? An Experimental Evaluation of Prompt Tuning in Code Intelligence

arXiv · PDF · Open in the Atlas

Code that ran

7 of 14 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 2 have no contract verdict; 5 failures of our instrument; 7 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/2207.11680.json · badge: /api/ran/2207.11680.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
adf1178/pt4code canonical (classifier label)
classifier basis not recorded on the link
7 ran · 7 no recorded run
FunctionStatusWhere it lives
add_lang_by_task Ran
ran; our contract draft was wrong, not the code
adf1178/pt4code/CodeT5-main/_utils.py
code served (permissive licence) · get_code("2e3e72e1e860afb2")
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 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

ARGS = {
    'target_str': 'This is a test string',
    'task': 'summarize',
    'sub_task': 'java-cs'
}
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 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
convert_clone_examples_to_features Ran
ran; our contract draft was wrong, not the code
adf1178/pt4code/CodeT5-main/_utils.py
code served (permissive licence) · get_code("08ffc47da0ae6767")
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 CloneInputFeatures. 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
from transformers import AutoTokenizer

torch.manual_seed(0)

class MockExample:
    def __init__(self, source, target, label, url1, url2):
        self.source = source
        self.target = target
        self.label = label
        self.url1 = url1
        self.url2 = url2

class MockArgs:
    def __init__(self):
        self.model_type = 'codet5'
        self.add_task_prefix = True
        self.task = 'clone_detection'
        self.max_source_length = 16

class MockTokenizer:
    def encode(self, text, max_length=None, padding=None, truncation=None):
        tokens = [101] + [i % 100 + 1000 for i in range(min(len(text), max_length - 2 if max_length else len(text)))] + [102]
        if max_length:
            if len(tokens) < max_length:
                tokens = tokens + [0] * (max_length - len(tokens))
            else:
                tokens = tokens[:max_length]
        return tokens

example = MockExample(
    source="int foo(int x) { return x + 1; }",
    target="int bar(int y) { return y + 1; }",
    label=1,
    url1="http://example.com/code1",
    url2="http://example.com/code2"
)

example_index = 0
tokenizer = MockTokenizer()
args = MockArgs()

item = (example, example_index, tokenizer, args)

ARGS = {
    'item': item
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type CloneInputFeatures — a CloneInputFeatures output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a CloneInputFeatures 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
convert_examples_to_features Ran
ran; our contract draft was wrong, not the code
adf1178/pt4code/CodeT5-main/_utils.py
code served (permissive licence) · get_code("70674cae33ae9c61")
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 InputFeatures. 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
from transformers import T5Tokenizer

# Create a minimal example class
class Example:
    def __init__(self, source, target, url=None):
        self.source = source
        self.target = target
        self.url = url

# Create a minimal args class
class Args:
    def __init__(self):
        self.model_type = 't5'
        self.add_task_prefix = True
        self.task = 'summarize'
        self.sub_task = 'none'
        self.max_source_length = 128
        self.max_target_length = 64
        self.add_lang_ids = True

# Create a minimal tokenizer stand-in
class MinimalTokenizer:
    def __init__(self):
        self.eos_token_id = 1
        self.pad_token_id = 0
    
    def encode(self, text, max_length=128, padding='max_length', truncation=True):
        # Return a list of token ids with exactly one eos_token_id at the end
        tokens = [2] * (max_length - 1) + [self.eos_token_id]
        return tokens

# Create example instance
example = Example(
    source="def hello(): pass",
    target="This function says hello",
    url="http://example.com"
)

# Create args instance
args = Args()

# Create tokenizer
tokenizer = MinimalTokenizer()

ARGS = {
    'item': (
        example,
        0,
        tokenizer,
        args,
        'train'
    )
}
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 InputFeatures — a InputFeatures output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a InputFeatures 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
count_ngrams Ran
ran; our contract draft was wrong, not the code
adf1178/pt4code/summarization/bleu.py
code served (permissive licence) · get_code("835fca2953749b59")
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 dict. 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

torch.manual_seed(0)

# The function count_ngrams takes:
# - words: a sequence of items (strings, tokens, etc.)
# - n: an integer specifying the maximum n-gram size

# Create a simple list of words
words = ["the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"]

# Create the ARGS dictionary with all parameters
ARGS = {
    "words": words,
    "n": 4
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
evaluate Ran
ran on a synthesized input
adf1178/pt4code/CodeT5-main/run_defect.py
code served (permissive licence) · get_code("7162c6b07c0d21f6")
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 dict. 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 os
import logging
import numpy as np
import torch
import torch.nn as nn
from torch.utils.data import TensorDataset

torch.manual_seed(0)
logging.basicConfig(level=logging.INFO)

# Create a minimal model that matches the function's usage
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)
    
    def forward(self, inputs, labels):
        # Returns (loss, logits)
        logits = self.linear(inputs)
        loss = torch.nn.functional.cross_entropy(logits, labels)
        return loss, logits

# Create minimal eval examples (with idx attribute)
class EvalExample:
    def __init__(self, idx):
        self.idx = idx

# Create args object
class Args:
    def __init__(self):
        self.eval_batch_size = 2
        self.device = 'cpu'
        self.output_dir = '/tmp'

args = Args()

# Create a minimal model
model = MinimalModel()

# Create eval examples
eval_examples = [EvalExample(0), EvalExample(1), EvalExample(2), EvalExample(3)]

# Create eval data - TensorDataset with (inputs, labels)
# batch_size=2, so we need 4 samples; inputs shape (4, 4), labels shape (4,)
inputs = torch.randn(4, 4)
labels = torch.randint(0, 2, (4,))
eval_data = TensorDataset(inputs, labels)

ARGS = {
    'args': args,
    'model': model,
    'eval_examples': eval_examples,
    'eval_data': eval_data,
    'write_to_pred': False
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
get_model_size Ran
ran; our contract draft was wrong, not the code
adf1178/pt4code/CodeT5-main/models.py
code served (permissive licence) · get_code("8cfe38019e9d6a49")
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 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 torch.nn as nn
import numpy as np

torch.manual_seed(0)

# Create a minimal model with some trainable parameters
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

model = SimpleModel()

ARGS = {
    'model': model
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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
read_examples Ran
ran on a synthesized input
adf1178/pt4code/defect/finetune/finetune_t5.py
code served (permissive licence) · get_code("90c23ee13a3e7488")
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 json
import tempfile
import os

# Create a temporary file with test data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.jsonl', encoding='utf-8')
temp_filename = temp_file.name

# Write test data
test_data = [
    json.dumps({'func': 'def foo(): pass', 'target': 1}),
    json.dumps({'func': 'def bar(): return 42', 'target': 0}),
]

for line in test_data:
    temp_file.write(line + '\n')

temp_file.close()

ARGS = {
    'filename': temp_filename
}
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 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
add_args Not yet run
unverified (harvested, no recorded run)
adf1178/pt4code/CodeT5-main/configs.py
code served (permissive licence) · get_code("504a7d87c9b11731")
How it ran

no invocation recorded.

build_or_load_gen_model Not yet run
unverified (harvested, no recorded run)
adf1178/pt4code/CodeT5-main/models.py
code served (permissive licence) · get_code("eb4f6d081f695b86")
How it ran

no invocation recorded.

eval_ppl_epoch Not yet run
unverified (harvested, no recorded run)
adf1178/pt4code/CodeT5-main/run_gen.py
code served (permissive licence) · get_code("18886d59952fec97")
How it ran

no invocation recorded.

evaluate Not yet run
unverified (harvested, no recorded run)
adf1178/pt4code/CodeT5-main/run_clone.py
code served (permissive licence) · get_code("a8459dd6372165af")
How it ran

no invocation recorded.

load_and_cache_clone_data Not yet run
unverified (harvested, no recorded run)
adf1178/pt4code/CodeT5-main/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from veronicium/cmtrans, is pointer only (licence: NONE) · get_code("4dfcf272e3b5535f")
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 veronicium/cmtrans, 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. No invocation recorded.

load_and_cache_defect_data Not yet run
unverified (harvested, no recorded run)
adf1178/pt4code/CodeT5-main/utils.py
code served (permissive licence) · get_code("db9fdc88ead105ab")
How it ran

no invocation recorded.

load_and_cache_gen_data Not yet run
unverified (harvested, no recorded run)
adf1178/pt4code/CodeT5-main/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from veronicium/cmtrans, is pointer only (licence: NONE) · get_code("08e8e1fc7c5648f7")
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 veronicium/cmtrans, 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. No invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 8 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 7 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_model_size 6 other papers
2 dated earlier, 4 later
1909.09436 (2019-09)
CodeSearchNet Challenge: Evaluating the State of Semantic Code Search
2206.07796 (2022-06)
FixEval: Execution-based Evaluation of Program Fixes for Programming Problems
2305.17506 (2023-05)
Backdooring Neural Code Search
and 3 more not named here
add_lang_by_task 4 other papers
2 dated earlier, 2 later
1909.09436 (2019-09)
CodeSearchNet Challenge: Evaluating the State of Semantic Code Search
2206.07796 (2022-06)
FixEval: Execution-based Evaluation of Program Fixes for Programming Problems
2311.00317 (2023-11)
Data Augmentation for Code Translation with Comparable Corpora and Multiple References
and 1 more not named here
convert_examples_to_features 3 other papers
1 dated earlier, 2 later
2206.07796 (2022-06)
FixEval: Execution-based Evaluation of Program Fixes for Programming Problems
2311.00317 (2023-11)
Data Augmentation for Code Translation with Comparable Corpora and Multiple References
2312.04234 (2023-12)
Graph Convolutions Enrich the Self-Attention in Transformers!
count_ngrams 3 other papers
3 dated earlier
1909.09436 (2019-09)
CodeSearchNet Challenge: Evaluating the State of Semantic Code Search
1910.07517 (2019-10)
Adversarial Examples for Models of Code
2109.08365 (2021-09)
CodeQA: A Question Answering Dataset for Source Code Comprehension
build_or_load_gen_model 1 other paper
1 later
2312.04234 (2023-12)
Graph Convolutions Enrich the Self-Attention in Transformers!
convert_clone_examples_to_features 1 other paper
1 later
2312.04234 (2023-12)
Graph Convolutions Enrich the Self-Attention in Transformers!
load_and_cache_clone_data 1 other paper
1 later
2311.00317 (2023-11)
Data Augmentation for Code Translation with Comparable Corpora and Multiple References
load_and_cache_gen_data 1 other paper
1 later
2311.00317 (2023-11)
Data Augmentation for Code Translation with Comparable Corpora and Multiple References

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

Pre-trained models have been shown effective in many code intelligence tasks. These models are pre-trained on large-scale unlabeled corpus and then fine-tuned in downstream tasks. However, as the inputs to pre-training and downstream tasks are in different forms, it is hard to fully explore the knowledge of pre-trained models. Besides, the performance of fine-tuning strongly relies on the amount of downstream data, while in practice, the scenarios with scarce data are common. Recent studies in the natural language processing (NLP) field show that prompt tuning, a new paradigm for tuning, alleviates the above issues and achieves promising results in various NLP tasks. In prompt tuning, the prompts inserted during tuning provide task-specific knowledge, which is especially beneficial for tasks with relatively scarce data. In this paper, we empirically evaluate the usage and effect of prompt tuning in code intelligence tasks. We conduct prompt tuning on popular pre-trained models CodeBERT and CodeT5 and experiment with three code intelligence tasks including defect prediction, code summarization, and code translation. Our experimental results show that prompt tuning consistently outperforms fine-tuning in all three tasks. In addition, prompt tuning shows great potential in low-resource scenarios, e.g., improving the BLEU scores of fine-tuning by more than 26\% on average for code summarization. Our results suggest that instead of fine-tuning, we could adapt prompt tuning for code intelligence tasks to achieve better performance, especially when lacking task-specific data.

For agents

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

get_harvested_code_for_paper("2207.11680")
get_code_for_paper("2207.11680")
have("2207.11680")

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

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

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

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

Connect an agent — have() is free.