Demystifying Errors in LLM Reasoning Traces: An Empirical Study of Code Execution Simulation
On the map: LLM reasoning → Reasoning for agents, planning and code
Abstract (arXiv)
Understanding a program's runtime reasoning behavior, meaning how intermediate states and control flows lead to final execution results, is essential for reliable code generation, debugging, and automated reasoning. Although large language models (LLMs) can accurately predict program outputs, most prior work has focused on output accuracy and performance, treating reasoning as a black box. As a result, little is known about the structure or failure modes of their reasoning traces. To address this gap, we conduct the first empirical study on runtime behavior inference with reasoning LLMs, aiming to uncover and characterize errors in their reasoning traces. We curate a benchmark from HumanEval Plus and LiveCodeBench, containing 427 code snippets. For each snippet, we test three input types: regular, edge, and invalid. Twelve input values are selected per snippet, each paired with its ground-truth execution result. We evaluate four state-of-the-art reasoning LLMs. Our results show that these models reach accuracies between 85 percent and 98 percent across input types. We also analyze the produced reasoning traces and develop a taxonomy with nine categories of inference errors. Finally, we explore tool-augmented reasoning. Using failures in the Computation Errors category as a case study, our experiments show that this approach corrects 58 percent of such errors, demonstrating the potential of tool support for improving LLM reasoning.
Key facts. Cited by 5 papers in the map (data through 7 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 18 of its 35 references that are in the map. First posted on arXiv 28 Nov 2025.
Builds on
18 of 35 references.
Closest ancestors · 10
Same direction, newest first
- 2025An Empirical Study of Reasoning Steps in Thinking Code LLMs8 Nov
- 2025CodeReasoner: Enhancing the Code Reasoning Ability with Reinforcement Learning23 Jul
- 2025Are They All Good? Evaluating the Quality of CoTs in LLM-based Code Generation9 Jul
- 2025CoRe: Benchmarking LLMs Code Reasoning Capabilities through Static Analysis Tasks3 Jul
- 2025Evaluating the Generalization Capabilities of Large Language Models on Code Reasoning7 Apr
- 2025Code to Think, Think to Code: A Survey on Code-Enhanced Reasoning and Reasoning-Driven Code Intelligence in LLMs26 Feb
- 2024OpenAI o1 System Card21 Dec
- 2024CRUXEval-X: A Benchmark for Multilingual Code Reasoning, Understanding and Execution23 Aug
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Code12 Mar
- 2023CodeCoT: Tackling Code Syntax Errors in CoT Reasoning for Code Generation17 Aug
Other references · 8
- 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,146
- 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,601
- 2025Gemini 2.5: Pushing the Frontier with Advanced Reasoning, Multimodality, Long Context, and Next Generation Agentic Capabilitiescited by 3,655
- 2022Challenging BIG-Bench Tasks and Whether Chain-of-Thought Can Solve Themcited by 1,767
- 2022Selection-Inference: Exploiting Large Language Models for Interpretable Logical Reasoningcited by 331
- 2024CRUXEval: A Benchmark for Code Reasoning, Understanding and Executioncited by 294
- 2024Code Simulation Challenges for Large Language Modelscited by 15
- 2025Unmasking the Genuine Type Inference Capabilities of LLMs for Java Code Snippetscited by 1
Built on by
Citing papers per year: 2026: 5.
5 papers.
- 2026TraceView: Interactive Visualization of Agentic Program Repair Trajectoriescited by 2
- 2026Magic, Madness, Heaven, Sin: LLM Output Diversity is Everything, Everywhere, All at Oncecited by 0
- 2026The Path Not Taken: Duality in Reasoning about Program Executioncited by 0
- 2026Domain-Filtered Knowledge Graphs from Sparse Autoencoder Featurescited by 0
- 2026Collaborative Reasoning Distillation via Cross-Feedback and Coherent Curationcited by 0
- 2026Collaborative Reasoning Distillation via Cross-Feedback and Coherent Curation7 Oct 2026
- 2026TraceView: Interactive Visualization of Agentic Program Repair Trajectories20 Jun 2026
- 2026Domain-Filtered Knowledge Graphs from Sparse Autoencoder Features26 Apr 2026
- 2026The Path Not Taken: Duality in Reasoning about Program Execution22 Apr 2026
- 2026Magic, Madness, Heaven, Sin: LLM Output Diversity is Everything, Everywhere, All at Once2 Apr 2026
Similar, not cited
Close in wording, no citation either way
- 2026CoRE: A Fine-Grained Code Reasoning Benchmark Beyond Output Prediction
- 2026Can LLMs Reason About Runtime Behavior? A Repository-Level Dynamic Benchmark
- 2024Reasoning Runtime Behavior of a Program with LLM: How Far Are We?
- 2025Do Code Semantics Help? A Comprehensive Study on Execution Trace-Based Information for Code Large Language Models
- 2026An Execution-Verified Multi-Language Benchmark for Code Semantic Reasoning
- 2026CodeGlance: Understanding Code Reasoning Challenges in LLMs through Multi-Dimensional Feature Analysis
- 2025A Tool for In-depth Analysis of Code Execution Reasoning of Large Language Models
- 2026How Robustly do LLMs Understand Execution Semantics?