mlsanityData to 14 Oct 2026

Can Large Language Models Reason About Complex Execution Paths? An Empirical Study on Python

arXiv 2511.18288 ↗First posted 23 Nov 2025cs.SEcited by 0

On the map: LLM reasoning → Reasoning for agents, planning and code

Abstract (arXiv)

Execution path reasoning is a key step towards program semantics understanding. It is crucial for generating test cases that cover certain branches/paths, or detecting bugs that are triggered by some paths without actually executing the program. Traditionally, execution path reasoning can be achieved by symbolic execution techniques, but existing SMT-based symbolic execution approaches struggle with complex data structures and external API calls. This challenge is even more pronounced in languages with highly flexible syntax, such as Python, resulting in a lack of widely adopted tools for reasoning on execution paths. Therefore, reasoning execution paths with AI-based approaches become a promising direction. In this paper, we investigate the feasibility of adopting large language models (LLMs) for execution path reasoning on Python, where traditional path-based symbolic execution tools are unavailable. We conduct an empirical study on two types of path reasoning tasks: generation tasks for test case generation and classification tasks for bug detection. We build new evaluation pipelines and benchmarks from both competition-level programs and real-world repositories. Our results show that state-of-the-art LLMs can perform correct reasoning on execution paths and improve test coverage on real-world software, though models with stronger reasoning abilities do not always outperform weaker ones. These findings highlight the potential of utilizing LLMs as a complementary heuristic for path-aware code reasoning, especially in program languages lacking mature symbolic execution tools. We have released our benchmark and evaluation scripts at https://github.com/jacobwwh/llm-path-study.

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 14 of its 51 references that are in the map. First posted on arXiv 23 Nov 2025.

Builds on

14 of 51 references.

References · 14

  1. 2025Qwen3 Technical Reportcited by 8,820
  2. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  3. 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,330
  4. 2025Gemma 3 Technical Reportcited by 1,824
  5. 2024DeepSeek-V3 Technical Reportcited by 811
  6. 2024Do NOT Think That Much for 2+3=? On the Overthinking of o1-Like LLMscited by 570
  7. 2025From System 1 to System 2: A Survey of Reasoning Large Language Modelscited by 320
  8. 2025Can Large Language Models Detect Errors in Long Chain-of-Thought Reasoning?cited by 44
  9. 2025What I cannot execute, I do not understand: Training and Evaluating LLMs on Program Execution Tracescited by 12
  10. 2024Python Symbolic Execution with LLM-powered Code Generationcited by 10
  11. 2022Scalpel: The Python Static Analysis Frameworkcited by 9
  12. 2025Integrating Symbolic Execution with LLMs for Automated Generation of Program Specificationscited by 4
2 more
  1. 2025Worst-Case Symbolic Constraints Analysis and Generalisation with Large Language Modelscited by 1
  2. 2025PALM: Path-aware LLM-based Test Generation with Comprehensioncited by 1

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2026Can LLMs Reason About Runtime Behavior? A Repository-Level Dynamic Benchmark
  2. 2025A Tool for In-depth Analysis of Code Execution Reasoning of Large Language Models
  3. 2024SemCoder: Training Code Language Models with Comprehensive Semantics Reasoning
  4. 2025Do Code Semantics Help? A Comprehensive Study on Execution Trace-Based Information for Code Large Language Models
  5. 2025Evaluating Code Reasoning Abilities of Large Language Models Under Real-World Settings
  6. 2025Demystifying Errors in LLM Reasoning Traces: An Empirical Study of Code Execution Simulation
  7. 2026An Execution-Verified Multi-Language Benchmark for Code Semantic Reasoning
  8. 2025Chain of Execution Supervision Promotes General Reasoning in Large Language Models