← All papers
First page of Tracepiler: Reasoning Traces as Programs: A Language and Checked Verdicts for Natural-Language Reasoning

Tracepiler: Reasoning Traces as Programs: A Language and Checked Verdicts for Natural-Language Reasoning

Yeqi Gao, Xujie Si

cs.PL Dec 3, 2026 · v1 cs.AI cs.LO
Obligations from reasoning traces are stated in Lean 4's logic over Mathlib, checked by a Lean kernel, re-proved by Lean, and LM-written Lean proofs close open goals.
Language models now write out their reasoning, and people act on it. Yet a right answer can rest on a step that is false, or on one that is true and does not follow from the reason it gives. Checking the answer sees neither, and a prover that finds its own proof of the final claim says nothing about the inference the text made. We treat a reasoning trace as a program: its steps are actions on a reasoning world, and checking the trace is giving that program a semantics. Ore is a small language in which a model rewrites a trace step by step. Every action, right or wrong, has a defined effect on the world and owes two obligations: that its claim follows from the world, and that it follows from the reason the step states. A claim refuted by a checked countermodel is withdrawn, which makes the first error of a trace well defined and keeps the world consistent. A domain is a library written in Ore, with definitions, checked theorems, and named assumptions that verdicts carry. Evidence is found by untrusted search and accepted only by small checkers and a kernel. On word problems, Tracepiler certifies every correct trace and is more accurate than the strongest of seven models used as judges, and Lean independently re-proves every verdict; a substantial share of the correct traces contain a true step that its stated reason does not support. On olympiad number theory Tracepiler locates more first errors than any judge, and a small language model used as an untrusted prover, each proof checked by Lean, proves most of the obligations its own search leaves open.

Natural-language reasoning traces from language models can reach right answers through false steps or steps that do not follow from their stated reasons. Answer checking, LLM judges, and provers of the final claim do not detect these faults or give a semantics for the trace as a whole.

Ore is a small language with a calculus that treats a trace as a program acting on a reasoning world. Each step owes a truth obligation and a support obligation, and a claim refuted by a checked countermodel is withdrawn. Domain knowledge lives in libraries: WordLib for word problems and Mathlib for mathematics. Obligations are Lean 4 statements, settled by untrusted search and accepted only by certificate checkers or a Lean-logic kernel; a small LM writes Lean proofs for obligations the search leaves open.

On GSM300, all 135 correct traces are certified, and Lean independently re-proves all 43,379 proofs and 1,088 refutations. Tracepiler is more accurate than the strongest of seven LLM judges. On Hard2Verify number theory it locates more first errors than any judge, and LM-written Lean proofs raise the share of proved obligations from about half to 96%.

benchmarkobligationsprovedrefutedopen
GSM300, truth44,47243,3791,0885
GSM300, support3,6712,5271,1395
H2V4,1872,092582,037
H2V, with model-written proofs4,1873,26458865
Obligations decided
systemGSM300 exact (of 300)H2V exact (of 41)
Opus 5.528329
Qwen3.8 2.4T28031
DeepSeek V4 Pro27330
Tracepiler28936
Comparison with LLM judges (exact verdicts)