에이전트 기반 코드 추론
Agentic Code Reasoning
LLM 에이전트가 코드를 실행하지 않고도 코드베이스를 탐색하고 코드 의미를 추론할 수 있을까요? 본 연구에서는 이러한 능력을 '에이전트 기반 코드 추론'이라고 정의하고, 에이전트가 명시적인 전제를 구성하고, 실행 경로를 추적하며, 형식적인 결론을 도출하도록 요구하는 구조화된 프롬프팅 방법론인 '준형식적 추론'을 소개합니다. 비구조화된 사고 과정(chain-of-thought)과 달리, 준형식적 추론은 인증 역할을 합니다. 즉, 에이전트는 특정 사례를 건너뛰거나 근거 없는 주장을 할 수 없습니다. 본 연구는 세 가지 작업(패치 동등성 검증, 오류 위치 추적, 코드 질문 답변)에 대해 실험을 진행했으며, 준형식적 추론이 모든 작업에서 정확도를 꾸준히 향상시키는 것을 확인했습니다. 패치 동등성 검증의 경우, 준형식적 추론을 사용했을 때 정확도가 78%에서 88%로 향상되었으며, 실제 에이전트가 생성한 패치에 대해서는 93%의 정확도를 달성했습니다. 이는 실행 없이도 강화학습(RL)의 보상 신호를 얻을 수 있을 만큼 높은 신뢰도를 나타냅니다. RubberDuckBench 데이터셋(Mohammad et al., 2026)을 사용한 코드 질문 답변 작업에서는 준형식적 추론이 87%의 정확도를 달성했습니다. 또한, Defects4J 데이터셋(Just et al., 2014)을 사용한 오류 위치 추적 작업에서는 준형식적 추론이 일반적인 추론 방식보다 Top-5 정확도를 5%p 향상시켰습니다. 이러한 결과는 구조화된 에이전트 기반 추론이 실행 없이 의미 있는 코드 의미 분석을 가능하게 하며, 이는 강화학습 훈련 파이프라인, 코드 검토, 정적 프로그램 분석 등 다양한 분야에 활용될 수 있음을 보여줍니다.
Can LLM agents explore codebases and reason about code semantics without executing the code? We study this capability, which we call agentic code reasoning, and introduce semi-formal reasoning: a structured prompting methodology that requires agents to construct explicit premises, trace execution paths, and derive formal conclusions. Unlike unstructured chain-of-thought, semi-formal reasoning acts as a certificate: the agent cannot skip cases or make unsupported claims. We evaluate across three tasks (patch equivalence verification, fault localization, and code question answering) and show that semi-formal reasoning consistently improves accuracy on all of them. For patch equivalence, accuracy improves from 78% to 88% on curated examples and reaches 93% on real-world agent-generated patches, approaching the reliability needed for execution-free RL reward signals. For code question answering on RubberDuckBench Mohammad et al. (2026), semi-formal reasoning achieves 87% accuracy. For fault localization on Defects4J Just et al. (2014), semi-formal reasoning improves Top-5 accuracy by 5 percentage points over standard reasoning. These results demonstrate that structured agentic reasoning enables meaningful semantic code analysis without execution, opening practical applications in RL training pipelines, code review, and static program analysis.
No Analysis Report Yet
This paper hasn't been analyzed by Gemini yet.
Log in to request an AI analysis.