Skip to main content
QUICK REVIEW

[논문 리뷰] RepairAgent: An Autonomous, LLM-Based Agent for Program Repair

Islem Bouzenia, Prémkumar Dévanbu|arXiv (Cornell University)|2024. 03. 25.
AI-based Problem Solving and Planning인용 수 13
한 줄 요약

RepairAgent는 동적 프롕프(prompt)와 일련의 repairTools, 그리고 버그 수정을 가이드하는 유한 상태 기계(FSM)를 활용하는 최초의 자율 LLM 기반 프로그램 수리 에이전트로, Defects4J에서 164건의 정확한 수리를 달성했으며(그 중 39건은 이전 연구에서 수정되지 않음), 버그당 약 14센트 소요됩니다.

ABSTRACT

Automated program repair has emerged as a powerful technique to mitigate the impact of software bugs on system reliability and user experience. This paper introduces RepairAgent, the first work to address the program repair challenge through an autonomous agent based on a large language model (LLM). Unlike existing deep learning-based approaches, which prompt a model with a fixed prompt or in a fixed feedback loop, our work treats the LLM as an agent capable of autonomously planning and executing actions to fix bugs by invoking suitable tools. RepairAgent freely interleaves gathering information about the bug, gathering repair ingredients, and validating fixes, while deciding which tools to invoke based on the gathered information and feedback from previous fix attempts. Key contributions that enable RepairAgent include a set of tools that are useful for program repair, a dynamically updated prompt format that allows the LLM to interact with these tools, and a finite state machine that guides the agent in invoking the tools. Our evaluation on the popular Defects4J dataset demonstrates RepairAgent's effectiveness in autonomously repairing 164 bugs, including 39 bugs not fixed by prior techniques. Interacting with the LLM imposes an average cost of 270,000 tokens per bug, which, under the current pricing of OpenAI's GPT-3.5 model, translates to 14 cents of USD per bug. To the best of our knowledge, this work is the first to present an autonomous, LLM-based agent for program repair, paving the way for future agent-based techniques in software engineering.

연구 동기 및 목표

  • 자동 프로그램 수리(APR) 및 고정 프롬프트 LLM 루프를 넘는 자율적 의사 결정 에이전트의 필요성에 대한 동기 부여.
  • RepairAgent를 계획하고 실행하며 버그 수정을 검증하는 자율적 도구 기반 LLM으로서 도입.
  • Defects4J에서의 효과성 시연 및 기존 방법이 달성하지 못한 수정 분석, 자원 비용 분석.

제안 방법

  • 일련의 repair 도구를 통해 버그 수정 작업을 계획하고 실행할 수 있는 자율 LLM 에이전트를 정의합니다.
  • 에이전트를 버그 이해, 정보 수집, 패치 검증으로 안내하는 동적으로 업데이트되는 프롬프트 형식을 소개합니다.
  • 도구 사용을 제약하고 수리 프로세스를 안내하기 위한 유한 상태 머신을 활용합니다.
  • LLM 출력의 도구 호출 매핑 및 오류 처리 휴리스틱을 포함하는 미들웨어를 제공합니다.
  • 사람의 수리 워크플로를 모방하기 위해 14개의 도구(코드 읽기/추출, 코드 검색/생성, 테스트/패치, 제어) 활용.
  • Defects4J 데이터세트에서 수리를 수행하고 세 가지 베이스라인(ChatRepair, ITER, SelfAPR)과 비교합니다.
Figure 1 : Overview of RepairAgent.
Figure 1 : Overview of RepairAgent.

실험 결과

연구 질문

  • RQ1RQ1 RepairAgent가 실제 버그 수정에서 얼마나 효과적인가?
  • RQ2RQ2 접근 방식의 비용은 얼마나 되는가?
  • RQ3RQ3 LLM 에이전트가 사용 가능한 도구를 어떻게 활용하는가?

주요 결과

  • RepairAgent는 Defects4J에서 164건의 버그를 수정했으며, 그중 39건은 기존 연구에서 수정되지 않았습니다.
  • RepairAgent는 v1.2에서 74건의 정확한 수정, v2.0에서 90건의 정확한 수정으로 186건의 그럴듯한 수정을 달성했습니다.
  • 상호 작용당 평균 토큰 비용은 버당 약 270,000 토큰( GPT-3.5 가격 기준 약 $0.14)입니다.
  • RepairAgent는 단일 행, 다중 행, 다중 파일 버그에서의 능력을 시연합니다(1, 1행: 115, 다중 행: 46, 다중 파일: 3).
  • ChatRepair, ITER, SelfAPR과 비교할 때 RepairAgent는 총 수정 건수에서 비슷한 수준의 성과를 보이고 Defects4Jv2에서 우수하며 다른 연구들이 수정한 수보다 더 많은 90건의 버그를 수정했습니다.
  • 이 접근 방식은 도구 세트에 의존하는 독점 수정(예: find_similar_api_calls, generate_method_body) 등 다수의 독점 수정들을 생성합니다.
Figure 2 : State machine to guide selection of tools.
Figure 2 : State machine to guide selection of tools.

더 나은 연구,지금 바로 시작하세요

연구 설계부터 논문 작성까지, 연구 시간을 획기적으로 줄여보세요.

카드 등록 없음 · 무료 플랜 제공

이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.