CodexGraph: コードグラフデータベースを介した大規模言語モデルとコードリポジトリの統合
CodexGraph: Bridging Large Language Models and Code Repositories via Code Graph Databases
August 7, 2024
著者: Xiangyan Liu, Bo Lan, Zhiyuan Hu, Yang Liu, Zhicheng Zhang, Wenmeng Zhou, Fei Wang, Michael Shieh
cs.AI
要旨
大規模言語モデル(LLM)は、HumanEvalやMBPPのような独立したコードタスクにおいて優れた性能を発揮しますが、コードリポジトリ全体を扱うことには苦戦しています。この課題に対処するため、リポジトリ規模でのLLMとコードベースの相互作用を強化する研究が進められています。現在の解決策は、類似性に基づく検索や手動ツール、APIに依存していますが、それぞれに顕著な欠点があります。類似性に基づく検索は、複雑なタスクにおいて再現率が低くなる傾向があり、手動ツールやAPIは通常タスク固有であり、専門知識を必要とするため、多様なコードタスクや実世界のアプリケーションにおける汎用性が低下します。これらの制限を緩和するため、我々は\frameworkを導入します。これは、コードリポジトリから抽出されたグラフデータベースインターフェースとLLMエージェントを統合するシステムです。グラフデータベースの構造的特性とグラフクエリ言語の柔軟性を活用することで、\frameworkはLLMエージェントがクエリを構築し実行することを可能にし、正確でコード構造を意識したコンテキスト検索とコードナビゲーションを実現します。我々は、CrossCodeEval、SWE-bench、EvoCodeBenchの3つのベンチマークを使用して\frameworkを評価します。さらに、5つの実世界のコーディングアプリケーションを開発しました。統一されたグラフデータベーススキーマにより、\frameworkは学術的および実世界の環境の両方で競争力のある性能と潜在能力を示し、ソフトウェアエンジニアリングにおけるその汎用性と有効性を実証しています。我々のアプリケーションデモは以下をご覧ください:
https://github.com/modelscope/modelscope-agent/tree/master/apps/codexgraph_agent。
English
Large Language Models (LLMs) excel in stand-alone code tasks like HumanEval
and MBPP, but struggle with handling entire code repositories. This challenge
has prompted research on enhancing LLM-codebase interaction at a repository
scale. Current solutions rely on similarity-based retrieval or manual tools and
APIs, each with notable drawbacks. Similarity-based retrieval often has low
recall in complex tasks, while manual tools and APIs are typically
task-specific and require expert knowledge, reducing their generalizability
across diverse code tasks and real-world applications. To mitigate these
limitations, we introduce \framework, a system that integrates LLM agents with
graph database interfaces extracted from code repositories. By leveraging the
structural properties of graph databases and the flexibility of the graph query
language, \framework enables the LLM agent to construct and execute queries,
allowing for precise, code structure-aware context retrieval and code
navigation. We assess \framework using three benchmarks: CrossCodeEval,
SWE-bench, and EvoCodeBench. Additionally, we develop five real-world coding
applications. With a unified graph database schema, \framework demonstrates
competitive performance and potential in both academic and real-world
environments, showcasing its versatility and efficacy in software engineering.
Our application demo:
https://github.com/modelscope/modelscope-agent/tree/master/apps/codexgraph_agent.Summary
AI-Generated Summary