[论文解读] BigCodeBench: Benchmarking Code Generation with Diverse Function Calls and Complex Instructions
BigCodeBench 基准在139个库和7个领域上评估基于LLM的代码生成,使用复杂的、需使用工具的指令,评估60个LLM,并揭示与人类表现的显著差距(Complete 上高达 60% Pass@1;Instruct 下 <50%)。
Task automation has been greatly empowered by the recent advances in Large Language Models (LLMs) via Python code, where the tasks ranging from software engineering development to general-purpose reasoning. While current benchmarks have shown that LLMs can solve tasks using programs like human developers, the majority of their evaluations are limited to short and self-contained algorithmic tasks or standalone function calls. Solving challenging and practical tasks requires the capability of utilizing diverse function calls as tools to efficiently implement functionalities like data analysis and web development. In addition, using multiple tools to solve a task needs compositional reasoning by accurately understanding complex instructions. Fulfilling both of these characteristics can pose a great challenge for LLMs.To assess how well LLMs can solve challenging and practical tasks via programs, we introduce BigCodeBench, a benchmark that challenges LLMs to invoke multiple function calls as tools from 139 libraries and 7 domains for 1,140 fine-grained tasks. To evaluate LLMs rigorously, each task encompasses 5.6 test cases with an average branch coverage of 99%. In addition, we propose a natural-language-oriented variant of BigCodeBench, BigCodeBench-Instruct, that automatically transforms the original docstrings into short instructions only with essential information. Our extensive evaluation of 60 LLMs shows that LLMs are not yet capable of following complex instructions to use function calls precisely, with scores up to 60%, significantly lower than the human performance of 97%. The results underscore the need for further advancements in this area.
研究动机与目标
- 激励在超越简短算法问题的具有挑战性的真实世界编程任务上,对LLM进行评估。
- 评估LLMs调用多样化库(工具)并遵循复杂、组合化指令的能力。
- 提供两个基准变体:BigCodeBench-Complete(结构化文档字符串)和 BigCodeBench-Instruct(面向自然语言的指令)。
- 展示与现有基准的相关性,并识别当前模型在某些方面落后于人类的差距。
提出的方法
- 通过人机协作,在数据合成、重构、测试和整理方面构建一个大规模、高质量的基于执行的基准。
- 使用种子示例来获取任务,并通过多样化的库(139 个库,7 个领域)来丰富它们。
- 重构合成的程序并使用启用代码解释器的 GPT-4 会话在有人大循环引导下生成严格的测试用例。
- 应用三轮人工策展(审查、预评估、互查)以确保任务难度和测试的确定性。
- 通过将文档字符串提示转换为简洁指令,将任务转换为面向自然语言的变体(BigCodeBench-Instruct)。
- 以零-shot 设置使用 Pass@K 指标评估 LLMs,并进行经过校准的分析以考虑上下文缺失。

实验结果
研究问题
- RQ1LLMs 能否解决需要多样化工具使用和复杂指令的具有挑战性且实用的编程任务?
- RQ2指令微调如何影响 LLMs 在跨领域遵循复杂约束和使用工具的能力?
- RQ3模型规模、指令微调与在开放式、多库代码生成任务上的性能之间有何关系?
主要发现
- 在 BigCodeBench-Complete 上评估了 60 个最先进的 LLM,在 BigCodeBench-Instruct 上评估了 35 个指令微调的 LLM。
- 最佳模型(GPT-4o)在 BigCodeBench-Complete 上达到最高 60% Pass@1,在 BigCodeBench-Instruct 上不足 50%。
- 经过校准的结果显示 Complete 与 Instruct 排名高度一致(Pearson r = 0.982)。
- 指令微调模型在遵循复杂约束方面有所提升,经过校准的平均 Pass@1 高于基线模型(例如在某些比较中为 40.7% 对 35.7%)。
- 模型在长上下文提示中常常省略必要的导入语句,影响任务成功,并且领域专门化影响工具使用表现。
- BigCodeBench 与 HumanEval+ 和 LiveCodeBench 之间存在强相关性,表明与主流基准的一致性,同时揭示了独特的评估维度。

更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。