arXiv:2603.26567cs.SEcs.AI2026-03被引 2

首个面向代码仓库级问答的基准测试,揭示大模型在真实项目理解中的局限性。

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

  • 构建包含134个开源项目的真实问题数据集,覆盖多文件依赖场景。
  • 基线准确率中等,引入结构信息后性能提升但整体仍有限。
  • 发现高分常源于复制答案而非真正推理,适合评估模型泛化能力。

大型语言模型在软件工程任务中表现优异,包括问答(QA)。然而,现有研究与基准大多聚焦孤立函数或单文件片段,忽视了真实程序理解中跨多文件和系统级依赖的挑战。本文提出 StackRepoQA,首个基于1,318个真实开发者问题与对应答案、涵盖134个开源Java项目的多项目仓库级问答数据集。利用该数据集,我们系统评估了两种广泛使用的LLM(Claude 3.5 Sonnet 和 GPT-4o)在直接提示与智能体配置下的表现。对比基线与结合文件级检索及依赖图表示的检索增强生成方法。结果显示,基线准确率中等,引入结构信号后有所提升,但整体在仓库级理解上仍受限。分析表明,高分常源于对Stack Overflow答案的逐字复现,而非真正推理。这是首个在仓库级问答中提供此类实证的研究。我们公开发布 StackRepoQA,以推动更优基准、评估协议与增强策略研究,助力大模型实现可靠的仓库级程序理解。

原文摘要 · Abstract (English)

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.

代码理解大模型评测问答系统

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。