SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.18457 · 2023

LLMSTEP: LLM proofstep suggestions in Lean

arXiv · PDF · Open in the Atlas

Code that ran

10 of 11 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 0 have no contract verdict; 10 failures of our instrument; 1 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/2310.18457.json · badge: /api/ran/2310.18457.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
wellecks/llmstep canonical (classifier label)
classifier basis: census
10 ran · 1 no recorded run
FunctionStatusWhere it lives
fmt_proofstep Ran
ran; our contract draft was wrong, not the code
wellecks/llmstep/python/train/data.py
code served (permissive licence) · get_code("ef2fe3849acf24b8")
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)

# Construct minimal valid arguments for fmt_proofstep
split = [
    {
        'traced_tactics': [
            {
                'state_before': 'goal_state_1',
                'tactic': 'intro x'
            },
            {
                'state_before': 'goal_state_2',
                'tactic': 'apply theorem'
            }
        ]
    },
    {
        'traced_tactics': [
            {
                'state_before': 'another_goal_state',
                'tactic': 'rfl'
            }
        ]
    }
]

ARGS = {
    'split': split
}
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
hf_encdec_generate Ran
ran; our contract draft was wrong, not the code
wellecks/llmstep/python/server_encdec.py
code served (permissive licence) · get_code("ba10a72407a0401c")
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)

# Stand-in tokenizer class
class MockTokenizer:
    def __init__(self):
        self.eos_token_id = 2
    
    def encode(self, text, return_tensors=None):
        # Return a simple token sequence
        tokens = torch.tensor([[1, 5, 10, 15]])
        if return_tensors == 'pt':
            return tokens
        return tokens
    
    def batch_decode(self, token_ids, skip_special_tokens=False):
        # Convert token ids back to text
        batch_size = token_ids.shape[0]
        return [f"generated text {i}" for i in range(batch_size)]

# Minimal encoder-decoder model
class MockEncoderDecoderModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.device_attr = 'cpu'
        self.linear = nn.Linear(4, 4)
    
    @property
    def device(self):
        return self.device_attr
    
    def generate(self, input_ids, max_new_tokens=128, do_sample=False, 
                 temperature=1.0, pad_token_id=None, num_return_sequences=1):
        # Return dummy generated token sequences
        batch_size = input_ids.shape[0]
        seq_len = input_ids.shape[1] + max_new_tokens
        output_size = batch_size * num_return_sequences if do_sample else batch_size
        return torch.randint(0, 100, (output_size, seq_len))

# Create instances
model = MockEncoderDecoderModel()
tokenizer = MockTokenizer()
prompt = "Once upon a time"
temperatures = [0.0, 0.7, 1.0]
num_samples = 2
max_new_tokens = 128

ARGS = {
    'model': model,
    'tokenizer': tokenizer,
    'prompt': prompt,
    'temperatures': temperatures,
    'num_samples': num_samples,
    'max_new_tokens': max_new_tokens
}
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
llmstep_prompt Ran
ran; our contract draft was wrong, not the code
wellecks/llmstep/python/server.py
code served (permissive licence) · get_code("95146b04fb52c3d1")
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

torch.manual_seed(0)

# The function llmstep_prompt takes two string parameters and formats them
# into a template string. No complex objects needed.

tactic_state = "x : Nat\n⊢ x + 0 = x"
prefix = "intro x\n"

ARGS = {
    "tactic_state": tactic_state,
    "prefix": prefix,
}
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
llmstep_prompt1 Ran
ran; our contract draft was wrong, not the code
wellecks/llmstep/python/server_llemma.py
code served (permissive licence) · get_code("f9d677d82616a315")
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 = {
    'tactic_state': 'n : ℕ\nh : n > 0\n⊢ n + 0 = n',
    'prefix': 'simp',
    'context': 'simp_lemmas: [add_zero]'
}
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
load_hf Ran
ran; our contract draft was wrong, not the code
wellecks/llmstep/python/server.py
code served (permissive licence) · get_code("d0a79e9af1754b83")
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. 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 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 transformers
from unittest.mock import Mock, MagicMock

torch.manual_seed(0)

