Rethinking Code Complexity Through the Lens of Large Language Models
On the map: LLM reasoning → Reasoning for agents, planning and code
Abstract (arXiv)
Code complexity metrics such as cyclomatic complexity have long been used to assess software quality and maintainability. With the rapid advancement of large language models (LLMs) on coding tasks, an important yet underexplored question arises: do traditional complexity metrics meaningfully characterize the coding difficulty that LLMs perceive? In this work, we empirically demonstrate that classical complexity metrics exhibit no consistent correlation with LLM performance, revealing a fundamental mismatch with model-perceived difficulty. To address this gap, we propose LM-CC, a novel code complexity metric tailored for LLMs, grounded in the hypothesis that model-perceived code difficulty is fundamentally driven by semantic nonlinearity. LM-CC quantifies complexity through an entropy-guided semantic compositional hierarchy, capturing the cumulative uncertainty encountered by LLMs during code understanding. Our experimental results demonstrate that LM-CC exhibits strong and consistent partial correlations with LLM performance, while semantics-preserving reductions in LM-CC consistently lead to improved downstream task performance. The source code is available at: https://github.com/xchen121/lm-cc.
Key facts. Cited by 3 papers in the map (data through 7 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 12 of its 45 references that are in the map. First posted on arXiv 8 Feb 2026.
Builds on
12 of 45 references.
Closest ancestors · 2
Same direction, newest first
- 2024Qwen2.5-Coder Technical Report18 Sep
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Code12 Mar
Other references · 10
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2024DeepSeek-V3 Technical Reportcited by 724
- 2025Beyond the 80/20 Rule: High-Entropy Minority Tokens Drive Effective Reinforcement Learning for LLM Reasoningcited by 540
- 2024StarCoder 2 and The Stack v2: The Next Generationcited by 484
- 2024DeepSeek-Coder-V2: Breaking the Barrier of Closed-Source Models in Code Intelligencecited by 325
- 2023OctoPack: Instruction Tuning Code Large Language Modelscited by 178
- 2025Entropy-Gated Branching for Efficient Test-Time Reasoningcited by 21
- 2024Perplexed: Understanding When Large Language Models are Confusedcited by 9
- 2026Intelligence Degradation in Long-Context LLMs: Critical Threshold Determination via Natural Length Distribution Analysiscited by 4
Built on by
Citing papers per year: 2026: 3.
3 papers.
- 2026ACEM: A Cost Estimation Model for Agentic Software Engineeringcited by 0
- 2026Can Agents Design Libraries for Agents?cited by 0
- 2026Complexity-Aware Evaluation of LLM Comprehensioncited by 0
- 2026Complexity-Aware Evaluation of LLM Comprehension29 Sep 2026
- 2026Can Agents Design Libraries for Agents?29 Sep 2026
- 2026ACEM: A Cost Estimation Model for Agentic Software Engineering3 Aug 2026
Similar, not cited
Close in wording, no citation either way
- 2026Rethinking Complexity Metrics for LLM-Integrated Applications: Beyond Source Code
- 2026Not All Code Is Equal: A Data-Centric Study of Code Complexity and LLM Reasoning
- 2025Evaluating Code Reasoning Abilities of Large Language Models Under Real-World Settings
- 2026Narrowing the Complexity Gap in the Evaluation of Large Language Models ↗
- 2025code_transformed: The Influence of Large Language Models on Code
- 2026CodeGlance: Understanding Code Reasoning Challenges in LLMs through Multi-Dimensional Feature Analysis
- 2025Beyond Synthetic Benchmarks: Evaluating LLM Performance on Real-World Class-Level Code Generation
- 2025BigO(Bench): Can LLMs Generate Code with Controlled Time and Space Complexity?