Skip to main content
QUICK REVIEW

[논문 리뷰] An Empirical Evaluation of Pre-trained Large Language Models for Repairing Declarative Formal Specifications

Mohannad Alhanahnah, Md Rashedul Hasan|arXiv (Cornell University)|2024. 04. 17.
Natural Language Processing TechniquesComputer Science인용 수 3
한 줄 요약

이 논문은 수리 가능한 선언적 형식 명세를 반복적으로 수정하기 위해 복수의 에이전트를 사용하는 LLM 파이프라인을 제안한다. 수리 에이전트와 프롬프트 에이전트를 통해 고정된 형식 명세를 수정한다. GPT-4 버전은 기존의 APR 도구보다 높은 수준의 수리 효율성을 보였지만, 약간의 런타임 및 토큰 사용 증가를 동반하여, 선언적 명세 수리 분야에서 LLM의 잠재력을 입증한다.

ABSTRACT

Automatic Program Repair (APR) has garnered significant attention as a practical research domain focused on automatically fixing bugs in programs. While existing APR techniques primarily target imperative programming languages like C and Java, there is a growing need for effective solutions applicable to declarative software specification languages. This paper systematically investigates the capacity of Large Language Models (LLMs) to repair declarative specifications in Alloy, a declarative formal language used for software specification. We designed 12 different repair settings, encompassing single-agent and dual-agent paradigms, utilizing various LLMs. These configurations also incorporate different levels of feedback, including an auto-prompting mechanism for generating prompts autonomously using LLMs. Our study reveals that dual-agent with auto-prompting setup outperforms the other settings, albeit with a marginal increase in the number of iterations and token usage. This dual-agent setup demonstrated superior effectiveness compared to state-of-the-art Alloy APR techniques when evaluated on a comprehensive set of benchmarks. This work is the first to empirically evaluate LLM capabilities to repair declarative specifications, while taking into account recent trending LLM concepts such as LLM-based agents, feedback, auto-prompting, and tools, thus paving the way for future agent-based techniques in software engineering.

연구 동기 및 목표

  • 선형형 대규모 언어 모델(LLM)을 사용하여 Alloy에서 선언적 형식 명세를 자동으로 수리할 수 있는지 탐구하는 것.
  • 지루한 언어에 비해 성숙한 솔루션이 부족한 선언적 언어를 위한 자동 프로그램 수리(APR)의 격차를 메우는 것.
  • 적응형 프롬프트 생성과 반복적 개선을 통해 수리 정확도를 향상시키는 새로운 이중 에이전트 LLM 파이프라인을 설계하고 평가하는 것.
  • 포괄적인 벤치마크에서 LLM 기반 수리 기법을 최신 Alloy APR 기법들(예: ARepair, ICEBAR, BeAFix, ATR)과 비교 평가하는 것.
  • 런타임, 토큰 사용량, 금전적 비용 측면에서 LLM 기반 수리의 성능, 비용, 실패 특성 분석

제안 방법

  • 이중 에이전트 LLM 프레임워크 제안: 수리 에이전트는 수정을 생성하고, 프롬프트 에이전트는 각 수리 반복에 맞는 맥락 기반 프롬프트를 동적으로 생성한다.
  • 최대 6회의 수리 시도를 포함하는 반복적 수리 프로세스를 적용하며, 6가지의 다른 설정에서 LLM과 프롬프트 전략을 다양화한다.
  • 표준화된 프롬프트를 사용하며, 고장 난 명세, 애자일 분석기에서 생성한 주장 위반 사례, 반례 추적 정보를 포함한 구조화된 입력을 제공한다.
  • 애자일 분석기의 피드백을 통합하여 LLM이 정확한 수정으로 나아가도록 유도하며, 주장 기반 오라클을 활용해 검증한다.
  • GPT-3.5-Turbo와 GPT-4 버전(예: GPT-4-Turbo, GPT-4-32k)을 다양한 실험 설정에서 사용하여 성능 차이를 평가한다.
  • 정확도, 런타임, 토큰 소비량, 금전적 비용을 측정하여 성공 여부를 평가하며, 재현 가능한 결과는 https://github.com/Mohannadcse/AlloySpecRepair 에 공개한다.
Figure 1 . LLM-assisted APR Pipeline.
Figure 1 . LLM-assisted APR Pipeline.

실험 결과

연구 질문

  • RQ1RQ1: 최신 APR 도구와 비교해 LLM이 고장 난 Alloy 명세를 얼마나 효과적으로 수리할 수 있는가?
  • RQ2RQ2: 이중 에이전트 프레임워크(수리 에이전트 + 프롬프트 에이전트)는 수리 성능과 적응 가능성에 어떤 영향을 미치는가?
  • RQ3RQ3: 다양한 LLM과 설정에서의 성능 및 비용 트레이드오프(런타임, 토큰 사용량, 금전적 비용)는 어떠한가?
  • RQ4RQ4: LLM 기반 수리의 실패 특성은 무엇이며, 모델과 설정에 따라 어떻게 달라지는가?
  • RQ5RQ5: 프롬프트 설계와 에이전트 사용은 수리 비용과 성공률에 어떤 영향을 미치는가?

주요 결과

  • GPT-4 버전은 ARepair 벤치마크에서 78.6%의 수리 성공률을 기록했고, Alloy4Fun 벤치마크에서는 82.1%를 기록하여 ARepair 및 BeAFix와 같은 기존 APR 도구보다 뚜렷이 높은 성능을 보였다.
  • 이중 에이전트 파이프라인은 단일 에이전트 기반 베이스라인 대비 12.3% 높은 수리 효율성을 보이며, 적응형 프롬프트 생성과 반복적 개선의 가치를 입증했다.
  • GPT-4-Turbo는 수리 당 가장 낮은 금전적 비용을 기록했으며, GPT-4-32k 대비 15.7%의 비용 절감 효과를 보였다. 이는 더 낮은 토큰 가격 덕분이었다.
  • GPT-4-Turbo 설정(설정-5)에서 고정된 버그의 중앙값 수리 시간은 493.28초였고, 실패한 버그의 경우 설정-4에서 392.2초였으며, 이는 실패한 수리에 더 높은 계산 비용이 소요됨을 시사한다.
  • 프롬프트 에이전트를 사용한 설정(설정-3 및 6)은 프롬프트 에이전트를 사용하지 않은 설정 대비 토큰 사용량이 8.4% 높고, 금전적 비용이 11.2% 높았다. 이는 동적 프롬프트 생성의 비용을 반영한다.
  • 표준화된 프롬프트와 민감도 분석을 통해 프롬프트 설계로 인한 명백한 편향이 없음을 확인했으며, 다양한 구성에서도 안정성이 높음을 입증했다.
Figure 2 . Venn diagrams illustrating the exclusive and overlapping cases of successful repairs by different repair methods, highlighting the complementary and unique capabilities of the APR pipeline compared to SoTA repair tools.
Figure 2 . Venn diagrams illustrating the exclusive and overlapping cases of successful repairs by different repair methods, highlighting the complementary and unique capabilities of the APR pipeline compared to SoTA repair tools.

이 논문 읽기

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

누빈트에서 이 논문 읽기

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