SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2006.03511 · 2020

Unsupervised Translation of Programming Languages

arXiv · PDF · Open in the Atlas

Code that ran

7 of 8 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, 1 violated it and 5 have no contract verdict; 1 failure of our instrument; 1 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/2006.03511.json · badge: /api/ran/2006.03511.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
code-desc/codesc community (classifier label)
classifier basis not recorded on the link
7 ran · 1 no recorded run
FunctionStatusWhere it lives
create_sample Ran
ran on a synthesized input
code-desc/codesc/Dataset_Preparation/Preprocess_CSN.py
code served (permissive licence) · get_code("cb64b0975f6c0461")
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

torch.manual_seed(0)

sample_id = "sample_001"
tokenized_code = "public void calculateSum ( int a , int b ) { return a + b ; }"
tokenized_nl = "This function calculates the sum of two integers and returns the result"
partition = "train"

ARGS = {
    "sample_id": sample_id,
    "tokenized_code": tokenized_code,
    "tokenized_nl": tokenized_nl,
    "partition": partition
}
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 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
override_model_args Ran
ran; our contract draft was wrong, not the code
code-desc/codesc/CodeSummarization/c2nl/config.py
code served (permissive licence) · get_code("c77d305475488a3d")
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 Namespace. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 logging

logging.basicConfig(level=logging.INFO)

# Create two argparse.Namespace objects with different values for some keys
old_namespace = argparse.Namespace(
    optimizer='sgd',
    fix_embeddings=False,
    learning_rate=0.001,
    momentum=0.9,
    weight_decay=0.0001,
    rnn_padding=True,
    dropout_rnn=0.3,
    dropout=0.2,
    dropout_emb=0.1,
    cuda=False,
    grad_clipping=5.0,
    lr_decay=0.99,
    warmup_steps=100,
    num_epochs=10,
    parallel=False,
    model_name='bert',
    hidden_size=256,
    num_layers=2,
    vocab_size=1000
)

new_namespace = argparse.Namespace(
    optimizer='adam',
    fix_embeddings=True,
    learning_rate=0.01,
    momentum=0.85,
    weight_decay=0.0005,
    rnn_padding=False,
    dropout_rnn=0.4,
    dropout=0.25,
    dropout_emb=0.15,
    cuda=True,
    grad_clipping=10.0,
    lr_decay=0.95,
    warmup_steps=200,
    num_epochs=20,
    parallel=True
)

ARGS = {
    'old_args': old_namespace,
    'new_args': new_namespace
}
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 Namespace — a Namespace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Namespace 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
str2bool Ran
ran, violated the contract we drafted
code-desc/codesc/CodeSummarization/c2nl/config.py
code served (permissive licence) · get_code("8c0dec327bfce0f2")
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 bool, ndim 0, dtype family float, shape () 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

ARGS = {
    'v': 'true'
}
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 bool, ndim 0, dtype family float, shape () — shape () 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
str_int_str_case_tokenizer Ran
ran on a synthesized input
code-desc/codesc/Tokenizer/CodePreprocess_final.py
code served (permissive licence) · get_code("81cd041092327b37")
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 re

def tokenize_with_str_int_str(token):
    p = re.compile('([a-zA-Z]+)(\\d+)([a-zA-Z]+)(\\d+)([a-zA-Z]+)|([a-zA-Z]{2,})(\\d+)([a-zA-Z]+)(\\d+)|([a-zA-Z]{2,})(\\d+)([a-zA-Z]+)|([a-zA-Z]\\d+)([a-zA-Z]+)(\\d+)|([a-zA-Z]\\d+)([a-zA-Z]+)|([a-zA-Z]{2,})(\\d+)')
    matches = p.finditer(token)
    ls = []
    for m in matches:
        l = len(m.groups()) + 1
        temp = [m.group(i) for i in range(1, l) if m.group(i) != None]
        ls.extend(temp)
    if len(ls) == 0:
        ls.append(token)
    return ls

def str_int_str_case_tokenizer(code):
    tokens = code.split()
    tokenized = []
    for token in tokens:
        tokenized.extend(tokenize_with_str_int_str(token))
    return ' '.join(tokenized)

ARGS = {
    "code": "a1b2c d5e f2g3h"
}
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 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
str_int_str_case_tokenizer Ran
ran on a synthesized input
code-desc/codesc/Tokenizer/NLPreprocess_final.py
code served (permissive licence) · get_code("002866c5d9bea425")
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 re

def tokenize_with_str_int_str(token):
    p = re.compile('([a-zA-Z]+)(\\d+)([a-zA-Z]+)(\\d+)([a-zA-Z]+)|([a-zA-Z]{2,})(\\d+)([a-zA-Z]+)(\\d+)|([a-zA-Z]{2,})(\\d+)([a-zA-Z]+)|([a-zA-Z]\\d+)([a-zA-Z]+)(\\d+)|([a-zA-Z]\\d+)([a-zA-Z]+)|([a-zA-Z]{2,})(\\d+)')
    matches = p.finditer(token)
    ls = []
    for m in matches:
        l = len(m.groups()) + 1
        temp = [m.group(i) for i in range(1, l) if m.group(i) != None]
        ls.extend(temp)
    if len(ls) == 0:
        ls.append(token)
    return ls

