Rethinking Complexity Metrics for LLM-Integrated Applications: Beyond Source Code
On the map: LLM reasoning → Reasoning for agents, planning and code
Abstract (arXiv)
LLM-integrated applications blend natural language prompts with program code, and much of their runtime behavior originates in the prompt layer rather than in the code itself. Existing complexity metrics, however, operate solely at the code level and therefore overlook this behavioral logic entirely. We present HECATE, the first tool designed to assess complexity in both the prompt and code layers of such applications. Central to HECATE is Prompt-as-Specification, a Hoare-logic-inspired formalism that interprets every prompt as a specification of intended behavior. Grounded in 25 complexity dimensions identified across published taxonomies, the tool generates 52 candidate metrics. We assess each metric against 118 components collected from 18 open-source repositories, relying on maintenance activity derived from version history as an empirical proxy for complexity, and discard any metric that loses significance once code size is accounted for. Only ten metrics withstand this test. Seven belong to our newly introduced set; rather than measuring sheer volume, each tallies structurally distinct elements, such as LLM call sites, memory attributes, and prompt templates, an attribute we call structural breadth. Of the three surviving conventional metrics, RFC exhibits a similar breadth-oriented character, while Halstead N and V survive only as a residual effect of size; our top-performing metrics exceed all three. Crucially, the prompt-layer metrics retain significance even when the strongest code-level metric is added as a covariate, establishing prompt complexity as a dimension in its own right. A final validation on 20 components spanning six held-out repositories shows that the two best-performing metrics continue to predict maintenance effort, supporting their generalizability beyond the training set.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 9 of its 36 references that are in the map. First posted on arXiv 2 Jul 2026.
Builds on
9 of 36 references.
Closest ancestors · 1
Same direction, newest first
Other references · 8
- 2023The Rise and Potential of Large Language Model Based Agents: A Surveycited by 1,422
- 2024Large Language Model based Multi-Agents: A Survey of Progress and Challengescited by 752
- 2026Inside the Scaffold: A Source-Code Taxonomy of Coding Agent Architecturescited by 15
- 2025A Taxonomy of Prompt Defects in LLM Systemscited by 7
- 2025Unified Tool Integration for LLMs: A Protocol-Agnostic Approach to Function Callingcited by 3
- 2025PromptDebt: A Comprehensive Study of Technical Debt Across LLM Projectscited by 3
- 2025Prompts as Software Engineering Artifacts: A Research Agenda and Preliminary Findingscited by 2
- 2026AI-Generated Smells: An Analysis of Code and Architecture in LLM and Agent-Driven Developmentcited by 2
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026Rethinking Code Complexity Through the Lens of Large Language Models
- 2026How Generation Architecture Shapes Code Complexity in Multi-Agent LLM Systems: A Paired Study on HumanEval
- 2026CodeGlance: Understanding Code Reasoning Challenges in LLMs through Multi-Dimensional Feature Analysis
- 2026An Empirical Evaluation of LLM-Generated Code Security Across Prompting Methods
- 2025Evaluating Code Reasoning Abilities of Large Language Models Under Real-World Settings
- 2024Symbolic Prompt Program Search: A Structure-Aware Approach to Efficient Compile-Time Prompt Optimization
- 2025Do Prompt Patterns Affect Code Quality? A First Empirical Assessment of ChatGPT-Generated Code
- 2025Can LLMs Reason About Program Semantics? A Comprehensive Evaluation of LLMs on Formal Specification Inference