SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2302.08468 · ICML · 2023

LEVER: Learning to Verify Language-to-Code Generation with Execution

Wen-Tau Yih, Victoria Xi, Lin, Dragomir Radev, Sida Wang, Ansong Ni, Srini Iyer, Ves Stoyanov, Ver Prob

arXiv · PDF · Open in the Atlas

Code that ran

18 of 22 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, 2 violated it and 12 have no contract verdict; 4 failures of our instrument; 4 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/2302.08468.json · badge: /api/ran/2302.08468.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
niansong1996/lever canonical (classifier label)
classifier basis not recorded on the link
18 ran · 4 no recorded run
FunctionStatusWhere it lives
byte_idx_to_char_idx Ran
ran on a synthesized input
niansong1996/lever/execution/program_tracing.py
code served (permissive licence) · get_code("7e87fa354c8a130c")
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 int, ndim 0, dtype family int, 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
import numpy as np

# Test with a simple ASCII string and byte index
byte_idx = 5
line = "hello world"

ARGS = {
    "byte_idx": byte_idx,
    "line": line,
}
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 int, ndim 0, dtype family int, 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
canonicalize_var_dict Ran
ran on a synthesized input
niansong1996/lever/execution/safe_execution_util.py
code served (permissive licence) · get_code("5601a3dc0fc200e8")
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
import re
from types import ModuleType

torch.manual_seed(0)

# Create a simple test variable dictionary with various types
var_dict = {
    'tensor_var': torch.randn(2, 4),
    'numpy_int': np.int64(42),
    'list_var': [1, 2, 3],
    'dict_var': {'a': 1, 'b': 2},
    'string_var': 'hello',
    'int_var': 10,
    'float_var': 3.14,
    'callable_var': lambda x: x + 1,
    'regex_match': re.match(r'\d+', '123abc'),
    'map_var': map(lambda x: x * 2, [1, 2, 3]),
    'module_var': torch,
}

ARGS = {
    'var_dict': var_dict
}
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 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
direct_categorize Ran
ran on a synthesized input
niansong1996/lever/execution/spider_execution.py
code served (permissive licence) · get_code("51262b43d9045912")
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
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    "example": {
        "category": "positive"
    }
}
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
estimate_pass_at_k Ran
ran on a synthesized input
niansong1996/lever/few_shot/codex.py
code served (permissive licence) · get_code("3a39b10c8a429dc8")
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 float64, ndim 0, 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 numpy as np

# estimate_pass_at_k takes three integer parameters: n, c, k
# n: total number of samples
# c: number of correct samples
# k: k in pass@k

# Set up reasonable test values
# Let's use: n=100 total samples, c=80 correct samples, k=5
n = 100
c = 80
k = 5

ARGS = {
    "n": n,
    "c": c,
    "k": k,
}
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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
is_number Ran
ran, violated the contract we drafted
niansong1996/lever/execution/wtq_eval.py
pointer only (licence: MIT); the stored copy get_code serves, from RikVN/AMR, is pointer only (licence: NONE) · get_code("e18607dae38b30e2")
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 RikVN/AMR, 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. A run is recorded.

join_tokens Ran
ran; our contract draft was wrong, not the code
niansong1996/lever/execution/parse.py
code served (permissive licence) · get_code("2178b95c919ae420")
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.

from typing import List, Tuple, Set, Iterator, Dict, Any, Union
from collections import namedtuple

Token = namedtuple('Token', ['ttype', 'value'])

# Create a list of Token objects for testing
tokens = [
    Token(ttype='WORD', value='hello'),
    Token(ttype='SPACE', value='  '),
    Token(ttype='WORD', value='world'),
    Token(ttype='SPACE', value=' '),
    Token(ttype='WORD', value='test'),
]

ARGS = {
    'tokens': tokens
}
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
normalize Ran
ran on a synthesized input
niansong1996/lever/execution/wtq_eval.py
code served (permissive licence) · get_code("5d30efa67a78bf91")
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 sys, os, re, argparse
import unicodedata

def normalize(x):
    x = ''.join((c for c in unicodedata.normalize('NFKD', x) if unicodedata.category(c) != 'Mn'))
    x = re.sub('[''´`]', "'", x)
    x = re.sub('[""]', '"', x)
    x = re.sub('[‐‑‒–—−]', '-', x)
    while True:
        old_x = x
        x = re.sub('((?<!^)\\[[^\\]]*\\]|\\[\\d+\\]|[•♦†‡*#+])*$', '', x.strip())
        x = re.sub('(?<!^)( \\([^)]*\\))*$', '', x.strip())
        x = re.sub('^"([^"]*)"$', '\\1', x.strip())
        if x == old_x:
            break
    if x and x[-1] == '.':
        x = x[:-1]
    x = re.sub('\\s+', ' ', x, flags=re.U).lower().strip()
    return x

