ChatPaper.aiChatPaper

코드 에이전트에게 얼마나 많은 정적 구조가 필요한가? 결정론적 앵커링에 대한 연구

How Much Static Structure Do Code Agents Need? A Study of Deterministic Anchoring

June 25, 2026
저자: Zhihao Lin, Mingyi Zhou, Yizhuo Yang, Li Li
cs.AI

초록

LLM 기반 코드 에이전트는 키워드 검색을 통해 저장소를 탐색하지만, 호출 그래프, 상속 계층, 구성 종속성 등 소프트웨어의 실제 작동 방식을 정의하는 구조적 관계를 놓친다. 이로 인해 에이전트 탐색은 확률적(stochastic)이 되고 실행 간 재현이 어려워진다. 본 연구는 경량 정적 분석이 이러한 에이전트에 대해 결정적 앵커(deterministic anchors), 즉 일반 텍스트 주석으로 주입되어 확률적 탐색을 제약하고 탐색을 더 예측 가능하게 만드는 안정적인 구조적 사실을 제공할 수 있는지 조사한다. 강력한 기준선인 OpenAI의 Codex에서 시작하여, 다양한 세분성의 구조적 주석을 체계적으로 주입하고, 이들이 위치 파악(localization), 궤적 행동(trajectory behavior), 실행 간 안정성에 미치는 영향을 측정한다. 본 연구는 우리가 결정적 앵커링 효과라고 부르는 것을 확인한다. 즉, 정적 구조는 에이전트를 '더 똑똑하게' 만들기보다는 탐색을 규율 있고 재현 가능하게 만듦으로써 더 큰 도움을 준다. 세 가지 관찰 결과가 이 발견을 뒷받침한다: (1) 앵커링은 효과적이다: 경량 호출/상속 토폴로지가 함수 수준 위치 파악을 개선하고(+2.2%포인트 Func@5), 궤적을 단축시킨다(-1.6 상호작용 라운드). (2) 앵커링은 규모에 민감하다: 최적의 세분성과 방향성은 저장소 특성에 따라 달라지며, 밀집된 의미론은 수확 체감을 보이고, 허브 중심(hub-heavy) 프로젝트는 순방향 엣지 없이 '누가 나를 호출하는지'를 드러내는 역방향 링크만으로 이점을 얻는다. (3) 앵커링은 안정화한다: 태그는 링크 추종률을 0.15-0.18에서 0.21-0.24로 높이고, 실행 간 분산을 대략 절반으로 줄이며, 중간 규모 저장소에서 단일 실행 신뢰도를 개선하지만(Pass@1 +3.4%포인트), 약 10% 더 많은 입력 토큰을 필요로 한다. 이러한 관찰 결과는 실용적인 지침을 제시한다: 중간 규모 프로젝트에서는 기본적으로 경량 토폴로지를 사용하고, 대규모 저장소에서는 순방향 엣지를 제거하며, 암시적 종속성 사례에 대해서만 밀집 태그를 남겨두는 것이다.
English
LLM-based code agents navigate repositories through keyword search but miss the structural relationships, such as call graphs, inheritance hierarchies, and configuration dependencies, that define how software actually works. This makes agent navigation stochastic and difficult to reproduce across runs. We investigate whether lightweight static analysis can provide deterministic anchors for these agents: stable structural facts injected as plain-text comments that constrain probabilistic exploration and make navigation more predictable. Starting from a strong baseline, Codex from OpenAI, we systematically inject varying granularities of structural annotations and measure their effects on localization, trajectory behavior, and run-to-run stability. Our study identifies what we call the deterministic anchoring effect: static structure helps less by making agents "smarter" and more by making their navigation disciplined and reproducible. Three observations support this finding: (1) Anchoring works: lightweight call/inheritance topology improves function-level localization (+2.2pp Func@5) and shortens trajectories (-1.6 interaction rounds); (2) Anchoring is scale-sensitive: the optimal granularity and directionality depend on repository characteristics, where denser semantics show diminishing returns and hub-heavy projects benefit from inverse-only links that expose "who-calls-me" without forward edges; (3) Anchoring stabilizes: tags raise link-following rate from 0.15-0.18 to 0.21-0.24, roughly halve run-to-run variance, and improve single-run reliability (Pass@1 +3.4 pp) on medium-scale repositories, at the cost of roughly 10% more input tokens. These observations suggest practical guidelines: default to lightweight topology on medium projects, prune forward edges in large repositories, and reserve dense tags for implicit-dependency cases.