LLM 통합 애플리케이션을 위한 복잡도 지표 재고찰: 소스 코드 그 이상
Rethinking Complexity Metrics for LLM-Integrated Applications: Beyond Source Code
LLM(Large Language Model)이 통합된 애플리케이션은 자연어 프롬프트와 프로그램 코드를 결합하며, 이들의 실행 동작의 상당 부분은 코드 자체가 아닌 프롬프트 레이어에서 비롯됩니다. 그러나 기존의 복잡도 지표는 오직 코드 수준에서만 작동하기 때문에 이러한 동작 논리를 완전히 간과합니다. 본 연구에서는 LLM 통합 애플리케이션의 프롬프트와 코드 레이어를 모두 평가하도록 설계된 최초의 도구인 HECATE를 제시합니다. HECATE의 핵심은 '프롬프트-as-사양(Prompt-as-Specification)'이라는 Hoare 논리에 영감을 받은 형식으로, 모든 프롬프트를 의도된 동작의 사양으로 해석합니다. 기존 연구에서 식별된 25가지 복잡도 차원을 기반으로, 이 도구는 52개의 후보 지표를 생성합니다. 각 지표는 18개의 오픈 소스 저장소에서 수집된 118개 구성 요소에 대해 평가되며, 버전 기록에서 파생된 유지 관리 활동을 경험적 지표로 사용하여 복잡도를 측정하고, 코드 크기를 고려할 때 유의미성을 잃는 지표는 제거합니다. 이러한 검증 결과, 10개의 지표만이 살아남았습니다. 이 중 7개는 새로 도입한 집합에 속하며, 단순히 양을 측정하는 것이 아니라 LLM 호출 위치, 메모리 속성, 프롬프트 템플릿과 같이 구조적으로 구별되는 요소를 세는 '구조적 폭(structural breadth)'이라는 속성을 갖습니다. 나머지 3개의 기존 지표 중 RFC는 유사한 폭 지향적인 특성을 가지며, Halstead N 및 V는 코드 크기의 잔여 효과로만 생존합니다. 우리의 최고 성능 지표들은 이 모든 지표들을 능가합니다. 중요한 점은 프롬프트 레이어 지표들이 가장 강력한 코드 수준 지표를 공변량으로 추가하더라도 유의미성을 유지하며, 이는 프롬프트 복잡성을 자체적인 차원으로 확립한다는 것을 의미합니다. 마지막으로, 6개의 별도 저장소에서 추출된 20개 구성 요소에 대한 최종 검증 결과, 가장 성능이 좋은 두 지표가 학습 데이터셋을 넘어 일반화 가능하면서도 유지 관리 노력을 예측하는 데 계속 사용될 수 있음을 보여줍니다.
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.
No Analysis Report Yet
This paper hasn't been analyzed by Gemini yet.
Log in to request an AI analysis.