# Create a mock model that behaves like GPTNeoXForCausalLM or AutoModelForCausalLM
mock_model = Mock(spec=transformers.GPTNeoXForCausalLM)
mock_model.cuda = Mock(return_value=None)
mock_model.eval = Mock(return_value=mock_model)

# Create a mock tokenizer
mock_tokenizer = Mock(spec=transformers.GPTNeoXTokenizerFast)

# Patch the from_pretrained methods to return our mocks
original_gpt = transformers.GPTNeoXForCausalLM.from_pretrained
original_gpt_tok = transformers.GPTNeoXTokenizerFast.from_pretrained
original_auto = transformers.AutoModelForCausalLM.from_pretrained
original_auto_tok = transformers.AutoTokenizer.from_pretrained

transformers.GPTNeoXForCausalLM.from_pretrained = Mock(return_value=mock_model)
transformers.GPTNeoXTokenizerFast.from_pretrained = Mock(return_value=mock_tokenizer)
transformers.AutoModelForCausalLM.from_pretrained = Mock(return_value=mock_model)
transformers.AutoTokenizer.from_pretrained = Mock(return_value=mock_tokenizer)

ARGS = {
    'hf_model': 'wellecks/llmstep-mathlib4-pythia-1.4b'
}
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 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
load_hf_encdec Ran
ran; our contract draft was wrong, not the code
wellecks/llmstep/python/server_encdec.py
code served (permissive licence) · get_code("80ae9da2d8d17562")
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 transformers
from unittest.mock import Mock, MagicMock

# Create a mock tokenizer
mock_tokenizer = Mock(spec=transformers.AutoTokenizer)
mock_tokenizer.from_pretrained = MagicMock(return_value=Mock())

# Create a mock model
mock_model = Mock(spec=transformers.AutoModelForSeq2SeqLM)
mock_model.from_pretrained = MagicMock(return_value=Mock())

# Mock the AutoTokenizer.from_pretrained and AutoModelForSeq2SeqLM.from_pretrained
# to avoid actual downloads
def mock_load_tokenizer(model_name):
    return Mock()

def mock_load_model(model_name):
    return Mock()

transformers.AutoTokenizer.from_pretrained = mock_load_tokenizer
transformers.AutoModelForSeq2SeqLM.from_pretrained = mock_load_model

