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
초록
대규모 언어 모델(Large Language Models, LLMs)은 HumanEval 및 MBPP와 같은 독립형 코드 작업에서 뛰어나지만 전체 코드 저장소를 처리하는 데 어려움을 겪습니다. 이러한 도전에 대응하기 위해 현재 연구는 저장소 규모에서 LLM-코드베이스 상호 작용을 향상시키는 방법에 대해 진행되고 있습니다. 현재 솔루션은 유사성 기반 검색이나 수동 도구 및 API에 의존하며, 각각이 주목할만한 단점을 가지고 있습니다. 유사성 기반 검색은 복잡한 작업에서 저 회수율을 보이는 반면, 수동 도구 및 API는 일반화가 어렵고 전문 지식이 필요하여 다양한 코드 작업 및 실제 응용 프로그램에서의 적용 범위가 제한됩니다. 이러한 한계를 극복하기 위해 우리는 \framework을 소개합니다. 이 시스템은 코드 저장소에서 추출된 그래프 데이터베이스 인터페이스와 통합되는 LLM 에이전트를 결합합니다. 그래프 데이터베이스의 구조적 특성과 그래프 쿼리 언어의 유연성을 활용하여 \framework은 LLM 에이전트가 쿼리를 작성하고 실행할 수 있도록 하여 정확한 코드 구조 인식 문맥 검색 및 코드 탐색을 가능하게 합니다. 우리는 \framework을 CrossCodeEval, SWE-bench 및 EvoCodeBench 세 가지 벤치마크를 사용하여 평가합니다. 또한 다섯 가지의 실제 코딩 응용 프로그램을 개발합니다. 통합된 그래프 데이터베이스 스키마를 사용하여 \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