SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.18120 · ICLR · 2024

Don't Trust: Verify - Grounding LLM Quantitative Reasoning with Autoformalization

Wenda Li, Yuhuai Wu, Christian Szegedy, Q Weinberger, Jin Zhou, Charles Staats, Xai Kilian

arXiv · PDF · Open in the Atlas

Code that ran

10 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 2 have no contract verdict; 8 failures of our instrument; 2 no recorded run), measured 2026-11-23; 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/2403.18120.json · badge: /api/ran/2403.18120.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
jinpz/dtv canonical (classifier label)
classifier basis: classifier_2025
10 ran · 2 no recorded run
FunctionStatusWhere it lives
extract_boxed_content_and_indices Ran
ran; our contract draft was wrong, not the code
jinpz/dtv/formalize_proof.py
code served (permissive licence) · get_code("205c76e81be50536")
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.

# Construct valid arguments for extract_boxed_content_and_indices

# The function takes a proof_string parameter and extracts content from \boxed{...}
# It handles nested braces by tracking opening/closing brackets

# Create a simple proof string with boxed content
proof_string_simple = r"The answer is \boxed{42}"

# Create a more complex proof string with nested braces
proof_string_nested = r"Therefore \boxed{x = \frac{1}{2}} is the solution"

# Create a proof string with multiple nested levels
proof_string_complex = r"We have \boxed{\{a, b, c\}} as our set"

# Use the simple case for testing
ARGS = {
    "proof_string": proof_string_simple
}
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 — 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
get_all_combination Ran
ran; our contract draft was wrong, not the code
jinpz/dtv/formalize_proof.py
code served (permissive licence) · get_code("bcde4757a2e7053d")
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) 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 numpy as np
import random

# Set seeds for reproducibility
np.random.seed(0)
random.seed(0)

# Define the arguments for get_all_combination
tag = "prompt_a"

all_available_prompts_d = {
    "prompt_a": "This is prompt A",
    "prompt_b": "This is prompt B",
    "prompt_c": "This is prompt C",
    "prompt_d": "This is prompt D",
    "prompt_e": "This is prompt E",
}

n = 3

permute = True

max_num = 5

ARGS = {
    "tag": tag,
    "all_available_prompts_d": all_available_prompts_d,
    "n": n,
    "permute": permute,
    "max_num": max_num,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — 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
get_all_combination_custom Ran
ran; our contract draft was wrong, not the code
jinpz/dtv/formalize_statement.py
code served (permissive licence) · get_code("4beea7c5a27ee0bb")
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) 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 random
import numpy as np

# Set seed for reproducibility
np.random.seed(0)
random.seed(0)

# Construct all_available_prompts_d
# This is a dictionary where keys are prompt identifiers and values are dicts with 'formal_statement'
all_available_prompts_d = {
    'prompt_1': {'formal_statement': 'some_statement_1'},
    'prompt_2': {'formal_statement': 'digits_in_base_statement'},
    'prompt_3': {'formal_statement': 'some_statement_3'},
    'prompt_4': {'formal_statement': 'digits_in_base_another'},
    'prompt_5': {'formal_statement': 'some_statement_5'},
    'prompt_6': {'formal_statement': 'some_statement_6'},
    'prompt_7': {'formal_statement': 'some_statement_7'},
    'prompt_8': {'formal_statement': 'some_statement_8'},
    'prompt_9': {'formal_statement': 'some_statement_9'},
    'prompt_10': {'formal_statement': 'some_statement_10'},
}

# Construct tag - should have a prefix before '|'
tag = 'prompt_1|some_suffix'

# Construct problem_type
problem_type = 'number_theory'

# Construct informal_statement - should contain 'base' to trigger the needed_prompts logic
informal_statement = 'Find the number in base 10'

# Construct n - number of prompts to choose
n = 3

# Construct max_num - maximum number of combinations to generate
max_num = 5

ARGS = {
    'tag': tag,
    'problem_type': problem_type,
    'informal_statement': informal_statement,
    'all_available_prompts_d': all_available_prompts_d,
    'n': n,
    'max_num': max_num,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — 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
get_category Ran
ran; our contract draft was wrong, not the code
jinpz/dtv/formalize_statement.py
code served (permissive licence) · get_code("dd67efd7d5b14425")
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) 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

