SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2502.00212 · 2025

STP: Self-play LLM Theorem Provers with Iterative Conjecturing and Proving

arXiv · PDF · Open in the Atlas

Code that ran

7 of 12 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 7 have no contract verdict; 0 failures of our instrument; 5 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/2502.00212.json · badge: /api/ran/2502.00212.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
kfdong/STP canonical (classifier label)
classifier basis not recorded on the link
7 ran · 5 no recorded run
FunctionStatusWhere it lives
compute_succ_lemmas Ran
ran on a synthesized input
kfdong/STP/RL/summary.py
code served (permissive licence) · get_code("e6d24885a45ef32d")
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 set. 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 iterates over generated_lemmas and accesses:
# - Each element as test_info (dict-like)
# - Calls test_info.get('complete', False) to get a boolean
# - Accesses test_info['lemma_id'] when complete is True

# Construct a list of dicts representing generated lemmas
generated_lemmas = [
    {'lemma_id': 'lemma_001', 'complete': True},
    {'lemma_id': 'lemma_002', 'complete': False},
    {'lemma_id': 'lemma_003', 'complete': True},
    {'lemma_id': 'lemma_004', 'complete': False},
]

ARGS = {
    'generated_lemmas': generated_lemmas,
}
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 set — a set output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a set 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
compute_succ_rate Ran
ran on a synthesized input
kfdong/STP/RL/summary.py
code served (permissive licence) · get_code("dbb2b224505ab89f")
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 numpy as np
from collections import defaultdict

# Construct valid arguments for compute_succ_rate

# The function expects:
# 1. all_generated_lemmas: list of dicts with keys 'iter', 'lemma_id', 'complete', 'system_errors'
# 2. lemma_ids: list or set of lemma identifiers

# Build test data
all_generated_lemmas = [
    {
        'iter': 0,
        'lemma_id': 'lemma_1',
        'complete': True,
        'system_errors': ''
    },
    {
        'iter': 0,
        'lemma_id': 'lemma_2',
        'complete': False,
        'system_errors': ''
    },
    {
        'iter': 1,
        'lemma_id': 'lemma_1',
        'complete': True,
        'system_errors': ''
    },
    {
        'iter': 1,
        'lemma_id': 'lemma_3',
        'complete': True,
        'system_errors': ''
    },
    {
        'iter': 2,
        'lemma_id': 'lemma_4',
        'complete': False,
        'system_errors': ''
    },
]

# Set of lemma IDs to track
lemma_ids = ['lemma_1', 'lemma_2', 'lemma_3', 'lemma_4', 'lemma_5']

ARGS = {
    'all_generated_lemmas': all_generated_lemmas,
    'lemma_ids': lemma_ids
}
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 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
compute_weight Ran
ran on a synthesized input
kfdong/STP/RL/RL_step3_final_model.py
code served (permissive licence) · get_code("c6775b43722353a9")
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

def compute_weight(proof):
    return np.exp(-0.001 * len(proof))

# proof parameter is used with len(), so it needs to be a sequence
# Creating a simple list as a stand-in proof
proof = [1, 2, 3, 4, 5]

ARGS = {
    "proof": proof
}
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
compute_weight Ran
ran on a synthesized input
kfdong/STP/RL/RL_step2_train.py
code served (permissive licence) · get_code("761e416f700e9ef7")
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

def compute_weight(proof, verify_time=0):
    return np.exp(-0.001 * len(proof) - 0.01 * verify_time)

# The function uses:
# - len(proof): proof should be a sequence (list, tuple, array, string, etc.)
# - verify_time: numeric value

# Create a proof as a list (supports len())
proof = [1, 2, 3, 4, 5]

# Create verify_time as a numeric value
verify_time = 10

ARGS = {
    "proof": proof,
    "verify_time": verify_time
}
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
get_checkpoint_name Ran
ran on a synthesized input
kfdong/STP/RL/utils/model_utils.py
code served (permissive licence) · get_code("e9dcbdf1132f8052")
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 os
import tempfile

# Create a temporary directory with a single checkpoint file
temp_dir = tempfile.mkdtemp()
checkpoint_path = os.path.join(temp_dir, 'checkpoint_001')
with open(checkpoint_path, 'w') as f:
    f.write('dummy checkpoint content')

