TraceCoder: 추적 기반 다중 에이전트 프레임워크를 이용한 LLM 생성 코드 자동 디버깅
TraceCoder: A Trace-Driven Multi-Agent Framework for Automated Debugging of LLM-Generated Code
대규모 언어 모델(LLM)은 복잡한 작업에서 특히 미묘하지만 중요한 버그를 포함하는 코드를 생성하는 경우가 많습니다. 기존의 자동 수정 방법은 일반적으로 표면적인 성공/실패 신호에 의존하며, 프로그램 동작에 대한 제한적인 정보를 제공하여 정확한 오류 위치 파악을 어렵게 합니다. 또한, 이전 실패로부터 학습할 수 있는 방법이 없기 때문에 수정 프로세스는 종종 반복적이고 비효율적인 순환에 빠집니다. 이러한 문제를 해결하기 위해, 우리는 인간 전문가의 관찰-분석-수정 과정을 모방하는 협업 다중 에이전트 프레임워크인 TraceCoder를 제시합니다. 이 프레임워크는 먼저 진단 프로브를 사용하여 코드에 대한 상세한 런타임 추적 정보를 캡처하여 프로그램의 내부 실행에 대한 심층적인 통찰력을 제공합니다. 그런 다음, 이러한 추적 정보에 대해 인과 분석을 수행하여 오류의 근본 원인을 정확하게 식별합니다. 이 프로세스는 또한 새로운 과거 학습 메커니즘(HLLM)에 의해 향상됩니다. HLLM은 이전의 실패한 수정 시도에서 얻은 통찰력을 추출하여 후속 수정 전략을 개선하고 유사한 오류의 재발을 방지합니다. 안정적인 수렴을 보장하기 위해, 롤백 메커니즘은 각 수정 반복이 올바른 해결책으로 향한 엄격한 개선을 구성하도록 합니다. 다양한 벤치마크에 대한 종합적인 실험 결과, TraceCoder는 기존의 고급 기준 모델보다 최대 34.43%의 상대적인 Pass@1 정확도 향상을 달성했습니다. Ablation 연구를 통해 각 시스템 구성 요소의 중요성이 확인되었으며, 반복적인 수정 프로세스 자체만으로도 정확도가 65.61%만큼 향상되었습니다. 또한, TraceCoder는 정확도와 비용 효율성 측면에서 선도적인 반복적인 방법보다 훨씬 우수한 성능을 보였습니다.
Large Language Models (LLMs) often generate code with subtle but critical bugs, especially for complex tasks. Existing automated repair methods typically rely on superficial pass/fail signals, offering limited visibility into program behavior and hindering precise error localization. In addition, without a way to learn from prior failures, repair processes often fall into repetitive and inefficient cycles. To overcome these challenges, we present TraceCoder, a collaborative multi-agent framework that emulates the observe-analyze-repair process of human experts. The framework first instruments the code with diagnostic probes to capture fine-grained runtime traces, enabling deep insight into its internal execution. It then conducts causal analysis on these traces to accurately identify the root cause of the failure. This process is further enhanced by a novel Historical Lesson Learning Mechanism (HLLM), which distills insights from prior failed repair attempts to inform subsequent correction strategies and prevent recurrence of similar mistakes. To ensure stable convergence, a Rollback Mechanism enforces that each repair iteration constitutes a strict improvement toward the correct solution. Comprehensive experiments across multiple benchmarks show that TraceCoder achieves up to a 34.43\% relative improvement in Pass@1 accuracy over existing advanced baselines. Ablation studies verify the significance of each system component, with the iterative repair process alone contributing a 65.61\% relative gain in accuracy. Furthermore, TraceCoder significantly outperforms leading iterative methods in terms of both accuracy and cost-efficiency.
No Analysis Report Yet
This paper hasn't been analyzed by Gemini yet.