CodeMind: Evaluating Large Language Models for Code Reasoning
On the map: LLM reasoning → Reasoning for agents, planning and code
Abstract (arXiv)
Large Language Models (LLMs) have been widely used to automate programming tasks. Their capabilities have been evaluated by assessing the quality of generated code through tests or proofs. The extent to which they can reason about code is a critical question revealing important insights about their true capabilities. This paper introduces CodeMind, a framework designed to gauge the code reasoning abilities of LLMs through the following explicit and implicit code reasoning tasks: Independent Execution Reasoning (IER), Specification Reasoning (SR) and Dynamic Semantics Reasoning (DSR). The first evaluates the abilities of LLMs to simulate the execution of given inputs to a code and predict the output (IER). The second assesses the abilities of LLMs to incorporate the simulation of test data in the specification into code generation (SR). Finally, CodeMind evaluates LLMs' abilities to understand overall code semantics only given a specific input/output (DSR). Our extensive evaluation of ten LLMs across four widely used benchmarks using CodeMind shows that LLMs, depending on their size and training strategy, can reason about some dynamic aspects of code. However, their performance drops for code with higher complexity, non-trivial logical and arithmetic operators, non-primitive types, and API calls. We show that these reasoning tasks evaluate LLMs differently, and a comprehensive evaluation of code reasoning requires them all. Finally, we show that the performance of LLMs in bug repair is not correlated with any of the code reasoning tasks, and except for advanced frontier models, other LLMs do not incorporate code reasoning when performing bug repair.
Key facts. Cited by 30 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 22 of its 66 references that are in the map. First posted on arXiv 15 Feb 2024.
Builds on
22 of 66 references.
Closest ancestors · 2
Same direction, newest first
- 2023Beyond Accuracy: Evaluating Self-Consistency of Code Large Language Models with IdentityChain21 Oct
- 2022PlanBench: An Extensible Benchmark for Evaluating Large Language Models on Planning and Reasoning about Change21 Jun
Other references · 20
- 2023GPT-4 Technical Reportcited by 18,132
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,193
- 2023Sparks of Artificial General Intelligence: Early experiments with GPT-4cited by 2,579
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2022Program of Thoughts Prompting: Disentangling Computation from Reasoning for Numerical Reasoning Taskscited by 1,057
- 2023Gemini: A Family of Highly Capable Multimodal Modelscited by 810
- 2022A Survey on In-context Learningcited by 717
- 2024DeepSeek LLM: Scaling Open-Source Language Models with Longtermismcited by 621
- 2023WizardMath: Empowering Mathematical Reasoning for Large Language Models via Reinforced Evol-Instructcited by 618
- 2024CRUXEval: A Benchmark for Code Reasoning, Understanding and Executioncited by 294
- 2023Reasoning or Reciting? Exploring the Capabilities and Limitations of Language Models Through Counterfactual Taskscited by 243
- 2023MathPrompter: Mathematical Reasoning using Large Language Modelscited by 236
8 more
- 2023OctoPack: Instruction Tuning Code Large Language Modelscited by 178
- 2023ClassEval: A Manually-Crafted Benchmark for Evaluating LLMs on Class-level Code Generationcited by 166
- 2023MathCoder: Seamless Code Integration in LLMs for Enhanced Mathematical Reasoningcited by 155
- 2023An Empirical Study of the Non-determinism of ChatGPT in Code Generationcited by 134
- 2021AVATAR: A Parallel Corpus for Java-Python Program Translationcited by 59
- 2023Do LVLMs Understand Charts? Analyzing and Correcting Factual Errors in Chart Captioningcited by 47
- 2023The Larger They Are, the Harder They Fail: Language Models do not Recognize Identifier Swaps in Pythoncited by 29
- 2023Lost in Translation: A Study of Bugs Introduced by Large Language Models while Translating Codecited by 3
Built on by
Citing papers per year: 2024: 2; 2025: 19; 2026: 9.
30 papers.
Sort:
By area:
- 2025RealSafe-R1: Safety-Aligned DeepSeek-R1 without Compromising Reasoning Capabilitycited by 58
- 2025Code to Think, Think to Code: A Survey on Code-Enhanced Reasoning and Reasoning-Driven Code Intelligence in LLMscited by 47
- 2025EquiBench: Benchmarking Large Language Models' Reasoning about Program Semantics via Equivalence Checkingcited by 23
- 2025CodeARC: Benchmarking Reasoning Capabilities of LLM Agents for Inductive Program Synthesiscited by 15
- 2025CodeSense: a Real-World Benchmark and Dataset for Code Semantic Reasoningcited by 12
- 2026Can We Predict Before Executing Machine Learning Agents?cited by 10
- 2025Understanding the Thinking Process of Reasoning Models: A Perspective from Schoenfeld's Episode Theorycited by 9
- 2025SV-TrustEval-C: Evaluating Structure and Semantic Reasoning in Large Language Models for Source Code Vulnerability Analysiscited by 8
- 2025HoarePrompt: Structural Reasoning About Program Correctness in Natural Languagecited by 7
- 2025Evaluating the Generalization Capabilities of Large Language Models on Code Reasoningcited by 7
- 2025Unveiling the Magic of Code Reasoning through Hypothesis Decomposition and Amendmentcited by 6
- 2025Can LLMs Reason Structurally? Benchmarking via the Lens of Data Structurescited by 5
18 more
- 2025EmbRACE-3K: Embodied Reasoning and Action in Complex Environmentscited by 5
- 2025Assessing Coherency and Consistency of Code Execution Reasoning by Large Language Modelscited by 5
- 2026RepoReasoner: Evaluating Repository-Level Code Reasoning Ability of Long-Context Language Modelscited by 5
- 2024NYT-Connections: A Deceptively Simple Text Classification Task that Stumps System-1 Thinkerscited by 4
- 2025Assessing the Impact of Code Changes on the Fault Localizability of Large Language Modelscited by 4
- 2025Code Reasoning for Software Engineering Tasks: A Survey and A Call to Actioncited by 4
- 2025A Study on Thinking Patterns of Large Reasoning Models in Code Generationcited by 4
- 2025ML-Tool-Bench: Tool-Augmented Planning for ML Taskscited by 3
- 2025Evaluating Code Reasoning Abilities of Large Language Models Under Real-World Settingscited by 3
- 2026Code-QA-Bench: Separating Code Reasoning from Documentation Memorization in Repository-Level QAcited by 2
- 2024Integrating Large Language Models and Reinforcement Learning for Non-Linear Reasoningcited by 1
- 2025Open the Oyster: Empirical Evaluation and Improvement of Code Reasoning Confidence in LLMscited by 1
- 2026CodeGlance: Understanding Code Reasoning Challenges in LLMs through Multi-Dimensional Feature Analysiscited by 1
- 2026Beyond Output Correctness: Benchmarking and Evaluating Large Language Model Reasoning in Coding Taskscited by 1
- 2026Evaluating LLMs Code Reasoning Under Real-World Contextcited by 0
- 2026The Path Not Taken: Duality in Reasoning about Program Executioncited by 0
- 2026Towards Evaluation of Implicit Software World Models in Coding LLMscited by 0
- 2026Evaluating Exact Output and Checkpoint-State Prediction in Real Programscited by 0
- 2026Evaluating Exact Output and Checkpoint-State Prediction in Real Programs8 Oct 2026
- 2026RepoReasoner: Evaluating Repository-Level Code Reasoning Ability of Long-Context Language Models28 Jul 2026
- 2026Towards Evaluation of Implicit Software World Models in Coding LLMs25 Jun 2026
- 2026Code-QA-Bench: Separating Code Reasoning from Documentation Memorization in Repository-Level QA28 May 2026
- 2026The Path Not Taken: Duality in Reasoning about Program Execution22 Apr 2026
- 2026Evaluating LLMs Code Reasoning Under Real-World Context14 Apr 2026
- 2026Beyond Output Correctness: Benchmarking and Evaluating Large Language Model Reasoning in Coding Tasks14 Apr 2026
- 2026CodeGlance: Understanding Code Reasoning Challenges in LLMs through Multi-Dimensional Feature Analysis15 Feb 2026
- 2026Can We Predict Before Executing Machine Learning Agents?9 Jan 2026
- 2025Evaluating Code Reasoning Abilities of Large Language Models Under Real-World Settings16 Dec 2025
- 2025ML-Tool-Bench: Tool-Augmented Planning for ML Tasks29 Nov 2025
- 2025Open the Oyster: Empirical Evaluation and Improvement of Code Reasoning Confidence in LLMs4 Nov 2025
18 more
- 2025Assessing Coherency and Consistency of Code Execution Reasoning by Large Language Models16 Oct 2025
- 2025Understanding the Thinking Process of Reasoning Models: A Perspective from Schoenfeld's Episode Theory18 Sep 2025
- 2025A Study on Thinking Patterns of Large Reasoning Models in Code Generation17 Sep 2025
- 2025EmbRACE-3K: Embodied Reasoning and Action in Complex Environments14 Jul 2025
- 2025Code Reasoning for Software Engineering Tasks: A Survey and A Call to Action16 Jun 2025
- 2025CodeSense: a Real-World Benchmark and Dataset for Code Semantic Reasoning31 May 2025
- 2025Can LLMs Reason Structurally? Benchmarking via the Lens of Data Structures29 May 2025
- 2025SV-TrustEval-C: Evaluating Structure and Semantic Reasoning in Large Language Models for Source Code Vulnerability Analysis27 May 2025
- 2025RealSafe-R1: Safety-Aligned DeepSeek-R1 without Compromising Reasoning Capability14 Apr 2025
- 2025Evaluating the Generalization Capabilities of Large Language Models on Code Reasoning7 Apr 2025
- 2025Assessing the Impact of Code Changes on the Fault Localizability of Large Language Models6 Apr 2025
- 2025CodeARC: Benchmarking Reasoning Capabilities of LLM Agents for Inductive Program Synthesis29 Mar 2025
- 2025HoarePrompt: Structural Reasoning About Program Correctness in Natural Language25 Mar 2025
- 2025Code to Think, Think to Code: A Survey on Code-Enhanced Reasoning and Reasoning-Driven Code Intelligence in LLMs26 Feb 2025
- 2025EquiBench: Benchmarking Large Language Models' Reasoning about Program Semantics via Equivalence Checking18 Feb 2025
- 2025Unveiling the Magic of Code Reasoning through Hypothesis Decomposition and Amendment17 Feb 2025
- 2024NYT-Connections: A Deceptively Simple Text Classification Task that Stumps System-1 Thinkers2 Dec 2024
- 2024Integrating Large Language Models and Reinforcement Learning for Non-Linear Reasoning17 Oct 2024
- 2025RealSafe-R1: Safety-Aligned DeepSeek-R1 without Compromising Reasoning Capabilitycited by 58
- 2025Code to Think, Think to Code: A Survey on Code-Enhanced Reasoning and Reasoning-Driven Code Intelligence in LLMscited by 47
- 2025EquiBench: Benchmarking Large Language Models' Reasoning about Program Semantics via Equivalence Checkingcited by 23
- 2025CodeARC: Benchmarking Reasoning Capabilities of LLM Agents for Inductive Program Synthesiscited by 15
- 2025CodeSense: a Real-World Benchmark and Dataset for Code Semantic Reasoningcited by 12
- 2025Understanding the Thinking Process of Reasoning Models: A Perspective from Schoenfeld's Episode Theorycited by 9
- 2025SV-TrustEval-C: Evaluating Structure and Semantic Reasoning in Large Language Models for Source Code Vulnerability Analysiscited by 8
- 2025HoarePrompt: Structural Reasoning About Program Correctness in Natural Languagecited by 7
- 2025Evaluating the Generalization Capabilities of Large Language Models on Code Reasoningcited by 7
- 2025Unveiling the Magic of Code Reasoning through Hypothesis Decomposition and Amendmentcited by 6
- 2025Can LLMs Reason Structurally? Benchmarking via the Lens of Data Structurescited by 5
- 2025EmbRACE-3K: Embodied Reasoning and Action in Complex Environmentscited by 5
12 most cited of 25 All 25 (JSON)
- 2026RepoReasoner: Evaluating Repository-Level Code Reasoning Ability of Long-Context Language Models28 Jul 2026
- 2026Code-QA-Bench: Separating Code Reasoning from Documentation Memorization in Repository-Level QA28 May 2026
- 2026The Path Not Taken: Duality in Reasoning about Program Execution22 Apr 2026
- 2026Evaluating LLMs Code Reasoning Under Real-World Context14 Apr 2026
- 2026Beyond Output Correctness: Benchmarking and Evaluating Large Language Model Reasoning in Coding Tasks14 Apr 2026
- 2026CodeGlance: Understanding Code Reasoning Challenges in LLMs through Multi-Dimensional Feature Analysis15 Feb 2026
- 2025Evaluating Code Reasoning Abilities of Large Language Models Under Real-World Settings16 Dec 2025
- 2025Open the Oyster: Empirical Evaluation and Improvement of Code Reasoning Confidence in LLMs4 Nov 2025
- 2025Assessing Coherency and Consistency of Code Execution Reasoning by Large Language Models16 Oct 2025
- 2025Understanding the Thinking Process of Reasoning Models: A Perspective from Schoenfeld's Episode Theory18 Sep 2025
- 2025A Study on Thinking Patterns of Large Reasoning Models in Code Generation17 Sep 2025
- 2025EmbRACE-3K: Embodied Reasoning and Action in Complex Environments14 Jul 2025
12 newest of 25 All 25 (JSON)
- 2026Can We Predict Before Executing Machine Learning Agents?cited by 10
- 2026Can We Predict Before Executing Machine Learning Agents?9 Jan 2026
Similar, not cited
Close in wording, no citation either way
- 2025A Tool for In-depth Analysis of Code Execution Reasoning of Large Language Models
- 2026CodeEval: A pedagogical approach for targeted evaluation of code-trained Large Language Models
- 2024SemCoder: Training Code Language Models with Comprehensive Semantics Reasoning
- 2024CodeMMLU: A Multi-Task Benchmark for Assessing Code Understanding & Reasoning Capabilities of CodeLLMs
- 2026CoRE: A Fine-Grained Code Reasoning Benchmark Beyond Output Prediction
- 2025Demystifying Errors in LLM Reasoning Traces: An Empirical Study of Code Execution Simulation
- 2025On Code-Induced Reasoning in LLMs
- 2025An Empirical Study of Reasoning Steps in Thinking Code LLMs