首个专用于评估大模型并发代码生成能力的基准测试
CONCUR: Benchmarking LLMs for Concurrent Code Generation
- 构建包含115个问题的并发代码生成基准CONCUR
- 现有大模型在并发代码生成中表现不佳,存在死锁等问题
- 适合研究并发编程与大模型结合的开发者和研究人员
将大语言模型(LLMs)用于代码生成已成为软件工程领域的常见实践。已有基准被建立以评估LLMs的代码生成能力,但主要关注顺序代码,缺乏对并发代码生成的有效评估。相比顺序代码,并发代码具有更高复杂性,且存在死锁、竞态条件等独特缺陷。因此,现有顺序代码基准无法有效评估基于LLMs的并发代码生成能力。为填补这一空白,我们设计了专门针对并发代码生成能力评估的基准CONCUR。CONCUR包含43个源自标准并发教材的基础问题,以及72个经过验证的变异体,共115个问题。基础问题构成基准语义核心,变异体则扩展了语言和结构多样性。我们在CONCUR上对多种LLMs进行了评估,揭示了当前模型在并发代码生成中的局限性。本工作为评估大模型生成并发代码的能力提供了新方向。
原文摘要 · Abstract (English)
Leveraging Large Language Models (LLMs) for code generation has increasingly emerged as a common practice in the domain of software engineering. Relevant benchmarks have been established to evaluate the code generation capabilities of LLMs. However, existing benchmarks focus primarily on sequential code, lacking the ability to effectively evaluate LLMs on concurrent code generation. Compared to sequential code, concurrent code exhibits greater complexity and possesses unique types of bugs, such as deadlocks and race conditions, that do not occur in sequential code. Therefore, a benchmark for evaluating sequential code generation cannot be useful for evaluating concurrent code generation with LLMs. To address this gap, we designed a benchmark CONCUR specifically aimed at evaluating the capability of LLMs to generate concurrent code. CONCUR consists of a base set of 43 concurrency problems derived from a standard concurrency textbook, together with 72 validated mutant variants, resulting in 115 total problems. The base problems serve as the semantic core of the benchmark, while the mutants expand linguistic and structural diversity. We conducted an evaluation of a range of LLMs on CONCUR, highlighting limitations of current models. Overall, our work provides a novel direction for evaluating the capability of LLMs to generate code with focus on concurrency.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。