CoReQA:发掘语言模型在代码仓库问答中的潜力
CoReQA: Uncovering Potentials of Language Models in Code Repository Question Answering
AI总结:
本文提出代码仓库级问答基准 CoReQA 与 LLM-as-a-judge 评估框架,评测短/长上下文模型,揭示现有模型在真实仓库理解上的不足。
摘要:
增强代码生成、代码补全和代码问答(QA)等软件开发任务的大型语言模型,已在学术界和工业界得到广泛研究。这些模型被集成到 JetBrains 和 Cursor 等流行的智能 IDE 中。当前用于评估模型代码理解能力的基准主要关注代码生成或补全,往往忽视了问答这一理解代码的关键方面。现有代码问答基准源自具有预定义模式的代码注释(例如 CodeQA),或聚焦于教育等特定领域(例如 CS1QA)。这些基准无法捕捉软件工程的真实复杂性以及用户理解代码仓库的需求。为弥补这一差距,我们提出 CoReQA,这是一个代码仓库级问答基准,基于 GitHub issues 和来自四种编程语言的 176 个热门仓库的评论构建。由于问题和答案可能同时包含自然语言和代码片段,BLEU 等传统评估指标不足以评估仓库级问答性能。因此,我们提供了一个 LLM-as-a-judge 框架,从五个方面评估问答性能。基于 CoReQA,我们评估了三个基线的性能,包括两个使用通用检索策略的短上下文模型,以及一个利用整个仓库上下文的长上下文模型。评估结果表明,最先进的专有模型和长上下文模型难以有效解决仓库级问题。我们的分析强调了语言模型在帮助开发者理解仓库方面的局限性,并提出了通过有效上下文检索方法改进仓库理解系统的未来方向。
英文摘要:
Large language models that enhance software development tasks, such as code generation, code completion, and code question answering (QA), have been extensively studied in both academia and the industry. The models are integrated into popular intelligent IDEs like JetBrains and Cursor. Current benchmarks for evaluating models' code comprehension capabilities primarily focus on code generation or completion, often neglecting QA, which is a crucial aspect of understanding code. Existing code QA benchmarks are derived from code comments with predefined patterns (e.g., CodeQA) or focus on specific domains, such as education (e.g., CS1QA). These benchmarks fail to capture the real-world complexity of software engineering and user requirements for understanding code repositories. To address this gap, we introduce CoReQA, a benchmark for Code Repository-level question answering, constructed from GitHub issues and comments from 176 popular repositories across four programming languages. Since questions and answers may include both natural language and code snippets, traditional evaluation metrics such as BLEU are inadequate for assessing repository-level QA performance. Thus, we provide an LLM-as-a-judge framework to evaluate QA performance from five aspects. Based on CoReQA, we evaluate the performance of three baselines, including two short-context models using generic retrieval strategies and one long-context model that utilizes the entire repository context. Evaluation results show that state-of-the-art proprietary and long-context models struggle to address repository-level questions effectively. Our analysis highlights the limitations of language models in assisting developers in understanding repositories and suggests future directions for improving repository comprehension systems through effective context retrieval methodologies.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。