# The function normalize takes a single parameter x which is a string
# The function performs various string normalizations and transformations

ARGS = {
    'x': 'Hello "World" – with some normalization [1] and special chars´ like–dashes.'
}
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
openai_call Ran
ran on a synthesized input
niansong1996/lever/few_shot/codex.py
code served (permissive licence) · get_code("73683dd2b9714a13")
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 2, 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 openai
import time
from typing import List, Optional, Dict, Any, Callable, Tuple

# Create a mock completion choice object
class MockLogprobs:
    def __init__(self):
        self.token_logprobs = [[-0.5, -0.3], [-0.2, -0.8]]
        self.tokens = ["hello", "world"]

class MockChoice:
    def __init__(self, text):
        self.text = text
        self.logprobs = MockLogprobs()

class MockCompletion:
    def __init__(self, choices):
        self.choices = choices

# Mock the openai.Completion.create method
def mock_create(**kwargs):
    prompts = kwargs.get('prompt', [])
    n = kwargs.get('n', 1)
    if isinstance(prompts, str):
        prompts = [prompts]
    
    # Create n choices per prompt
    choices = []
    for i in range(len(prompts) * n):
        choices.append(MockChoice(f" Generated response {i}"))
    
    return MockCompletion(choices)

# Patch openai.Completion.create
openai.Completion.create = mock_create

