SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1910.00577 · 2019

Structural Language Models of Code

arXiv · PDF · Open in the Atlas

Code that ran

5 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, 0 violated it and 4 have no contract verdict; 1 failure of our instrument; 3 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/1910.00577.json · badge: /api/ran/1910.00577.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
tech-srl/slm-code-generation canonical (classifier label)
classifier basis: census
5 ran · 3 no recorded run
FunctionStatusWhere it lives
get_immediate_files Ran
ran on a synthesized input
tech-srl/slm-code-generation/JavaExtractor/extract.py
code served (permissive licence) · get_code("99549bf0b7bd6143")
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 os
import tempfile
import shutil

# Create a temporary directory with some test files
temp_dir = tempfile.mkdtemp()

# Create some test files in the temporary directory
test_files = ["file1.txt", "file2.py", "file3.dat"]
for filename in test_files:
    filepath = os.path.join(temp_dir, filename)
    with open(filepath, 'w') as f:
        f.write("test content")

# Create a subdirectory (which should not be returned as it's not a file)
subdir = os.path.join(temp_dir, "subdir")
os.makedirs(subdir, exist_ok=True)

ARGS = {
    "dir": temp_dir
}
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_immediate_subdirectories Ran
ran on a synthesized input
tech-srl/slm-code-generation/JavaExtractor/extract.py
code served (permissive licence) · get_code("94cb8d60c8256a0a")
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 os
import tempfile
import shutil

# Create a temporary directory with subdirectories for testing
temp_dir = tempfile.mkdtemp()

# Create some subdirectories
subdir1 = os.path.join(temp_dir, "subdir1")
subdir2 = os.path.join(temp_dir, "subdir2")
subdir3 = os.path.join(temp_dir, "subdir3")

os.makedirs(subdir1, exist_ok=True)
os.makedirs(subdir2, exist_ok=True)
os.makedirs(subdir3, exist_ok=True)

# Create a file (not a directory) to ensure it's filtered out
file_path = os.path.join(temp_dir, "file.txt")
with open(file_path, "w") as f:
    f.write("test")

ARGS = {
    "a_dir": temp_dir
}
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
make_example Ran
ran on a synthesized input
tech-srl/slm-code-generation/preprocess.py
code served (permissive licence) · get_code("535af502a418b7ff")
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 bytes. 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 tensorflow as tf

MAX_CONTEXTS = 2
MAX_INTERNAL_PATHS = 2
MAX_PATH_LENGTH = 3
MAX_RELATIVE_PATH_LENGTH = 2

obj = {
    'num_targets': 5,
    'num_nodes': 10,
    'head_child_id': 1,
    'linearized_tree': 'FunctionDeclaration(name=foo, params=[x, y])',
    'filepath': '/path/to/file.py',
    'line': 42,
    'targets': ['target1', 'target2', 'target3'],
    'is_token': [1, 0, 1],
    'target_child_id': [2, 3, 4],
    'relative_paths': [
        {
            'nodes': [
                {'node': ('Identifier', 0)},
                {'node': ('VarDecl', 1)},
                {'node': ('Block', 2)},
            ]
        },
        {
            'nodes': [
                {'node': ('Call', 0)},
                {'node': ('Argument', 1)},
            ]
        },
    ],
    'internal_paths': [
        [
            {
                'sources': ['sub1', 'sub2'],
                'nodes': [
                    {'node': ('NodeA', 0)},
                    {'node': ('NodeB', 1)},
                    {'node': ('NodeC', 2)},
                ]
            },
            {
                'sources': ['sub3'],
                'nodes': [
                    {'node': ('NodeD', 0)},
                ]
            },
        ],
        [
            {
                'sources': ['sub4', 'sub5', 'sub6'],
                'nodes': [
                    {'node': ('NodeE', 1)},
                    {'node': ('NodeF', 2)},
                ]
            },
        ],
        [
            {
                'sources': ['sub7'],
                'nodes': [
                    {'node': ('NodeG', 0)},
                    {'node': ('NodeH', 1)},
                    {'node': ('NodeI', 2)},
                    {'node': ('NodeJ', 3)},
                ]
            },
        ],
    ],
    'head_paths': [
        {
            'sources': ['head1', 'head2'],
            'nodes': [
                {'node': ('HeadNodeA', 0)},
                {'node': ('HeadNodeB', 1)},
            ]
        },
        {
            'sources': ['head3'],
            'nodes': [
                {'node': ('HeadNodeC', 0)},
                {'node': ('HeadNodeD', 1)},
                {'node': ('HeadNodeE', 2)},
            ]
        },
        {
            'sources': ['head4', 'head5'],
            'nodes': [
                {'node': ('HeadNodeF', 0)},
            ]
        },
    ],
    'head_root_path': {
        'nodes': [
            {'node': ('RootA', 0)},
            {'node': ('RootB', 1)},
            {'node': ('RootC', 2)},
            {'node': ('RootD', 3)},
        ]
    }
}

