LLM이 버그 보고서를 어떻게 읽을까? 자동 프로그램 수정에 사용되는 LLM의 어텐션에 대한 실증 연구
How Do LLMs Read Bug Reports? An Empirical Study of Attention in LLMs for Automated Program Repair
대규모 언어 모델(LLM) 기반 자동 프로그램 수정 시스템은 빠르게 발전하고 있지만, 성능은 여전히 일관되지 않습니다. 동일한 상황 정보를 제공하더라도, LLM은 하나의 버그에 대해서는 올바른 패치를 생성하지만, 다른 관련 버그에서는 실패할 수 있습니다. 이러한 현상이 발생하는 원인은 아직 명확하게 이해되지 않았으며, LLM이 버그 보고서의 다양한 정보를 어떻게 우선순위화하는지, 그리고 모델의 어텐션이 수정 성공 여부에 어떤 영향을 미치는지 불분명합니다. 본 논문에서는 LLM 기반 프로그램 수정에서 어텐션 패턴에 대한 최초의 실증 연구를 제시하며, 모델이 버그 보고서를 어떻게 처리하고 수정 과정에서 어디에 집중하는지에 대한 해석 가능한 통찰력을 제공합니다. SWE-bench Verified 및 Multi-SWE-bench에서 추출한 319개의 실제 Python 및 Java 버그를 분석하여 (RQ1) 모델 어텐션이 버그 보고서의 각 섹션에 어떻게 분포되는지, (RQ2) 성공적인 수정과 실패한 수정을 구분하는 각 섹션 내에서의 어텐션 패턴 차이를 분석하고, (RQ3) 이러한 패턴이 개발자가 버그 해결에 중요하다고 생각하는 정보와 어떻게 비교되는지를 연구합니다. 분석 결과, 성공적인 수정은 버그 설명, 스택 트레이스 및 테스트 케이스와 같은 여러 진단 구성 요소에 걸쳐 분산된 어텐션을 특징으로 하는 반면, 실패는 종종 버전 정보와 같은 메타데이터에 과도하게 집중하는 경향을 보였습니다. 또한 모델의 어텐션과 개발자가 중요하다고 식별한 주요 섹션 및 구절 간의 정렬이 높을수록 수정 성공률이 더 높다는 것을 확인했습니다. 본 연구 결과는 LLM 기반 자동 프로그램 수정 실패의 핵심 요인이 어텐션 할당 오류라는 최초의 실증적 증거를 제공하며, 보다 해석 가능하고 신뢰할 수 있는 미래의 자동 프로그램 수정 시스템 설계에 대한 실행 가능한 통찰력을 제시합니다.
Large Language Model (LLM)-based Automated Program Repair systems are advancing rapidly, yet their performance remains inconsistent. Even when provided with the same contextual information, an LLM may generate a correct patch for one bug but fail on another closely related bug. Why this happens remains poorly understood, and it is unclear how LLMs prioritize the diverse information in bug reports and whether model attention affects repair success. In this paper, we present the first empirical study of attention patterns in LLM-based program repair, providing interpretable insights into how models process bug reports and where their attention is concentrated during repair. We analyze 319 real-world Python and Java bugs from SWE-bench Verified and Multi-SWE-bench to study (RQ1) how model attention is distributed across bug report sections, (RQ2) how attention patterns within each section differ between successful and unsuccessful repairs, and (RQ3) how these patterns compare to information developers consider important for bug fixing. We find that successful repairs are characterized by diffused attention across multiple diagnostic components such as bug descriptions, stacktraces, and test cases, while failures often exhibit over-localized attention toward metadata such as version information. We further observe that stronger alignment between model attention and developer-identified key sections and phrases is associated with higher repair success. Our results provide the first empirical evidence that attention misallocation is a key factor in LLM-based APR failures, and offer actionable insights for designing more interpretable and reliable future APR systems.
No Analysis Report Yet
This paper hasn't been analyzed by Gemini yet.
Log in to request an AI analysis.