# Define arguments for openai_call
ARGS = {
    'prompts': [
        "What is the capital of France?",
        "What is 2+2?"
    ],
    'engine': 'text-davinci-003',
    'max_tokens': 512,
    'temperature': 0.7,
    'top_p': 0.9,
    'n': 2,
    'best_of': 3,
    'wait_on_limit': True,
    'stop': '.',
    'get_raw_generation_results': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
openai — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, 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
pd_df_to_dict Ran
ran on a synthesized input
niansong1996/lever/execution/spider_execution.py
code served (permissive licence) · get_code("96389cb2ab61121a")
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 pandas as pd
import numpy as np

# Create a sample DataFrame with more than 5 rows to test the cutoff logic
df = pd.DataFrame({
    'col1': [1, 2, 3, 4, 5, 6, 7, 8],
    'col2': ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'],
    'col3': [1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8]
})

ARGS = {
    'df': df
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — 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
permute_tuple Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
niansong1996/lever/execution/spider_official_exec_match.py
code served (permissive licence) · get_code("f23d6ff3772963bc")
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

torch.manual_seed(0)

# The function permute_tuple takes:
# 1. element: a Tuple - can be any tuple
# 2. perm: a Tuple - should be a permutation of indices matching element length

# Create a simple tuple with 4 elements of different types
element = (1, "hello", 3.14, torch.tensor([1, 2, 3]))

# Create a permutation tuple that reorders the indices
# For a 4-element tuple, a valid permutation could be (3, 1, 0, 2)
perm = (3, 1, 0, 2)

ARGS = {
    "element": element,
    "perm": perm,
}
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
postprocess Ran
ran; our contract draft was wrong, not the code
niansong1996/lever/execution/parse.py
code served (permissive licence) · get_code("58e472cff9780d63")
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 numpy as np

torch.manual_seed(0)

# The function postprocess takes a single string parameter 'query'
# and performs string replacements on it.
# No complex objects needed - just a simple string.

ARGS = {
    'query': '> = test < = and ! = check'
}
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
python_program_len Ran
ran on a synthesized input
niansong1996/lever/execution/executors.py
code served (permissive licence) · get_code("48ddf72e21e4525b")
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 int, ndim 0, dtype family int, 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

# The function takes a code string parameter and counts non-comment, non-empty lines
# We need to construct a valid code string as input

code_string = """
def hello_world():
    # This is a comment
    print("Hello")
    x = 5
    
    # Another comment
    return x
"""

ARGS = {
    "code": code_string
}
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 int, ndim 0, dtype family int, 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
quick_rej Ran
ran, violated the contract we drafted
niansong1996/lever/execution/spider_official_exec_match.py
code served (permissive licence) · get_code("a40510ba6a37f798")
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

torch.manual_seed(0)

# Analyze the function:
# - result1: List[Tuple] - list of tuples
# - result2: List[Tuple] - list of tuples
# - order_matters: bool - determines comparison mode

# The function processes tuples through unorder_row which sorts elements
# by their string representation and type. Then it either compares lists
# directly (order_matters=True) or as sets (order_matters=False).

# Create test data with various tuple types
result1 = [
    (1, "a", 2.5),
    (10, "b", 3.5),
    (5, "c", 1.5),
]

result2 = [
    (5, "c", 1.5),
    (1, "a", 2.5),
    (10, "b", 3.5),
]

order_matters = False

ARGS = {
    "result1": result1,
    "result2": result2,
    "order_matters": order_matters,
}
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
saved_promptify_mathqa Ran
ran on a synthesized input
niansong1996/lever/finetuning/lightning_modules/datasets/mathqa_reader.py
code served (permissive licence) · get_code("acdd63b83770726f")
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 tempfile
import os

# Create a temporary prompt file
temp_dir = tempfile.mkdtemp()
prompt_file_path = os.path.join(temp_dir, "prompt.txt")
with open(prompt_file_path, 'w') as f:
    f.write("You are a math question answering assistant.\n\nHere are some examples:")

# Create an example dictionary
example = {
    'question': 'What is 2 + 2?',
    'answer': '4'
}

# Define ARGS
ARGS = {
    'prompt_file_path': prompt_file_path,
    'example': example,
    'max_prompt_examples': 100
}
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
simple_canonicalize_var_dict Ran
ran on a synthesized input
niansong1996/lever/execution/safe_execution_util.py
code served (permissive licence) · get_code("f7dbd2bcc2e00ee0")
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 collections import OrderedDict

torch.manual_seed(0)

# Create a simple var_dict with various types of values
var_dict = {
    'tensor_var': torch.randn(2, 4),
    'numpy_array': np.array([1, 2, 3]),
    'list_var': [1, 2, 3, 4, 5],
    'dict_var': {'a': 1, 'b': 2},
    'string_var': 'hello',
    'int_var': 42,
    'float_var': 3.14,
    'bool_var': True,
    'tuple_var': (1, 2, 3),
    'set_var': {1, 2, 3},
    'canonicalize_var_dict': lambda x: x,  # This will be skipped
    'tracing_local_list': [1, 2, 3],  # This will be skipped
    'deepcopy': None,  # This will be skipped
    'record_state': 'state',  # This will be skipped
    'ModuleType': 'module',  # This will be skipped
}

ARGS = {
    'var_dict': var_dict
}
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 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
sql_program_len Ran
ran on a synthesized input
niansong1996/lever/execution/executors.py
code served (permissive licence) · get_code("53b15e547590af1b")
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 int, ndim 0, dtype family int, 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
import numpy as np

def sql_program_len(code: str) -> int:
    """ return the length of the sql query """
    return len(list(filter(lambda x: not len(x.strip()) == 0, code.split())))

ARGS = {
    "code": "SELECT * FROM users WHERE id = 1 AND name = 'John'"
}
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 int, ndim 0, dtype family int, 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
state_answer_only_func Ran
ran on a synthesized input
niansong1996/lever/finetuning/lightning_modules/datasets/mathqa_reader.py
code served (permissive licence) · get_code("4269741e408c7847")
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
from typing import Dict, Any

torch.manual_seed(0)

# The function expects a state_dict parameter which is a Dict[str, Any]
# It checks:
# 1. If state_dict is a string, return it
# 2. If state_dict is not None and has 'answer' key, return str(state_dict['answer'])
# 3. Otherwise return 'ERROR'

# We'll test case 2 (the main logic path with 'answer' key)
state_dict = {
    'answer': 42,
    'other_key': 'some_value',
    'tensor': torch.randn(2, 4)
}

ARGS = {
    'state_dict': state_dict
}
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
unorder_row Ran
ran; our contract draft was wrong, not the code
niansong1996/lever/execution/spider_official_exec_match.py
code served (permissive licence) · get_code("afc8ef89576ef2aa")
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 numpy as np
from typing import Tuple, Any, List, Set

torch.manual_seed(0)

# Construct a tuple with mixed types to test the sorting logic
row = (
    "zebra",
    42,
    3.14,
    torch.tensor([1, 2, 3]),
    {"key": "value"},
    [1, 2, 3],
    None,
)

ARGS = {
    "row": row,
}
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 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
execute Not yet run
unverified (harvested, no recorded run)
niansong1996/lever/execution/safe_execution_util.py
code served (permissive licence) · get_code("0e6bb17163d0c70b")
How it ran

no invocation recorded.

pd_df_from_dict Not yet run
unverified (harvested, no recorded run)
niansong1996/lever/execution/spider_execution.py
code served (permissive licence) · get_code("d4c44c1affe7cfe5")
How it ran

no invocation recorded.

state_simple_str_func Not yet run
unverified (harvested, no recorded run)
niansong1996/lever/finetuning/lightning_modules/datasets/mathqa_reader.py
code served (permissive licence) · get_code("bc02ec961672d267")
How it ran

no invocation recorded.

to_value Not yet run
unverified (harvested, no recorded run)
niansong1996/lever/execution/wtq_eval.py
code served (permissive licence) · get_code("efd6f533b8606dca")
How it ran

no invocation recorded.

Also present in other papers' code

Of 22 samples lifted from this paper's linked repositories, 22 carry a function identity and 0 do not. Of the 22 distinct functions with an identity, 7 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 7 later) and 15 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
is_number 13 other papers
5 dated earlier, 7 later, 1 undated
1202.3665 (2012-02)
emcee: The MCMC Hammer
1705.09980 (2017-05)
Neural Semantic Parsing by Character-based Translation: Experiments with Abstract Meaning Representations
2003.05855 (2020-03)
End-to-End Learning Local Multi-view Descriptors for 3D Point Clouds
and 10 more not named here
permute_tuple 6 other papers
6 later
2310.17342 (2023-10)
ACT-SQL: In-Context Learning for Text-to-SQL with Automatically-Generated Chain-of-Thought
2406.12288 (2024-06)
An Investigation of Neuron Activation as a Unified Lens to Explain Chain-of-Thought Eliciting Arithmetic Reasoning of LLMs
2408.07930 (2024-08)
MAG-SQL: Multi-Agent Generative Approach with Soft Schema Linking and Iterative Sub-SQL Refinement for Text-to-SQL
and 3 more not named here
quick_rej 6 other papers
6 later
2310.17342 (2023-10)
ACT-SQL: In-Context Learning for Text-to-SQL with Automatically-Generated Chain-of-Thought
2406.12288 (2024-06)
An Investigation of Neuron Activation as a Unified Lens to Explain Chain-of-Thought Eliciting Arithmetic Reasoning of LLMs
2408.07930 (2024-08)
MAG-SQL: Multi-Agent Generative Approach with Soft Schema Linking and Iterative Sub-SQL Refinement for Text-to-SQL
and 3 more not named here
unorder_row 6 other papers
6 later
2310.17342 (2023-10)
ACT-SQL: In-Context Learning for Text-to-SQL with Automatically-Generated Chain-of-Thought
2406.12288 (2024-06)
An Investigation of Neuron Activation as a Unified Lens to Explain Chain-of-Thought Eliciting Arithmetic Reasoning of LLMs
2408.07930 (2024-08)
MAG-SQL: Multi-Agent Generative Approach with Soft Schema Linking and Iterative Sub-SQL Refinement for Text-to-SQL
and 3 more not named here
join_tokens 5 other papers
5 later
2310.17342 (2023-10)
ACT-SQL: In-Context Learning for Text-to-SQL with Automatically-Generated Chain-of-Thought
2406.12288 (2024-06)
An Investigation of Neuron Activation as a Unified Lens to Explain Chain-of-Thought Eliciting Arithmetic Reasoning of LLMs
2408.07930 (2024-08)
MAG-SQL: Multi-Agent Generative Approach with Soft Schema Linking and Iterative Sub-SQL Refinement for Text-to-SQL
and 2 more not named here
postprocess 5 other papers
5 later
2310.17342 (2023-10)
ACT-SQL: In-Context Learning for Text-to-SQL with Automatically-Generated Chain-of-Thought
2406.12288 (2024-06)
An Investigation of Neuron Activation as a Unified Lens to Explain Chain-of-Thought Eliciting Arithmetic Reasoning of LLMs
2408.07930 (2024-08)
MAG-SQL: Multi-Agent Generative Approach with Soft Schema Linking and Iterative Sub-SQL Refinement for Text-to-SQL
and 2 more not named here
to_value 2 other papers
2 later
2024.findings-emnlp.131 (2024 (year only))
SYNTQA: Synergistic Table-based Question Answering via Mixture of Text-to-SQL and E2E TQA
2402.01155 (2024-02)
CABINET: Content Relevance based Noise Reduction for Table Question Answering

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

The advent of large language models trained on code (code LLMs) has led to significant progress in language-to-code generation. State-of-the-art approaches in this area combine LLM decoding with sample pruning and reranking using test cases or heuristics based on the execution results. However, it is challenging to obtain test cases for many real-world language-to-code applications, and heuristics cannot well capture the semantic features of the execution results, such as data type and value range, which often indicates the correctness of the program. In this work, we propose LEVER, a simple approach to improve language-to-code generation by learning to verify the generated programs with their execution results. Specifically, we train verifiers to determine whether a program sampled from the LLMs is correct or not based on the natural language input, the program itself and its execution results. The sampled programs are reranked by combining the verification score with the LLM generation probability, and marginalizing over programs with the same execution results. On four datasets across the domains of table QA, math QA and basic Python programming, LEVER consistently improves over the base code LLMs(4.6% to 10.9% with code-davinci-002) and achieves new state-of-the-art results on all of them.

For agents

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

get_harvested_code_for_paper("2302.08468")
get_code_for_paper("2302.08468")
have("2302.08468")

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

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

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

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

Connect an agent — have() is free.