要約
コードのローカリゼーション – コードベースの変更を行う必要がある場所を正確に特定することは、ソフトウェアメンテナンスにおける根本的でありながら挑戦的なタスクです。
既存のアプローチは、関連するコードセクションを識別するときに複雑なコードベースを効率的にナビゲートするのに苦労しています。
課題は、適切なコード要素を備えた自然言語の問題の説明を埋めることにあり、多くの場合、階層構造と複数の依存関係を越えて推論が必要です。
グラフベースの表現を介してコードのローカリゼーションに対処するフレームワークであるLocagentを紹介します。
コードベースを指示された不均一なグラフに解析することにより、Locagentはコード構造(ファイル、クラス、関数)とその依存関係(インポート、招待状、継承)をキャプチャする軽量表現を作成し、LLMエージェントが強力なマルチホップの推論を通じて効果的に検索し、関連するエンティティを見つけられるようにします。
実際のベンチマークでの実験結果は、このアプローチがコードのローカリゼーションの精度を大幅に向上させることを示しています。
特に、微調整されたQwen-2.5-Coder-Instruct-32Bモデルを使用した方法は、コストが大幅に削減された(約86%の削減)でSOTA独自モデルに匹敵する結果を達成し、ファイルレベルのローカリゼーションで最大92.7%の精度に達し、下流のGithub問題解決の成功率が12%(@10)を改善します。
私たちのコードは、https://github.com/gersteinlab/locagentで入手できます。
要約(オリジナル)
Code localization–identifying precisely where in a codebase changes need to be made–is a fundamental yet challenging task in software maintenance. Existing approaches struggle to efficiently navigate complex codebases when identifying relevant code sections. The challenge lies in bridging natural language problem descriptions with the appropriate code elements, often requiring reasoning across hierarchical structures and multiple dependencies. We introduce LocAgent, a framework that addresses code localization through graph-based representation. By parsing codebases into directed heterogeneous graphs, LocAgent creates a lightweight representation that captures code structures (files, classes, functions) and their dependencies (imports, invocations, inheritance), enabling LLM agents to effectively search and locate relevant entities through powerful multi-hop reasoning. Experimental results on real-world benchmarks demonstrate that our approach significantly enhances accuracy in code localization. Notably, our method with the fine-tuned Qwen-2.5-Coder-Instruct-32B model achieves comparable results to SOTA proprietary models at greatly reduced cost (approximately 86% reduction), reaching up to 92.7% accuracy on file-level localization while improving downstream GitHub issue resolution success rates by 12% for multiple attempts (Pass@10). Our code is available at https://github.com/gersteinlab/LocAgent.
arxiv情報
著者 | Zhaoling Chen,Xiangru Tang,Gangda Deng,Fang Wu,Jialong Wu,Zhiwei Jiang,Viktor Prasanna,Arman Cohan,Xingyao Wang |
発行日 | 2025-04-29 14:37:43+00:00 |
arxivサイト | arxiv_id(pdf) |
提供元, 利用サービス
arxiv.jp, Google