ARGS = {
    'directory': 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 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
get_prompt Ran
ran on a synthesized input
kfdong/STP/RL/utils/model_utils.py
code served (permissive licence) · get_code("ba7c25429714f2b5")
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
from typing import Any, Dict, List

torch.manual_seed(0)

# Create a minimal stand-in tokenizer class
class MinimalTokenizer:
    def encode(self, s, return_tensors=None, padding=None, max_length=None, truncation=False):
        # Simple mock: split by spaces and convert to token IDs
        tokens = s.split()[:max_length] if max_length else s.split()
        token_ids = [hash(t) % 1000 for t in tokens]  # Simple hash to int
        if return_tensors == 'pt':
            return [torch.tensor([token_ids], dtype=torch.long)]
        return token_ids
    
    def decode(self, tokens, skip_special_tokens=False):
        # Convert token tensor back to string
        if isinstance(tokens, torch.Tensor):
            token_list = tokens.tolist()
        else:
            token_list = tokens
        # Simple mock decode: just reconstruct from token IDs
        return ' '.join([f'token_{t}' for t in token_list])

# Create test_info dictionary with all required fields
test_info_conjecture = {
    'shared_lemma_statement': 'lemma shared_helper (n : ℕ) : n + 0 = n := by simp',
    'statement': 'theorem easy_thm (x : ℕ) : x = x := by rfl',
    'proof': ' rfl'
}

test_info_header = {
    'header': 'import Mathlib\n',
    'statement': 'theorem test_thm : True := trivial'
}

test_info_default = {
    'statement': 'theorem default_thm : 1 + 1 = 2 := by norm_num'
}

# Create tokenizer instance
tokenizer = MinimalTokenizer()

# Define ARGS with the conjecture invoke_type
ARGS = {
    'test_info': test_info_conjecture,
    'tokenizer': tokenizer,
    'max_length': 256,
    'invoke_type': 'conjecture'
}
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
merge_labels Ran
ran on a synthesized input
kfdong/STP/RL/utils/RL_utils.py
code served (permissive licence) · get_code("1686317bd96ca309")
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 numpy as np
from typing import List

torch.manual_seed(0)

# Construct arguments for merge_labels function
labels = ["cat", "dog", "bird"]
new_labels = ["fish", "dog", "elephant"]

ARGS = {
    "labels": labels,
    "new_labels": new_labels,
}
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 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
build_docker Not yet run
unverified (harvested, no recorded run)
kfdong/STP/levanter/infra/push_docker.py
code served (permissive licence) · get_code("de272c3c1e0ec598")
How it ran

no invocation recorded.

list_tpus Not yet run
unverified (harvested, no recorded run)
kfdong/STP/levanter/infra/launch.py
code served (permissive licence) · get_code("aefb09b34244c0e3")
How it ran

no invocation recorded.

push_to_gcp Not yet run
unverified (harvested, no recorded run)
kfdong/STP/levanter/infra/push_docker.py
code served (permissive licence) · get_code("d6503a4e0ef91a8b")
How it ran

no invocation recorded.

push_to_github Not yet run
unverified (harvested, no recorded run)
kfdong/STP/levanter/infra/push_docker.py
code served (permissive licence) · get_code("9f6615b4d3762c8e")
How it ran

no invocation recorded.

right_truncate Not yet run
unverified (harvested, no recorded run)
kfdong/STP/RL/utils/model_utils.py
code served (permissive licence) · get_code("9bdec843cb765dde")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 12 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.

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

A fundamental challenge in formal theorem proving by LLMs is the lack of high-quality training data. Although reinforcement learning or expert iteration partially mitigates this issue by alternating between LLM generating proofs and finetuning them on correctly generated ones, performance quickly plateaus due to the scarcity of correct proofs (sparse rewards). To keep improving the models with limited data, we draw inspiration from mathematicians, who continuously develop new results, partly by proposing novel conjectures or exercises (which are often variants of known results) and attempting to solve them. We design the Self-play Theorem Prover (STP) that simultaneously takes on two roles, conjecturer and prover, each providing training signals to the other. The conjecturer is trained iteratively on previously generated conjectures that are barely provable by the current prover, which incentivizes it to generate increasingly challenging conjectures over time. The prover attempts to prove the conjectures with standard expert iteration. We evaluate STP with both Lean and Isabelle formal versifiers. With 51.3 billion tokens generated during the training in Lean, STP proves 28.5% of the statements in the LeanWorkbook dataset, doubling the previous best result of 13.2% achieved through expert iteration. The final model achieves state-of-the-art performance among whole-proof generation methods on miniF2F-test (65.0%, pass@3200), Proofnet-test (23.9%, pass@3200) and PutnamBench (8/644, pass@3200). We release our code, model, and dataset in this URL: https://github.com/kfdong/STP.

For agents

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

get_harvested_code_for_paper("2502.00212")
get_code_for_paper("2502.00212")
have("2502.00212")

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

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

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

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

Connect an agent — have() is free.