arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.26567cs.SEcs.AI
收藏

超越代码片段:在仓库层面评估大语言模型的问答任务

Beyond Code Snippets: Benchmarking LLMs on Repository-Level Question Answering

Department of Computer Science, Virginia Tech(弗吉尼亚理工大学计算机科学系)

Yoseph Berhanu Alebachew, Hunter Leary, Swanand Vaishampayan, Chris Brown

AI总结:

本文提出StackRepoQA数据集,用于评估大语言模型在多项目仓库层面的问答能力,通过对比不同配置下的性能,揭示了模型在处理仓库级程序理解时的局限性。

摘要:

大型语言模型(LLMs)在软件工程任务中展现出显著能力,包括问答(QA)。然而,大多数研究和基准测试集中在孤立函数或单文件片段上,忽略了现实世界程序理解的挑战,这些挑战往往跨越多个文件和系统级依赖。本文引入StackRepoQA,这是首个多项目、仓库级问答数据集,基于134个开源Java项目中的1318个真实开发者问题和接受答案。使用此数据集,我们系统评估了两种广泛使用的LLM(Claude 3.5 Sonnet和GPT-4o)在直接提示和代理配置下的表现。我们比较了基础性能与检索增强生成方法,这些方法利用文件级检索和结构依赖的图表示。结果表明,LLM在基础性能上达到中等准确率,当整合结构信号时性能有所提升。然而,整体准确率在仓库级理解上仍有限。分析发现,高分往往源于直接复制Stack Overflow答案而非真正的推理。据我们所知,这是首次在仓库级问答中提供此类证据的实证研究。我们发布StackRepoQA以鼓励进一步研究基准测试、评估协议和增强策略,以区分记忆与推理,推动LLM成为可靠的仓库级程序理解工具。

英文摘要:

Large Language Models (LLMs) have shown impressive capabilities across software engineering tasks, including question answering (QA). However, most studies and benchmarks focus on isolated functions or single-file snippets, overlooking the challenges of real-world program comprehension, which often spans multiple files and system-level dependencies. In this work, we introduce StackRepoQA, the first multi-project, repository-level question answering dataset constructed from 1,318 real developer questions and accepted answers across 134 open-source Java projects. Using this dataset, we systematically evaluate two widely used LLMs (Claude 3.5 Sonnet and GPT-4o) under both direct prompting and agentic configurations. We compare baseline performance with retrieval-augmented generation methods that leverage file-level retrieval and graph-based representations of structural dependencies. Our results show that LLMs achieve moderate accuracy at baseline, with performance improving when structural signals are incorporated. Nonetheless, overall accuracy remains limited for repository-scale comprehension. The analysis reveals that high scores often result from verbatim reproduction of Stack Overflow answers rather than genuine reasoning. To our knowledge, this is the first empirical study to provide such evidence in repository-level QA. We release StackRepoQA to encourage further research into benchmarks, evaluation protocols, and augmentation strategies that disentangle memorization from reasoning, advancing LLMs as reliable tool for repository-scale program comprehension.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