SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2201.01549 · 2022

SPT-Code: Sequence-to-Sequence Pre-Training for Learning Source Code Representations

arXiv · PDF · Open in the Atlas

Code that ran

3 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; 0 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 0 failures of our instrument; 3 no recorded run), measured 2026-11-21; 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/2201.01549.json · badge: /api/ran/2201.01549.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
nougatca/spt-code canonical (classifier label)
classifier basis not recorded on the link
3 ran · 3 no recorded run
FunctionStatusWhere it lives
ir_metrics Ran
ran on a synthesized input
nougatca/spt-code/sources/eval/metrics.py
code served (permissive licence) · get_code("9ccdbe15b1958f3a")
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 torch
import numpy as np
from sklearn.metrics import precision_score, recall_score, f1_score, accuracy_score

# Set seed for reproducibility
torch.manual_seed(0)

# Create valid binary classification references and candidates
# Both must be lists of 0s and 1s
references = [1, 0, 1, 1, 0, 1, 0, 0]
candidates = [1, 0, 1, 0, 0, 1, 1, 0]

ARGS = {
    'references': references,
    'candidates': candidates
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn, 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
run_eval Ran
ran on a synthesized input
nougatca/spt-code/sources/downstream_tasks/search.py
code served (permissive licence) · get_code("1646803daed79ebe")
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 torch
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

class MockVocab:
    def get_eos_index(self):
        return 2

class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 5)
    
    def forward(self, input_ids, attention_mask, labels, decoder_attention_mask, return_dict=True, output_hidden_states=True):
        batch_size = input_ids.size(0)
        seq_len = input_ids.size(1)
        hidden_dim = 5
        
        decoder_hidden = torch.randn(batch_size, seq_len, hidden_dim)
        
        class MockOutput:
            def __init__(self, hidden_states):
                self.decoder_hidden_states = hidden_states
        
        return MockOutput([decoder_hidden, decoder_hidden])

def create_batch(batch_size=2, seq_len=3, eos_idx=2):
    input_ids = torch.randint(0, 10, (batch_size, seq_len))
    input_ids[:, -1] = eos_idx
    attention_mask = torch.ones(batch_size, seq_len)
    urls = [f"url_{i}" for i in range(batch_size)]
    return {
        'input_ids': input_ids,
        'attention_mask': attention_mask,
        'urls': urls
    }

query_dataloader = [create_batch(2, 3) for _ in range(1)]
codebase_dataloader = [create_batch(2, 3) for _ in range(1)]

ARGS = {
    'args': type('Args', (), {})(),
    'model': MockModel(),
    'query_dataloader': query_dataloader,
    'codebase_dataloader': codebase_dataloader,
    'code_vocab': MockVocab(),
    'nl_vocab': MockVocab(),
    'split': 'valid',
    'epoch': 1
}
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
transfer_arg_name Ran
ran on a synthesized input
nougatca/spt-code/sources/args.py
code served (permissive licence) · get_code("2ac804bb1bee5821")
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

def transfer_arg_name(name):
    return '--' + name.replace('_', '-')

ARGS = {
    'name': 'example_parameter_name'
}
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
avg_ir_metrics Not yet run
unverified (harvested, no recorded run)
nougatca/spt-code/sources/eval/metrics.py
code served (permissive licence) · get_code("6ff490d86a628905")
How it ran

no invocation recorded.

inputs_to_cuda Not yet run
unverified (harvested, no recorded run)
nougatca/spt-code/sources/models/utils.py
code served (permissive licence) · get_code("37d5e92e475ada09")
How it ran

no invocation recorded.

remove_white_characters Not yet run
unverified (harvested, no recorded run)
nougatca/spt-code/sources/eval/metrics.py
code served (permissive licence) · get_code("14a264bdefb0717c")
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, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 5 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
transfer_arg_name 1 other paper
1 later
2024.findings-emnlp.621 (2024 (year only))
Code Membership Inference for Detecting Unauthorized Data Use in Code Pre-trained Language Models

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

Repositories linked to this paper

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

Abstract

Recent years have seen the successful application of large pre-trained models to code representation learning, resulting in substantial improvements on many code-related downstream tasks. But there are issues surrounding their application to SE tasks. First, the majority of the pre-trained models focus on pre-training only the encoder of the Transformer. For generation tasks that are addressed using models with the encoder-decoder architecture, however, there is no reason why the decoder should be left out during pre-training. Second, many existing pre-trained models, including state-of-the-art models such as T5-learning, simply reuse the pre-training tasks designed for natural languages. Moreover, to learn the natural language description of source code needed eventually for code-related tasks such as code summarization, existing pre-training tasks require a bilingual corpus composed of source code and the associated natural language description, which severely limits the amount of data for pre-training. To this end, we propose SPT-Code, a sequence-to-sequence pre-trained model for source code. In order to pre-train SPT-Code in a sequence-to-sequence manner and address the aforementioned weaknesses associated with existing pre-training tasks, we introduce three pre-training tasks that are specifically designed to enable SPT-Code to learn knowledge of source code, the corresponding code structure, as well as a natural language description of the code without relying on any bilingual corpus, and eventually exploit these three sources of information when it is applied to downstream tasks. Experimental results demonstrate that SPT-Code achieves state-of-the-art performance on five code-related downstream tasks after fine-tuning.

For agents

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

get_harvested_code_for_paper("2201.01549")
get_code_for_paper("2201.01549")
have("2201.01549")

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

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

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

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

Connect an agent — have() is free.