
?影响 • ?新闻•快速启动•远程评估•LLM生成的代码•?高级用法•?结果提交•引文
BigCodeBench已被许多LLM团队使用,包括:
bigcodebench==v0.2.0 !bigcodebench==v0.1.9 。bigcodebench==v0.1.8 。bigcodebench==v0.1.7 。bigcodebench==v0.1.6 。0.1.5版本。 BigCodeBench是通过代码解决实用和具有挑战性的任务的易于使用的基准。它旨在在更现实的环境中评估大语言模型(LLM)的真正编程功能。该基准是为类似HOMANEVAL的功能级代码生成任务而设计的,但具有更复杂的说明和不同的功能调用。
BigCodebench中有两个分裂:
Complete :THES Split设计用于基于综合docstrings的代码完成。Instruct :拆分仅适用于指令调整和聊天模型,在此要求模型根据自然语言说明生成代码段。该说明仅包含必要的信息,需要更复杂的推理。BigCodeBench专注于通过代码生成具有不同功能呼叫和复杂说明的代码自动化,其中:
首先,请首先设置环境:
# By default, you will use the remote evaluation API to execute the output samples.
pip install bigcodebench --upgrade
# You are suggested to use `flash-attn` for generating code samples.
pip install packaging ninja
pip install flash-attn --no-build-isolation
# Note: if you have installation problem, consider using pre-built
# wheels from https://github.com/Dao-AILab/flash-attention/releases # Install to use bigcodebench.generate
pip install " git+https://github.com/bigcode-project/bigcodebench.git " --upgrade我们使用贪婪的解码来显示如何通过远程API评估生成的代码样本。
警告
为了简化生成,我们默认使用批处理推断。但是,至少对于VLLM后端而言,批处理推理结果可能从批处理大小到批处理大小以及版本到版本之间有所不同。如果您想获得更多的贪婪解码结果,请将--bs设置为1 。
笔记
在BigCodeBench-Full上执行远程执行通常需要6-7分钟,而在BigCodeBench-Hard上通常需要4-5分钟。
bigcodebench.evaluate
--model meta-llama/Meta-Llama-3.1-8B-Instruct
--split [complete | instruct]
--subset [full | hard]
--backend [vllm | openai | anthropic | google | mistral | hf]bcb_results的文件夹中。[model_name]--bigcodebench-[instruct|complete]--[backend]-[temp]-[n_samples]-sanitized_calibrated.jsonl 。[model_name]--bigcodebench-[instruct|complete]--[backend]-[temp]-[n_samples]-sanitized_calibrated_eval_results.json 。[model_name]--bigcodebench-[instruct|complete]--[backend]-[temp]-[n_samples]-sanitized_calibrated_pass_at_k.json 。 笔记
BigCodeBench对基础和聊天模型使用不同的提示。默认情况下,使用hf / vllm作为后端时,由tokenizer.chat_template检测到它。对于其他后端,仅允许聊天模式。
因此,如果您的基本模型带有tokenizer.chat_template ,请添加--direct_completion ,以避免在聊天模式下评估。
访问OpenAI控制台的OpenAI API
export OPENAI_API_KEY= < your_openai_api_key >从拟人控制台访问拟人API
export ANTHROPIC_API_KEY= < your_anthropic_api_key >从Mistral控制台访问Mistral API
export MISTRAL_API_KEY= < your_mistral_api_key >访问Google AI Studio的GEMINI API
export GOOGLE_API_KEY= < your_google_api_key > 我们共享我们评估过的LLM的预生产代码样本:
sanitized_samples_calibrated.zip 。 有关更多详细信息,请参考高级用法。
如果您想将模型贡献给排行榜,请通过电子邮件将生成的代码示例和执行结果发送给[email protected]。请注意,文件名应为[model_name]--[revision]--[bigcodebench|bigcodebench-hard]-[instruct|complete]--[backend]-[temp]-[n_samples]-sanitized_calibrated.jsonl and [model_name]--[revision]--[bigcodebench|bigcodebench-hard]-[instruct|complete]--[backend]-[temp]-[n_samples]-sanitized_calibrated_eval_results.json 。如果我们在3天内不回复您的电子邮件,您可以提出问题以提醒我们。
@article { zhuo2024bigcodebench ,
title = { BigCodeBench: Benchmarking Code Generation with Diverse Function Calls and Complex Instructions } ,
author = { Zhuo, Terry Yue and Vu, Minh Chien and Chim, Jenny and Hu, Han and Yu, Wenhao and Widyasari, Ratnadira and Yusuf, Imam Nur Bani and Zhan, Haolan and He, Junda and Paul, Indraneil and others } ,
journal = { arXiv preprint arXiv:2406.15877 } ,
year = { 2024 }
}