# The function get_category takes two parameters:
# 1. name: a string that will be checked for various keywords
# 2. is_prompt: a boolean flag

# Test with various name strings to cover different categories
ARGS = {
    'name': 'intermediate algebra problem',
    'is_prompt': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
get_formalize_proof_prompts Ran
ran on a synthesized input
jinpz/dtv/formalize_proof.py
code served (permissive licence) · get_code("d4fc3bd77d6ef327")
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 os
import json
import tempfile
import shutil

# Create a temporary directory structure with mock prompt files
temp_dir = tempfile.mkdtemp()
prompts_dir = os.path.join(temp_dir, 'prompts', 'formal_solution')
os.makedirs(prompts_dir, exist_ok=True)

# Create sample prompt JSON files
prompt_data_1 = {
    'tag': 'tag1',
    'category': 'Category_A',
    'formal_statement': 'formal statement 1',
    'formal_proof': 'formal proof 1',
    'informal_statement': 'informal statement 1',
    'informal_proof': 'informal proof 1'
}

prompt_data_2 = {
    'tag': 'tag2',
    'category': 'CATEGORY_B',
    'formal_statement': 'formal statement 2',
    'formal_proof': 'formal proof 2',
    'informal_statement': 'informal statement 2',
    'informal_proof': 'informal proof 2'
}

prompt_data_3 = {
    'tag': 'tag3',
    'category': 'Category_A',
    'formal_statement': 'formal statement 3',
    'formal_proof': 'formal proof 3',
    'informal_statement': 'informal statement 3',
    'informal_proof': 'informal proof 3'
}

# Invalid prompt (missing formal_proof)
invalid_prompt = {
    'tag': 'tag_invalid',
    'category': 'Category_C',
    'formal_statement': 'formal statement invalid',
    'informal_statement': 'informal statement invalid',
    'informal_proof': 'informal proof invalid'
}

with open(os.path.join(prompts_dir, 'prompt1.json'), 'w') as f:
    json.dump(prompt_data_1, f)

with open(os.path.join(prompts_dir, 'prompt2.json'), 'w') as f:
    json.dump(prompt_data_2, f)

with open(os.path.join(prompts_dir, 'prompt3.json'), 'w') as f:
    json.dump(prompt_data_3, f)

with open(os.path.join(prompts_dir, 'prompt_invalid.json'), 'w') as f:
    json.dump(invalid_prompt, f)

# Write a non-JSON file that should be skipped
with open(os.path.join(prompts_dir, 'readme.txt'), 'w') as f:
    f.write('This is not a JSON file')

# Change to the temporary directory so the relative path works
original_cwd = os.getcwd()
os.chdir(temp_dir)

ARGS = {}
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 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
get_prompt_template Ran
ran on a synthesized input
jinpz/dtv/formalize_proof.py
code served (permissive licence) · get_code("5066c882ff4a78e3")
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 torch

torch.manual_seed(0)

def get_prompt_template():
    prefix_template = 'Informal:\n(*### Problem\n\n{1}\n\n### Solution\n\n{2}*)\n\nFormal:\n{0}\n{3}'
    problem_template = 'Informal:\n(*### Problem\n\n{1}\n\n### Solution\n\n{2}*)\n\nFormal:\n{0}\n'
    split_word = 'Informal'
    return (prefix_template, problem_template, split_word)

ARGS = {}
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, 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
get_single_sample_formatted Ran
ran; our contract draft was wrong, not the code
jinpz/dtv/formalize_proof.py
code served (permissive licence) · get_code("817a2de49240df8f")
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.

# Setup code for get_single_sample_formatted

ARGS = {
    "informal_statement": "Prove that the sum of two even numbers is even.",
    "problem_template": "Formal: {}\nInformal Statement: {}\nInformal Proof: {}",
    "informal_proof": "Let $a = 2m$ and $b = 2n$ for integers $m, n$. Then $a + b = 2m + 2n = 2(m+n)$, which is even. \\boxed{The sum is even}",
    "formal_statement": "∀ a b : ℤ, Even a → Even b → Even (a + b)",
    "prompt_prefix": "(* This is a comment *)\n(* Another comment *)\nTheorem example : True := by\n  trivial",
    "add_final_answer_informal_statement": True,
    "delete_comments": True,
}
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_the_type Ran
ran; our contract draft was wrong, not the code
jinpz/dtv/formalize_proof.py
code served (permissive licence) · get_code("9930a8f109c8e5a3")
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) 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)