def str_int_str_case_tokenizer(nl):
    tokens = nl.split()
    tokenized = []
    for token in tokens:
        tokenized.extend(tokenize_with_str_int_str(token))
    return ' '.join(tokenized)

# Test cases that exercise the regex patterns
test_input_1 = "abc123def456ghi"
test_input_2 = "ab12cd34"
test_input_3 = "xy56zw"
test_input_4 = "a1bc23"
test_input_5 = "a1bc"
test_input_6 = "ab78"
test_input_7 = "hello world test123case"

ARGS = {
    "nl": "abc123def456ghi ab12cd34 xy56zw a1bc23 a1bc ab78 hello world"
}
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 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
tokenize_with_snake_case Ran
ran on a synthesized input
code-desc/codesc/Tokenizer/CodePreprocess_final.py
code served (permissive licence) · get_code("d1365e142f9912b3")
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

def tokenize_with_snake_case(token):
    return token.split('_')

ARGS = {
    'token': 'hello_world_test'
}
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
tokenize_with_str_int_str Ran
ran on a synthesized input
code-desc/codesc/Tokenizer/CodePreprocess_final.py
code served (permissive licence) · get_code("925b4c4f3d361730")
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 re

def tokenize_with_str_int_str(token):
    p = re.compile('([a-zA-Z]+)(\\d+)([a-zA-Z]+)(\\d+)([a-zA-Z]+)|([a-zA-Z]{2,})(\\d+)([a-zA-Z]+)(\\d+)|([a-zA-Z]{2,})(\\d+)([a-zA-Z]+)|([a-zA-Z]\\d+)([a-zA-Z]+)(\\d+)|([a-zA-Z]\\d+)([a-zA-Z]+)|([a-zA-Z]{2,})(\\d+)')
    matches = p.finditer(token)
    ls = []
    for m in matches:
        l = len(m.groups()) + 1
        temp = [m.group(i) for i in range(1, l) if m.group(i) != None]
        ls.extend(temp)
    if len(ls) == 0:
        ls.append(token)
    return ls

ARGS = {
    "token": "abc123def456ghi"
}
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
get_model_args Not yet run
unverified (harvested, no recorded run)
code-desc/codesc/CodeSummarization/c2nl/config.py
code served (permissive licence) · get_code("d04ac70d96d9c8bd")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 8 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 8 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
str2bool 5 other papers
1 dated earlier, 4 later
1905.05733 (2019-05)
Multi-step Retriever-Reader Interaction for Scalable Open-domain Question Answering
2010.03009 (2020-10)
GATE: Graph Attention Transformer Encoder for Cross-lingual Relation and Event Extraction
2021.acl-long.164 (2021 (year only))
BERTAC: Enhancing Transformer-based Language Models with Adversarially Pretrained Convolutional Neural Networks
and 2 more not named here
override_model_args 2 other papers
2 later
2021.acl-long.164 (2021 (year only))
BERTAC: Enhancing Transformer-based Language Models with Adversarially Pretrained Convolutional Neural Networks
2105.14220 (2021-05)
CoDesc: A Large Code-Description Parallel Dataset
create_sample 1 other paper
1 later
2105.14220 (2021-05)
CoDesc: A Large Code-Description Parallel Dataset
get_model_args 1 other paper
1 later
2105.14220 (2021-05)
CoDesc: A Large Code-Description Parallel Dataset
str_int_str_case_tokenizer 1 other paper
1 later
2105.14220 (2021-05)
CoDesc: A Large Code-Description Parallel Dataset
str_int_str_case_tokenizer 1 other paper
1 later
2105.14220 (2021-05)
CoDesc: A Large Code-Description Parallel Dataset
tokenize_with_snake_case 1 other paper
1 later
2105.14220 (2021-05)
CoDesc: A Large Code-Description Parallel Dataset
tokenize_with_str_int_str 1 other paper
1 later
2105.14220 (2021-05)
CoDesc: A Large Code-Description Parallel Dataset

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

A transcompiler, also known as source-to-source translator, is a system that converts source code from a high-level programming language (such as C++ or Python) to another. Transcompilers are primarily used for interoperability, and to port codebases written in an obsolete or deprecated language (e.g. COBOL, Python 2) to a modern one. They typically rely on handcrafted rewrite rules, applied to the source code abstract syntax tree. Unfortunately, the resulting translations often lack readability, fail to respect the target language conventions, and require manual modifications in order to work properly. The overall translation process is timeconsuming and requires expertise in both the source and target languages, making code-translation projects expensive. Although neural models significantly outperform their rule-based counterparts in the context of natural language translation, their applications to transcompilation have been limited due to the scarcity of parallel data in this domain. In this paper, we propose to leverage recent approaches in unsupervised machine translation to train a fully unsupervised neural transcompiler. We train our model on source code from open source GitHub projects, and show that it can translate functions between C++, Java, and Python with high accuracy. Our method relies exclusively on monolingual source code, requires no expertise in the source or target languages, and can easily be generalized to other programming languages. We also build and release a test set composed of 852 parallel functions, along with unit tests to check the correctness of translations. We show that our model outperforms rule-based commercial baselines by a significant margin.

For agents

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

get_harvested_code_for_paper("2006.03511")
get_code_for_paper("2006.03511")
have("2006.03511")

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

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

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

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

Connect an agent — have() is free.