ARGS = {
    'obj': obj
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bytes — a bytes output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a bytes 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
split_subtokens Ran
ran; our contract draft was wrong, not the code
tech-srl/slm-code-generation/baselines/prep_baseline.py
code served (permissive licence) · get_code("f9002ff6f18c407d")
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

RE_WORDS = re.compile('\n    # Find words in a string. Order matters!\n    [A-Z]+(?=[A-Z][a-z]) |  # All upper case before a capitalized word\n    [A-Z]?[a-z]+ |  # Capitalized words / all lower case\n    [A-Z]+ |  # All upper case\n    \\d+ | # Numbers\n    _ |\n    \\" |\n    .+\n', re.VERBOSE)

def split_subtokens(str):
    return [subtok for subtok in RE_WORDS.findall(str) if not subtok == '_']

ARGS = {
    'str': 'camelCaseExample_with123Numbers'
}
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
subtokenize_tree Ran
ran on a synthesized input
tech-srl/slm-code-generation/baselines/prep_baseline.py
code served (permissive licence) · get_code("2da202e46aefd959")
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

TREE_SPLIT = re.compile('([(),])')

def subtokenize_tree(s):
    return ' '.join([sub for sub in re.split(TREE_SPLIT, s) if len(sub) > 0])

ARGS = {
    's': '(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
ParallelExtractDir Not yet run
unverified (harvested, no recorded run)
tech-srl/slm-code-generation/JavaExtractor/extract.py
code served (permissive licence) · get_code("0e3bd17b6b88ea45")
How it ran

no invocation recorded.

make_example_and_histograms Not yet run
unverified (harvested, no recorded run)
tech-srl/slm-code-generation/preprocess.py
code served (permissive licence) · get_code("25eb72be1587171b")
How it ran

no invocation recorded.

make_example_from_line Not yet run
unverified (harvested, no recorded run)
tech-srl/slm-code-generation/preprocess.py
code served (permissive licence) · get_code("343969d3f1436f23")
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, 2 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 2 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_immediate_subdirectories 1 other paper
1 the same month
1910.07517 (2019-10)
Adversarial Examples for Models of Code
split_subtokens 1 other paper
1 the same month
1910.07517 (2019-10)
Adversarial Examples for Models of Code

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

We address the problem of any-code completion - generating a missing piece of source code in a given program without any restriction on the vocabulary or structure. We introduce a new approach to any-code completion that leverages the strict syntax of programming languages to model a code snippet as a tree - structural language modeling (SLM). SLM estimates the probability of the program's abstract syntax tree (AST) by decomposing it into a product of conditional probabilities over its nodes. We present a neural model that computes these conditional probabilities by considering all AST paths leading to a target node. Unlike previous techniques that have severely restricted the kinds of expressions that can be generated in this task, our approach can generate arbitrary code in any programming language. Our model significantly outperforms both seq2seq and a variety of structured approaches in generating Java and C# code. Our code, data, and trained models are available at http://github.com/tech-srl/slm-code-generation/ . An online demo is available at http://AnyCodeGen.org .

For agents

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

get_harvested_code_for_paper("1910.00577")
get_code_for_paper("1910.00577")
have("1910.00577")

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

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

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

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

Connect an agent — have() is free.