[논문 리뷰] Keep the Conversation Going: Fixing 162 out of 337 bugs for $0.42 each using ChatGPT
ChatRepair를 소개합니다. 대화 기반 APR 접근법으로 Patch 생성과 즉각적인 피드백을 ChatGPT와 함께 번갈아 수행하여 Defects4j에서 최첨단 수정 성능을 달성했고 337개 버그 중 162개를 수정했으며 버그당 비용은 $0.42입니다.
Automated Program Repair (APR) aims to automatically generate patches for buggy programs. Recent APR work has been focused on leveraging modern Large Language Models (LLMs) to directly generate patches for APR. Such LLM-based APR tools work by first constructing an input prompt built using the original buggy code and then queries the LLM to generate patches. While the LLM-based APR tools are able to achieve state-of-the-art results, it still follows the classic Generate and Validate repair paradigm of first generating lots of patches and then validating each one afterwards. This not only leads to many repeated patches that are incorrect but also miss the crucial information in test failures as well as in plausible patches. To address these limitations, we propose ChatRepair, the first fully automated conversation-driven APR approach that interleaves patch generation with instant feedback to perform APR in a conversational style. ChatRepair first feeds the LLM with relevant test failure information to start with, and then learns from both failures and successes of earlier patching attempts of the same bug for more powerful APR. For earlier patches that failed to pass all tests, we combine the incorrect patches with their corresponding relevant test failure information to construct a new prompt for the LLM to generate the next patch. In this way, we can avoid making the same mistakes. For earlier patches that passed all the tests, we further ask the LLM to generate alternative variations of the original plausible patches. In this way, we can further build on and learn from earlier successes to generate more plausible patches to increase the chance of having correct patches. While our approach is general, we implement ChatRepair using state-of-the-art dialogue-based LLM -- ChatGPT. By calculating the cost of accessing ChatGPT, we can fix 162 out of 337 bugs for \$0.42 each!
연구 동기 및 목표
- 정적 프롬프트에 의존하고 테스트 실패 통합이 부족한 전통적 및 기존 LLM 기반 APR 접근법의 한계를 동기부여하고 해결한다.
- 테스트 실패 정보와 과거 패치 이력을 활용하여 패치 생성을 안내하는 완전 자동 대화 기반 APR 워크플로우를 제안한다.
- 패치 생성을 즉시 피드백과 교호 배치하는 것이 기존 방법에 비해 패치 품질과 다양성을 향상시킨다는 것을 보여준다.
- 수정된 각 버그당 ChatGPT API 사용량을 계산하여 비용 의식 있는 평가를 시연한다.
제안 방법
- 피드백 루프가 있는 대화로 패치를 생성하기 위해 ChatGPT를 기반으로 한 대화형 APR 도구인 ChatRepair를 제안한다.
- 초기 프롬트를 구성하고 패치 생성을 안내하기 위해 간결하고 관련된 테스트 실패 정보를 추출한다.
- 실패한 패치를 반복하지 않도록 하기 위해 패치 생성과 즉각적인 테스트 기반 피드백을 교대로 수행하고 오류로부터 학습한다.
- 가능한 패치에 대해 대안 변형을 생성하여 후보 수정 집합을 확장한다.
- Defects4j 1.2, 2.0 및 QuixBugs에서 평가하여 최첨단 수리 성능을 확립하고 버당 비용을 계산한다.
- 풍부한 테스트 실패 정보와 패치 이력을 포함시킬 수 있는 프롬프트 기반 상호작용을 사용하여 일반성을 지원한다.

실험 결과
연구 질문
- RQ1전통적인 Generate-and-Validate 방식과 비교하여 LLM과의 대화 기반 상호작용이 자동 패치 생성을 개선할 수 있는가?
- RQ2테스트 실패 정보와 이전 패치 이력을 포함하는 것이 더 그럴듯하고 정확한 패치를 가능하게 하는가?
- RQ3표준 벤치마크에서 ChatGPT를 활용한 대화형 APR을 사용할 때 수리 성능 향상과 관련 비용은 무엇인가?
주요 결과
- ChatRepair는 Defects4j 1.2에서 114개의 올바른 수정으로 최첨단 수리 성능을 달성하고 Defects4j 2.0에서 48개를 달성했다.
- 이 방법은 337개 버그 중 162개를 수정했으며 버그당 비용은 $0.42이다.
- 풍부한 테스트 실패 정보와 대화 기록을 도입하면 패치 품질이 향상되고 더 다양한 그럴듯한 패치들이 나온다.
- 고찰 연구에서 실패 정보와 대화형 패러다임의 사용으로 이득이 나타난다.
- 평가에는 Defects4j 1.2, 2.0 및 QuixBugs 데이터세트가 포함되며 기존 비교기 대비 우수한 성능을 보여준다.

더 나은 연구,지금 바로 시작하세요
논문 읽기부터 검토까지, 연구 시간을 획기적으로 줄여보세요.
카드 등록 없음 · 무료 플랜 제공
이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.