A Tool for In-depth Analysis of Code Execution Reasoning of Large Language Models
Changshu Liu, Reyhaneh Jabbarvand
TL;DR
This paper tackles the challenge of interpreting code execution reasoning beyond mere input/output predictions. It introduces ExeRScope, a tool that combines static and dynamic program analysis to extract properties such as program constructs, complexity, dynamic behaviors, and variable types, linking them to LLM reasoning outcomes. Key contributions include a taxonomy of program constructs, multiple complexity metrics including CFG-based cyclomatic complexity, dynamic property extraction per input, and a comprehensive visualization/reporting pipeline. Across six LLMs and four benchmarks, the results show that recursive/nested constructs, higher complexity, longer loops, and non-primitive types hinder reasoning, underscoring the need for more representative benchmarks and execution-aware improvements.
Abstract
Code Executing Reasoning is becoming a new non-functional metric that assesses the ability of large language models (LLMs) in programming tasks. State-of-the-art frameworks (CodeMind or REval) and benchmarks (CruxEval) usually focus on LLM's prediction of a given code's input/output or intermediate variable states/values on limited programs. However, there is no tool for more in-depth analysis of the results. Without such a tool, the observations about LLM's code execution reasoning cannot be generalized to more datasets, preventing the research community and practitioners from devising the next generation of LLMs with better code execution reasoning abilities. This paper introduces ExeRScope, a series of tools and heuristics to analyze the result of code execution reasoning frameworks to understand better the impact of code properties in the studied benchmarks on the code execution reasoning. With such tooling, analysis can be generalized to code with similar properties without the urgent need to design more benchmarks, which is a cumbersome effort.
