Complexity-Aware Evaluation of LLM Comprehension
Not on the map. Why?
Abstract (arXiv)
Large language models (LLMs) are increasingly used for software engineering tasks that require understanding existing source code, including behavior prediction, function explanation, debugging, and code review. However, aggregate benchmark accuracy can conceal how model reliability changes as source code becomes structurally more complex. This paper presents a complexity-aware framework for evaluating LLM code comprehension using cyclomatic complexity, nesting depth, branching factor, and Halstead volume. We evaluate DeepSeek-Coder-V2 and Llama through two complementary tasks: automatic input-output prediction over 300 Python functions and manually assessed semantic comprehension over a balanced subset of 60 functions. The functions are grouped into Low-, Medium-, and High-complexity bands. DeepSeek-Coder-V2 achieves an overall automatic accuracy of 78.33%, compared with 70.33% for Llama. However, accuracy decreases substantially from Low to High complexity, from 93.52% to 52.78% for DeepSeek-Coder-V2 and from 87.04% to 47.22% for Llama. Incorrect predictions are consistently associated with higher values of all four complexity metrics, and correlation and logistic-regression analyses confirm broadly comparable negative associations between structural complexity and correctness. Manual semantic comprehension shows the same degradation pattern, with accuracy decreasing from 100.00% to 75.00% for DeepSeek-Coder-V2 and from 90.00% to 60.00% for Llama. These findings demonstrate that complexity-aware evaluation provides a more diagnostic assessment of LLM code-comprehension reliability than aggregate accuracy alone.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 28 of its 35 references that are in the map. First posted on arXiv 29 Sep 2026.
Builds on
28 of 35 references.
References · 28
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 1,906
- 2022Competition-Level Code Generation with AlphaCodecited by 1,427
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2021Measuring Coding Challenge Competence With APPScited by 879
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
- 2024BigCodeBench: Benchmarking Code Generation with Diverse Function Calls and Complex Instructionscited by 527
- 2023RepoBench: Benchmarking Repository-Level Code Auto-Completion Systemscited by 346
- 2024DeepSeek-Coder-V2: Breaking the Barrier of Closed-Source Models in Code Intelligencecited by 325
- 2024CRUXEval: A Benchmark for Code Reasoning, Understanding and Executioncited by 294
16 more
- 2023Large Language Models for Software Engineering: Survey and Open Problemscited by 178
- 2025LeetCodeDataset: A Temporal Dataset for Robust Evaluation and Efficient Training of Code LLMscited by 67
- 2023A Survey of Large Language Models for Code: Evolution, Benchmarking, and Future Trendscited by 66
- 2023A Survey on Large Language Models for Software Engineeringcited by 58
- 2023Is Stack Overflow Obsolete? An Empirical Study of the Characteristics of ChatGPT Answers to Stack Overflow Questionscited by 42
- 2025LongCodeBench: Evaluating Coding LLMs at 1M Context Windowscited by 37
- 2024Source Code Summarization in the Era of Large Language Modelscited by 30
- 2025Enhancing LLM-Based Code Generation with Complexity Metrics: A Feedback-Driven Approachcited by 10
- 2020An Empirical Validation of Cognitive Complexity as a Measure of Source Code Understandabilitycited by 7
- 2024CRQBench: A Benchmark of Code Reasoning Questionscited by 6
- 2025Automated Code Review Using Large Language Models at Ericsson: An Experience Reportcited by 5
- 2024Understanding Defects in Generated Codes by Language Modelscited by 4
- 2025Evaluating Code Reasoning Abilities of Large Language Models Under Real-World Settingscited by 3
- 2026Rethinking Code Complexity Through the Lens of Large Language Modelscited by 3
- 2026CoRE: A Fine-Grained Code Reasoning Benchmark Beyond Output Predictioncited by 2
- 2026Prompt Optimization for LLM Code Generation via Reinforcement Learningcited by 1
Built on by
Not cited yet.