arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2412.18573cs.SEcs.AIcs.CL
收藏

顶级通用性能 = 顶级领域性能?DomainCodeBench:一个多领域代码生成基准

Top General Performance = Top Domain Performance? DomainCodeBench: A Multi-domain Code Generation Benchmark

Sun Yat-sen University(中山大学);Huawei Cloud Computing Technologies Co., Ltd(华为云计算技术有限公司);Chongqing University(重庆大学)

Dewu Zheng, Yanlin Wang, Ensheng Shi, Xilin Liu, Yuchi Ma, Hongyu Zhang, Zibin Zheng

AI总结:

本文构建覆盖12个领域、15种语言和2,400个任务的 DomainCodeBench,发现LLM通用代码能力与领域表现解耦,而领域知识增强提示可提升约38.17%。

摘要:

随着大型语言模型(LLM)的快速发展,已有大量研究考察 LLM 的代码生成能力。然而,现有工作主要关注通用领域任务,导致 LLM 在真实应用领域中的代码生成表现仍未得到充分探索。这引出一个关键问题:模型的通用领域编程能力能否可靠地代表其在专业领域中的能力?本文提出 DomainCodeBench,这是一个多领域代码生成基准,旨在系统评估 LLM 在 12 个软件应用领域和 15 种编程语言上的表现。DomainCodeBench 包含 2,400 个经过人工验证的任务,并提供标准答案、人工标注的 docstring 以及细粒度依赖信息,以确保更充分地覆盖领域特定挑战。具体而言,我们首先通过主题挖掘识别最流行的应用领域;随后,根据各领域中常用的框架和平台整理编程任务。通过在 DomainCodeBench 上对十个主流 LLM 开展大量实验,我们得到若干发现:(1)性能解耦:实验表明,顶级通用领域模型并不能在特定应用领域中持续表现优异;(2)领域特定弱点:LLM 常因领域知识缺口和第三方库误用而失败;(3)上下文增强:我们证明,使用领域特定知识增强提示可使性能提升约 38.17%,为性能优化提供了可操作的洞见。我们的复现包(包括基准、源代码和实验结果)可在 https://github.com/DeepSoftwareAnalytics/DomainCodeBench 获取。

英文摘要:

With the rapid advancement of large language models (LLMs), extensive research has been conducted to investigate the code generation capabilities of LLMs. However, existing efforts primarily focus on general-domain tasks, leaving LLMs' code generation performance in real-world application domains underexplored. This raises a critical question: can a model's general-domain coding ability reliably represent its ability in specialized domains? In this paper, we introduce DomainCodeBench, a multi-domain code generation benchmark designed to systematically evaluate LLMs across 12 software application domains and 15 programming languages. DomainCodeBench contains 2,400 manually verified tasks with ground truth, human-annotated docstrings, and fine-grained dependency information to ensure more coverage of domain-specific challenges. Specifically, we first identify the most popular application domains by topic mining. Then, we curate coding tasks based on commonly used frameworks and platforms in each domain. We obtain several findings through extensive experiments on DomainCodeBench with ten mainstream LLMs. (1) Performance decoupling: experiments reveal that top general-domain models do not consistently excel in specific application domains; (2) Domain-specific weaknesses: LLMs often fail due to domain knowledge gaps and third-party library misusage; (3) Contextual enhancement: we show that augmenting prompts with domain-specific knowledge improves performance by around 38.17%, providing actionable insights for performance optimization. Our replication package, including the benchmark, source code, and experimental results, is available at https://github.com/DeepSoftwareAnalytics/DomainCodeBench.

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

↑