CONCUR: 评估LLM在并发代码生成中的基准测试
CONCUR: Benchmarking LLMs for Concurrent Code Generation
AI总结:
CONCUR是一个专门评估LLM在并发代码生成能力的基准测试,包含115个问题,涵盖基础和变体,用于评估LLM在并发编程中的性能。
摘要:
利用大型语言模型(LLMs)进行代码生成在软件工程领域已成为一种常见实践。已经建立了相关基准测试来评估LLMs的代码生成能力。然而,现有基准测试主要集中在顺序代码上,无法有效评估LLMs在并发代码生成中的能力。与顺序代码相比,并发代码更加复杂,并具有独特的错误类型,如死锁和竞态条件,这些错误在顺序代码中不会出现。因此,用于评估顺序代码生成的基准测试无法用于评估LLMs在并发代码生成中的能力。为了解决这一差距,我们设计了一个专门用于评估LLMs生成并发代码能力的基准测试CONCUR。CONCUR包含从标准并发教材中衍生出的43个基础并发问题,以及72个经过验证的变体,共计115个问题。基础问题构成了基准测试的语义核心,而变体则扩展了语言和结构的多样性。我们对一系列LLMs在CONCUR上的评估突显了当前模型的局限性。总体而言,我们的工作为评估LLMs生成代码的能力提供了新的方向,特别是针对并发性。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。