CoCoNUT: Structural Code Understanding does not fall out of a tree
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) have shown impressive performance across a wide array of tasks involving both structured and unstructured textual data. Recent results on various benchmarks for code generation, repair, or completion suggest that certain models have programming abilities comparable to or even surpass humans. In this work, we demonstrate that high performance on such benchmarks does not correlate to humans' innate ability to understand structural control flow in code. To this end, we extract solutions from the HumanEval benchmark, which the relevant models perform strongly on, and trace their execution path using function calls sampled from the respective test set. Using this dataset, we investigate the ability of seven state-of-the-art LLMs to match the execution trace and find that, despite their ability to generate semantically identical code, they possess limited ability to trace execution paths, especially for longer traces and specific control structures. We find that even the top-performing model, Gemini, can fully and correctly generate only 47% of HumanEval task traces. Additionally, we introduce a subset for three key structures not contained in HumanEval: Recursion, Parallel Processing, and Object-Oriented Programming, including concepts like Inheritance and Polymorphism. Besides OOP, we show that none of the investigated models achieve an accuracy over 5% on the relevant traces. Aggregating these specialized parts with HumanEval tasks, we present CoCoNUT: Code Control Flow for Navigation Understanding and Testing, which measures a model's ability to trace execution of code upon relevant calls, including advanced structural components. We conclude that current LLMs need significant improvement to enhance code reasoning abilities. We hope our dataset helps researchers bridge this gap.
Key facts. Cited by 7 papers in the map (data through 7 Oct 2026). Builds on 14 of its 24 references that are in the map. First posted on arXiv 27 Jan 2025.
Builds on
14 of 24 references.
References · 14
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2023Tree of Thoughts: Deliberate Problem Solving with Large Language Modelscited by 3,155
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 1,906
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
- 2021Show Your Work: Scratchpads for Intermediate Computation with Language Modelscited by 871
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
- 2024CRUXEval: A Benchmark for Code Reasoning, Understanding and Executioncited by 294
- 2024NExT: Teaching Large Language Models to Reason about Code Executioncited by 60
- 2024Reasoning Runtime Behavior of a Program with LLM: How Far Are We?cited by 44
- 2024SemCoder: Training Code Language Models with Comprehensive Semantics Reasoningcited by 27
2 more
Built on by
Citing papers per year: 2025: 5; 2026: 2.
7 papers.
- 2025DynaCode: A Dynamic Complexity-Aware Code Benchmark for Evaluating Large Language Models in Code Generationcited by 7
- 2025LLMs Lean on Priors, Not Programming Language Semanticscited by 5
- 2025Gistify! Codebase-Level Understanding via Runtime Executioncited by 4
- 2025Evaluating Code Reasoning Abilities of Large Language Models Under Real-World Settingscited by 3
- 2026OmniCode: A Benchmark for Evaluating Software Engineering Agentscited by 3
- 2025Parameter Importance-Driven Continual Learning for Foundation Modelscited by 2
- 2026Can LLMs Reason About Runtime Behavior? A Repository-Level Dynamic Benchmarkcited by 0
- 2026Can LLMs Reason About Runtime Behavior? A Repository-Level Dynamic Benchmark23 Sep 2026
- 2026OmniCode: A Benchmark for Evaluating Software Engineering Agents2 Feb 2026
- 2025Evaluating Code Reasoning Abilities of Large Language Models Under Real-World Settings16 Dec 2025
- 2025Parameter Importance-Driven Continual Learning for Foundation Models19 Nov 2025
- 2025Gistify! Codebase-Level Understanding via Runtime Execution30 Oct 2025
- 2025LLMs Lean on Priors, Not Programming Language Semantics3 Oct 2025
- 2025DynaCode: A Dynamic Complexity-Aware Code Benchmark for Evaluating Large Language Models in Code Generation13 Mar 2025
Similar, not cited
Close in wording, no citation either way
- 2026An Execution-Verified Multi-Language Benchmark for Code Semantic Reasoning
- 2026Not All Code Is Equal: A Data-Centric Study of Code Complexity and LLM Reasoning
- 2026The Path Not Taken: Duality in Reasoning about Program Execution
- 2025CoRe: Benchmarking LLMs Code Reasoning Capabilities through Static Analysis Tasks
- 2025Chain of Execution Supervision Promotes General Reasoning in Large Language Models
- 2026CoRE: A Fine-Grained Code Reasoning Benchmark Beyond Output Prediction
- 2026Evaluating Language Models on Cross-Language Code Functional Equivalence
- 2025On Code-Induced Reasoning in LLMs