LLM Comprehension Complexity Evaluation
Complexity-Aware Evaluation of LLM Comprehension
This research reveals that LLM performance degrades significantly as code complexity increases, a critical insight masked by aggregate accuracy metrics. Developers and organizations relying on AI for code review or debugging should consider complexity-specific performance when selecting models, as even advanced models like DeepSeek-Coder-V2 struggle with highly complex code structures.
Researchers evaluated DeepSeek-Coder-V2 and Llama on code comprehension tasks using 300 Python functions.
The models achieved 78.33% and 70.
33% overall automatic accuracy respectively.Accuracy decreased substantially from Low to High complexity bands, with DeepSeek-Coder-V2 dropping from 93.
52% to 52.78% and Llama from 87.
04% to 47.22%.
Manual semantic comprehension showed similar degradation patterns.
Complexity-Aware Evaluation of LLM Comprehension
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.
This report is categorized under AITOP's "Papers" desk, focusing on China's AI industry and domestic foundation model ecosystem. Within our cross-regional analytical framework, it directly maps to AI developer toolchains, coding agents, and engineering workflows. Key entities and technical topics under continuous tracking include DeepSeek-Coder-V2, Llama, code understanding.
Primary source verification: published directly by arXiv: DeepSeek with first-party authority.