2025-09-12 · 专家 · 数据科学 · 机器学习 · 计算机视觉

LoCoBench: A Benchmark for Long-Context Large Language Models in Complex Software Engineering

LoCoBench提出了一种针对复杂软件工程场景下长上下文大型语言模型的综合基准,通过系统生成评估场景和引入新的评估指标,评估LLM在理解大型代码库、跨文件推理和保持架构一致性方面的能力。

更新于 2025-10-19。作者:Jielin Qiu、Zuxin Liu、Zhiwei Liu、Rithesh Murthy、Jianguo Zhang、Haolin Chen、Shiyu Wang、Ming Zhu、Liangwei Yang、Juntao Tan、Zhepeng Cen、Cheng Qian、Shelby Heinecke、Weiran Yao、Silvio Savarese、Caiming Xiong、Huan Wang。

中文摘要

长上下文语言模型的兴起,其上下文窗口扩展至数百万个标记,为复杂的代码理解和软件开发评估带来了新的机遇。我们提出了LoCoBench,这是一个专门为评估长上下文LLM在现实、复杂的软件开发场景中设计的全面基准。与现有专注于单一功能完成或短上下文任务的代码评估基准不同,LoCoBench针对需要理解整个代码库、跨多个文件进行推理以及在大型软件系统中保持架构一致性的长上下文能力的关键评估差距进行了处理。我们的基准提供了8,000个评估场景,这些场景在10种编程语言中系统性地生成,上下文长度从10K到1M个标记不等,这种100倍的差异使得在现实软件开发环境中对长上下文性能退化的评估更加精确。LoCoBench引入了8个任务类别,以捕捉基本的长上下文能力:架构理解、跨文件重构、多会话开发、故障调查、功能实现、代码理解、集成测试和安全分析。通过一个5阶段的流程,我们创建了多样化的、高质量的场景,挑战LLM在前所未有的规模上对复杂代码库进行推理。我们引入了一个全面的评估框架,包含4个维度的17个指标,包括8个新的评估指标,结合成一个LoCoBench得分(LCBS)。我们对最先进的长期上下文模型进行了评估,揭示了显著的性能差距,表明在复杂的软件开发中,长上下文理解是一个重大的未解挑战,需要更多的关注。LoCoBench发布于:https://github.com/SalesforceAIResearch/LoCoBench。

英文摘要

The emergence of long-context language models with context windows extending to millions of tokens has created new opportunities for sophisticated code understanding and software development evaluation. We propose LoCoBench, a comprehensive benchmark specifically designed to evaluate long-context LLMs in realistic, complex software development scenarios. Unlike existing code evaluation benchmarks that focus on single-function completion or short-context tasks, LoCoBench addresses the critical evaluation gap for long-context capabilities that require understanding entire codebases, reasoning across multiple files, and maintaining architectural consistency across large-scale software systems. Our benchmark provides 8,000 evaluation scenarios systematically generated across 10 programming languages, with context lengths spanning 10K to 1M tokens, a 100x variation that enables precise assessment of long-context performance degradation in realistic software development settings. LoCoBench introduces 8 task categories that capture essential long-context capabilities: architectural understanding, cross-file refactoring, multi-session development, bug investigation, feature implementation, code comprehension, integration testing, and security analysis. Through a 5-phase pipeline, we create diverse, high-quality scenarios that challenge LLMs to reason about complex codebases at unprecedented scale. We introduce a comprehensive evaluation framework with 17 metrics across 4 dimensions, including 8 new evaluation metrics, combined in a LoCoBench Score (LCBS). Our evaluation of state-of-the-art long-context models reveals substantial performance gaps, demonstrating that long-context understanding in complex software development represents a significant unsolved challenge that demands more attention. LoCoBench is released at: https://github.com/SalesforceAIResearch/LoCoBench.

解读

一句话总结

LoCoBench提出了一种针对复杂软件工程场景下长上下文大型语言模型的综合基准,通过系统生成评估场景和引入新的评估指标,评估LLM在理解大型代码库、跨文件推理和保持架构一致性方面的能力。

问题1:这篇论文想要解决什么具体问题?

问题2:论文的核心创新点是什么?

问题3:实验结果如何验证了方法的有效性?

问题4:这个研究的实际应用价值是什么?

来源