ARGS = {
    'model_name': 'google/flan-t5-small'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
transformers — 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
preprocess Ran
ran; our contract draft was wrong, not the code
wellecks/llmstep/python/train/tune.py
code served (permissive licence) · get_code("0260b6a8ebc40a5f")
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 transformers
from typing import Dict, Sequence
import copy

torch.manual_seed(0)

# Create a minimal stand-in tokenizer
class MinimalTokenizer:
    def __init__(self):
        self.model_max_length = 512
        self.pad_token_id = 0
    
    def __call__(self, text, return_tensors=None, padding=None, max_length=None, truncation=None):
        # Simple tokenization: convert text to token ids
        token_ids = [ord(c) % 100 for c in text]  # Simple hash-based tokenization
        input_ids = torch.tensor([token_ids], dtype=torch.long)
        
        # Pad if needed
        if padding == 'longest' and max_length:
            if input_ids.shape[1] < max_length:
                pad_length = max_length - input_ids.shape[1]
                input_ids = torch.nn.functional.pad(input_ids, (0, pad_length), value=self.pad_token_id)
        
        class TokenizerOutput:
            def __init__(self, input_ids_tensor):
                self.input_ids = input_ids_tensor
        
        return TokenizerOutput(input_ids)

tokenizer = MinimalTokenizer()

sources = [
    "Source one: ",
    "Source two: "
]

targets = [
    "target response one",
    "target response two"
]

ARGS = {
    "sources": sources,
    "targets": targets,
    "tokenizer": tokenizer
}
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 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
proofstep Ran
ran; our contract draft was wrong, not the code
wellecks/llmstep/python/train/data.py
code served (permissive licence) · get_code("652c32004f36cbf1")
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 json
import os
import tempfile
from pathlib import Path

# Create a temporary directory for the test data
temp_dir = tempfile.mkdtemp()

# Create the necessary directory structure
data_subdir = os.path.join(temp_dir, 'leandojo_benchmark_4', 'random')
os.makedirs(data_subdir, exist_ok=True)

# Create minimal valid JSON data for train, val, test splits
# Each split contains a list of traced theorems with traced tactics
sample_data = [
    {
        'theorem_name': 'test_theorem_1',
        'traced_tactics': [
            {
                'state_before': 'Goal: x = x',
                'tactic': 'rfl'
            },
            {
                'state_before': 'Goal: y + 0 = y',
                'tactic': 'simp'
            }
        ]
    },
    {
        'theorem_name': 'test_theorem_2',
        'traced_tactics': [
            {
                'state_before': 'Goal: a ∧ b → a',
                'tactic': 'intro h; exact h.1'
            }
        ]
    }
]

# Write the sample data to JSON files
for split in ['train', 'val', 'test']:
    filepath = os.path.join(data_subdir, f'{split}.json')
    with open(filepath, 'w') as f:
        json.dump(sample_data, f)

# Create the processed output directory
os.makedirs(os.path.join(temp_dir, 'processed'), exist_ok=True)

ARGS = {
    'data_dir': temp_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
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
reprover_prompt Ran
ran; our contract draft was wrong, not the code
wellecks/llmstep/python/server_encdec.py
code served (permissive licence) · get_code("9a02d31cabf99be9")
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

torch.manual_seed(0)

# Analyzing the function:
# def reprover_prompt(tactic_state, prefix):
#     return '%s%s' % (tactic_state, prefix)
# 
# The function takes two parameters and formats them as strings.
# Both tactic_state and prefix need to be string-like (or convertible to strings).

ARGS = {
    'tactic_state': 'goal: x + y = y + x\n',
    'prefix': 'apply comm_add\n'
}
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
resume_from Ran
ran; our contract draft was wrong, not the code
wellecks/llmstep/python/benchmarking/proofsearch/proofsearch.py
code served (permissive licence) · get_code("f227a3efda0fb0e6")
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 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 json
import tempfile
import os

# Create a temporary JSON file with results data
temp_dir = tempfile.mkdtemp()
results_filename = os.path.join(temp_dir, "results.json")

# Create sample results data
sample_results = {
    "results": [
        {"epoch": 0, "loss": 0.5},
        {"epoch": 1, "loss": 0.3},
        {"epoch": 2, "loss": 0.2}
    ]
}

with open(results_filename, 'w') as f:
    json.dump(sample_results, f)

# Create sample data - a list with more elements than results
# The function will slice from len(results) onwards
sample_data = [
    {"id": 0, "value": "a"},
    {"id": 1, "value": "b"},
    {"id": 2, "value": "c"},
    {"id": 3, "value": "d"},
    {"id": 4, "value": "e"},
    {"id": 5, "value": "f"}
]

ARGS = {
    "results_filename": results_filename,
    "data": sample_data
}
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 tuple, ndim 2, 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
hf_generate Not yet run
unverified (harvested, no recorded run)
wellecks/llmstep/python/server.py
code served (permissive licence) · get_code("9f6ffd840464d935")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 1 the same month, 1 later) and 10 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
resume_from 2 other papers
1 the same month, 1 later
2310.10631 (2023-10)
Llemma: An Open Language Model For Mathematics
2410.15700 (2024-10)
InternLM2.5-StepProver: Advancing Automated Theorem Proving via Critic-Guided Search

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

We present LLMSTEP, a tool for integrating a language model into the Lean proof assistant. LLMSTEP is a Lean 4 tactic that sends a user's proof state to a server hosting a language model. The language model generates suggestions, which are checked in Lean and displayed to a user in their development environment. We provide a baseline language model, along with code for fine-tuning and evaluation to support further development. We provide server implementations that run on CPU, a CUDA GPU, or a Google Colab notebook, as a step towards fast, effective language model suggestions for any user.

For agents

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

get_harvested_code_for_paper("2310.18457")
get_code_for_paper("2310.18457")
have("2310.18457")

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

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

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

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

Connect an agent — have() is free.