NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

CoRe: Benchmarking LLMs’ Code Reasoning Capabilities through Static Analysis Tasks

Danning Xie, Mingwei Zheng, Xuwei Liu, Jiannan Wang, Chengpeng Wang, Lin Tan, Xiangyu Zhang · DOI

Abstract

As Large Language Models (LLMs) are increasingly integrated into high-stakes software engineering workflows, the need to verify their underlying semantic understanding becomes critical. We present CORE (COde REasoning), a human-verified benchmark of 12,553 task instances designed to evaluate LLMs on fundamental static analysis tasks, including data dependency, control flow, and information flow. Our findings indicate that while top-tier reasoning models outperform standard variants by up to 31.5%, significant challenges remain in handling complex logic, multi-step reasoning, and backward dependencies. This paper highlights the "black box" nature of current code generation and the necessity of semantic-aware evaluation.

Introduction

Large Language Models (LLMs) have demonstrated impressive capabilities in automated program repair and vulnerability detection. However, most existing benchmarks focus on end-to-end outcomes—such as whether a model can generate a passing test case—rather than the reasoning process itself. This creates a "black box" problem: it is unclear if a model succeeds through genuine semantic reasoning or surface-level pattern recognition.

To truly assist in complex engineering, a model must understand program semantics: how values propagate through variables (data dependency), how conditions govern execution (control dependency), and how these two interact (information flow). CORE addresses this gap by providing a rigorous framework for testing these core skills.

The CORE Benchmark

CORE consists of 12,553 human-verified instances across C/C++, Java, and Python. To ensure the benchmark captures genuine reasoning challenges, the authors employed a Semantics-Aware Diverse Sampling strategy. Instead of random selection, code targets were chosen based on structural coverage (e.g., loops, if-else branches) and dependency depth, requiring multi-step reasoning rather than simple direct assignments.

Models are evaluated on three query types:

  1. Pairwise Query: Determining if element A depends on element B.
  2. Target-Centric Query: Enumerating all elements that influence a specific target X.
  3. Trace Generation: Providing a step-by-step path of the dependency.

Key Insights: Complexity and Biases

Our analysis reveals several systemic weaknesses in current LLMs. Performance declines sharply as the complexity of the code increases, specifically regarding function length and the number of conditional branches.

Figure 4: Impact of code complexity and structural features on model performance across various metrics.

A notable finding is the "Left-to-Right" Bias. LLMs struggle significantly with backward dependencies—scenarios where a later line influences an earlier one, common in loop structures. Performance on these tasks can drop by nearly 50% compared to forward dependencies. Furthermore, when prompted to generate a trace, models often exhibit a "Yes-Man" hallucination, where they are more likely to predict a dependency exists even when it does not, effectively hallucinating logic to justify a guess.

Experimental Results

We evaluated 10 mainstream LLMs, including specialized "reasoning" models like DeepSeek R1 and GPT-o3. While most models perform reasonably well on simple classification tasks, their performance plummets when faced with more rigorous requirements like full trace generation or exhaustive dependency enumeration.

Figure 6: Comparison of reasoning vs. non-reasoning models across Dependency Classification, Trace Generation, and Dependency Enumeration.

Gemini 2.5 Pro and GPT-o3 emerged as the top performers. However, even these models struggled with Information Flow tasks, which require the simultaneous integration of data and control flow logic. Additionally, the study found that Python tasks were generally more difficult for models than C or Java, likely due to Python's lack of explicit block delimiters and its reliance on "syntactic sugar," which complicates precise semantic tracking.

Conclusion and Future Work

The CORE benchmark demonstrates that while LLMs are improving, they are far from mastering the semantic reasoning required for reliable static analysis. Current limitations include a focus on intra-procedural analysis and functions under 100 lines of code. Future work will expand CORE to include inter-procedural analysis across multiple files and explore the impact of code obfuscation on model reasoning. By shifting the focus from output to process, CORE provides a roadmap for developing more trustworthy and capable AI assistants for software engineering.

Summary updated

BibTeX
@misc{xie2025core,
  author = {Danning Xie and Mingwei Zheng and Xuwei Liu and Jiannan Wang and Chengpeng Wang and Lin Tan and Xiangyu Zhang},
  title = {{CoRe: Benchmarking LLMs’ Code Reasoning Capabilities through Static Analysis Tasks}},
  year = {2025},
  eprint = {2507.05269},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.05269},
}
Figure