CodeSense: a Real-World Benchmark and Dataset for Code Semantic Reasoning
On the map: LLM reasoning → Reasoning for agents, planning and code
Abstract (arXiv)
Understanding and reasoning about code semantics is essential for enhancing code LLMs' abilities to solve real-world software engineering (SE) tasks. Although several code reasoning benchmarks exist, most rely on synthetic datasets or educational coding problems and focus on coarse-grained reasoning tasks such as input/output prediction, limiting their effectiveness in evaluating LLMs in practical SE contexts. To bridge this gap, we propose CodeSense, the first benchmark that makes available a spectrum of fine-grained code reasoning tasks concerned with the software engineering of real-world code. We collected Python, C and Java software projects from real-world repositories. We executed tests from these repositories, collected their execution traces, and constructed a ground truth dataset for fine-grained semantic reasoning tasks. We then performed comprehensive evaluations on state-of-the-art LLMs. Our results show a clear performance gap for the models to handle fine-grained reasoning tasks. Although prompting techniques such as chain-of-thought and in-context learning helped, the lack of code semantics in LLMs fundamentally limits models' capabilities of code reasoning. Besides dataset, benchmark and evaluation, our work produced an execution tracing framework and tool set that make it easy to collect ground truth for fine-grained SE reasoning tasks, offering a strong basis for future benchmark construction and model post training. Our code and data are located at https://codesense-bench.github.io/.
Key facts. Cited by 13 papers in the map (data through 14 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 22 of its 40 references that are in the map. First posted on arXiv 31 May 2025.
Builds on
22 of 40 references.
Closest ancestors · 7
Same direction, newest first
- 2025Dynamic Benchmarking of Reasoning Capabilities in Code Large Language Models Under Data Contamination6 Mar
- 2024CRUXEval-X: A Benchmark for Multilingual Code Reasoning, Understanding and Execution23 Aug
- 2024SemCoder: Training Code Language Models with Comprehensive Semantics Reasoning3 Jun
- 2024To Err is Machine: Vulnerability Detection Challenges LLM Reasoning25 Mar
- 2024Reasoning Runtime Behavior of a Program with LLM: How Far Are We?25 Mar
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Code12 Mar
- 2024CodeMind: Evaluating Large Language Models for Code Reasoning15 Feb
Other references · 15
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2021Program Synthesis with Large Language Modelscited by 3,637
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,391
- 2024BigCodeBench: Benchmarking Code Generation with Diverse Function Calls and Complex Instructionscited by 546
- 2024CRUXEval: A Benchmark for Code Reasoning, Understanding and Executioncited by 300
- 2024CodeAgent: Enhancing Code Generation with Tool-Integrated Agent Systems for Real-World Repo-level Coding Challengescited by 282
- 2021CodeNet: A Large-Scale AI for Code Dataset for Learning a Diversity of Coding Taskscited by 200
- 2023CrossCodeEval: A Diverse and Multilingual Benchmark for Cross-File Code Completioncited by 183
- 2023ClassEval: A Manually-Crafted Benchmark for Evaluating LLMs on Class-level Code Generationcited by 168
- 2025SWE-PolyBench: A multi-language benchmark for repository level evaluation of coding agentscited by 85
- 2024EvoCodeBench: An Evolving Code Generation Benchmark Aligned with Real-World Code Repositoriescited by 72
3 more
- 2023CodeScope: An Execution-based Multilingual Multitask Multidimensional Benchmark for Evaluating LLMs on Code Understanding and Generationcited by 39
- 2023TRACED: Execution-aware Pre-training for Source Codecited by 27
- 2024CodeBenchGen: Creating Scalable Execution-based Code Generation Benchmarkscited by 23
Built on by
Citing papers per year: 2025: 5; 2026: 8.
13 papers.
Sort:
By area:
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligencecited by 15
- 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
- 2025CodeReasoner: Enhancing the Code Reasoning Ability with Reinforcement Learningcited by 4
- 2025Is "Knowing It's Malicious Enough?" Evaluating LLMs for Fine-Grained Malware Behavior Auditingcited by 3
- 2025Evaluating Code Reasoning Abilities of Large Language Models Under Real-World Settingscited by 3
- 2026How Robustly do LLMs Understand Execution Semantics?cited by 2
- 2026StepCodeReasoner: Aligning Code Reasoning with Stepwise Execution Traces via Reinforcement Learningcited by 2
- 2026CodeGlance: Understanding Code Reasoning Challenges in LLMs through Multi-Dimensional Feature Analysiscited by 1
- 2026Evaluating LLMs Code Reasoning Under Real-World Contextcited by 0
- 2026Can LLMs Reason About Runtime Behavior? A Repository-Level Dynamic Benchmarkcited by 0
- 2026FastCI: Efficient GPU-Intensive CI for LLM Training Frameworkscited by 0
1 more
- 2026PyINE: A Framework for Scalable Elicitation and Oversight via Code Execution3 Oct 2026
- 2026FastCI: Efficient GPU-Intensive CI for LLM Training Frameworks1 Oct 2026
- 2026Can LLMs Reason About Runtime Behavior? A Repository-Level Dynamic Benchmark23 Sep 2026
- 2026RepoReasoner: Evaluating Repository-Level Code Reasoning Ability of Long-Context Language Models28 Jul 2026
- 2026StepCodeReasoner: Aligning Code Reasoning with Stepwise Execution Traces via Reinforcement Learning12 May 2026
- 2026Evaluating LLMs Code Reasoning Under Real-World Context14 Apr 2026
- 2026How Robustly do LLMs Understand Execution Semantics?24 Feb 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
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligence23 Nov 2025
- 2025Assessing Coherency and Consistency of Code Execution Reasoning by Large Language Models16 Oct 2025
- 2025Is "Knowing It's Malicious Enough?" Evaluating LLMs for Fine-Grained Malware Behavior Auditing17 Sep 2025
1 more
- 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
- 2025CodeReasoner: Enhancing the Code Reasoning Ability with Reinforcement Learningcited by 4
- 2025Evaluating Code Reasoning Abilities of Large Language Models Under Real-World Settingscited by 3
- 2026CodeGlance: Understanding Code Reasoning Challenges in LLMs through Multi-Dimensional Feature Analysiscited by 1
- 2026Evaluating LLMs Code Reasoning Under Real-World Contextcited by 0
- 2026Can LLMs Reason About Runtime Behavior? A Repository-Level Dynamic Benchmarkcited by 0
- 2026PyINE: A Framework for Scalable Elicitation and Oversight via Code Executioncited by 0
- 2026PyINE: A Framework for Scalable Elicitation and Oversight via Code Execution3 Oct 2026
- 2026Can LLMs Reason About Runtime Behavior? A Repository-Level Dynamic Benchmark23 Sep 2026
- 2026RepoReasoner: Evaluating Repository-Level Code Reasoning Ability of Long-Context Language Models28 Jul 2026
- 2026Evaluating LLMs Code Reasoning Under Real-World Context14 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
- 2025Assessing Coherency and Consistency of Code Execution Reasoning by Large Language Models16 Oct 2025
- 2025CodeReasoner: Enhancing the Code Reasoning Ability with Reinforcement Learning23 Jul 2025
- 2026How Robustly do LLMs Understand Execution Semantics?cited by 2
- 2026How Robustly do LLMs Understand Execution Semantics?24 Feb 2026
Similar, not cited
Close in wording, no citation either way
- 2025CoRe: Benchmarking LLMs Code Reasoning Capabilities through Static Analysis Tasks
- 2025Code to Think, Think to Code: A Survey on Code-Enhanced Reasoning and Reasoning-Driven Code Intelligence in LLMs
- 2024CodeMMLU: A Multi-Task Benchmark for Assessing Code Understanding & Reasoning Capabilities of CodeLLMs
- 2025Code Reasoning for Software Engineering Tasks: A Survey and A Call to Action
- 2026CoRE: A Fine-Grained Code Reasoning Benchmark Beyond Output Prediction
- 2025Think Like Human Developers: Harnessing Community Knowledge for Structured Code Reasoning
- 2026An Execution-Verified Multi-Language Benchmark for Code Semantic Reasoning
- 2026Beyond Output Correctness: Benchmarking and Evaluating Large Language Model Reasoning in Coding Tasks