livecodebench
收藏LiveCodeBench for Code-LLaVA 数据集概述
数据集基本信息
- 数据集名称: LiveCodeBench for Code-LLaVA
- 托管地址: https://huggingface.co/datasets/tonychenxyz/livecodebench
- 许可协议: MIT
- 主要任务类别: 文本生成
- 语言: 英语
- 标签: 代码生成、编程、基准测试、livecodebench
- 数据规模: 1K<n<10K
数据来源与背景
- 源论文: LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Code
- 源仓库: https://github.com/LiveCodeBench/LiveCodeBench
- 数据版本: release_v6
- 问题时间范围: 2023年5月至2025年4月
- 问题总数: 1055个
- 问题来源平台: LeetCode、AtCoder、Codeforces
- 难度等级: 简单、中等、困难
数据集结构
数据集提供两种配置:
配置一:memwrap
- 描述: 包含用于Code-LLaVA内存压缩的
<|memory_start|>/<|memory_end|>标记的问题。 - 数据文件路径:
memwrap/test-* - 特征字段:
prompt: 字符串类型,聊天模板化的提示字符串。category: 字符串类型,格式为{variant}/livecodebench/{difficulty}(例如memwrap/livecodebench/medium)。extra_info: 结构体,包含:ground_truth: 结构体,包含question_id、question_title、difficulty、platform、contest_id、starter_code字段。scoring_function: 字符串类型。question_id: 字符串类型。variant: 字符串类型。
- 数据分割: 仅测试集
- 样本数量: 1055
- 数据集大小: 2122314字节
- 下载大小: 751019字节
配置二:plain
- 描述: 不包含内存标记的相同问题集(基线版本)。
- 数据文件路径:
plain/test-* - 特征字段:
prompt: 字符串类型,聊天模板化的提示字符串。category: 字符串类型,格式为{variant}/livecodebench/{difficulty}。extra_info: 结构体,包含:ground_truth: 结构体,包含contest_id、difficulty、platform、question_id、question_title、starter_code字段。question_id: 字符串类型。scoring_function: 字符串类型。variant: 字符串类型。
- 数据分割: 仅测试集
- 样本数量: 1055
- 数据集大小: 2085397字节
- 下载大小: 748524字节
内置评估功能
- 评分函数:
livecodebench_code - 基本验证项:
has_code: 响应是否包含代码。syntax_valid: 代码语法是否有效(Python)。includes_starter: 是否包含起始代码签名。
使用方式
可通过Hugging Face datasets库加载:
python
from datasets import load_dataset
ds = load_dataset("tonychenxyz/livecodebench", "memwrap", split="test")
可按难度过滤数据: python medium = ds.filter(lambda x: "medium" in x["category"])
完整评估说明
对于pass@k评估,需将生成的代码导出并使用LiveCodeBench的官方评估器: bash python -m lcb_runner.runner.custom_evaluator --custom_output_file predictions.json
引用格式
bibtex @article{jain2024livecodebench, title={LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Code}, author={Jain, Naman and Han, King and Gu, Alex and Li, Wen-Ding and Yan, Fanjia and Zhang, Tianjun and Wang, Sida and Solar-Lezama, Armando and Sen, Koushik and Stoica, Ion}, journal={arXiv preprint arXiv:2403.07974}, year={2024} }