# Analyze the function: get_the_type takes a single parameter 'problem_name'
# which is a string. The function checks if certain substrings are in the
# lowercased version of problem_name and returns a classification string.

# Test with a problem name containing 'algebra'
problem_name = "Algebra_Problem_001"

ARGS = {
    "problem_name": problem_name
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
load_formalize_data Ran
ran; our contract draft was wrong, not the code
jinpz/dtv/formalize_proof.py
code served (permissive licence) · get_code("0fd61471e4ab26ac")
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 json
import tempfile
import os

# Create a temporary JSONL file with valid data
temp_dir = tempfile.mkdtemp()
jsonl_path = os.path.join(temp_dir, "test_data.jsonl")

# Write test data to the JSONL file
test_data = [
    {
        "problem_name": "test_problem_1",
        "formal_statement": "theorem test1 : True := trivial",
        "generated_informal_statement": "This is an informal statement 1",
        "generated_informal_proof": "This is an informal proof 1"
    },
    {
        "problem_name": "test_problem_2",
        "formal_statement": "theorem test2 : True := trivial",
        "generated_informal_statement": "This is an informal statement 2",
        "generated_informal_proof": "This is an informal proof 2"
    }
]

with open(jsonl_path, 'w') as f:
    for item in test_data:
        f.write(json.dumps(item) + '\n')

ARGS = {
    "jsonl_path": jsonl_path
}
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
read_jsonl Ran
ran; our contract draft was wrong, not the code
jinpz/dtv/formalize_proof.py
code served (permissive licence) · get_code("1eee05718afec3bf")
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 json
import tempfile
import os

# Create a temporary JSONL file with some test data
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test.jsonl")

# Write test data to the file
test_data = [
    {"id": 1, "text": "first entry"},
    {"id": 2, "text": "second entry"},
    {"id": 3, "text": "third entry"}
]

with open(temp_file, 'w') as f:
    for item in test_data:
        f.write(json.dumps(item) + '\n')

ARGS = {
    "path": temp_file
}
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_all_samples_formatted Not yet run
unverified (harvested, no recorded run)
jinpz/dtv/formalize_proof.py
code served (permissive licence) · get_code("cba887d03c3bfe57")
How it ran

no invocation recorded.

prepare_formalize_data Not yet run
unverified (harvested, no recorded run)
jinpz/dtv/formalize_proof.py
code served (permissive licence) · get_code("687cc8760b503e9e")
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

Large language models (LLM), such as Google's Minerva and OpenAI's GPT families, are becoming increasingly capable of solving mathematical quantitative reasoning problems. However, they still make unjustified logical and computational errors in their reasoning steps and answers. In this paper, we leverage the fact that if the training corpus of LLMs contained sufficiently many examples of formal mathematics (e.g. in Isabelle, a formal theorem proving environment), they can be prompted to translate i.e. autoformalize informal mathematical statements into formal Isabelle code -which can be verified automatically for internal consistency. This provides a mechanism to automatically reject solutions whose formalized versions are inconsistent within themselves or with the formalized problem statement. We evaluate our method on GSM8K, MATH and MultiArith datasets and demonstrate that our approach provides a consistently better heuristic than vanilla majority voting -the previously best method to identify correct answers, by more than 12% on GSM8K. In our experiments it improves results consistently across all datasets and LLM model sizes. The code can be found at https://github.com/jinpz/dtv.

For agents

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

get_harvested_code_for_paper("2403.18120")
get_code_for_paper("2403.18120")
have("2403.18120")

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

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

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

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

Connect an agent — have() is free.