Skip to main content
QUICK REVIEW

[논문 리뷰] CigaR: Cost-efficient Program Repair with LLMs

Dávid Hidvégi, Khashayar Etemadi|arXiv (Cornell University)|2024. 02. 09.
Parallel Computing and Optimization TechniquesComputer Science인용 수 8
한 줄 요약

CigaR는 버그를 수정하면서 토큰 비용을 최소화하는 LLM 기반 프로그램 수정 도구이다; Defects4J에서 토큰 비용을 62% 절감하고 267개 버그 중 69개를 수정하며(정확한 패치 25.8%), 이전의 GPT 기반 APR 도구들보다 우수한 성과를 보인다.

ABSTRACT

Large language models (LLM) have proven to be effective at automated program repair (APR). However, using LLMs can be costly, with companies invoicing users by the number of tokens. In this paper, we propose CigaR, the first LLM-based APR tool that focuses on minimizing the repair cost. CigaR works in two major steps: generating a first plausible patch and multiplying plausible patches. CigaR optimizes the prompts and the prompt setting to maximize the information given to LLMs using the smallest possible number of tokens. Our experiments on 429 bugs from the widely used Defects4J and HumanEval-Java datasets shows that CigaR reduces the token cost by 73%. On average, CigaR spends 127k tokens per bug while the baseline uses 467k tokens per bug. On the subset of bugs that are fixed by both, CigaR spends 20k per bug while the baseline uses 608k tokens, a cost saving of 96%. Our extensive experiments show that CigaR is a cost-effective LLM-based program repair tool that uses a low number of tokens to automatically generate patches.

연구 동기 및 목표

  • LLM 기반 자동 프로그램 수정(APR)의 재정적·환경적 비용 감소를 동기로 삼는다.
  • 패치 품질을 보존하거나 향상시키면서 토큰 사용을 최소화하는 APR 시스템을 개발한다.
  • 정보를 토큰당 최대한으로 활용하고 다양한 패치를 효율적으로 탐색하기 위한 프롬프트 전략을 설계하고 구성한다.
  • 표준 벤치마크(Defects4J)에서 최첨단 GPT 기반 APR 도구와 비교하여 CigaR을 평가한다.

제안 방법

  • 세 가지 프롬프트가 협력하여 작동한다: 초기 패치를 생성하는 시작 프롬프트, 부분 패치를 다듬는 개선 프롬프트, 다양한 타당한 패치를 생성하는 곱셈 프롬프트.
  • 과도한 토큰 사용 없이 정보를 제공하는 맥락을 구축하기 위해 이전 응답의 요약을 통한 반복 프롬팅.
  • 다양하고 타당한 패치를 생성하는 패치 곱셈으로 탐색 공간의 중복 탐색을 감소시킨다.
  • 다른 영역의 탐색을 위한 고온도(High-temperature), 재부팅 기반 탐색으로 탐색 공간을 확장한다.
  • 재현성과 비용 추적을 위해 프롬프트, 응답, 테스트 결과를 캐싱한다.
  • Python으로 구현되며 GPT-3.5-turbo-0301을 사용하고 샘플링 온도는 1이며 토큰 비용 인식 워크플로우를 적용한다.
Figure 1 . Overview of CigaR : CigaR combines original prompting techniques, incl. partial patch improvement, search rebooting and patch multiplication to reach high effectiveness at a low token cost.
Figure 1 . Overview of CigaR : CigaR combines original prompting techniques, incl. partial patch improvement, search rebooting and patch multiplication to reach high effectiveness at a low token cost.

실험 결과

연구 질문

  • RQ1CigaR이 최첨단 GPT 기반 APR 도구와 비교했을 때 합리적이고 올바른 패치를 생성하는 데 얼마나 효과적인가?
  • RQ2Defects4J 버그 해결에 있어 CigaR은 기준치에 비해 토큰 비용이 얼마나 효율적인가?
  • RQ3재부팅과 패치-곱셈이 패치 탐색 공간을 어떻게 확장하고 패치 다양성을 높이는 데 기여하는가?

주요 결과

  • CigaR은 267개 버그 중 69개를 수정(정확한 AST 일치 25.8%)하고 여러 라운드 후 185/267의 그럴듯한 패치(69.2%)를 생성한다.
  • CigaR은 평균적으로 토큰 비용을 62% 절감한다(버그당 171K 대 451K 토큰), ChatRepair와 비교하여.
  • 두 도구가 수정한 버그에 대해 CigaR은 토큰 비용의 97%를 절감한다(평균 20K 대 695K 토큰).
  • CigaR은 더 높은 그럴듯함과 패치 다양성을 달성하며, 연구 대상 집합에서 CigaR에 의해 독자적으로 해결된 24개 버그와 두 도구 중 어느 쪽으로든 해결된 45개 버그가 있다.
  • 패치 탐색 전략(재부팅 및 곱셈)은 서로 다른 패치를 점진적으로 증가시키며 탐색 공간 탐색의 효과를 보여준다.
Figure 2 . P1: initiation prompt structure used for plausible patch search initiation.
Figure 2 . P1: initiation prompt structure used for plausible patch search initiation.

이 논문 읽기

누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.

누빈트에서 이 논문 읽기

이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.