Generating Verifiable Chain of Thoughts from Exection-Traces
On the map: LLM reasoning → Reasoning for agents, planning and code
Abstract (arXiv)
Getting language models to reason correctly about code requires training on data where each reasoning step can be checked. Current synthetic Chain-of-Thought (CoT) training data often consists of plausible-sounding explanations generated by teacher models, and not verifiable accounts of actual program behavior. Models trained on such data learn logically flawed reasoning patterns despite syntactic correctness. To address this, we build a pipeline that generates execution-trace-verified CoT rationales by instrumenting code to capture traces, narrating them into natural language, and cross-checking each narration against the original trace. We systematically create 54,000 verified, bi-directional rationales that teach models to reason both forward (inputrightarrowoutput) and backward (outputrightarrowinput). Models fine-tuned on our verified data achieve substantial improvements, with a peak gain of +26.6 on LiveCodeBench-Exec, +22.2 on CruxEval, and +19.5 on HumanEval across our fine-tuned models, demonstrating that verification quality directly determines both reasoning and code generation capabilities. Complete synthesis pipeline is avilable as open-source: https://github.com/IBM/verified-code-cot/
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 26 of its 32 references that are in the map. First posted on arXiv 28 Nov 2025.
Builds on
26 of 32 references.
Closest ancestors · 8
Same direction, newest first
- 2025Code Execution as Grounded Supervision for LLM Reasoning12 Jun
- 2025rStar-Coder: Scaling Competitive Code Reasoning with a Large-Scale Verified Dataset27 May
- 2025CodeI/O: Condensing Reasoning Patterns via Code Input-Output Prediction11 Feb
- 2024Qwen2.5-Coder Technical Report18 Sep
- 2024SemCoder: Training Code Language Models with Comprehensive Semantics Reasoning3 Jun
- 2024NExT: Teaching Large Language Models to Reason about Code Execution23 Apr
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Code12 Mar
- 2023Teaching Large Language Models to Self-Debug11 Apr
Other references · 18
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,276
- 2021Program Synthesis with Large Language Modelscited by 3,637
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
- 2023Language Models Don't Always Say What They Think: Unfaithful Explanations in Chain-of-Thought Promptingcited by 1,122
- 2022Program of Thoughts Prompting: Disentangling Computation from Reasoning for Numerical Reasoning Taskscited by 1,076
- 2021Show Your Work: Scratchpads for Intermediate Computation with Language Modelscited by 886
- 2023StarCoder: may the source be with you!cited by 799
- 2022CodeT: Code Generation with Generated Testscited by 384
- 2024CRUXEval: A Benchmark for Code Reasoning, Understanding and Executioncited by 300
6 more
- 2023Magicoder: Empowering Code Generation with OSS-Instructcited by 256
- 2024Granite Code Models: A Family of Open Foundation Models for Code Intelligencecited by 117
- 2023Forward-Backward Reasoning in Large Language Models for Mathematical Verificationcited by 40
- 2024Reverse Thinking Makes LLMs Stronger Reasonerscited by 29
- 2023TRACED: Execution-aware Pre-training for Source Codecited by 27
- 2025What I cannot execute, I do not understand: Training and Evaluating LLMs on Program Execution Tracescited by 12
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2025Chain of Execution Supervision Promotes General Reasoning in Large Language Models
- 2025Scaling Code-Assisted Chain-of-Thoughts and Instructions for Model Reasoning
- 2025Shape of Thought: When Distribution Matters More than Correctness in Reasoning Tasks
- 2026The Tell-Tale Trace: Detecting Reasoning Failures in LLMs Using Chain-of-Thought Dynamics
- 2025FOL-Traces: Verified First-Order Logic Reasoning Traces at Scale
- 2026Correct Answers, Invalid Traces: What Verifiable Grade-School Math Reveals About Chain-of-Thought Traces
- 2025Beyond Semantics: The Unreasonable Effectiveness of Reasonless Intermediate Tokens
- 2023Deductive Verification of Chain-of-Thought Reasoning