{
  "meta": {
    "pretty_name": "BigCodeBench",
    "dataset_id": "evalscope/bigcodebench",
    "paper_url": null,
    "tags": [
      "Coding"
    ],
    "metrics": [
      "acc"
    ],
    "few_shot_num": 0,
    "eval_split": "v0.1.4",
    "train_split": "",
    "subset_list": [
      "default"
    ],
    "description": "\n## Overview\n\nBigCodeBench is an easy-to-use benchmark for solving practical and challenging tasks via code. It evaluates the true programming capabilities of large language models (LLMs) in a more realistic setting with diverse function calls from 139 popular libraries covering 723 API calls.\n\n## Task Description\n\n- **Task Type**: Code Generation (Python)\n- **Input**: Programming task description (docstring or natural language instruction)\n- **Output**: Complete Python function implementation\n- **Libraries**: 139 popular Python libraries (numpy, pandas, sklearn, etc.)\n\n## Key Features\n\n- 1,140 rich-context programming tasks in Python\n- Two evaluation modes: Complete (docstring) and Instruct (natural language)\n- Covers diverse function calls from 139 popular libraries\n- Uses unittest.TestCase for thorough correctness verification\n- Supports pass@k metric calculation\n\n## Evaluation Notes\n\n- **Sandbox Required**: Requires sandbox environment with 70+ Python libraries pre-installed\n- Two modes available via `split` parameter: `complete` (docstring completion) or `instruct` (NL instruction)\n- Default timeout is 240 seconds per problem\n- `calibrate` option prepends code_prompt to align function signatures\n- See [sandbox documentation](https://evalscope.readthedocs.io/en/latest/user_guides/sandbox.html) for setup\n",
    "prompt_template": "{prompt}",
    "system_prompt": "",
    "few_shot_prompt_template": "",
    "aggregation": "mean_and_pass_at_k",
    "extra_params": {
      "split": {
        "type": "str",
        "description": "Evaluation mode: \"complete\" (docstring completion) or \"instruct\" (NL instruction).",
        "value": "instruct",
        "choices": [
          "complete",
          "instruct"
        ]
      },
      "version": {
        "type": "str",
        "description": "Dataset version. Use \"default\" for the latest available version.",
        "value": "default"
      },
      "calibrate": {
        "type": "bool",
        "description": "Whether to prepend code_prompt to the solution for function signature alignment.",
        "value": true
      }
    },
    "sandbox_config": {
      "image": "bigcodebench/bigcodebench-evaluate:latest",
      "tools_config": {
        "shell_executor": {},
        "python_executor": {}
      },
      "memory_limit": "4g"
    },
    "category": "llm"
  },
  "statistics": {
    "total_samples": 0,
    "subset_stats": [],
    "prompt_length": {
      "mean": 0,
      "min": 0,
      "max": 0,
      "std": null
    },
    "target_length_mean": null,
    "computed_at": "2026-06-22T17:16:20.257001"
  },
  "sample_example": {
    "data": {
      "input": [
        {
          "id": "657d2473",
          "content": "Calculates the average of the sums of absolute differences between each pair of consecutive numbers for all permutations of a given list. Each permutation is shuffled before calculating the differences. Args: - numbers (list): A list of numbe ... [TRUNCATED 75 chars] ... loat: The average of the sums of absolute differences for each shuffled permutation of the list.\nYou should write self-contained code starting with:\n```\nimport itertools\nfrom random import shuffle\ndef task_func(numbers=list(range(1, 3))):\n```"
        }
      ],
      "target": "    permutations = list(itertools.permutations(numbers))\n    sum_diffs = 0\n\n    for perm in permutations:\n        perm = list(perm)\n        shuffle(perm)\n        diffs = [abs(perm[i] - perm[i+1]) for i in range(len(perm)-1)]\n        sum_diffs += sum(diffs)\n\n    avg_sum_diffs = sum_diffs / len(permutations)\n    \n    return avg_sum_diffs",
      "id": 0,
      "group_id": 0,
      "metadata": {
        "task_id": "BigCodeBench/0",
        "entry_point": "task_func",
        "complete_prompt": "import itertools\nfrom random import shuffle\n\ndef task_func(numbers=list(range(1, 3))):\n    \"\"\"\n    Calculates the average of the sums of absolute differences between each pair of consecutive numbers \n    for all permutations of a given list.  ... [TRUNCATED 187 chars] ... age of the sums of absolute differences for each shuffled permutation of the list.\n\n    Requirements:\n    - itertools\n    - random.shuffle\n\n    Example:\n    >>> result = task_func([1, 2, 3])\n    >>> isinstance(result, float)\n    True\n    \"\"\"\n",
        "code_prompt": "import itertools\nfrom random import shuffle\ndef task_func(numbers=list(range(1, 3))):\n",
        "test": "import unittest\nfrom unittest.mock import patch\nfrom random import seed, shuffle\nimport itertools\nclass TestCases(unittest.TestCase):\n    def test_default_numbers(self):\n        # Test with default number range (1 to 10) to check that the res ... [TRUNCATED 2578 chars] ...  x: seed(1) or shuffle(x)):\n            result1 = task_func([1, 2, 3])\n        with patch('random.shuffle', side_effect=lambda x: seed(1) or shuffle(x)):\n            result2 = task_func([1, 2, 4])\n        self.assertNotEqual(result1, result2)"
      }
    },
    "subset": "default",
    "truncated": false
  },
  "readme": {
    "en": "# BigCodeBench\n\n\n## Overview\n\nBigCodeBench is an easy-to-use benchmark for solving practical and challenging tasks via code. It evaluates the true programming capabilities of large language models (LLMs) in a more realistic setting with diverse function calls from 139 popular libraries covering 723 API calls.\n\n## Task Description\n\n- **Task Type**: Code Generation (Python)\n- **Input**: Programming task description (docstring or natural language instruction)\n- **Output**: Complete Python function implementation\n- **Libraries**: 139 popular Python libraries (numpy, pandas, sklearn, etc.)\n\n## Key Features\n\n- 1,140 rich-context programming tasks in Python\n- Two evaluation modes: Complete (docstring) and Instruct (natural language)\n- Covers diverse function calls from 139 popular libraries\n- Uses unittest.TestCase for thorough correctness verification\n- Supports pass@k metric calculation\n\n## Evaluation Notes\n\n- **Sandbox Required**: Requires sandbox environment with 70+ Python libraries pre-installed\n- Two modes available via `split` parameter: `complete` (docstring completion) or `instruct` (NL instruction)\n- Default timeout is 240 seconds per problem\n- `calibrate` option prepends code_prompt to align function signatures\n- See [sandbox documentation](https://evalscope.readthedocs.io/en/latest/user_guides/sandbox.html) for setup\n\n\n## Properties\n\n| Property | Value |\n|----------|-------|\n| **Benchmark Name** | `bigcodebench` |\n| **Dataset ID** | [evalscope/bigcodebench](https://modelscope.cn/datasets/evalscope/bigcodebench/summary) |\n| **Paper** | N/A |\n| **Tags** | `Coding` |\n| **Metrics** | `acc` |\n| **Default Shots** | 0-shot |\n| **Evaluation Split** | `v0.1.4` |\n| **Aggregation** | `mean_and_pass_at_k` |\n\n\n## Data Statistics\n\n*Statistics not available.*\n\n## Sample Example\n\n**Subset**: `default`\n\n```json\n{\n  \"input\": [\n    {\n      \"id\": \"657d2473\",\n      \"content\": \"Calculates the average of the sums of absolute differences between each pair of consecutive numbers for all permutations of a given list. Each permutation is shuffled before calculating the differences. Args: - numbers (list): A list of numbe ... [TRUNCATED 75 chars] ... loat: The average of the sums of absolute differences for each shuffled permutation of the list.\\nYou should write self-contained code starting with:\\n```\\nimport itertools\\nfrom random import shuffle\\ndef task_func(numbers=list(range(1, 3))):\\n```\"\n    }\n  ],\n  \"target\": \"    permutations = list(itertools.permutations(numbers))\\n    sum_diffs = 0\\n\\n    for perm in permutations:\\n        perm = list(perm)\\n        shuffle(perm)\\n        diffs = [abs(perm[i] - perm[i+1]) for i in range(len(perm)-1)]\\n        sum_diffs += sum(diffs)\\n\\n    avg_sum_diffs = sum_diffs / len(permutations)\\n    \\n    return avg_sum_diffs\",\n  \"id\": 0,\n  \"group_id\": 0,\n  \"metadata\": {\n    \"task_id\": \"BigCodeBench/0\",\n    \"entry_point\": \"task_func\",\n    \"complete_prompt\": \"import itertools\\nfrom random import shuffle\\n\\ndef task_func(numbers=list(range(1, 3))):\\n    \\\"\\\"\\\"\\n    Calculates the average of the sums of absolute differences between each pair of consecutive numbers \\n    for all permutations of a given list.  ... [TRUNCATED 187 chars] ... age of the sums of absolute differences for each shuffled permutation of the list.\\n\\n    Requirements:\\n    - itertools\\n    - random.shuffle\\n\\n    Example:\\n    >>> result = task_func([1, 2, 3])\\n    >>> isinstance(result, float)\\n    True\\n    \\\"\\\"\\\"\\n\",\n    \"code_prompt\": \"import itertools\\nfrom random import shuffle\\ndef task_func(numbers=list(range(1, 3))):\\n\",\n    \"test\": \"import unittest\\nfrom unittest.mock import patch\\nfrom random import seed, shuffle\\nimport itertools\\nclass TestCases(unittest.TestCase):\\n    def test_default_numbers(self):\\n        # Test with default number range (1 to 10) to check that the res ... [TRUNCATED 2578 chars] ...  x: seed(1) or shuffle(x)):\\n            result1 = task_func([1, 2, 3])\\n        with patch('random.shuffle', side_effect=lambda x: seed(1) or shuffle(x)):\\n            result2 = task_func([1, 2, 4])\\n        self.assertNotEqual(result1, result2)\"\n  }\n}\n```\n\n## Prompt Template\n\n**Prompt Template:**\n```text\n{prompt}\n```\n\n## Extra Parameters\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `split` | `str` | `instruct` | Evaluation mode: \"complete\" (docstring completion) or \"instruct\" (NL instruction). Choices: ['complete', 'instruct'] |\n| `version` | `str` | `default` | Dataset version. Use \"default\" for the latest available version. |\n| `calibrate` | `bool` | `True` | Whether to prepend code_prompt to the solution for function signature alignment. |\n\n## Sandbox Configuration\n\nThis benchmark requires a sandbox environment for code execution.\n\n```json\n{\n  \"image\": \"bigcodebench/bigcodebench-evaluate:latest\",\n  \"tools_config\": {\n    \"shell_executor\": {},\n    \"python_executor\": {}\n  },\n  \"memory_limit\": \"4g\"\n}\n```\n\n## Usage\n\n### Using CLI\n\n```bash\nevalscope eval \\\n    --model YOUR_MODEL \\\n    --api-url OPENAI_API_COMPAT_URL \\\n    --api-key EMPTY_TOKEN \\\n    --datasets bigcodebench \\\n    --sandbox '{\"enabled\": true}' \\\n    --limit 10  # Remove this line for formal evaluation\n```\n\n### Using Python\n\n```python\nfrom evalscope import run_task\nfrom evalscope.config import TaskConfig\n\ntask_cfg = TaskConfig(\n    model='YOUR_MODEL',\n    api_url='OPENAI_API_COMPAT_URL',\n    api_key='EMPTY_TOKEN',\n    datasets=['bigcodebench'],\n    sandbox={'enabled': True},\n    dataset_args={\n        'bigcodebench': {\n            # extra_params: {}  # uses default extra parameters\n        }\n    },\n    limit=10,  # Remove this line for formal evaluation\n)\n\nrun_task(task_cfg=task_cfg)\n```\n\n\n",
    "zh": "# BigCodeBench\n\n\n## 概述\n\nBigCodeBench 是一个易于使用的基准测试，用于通过代码解决实际且具有挑战性的任务。它在更贴近现实的场景中评估大语言模型（LLMs）的真实编程能力，涵盖来自 139 个流行库的 723 个 API 调用。\n\n## 任务描述\n\n- **任务类型**：代码生成（Python）\n- **输入**：编程任务描述（文档字符串或自然语言指令）\n- **输出**：完整的 Python 函数实现\n- **涉及库**：139 个流行的 Python 库（如 numpy、pandas、sklearn 等）\n\n## 主要特性\n\n- 包含 1,140 个上下文丰富的 Python 编程任务\n- 提供两种评估模式：Complete（基于文档字符串）和 Instruct（基于自然语言指令）\n- 覆盖来自 139 个流行库的多样化函数调用\n- 使用 `unittest.TestCase` 进行全面的正确性验证\n- 支持 pass@k 指标计算\n\n## 评估说明\n\n- **需要沙箱环境**：要求预装 70+ 个 Python 库的沙箱环境\n- 通过 `split` 参数选择两种模式：`complete`（文档字符串补全）或 `instruct`（自然语言指令）\n- 每个问题默认超时时间为 240 秒\n- 启用 `calibrate` 选项会在生成代码前添加 `code_prompt`，以对齐函数签名\n- 沙箱环境设置详见 [沙箱文档](https://evalscope.readthedocs.io/zh-cn/latest/user_guides/sandbox.html)\n\n## 属性\n\n| 属性 | 值 |\n|----------|-------|\n| **基准测试名称** | `bigcodebench` |\n| **数据集ID** | [evalscope/bigcodebench](https://modelscope.cn/datasets/evalscope/bigcodebench/summary) |\n| **论文** | N/A |\n| **标签** | `Coding` |\n| **指标** | `acc` |\n| **默认示例数** | 0-shot |\n| **评估划分版本** | `v0.1.4` |\n| **聚合方式** | `mean_and_pass_at_k` |\n\n\n## 数据统计\n\n*统计数据暂不可用。*\n\n## 样例示例\n\n**子集**: `default`\n\n```json\n{\n  \"input\": [\n    {\n      \"id\": \"657d2473\",\n      \"content\": \"Calculates the average of the sums of absolute differences between each pair of consecutive numbers for all permutations of a given list. Each permutation is shuffled before calculating the differences. Args: - numbers (list): A list of numbe ... [TRUNCATED 75 chars] ... loat: The average of the sums of absolute differences for each shuffled permutation of the list.\\nYou should write self-contained code starting with:\\n```\\nimport itertools\\nfrom random import shuffle\\ndef task_func(numbers=list(range(1, 3))):\\n```\"\n    }\n  ],\n  \"target\": \"    permutations = list(itertools.permutations(numbers))\\n    sum_diffs = 0\\n\\n    for perm in permutations:\\n        perm = list(perm)\\n        shuffle(perm)\\n        diffs = [abs(perm[i] - perm[i+1]) for i in range(len(perm)-1)]\\n        sum_diffs += sum(diffs)\\n\\n    avg_sum_diffs = sum_diffs / len(permutations)\\n    \\n    return avg_sum_diffs\",\n  \"id\": 0,\n  \"group_id\": 0,\n  \"metadata\": {\n    \"task_id\": \"BigCodeBench/0\",\n    \"entry_point\": \"task_func\",\n    \"complete_prompt\": \"import itertools\\nfrom random import shuffle\\n\\ndef task_func(numbers=list(range(1, 3))):\\n    \\\"\\\"\\\"\\n    Calculates the average of the sums of absolute differences between each pair of consecutive numbers \\n    for all permutations of a given list.  ... [TRUNCATED 187 chars] ... age of the sums of absolute differences for each shuffled permutation of the list.\\n\\n    Requirements:\\n    - itertools\\n    - random.shuffle\\n\\n    Example:\\n    >>> result = task_func([1, 2, 3])\\n    >>> isinstance(result, float)\\n    True\\n    \\\"\\\"\\\"\\n\",\n    \"code_prompt\": \"import itertools\\nfrom random import shuffle\\ndef task_func(numbers=list(range(1, 3))):\\n\",\n    \"test\": \"import unittest\\nfrom unittest.mock import patch\\nfrom random import seed, shuffle\\nimport itertools\\nclass TestCases(unittest.TestCase):\\n    def test_default_numbers(self):\\n        # Test with default number range (1 to 10) to check that the res ... [TRUNCATED 2578 chars] ...  x: seed(1) or shuffle(x)):\\n            result1 = task_func([1, 2, 3])\\n        with patch('random.shuffle', side_effect=lambda x: seed(1) or shuffle(x)):\\n            result2 = task_func([1, 2, 4])\\n        self.assertNotEqual(result1, result2)\"\n  }\n}\n```\n\n## 提示模板\n\n**提示模板：**\n```text\n{prompt}\n```\n\n## 额外参数\n\n| 参数 | 类型 | 默认值 | 描述 |\n|-----------|------|---------|-------------|\n| `split` | `str` | `instruct` | 评估模式：\"complete\"（文档字符串补全）或 \"instruct\"（自然语言指令）。可选值：['complete', 'instruct'] |\n| `version` | `str` | `default` | 数据集版本。使用 \"default\" 表示最新可用版本。 |\n| `calibrate` | `bool` | `True` | 是否在解决方案前添加 `code_prompt` 以对齐函数签名。 |\n\n## 沙箱配置\n\n此基准测试需要沙箱环境来执行代码。\n\n```json\n{\n  \"image\": \"bigcodebench/bigcodebench-evaluate:latest\",\n  \"tools_config\": {\n    \"shell_executor\": {},\n    \"python_executor\": {}\n  },\n  \"memory_limit\": \"4g\"\n}\n```\n\n## 使用方法\n\n### 使用 CLI\n\n```bash\nevalscope eval \\\n    --model YOUR_MODEL \\\n    --api-url OPENAI_API_COMPAT_URL \\\n    --api-key EMPTY_TOKEN \\\n    --datasets bigcodebench \\\n    --sandbox '{\"enabled\": true}' \\\n    --limit 10  # 正式评估时请删除此行\n```\n\n### 使用 Python\n\n```python\nfrom evalscope import run_task\nfrom evalscope.config import TaskConfig\n\ntask_cfg = TaskConfig(\n    model='YOUR_MODEL',\n    api_url='OPENAI_API_COMPAT_URL',\n    api_key='EMPTY_TOKEN',\n    datasets=['bigcodebench'],\n    sandbox={'enabled': True},\n    dataset_args={\n        'bigcodebench': {\n            # extra_params: {}  # 使用默认额外参数\n        }\n    },\n    limit=10,  # 正式评估时请删除此行\n)\n\nrun_task(task_cfg=task_cfg)\n```",
    "content_hash": "86a2b4701845ac156c978de01a8aa00d",
    "needs_translation": false
  },
  "updated_at": "2026-06-22T17:16:23.830036",
  "translation_updated_at": "2026-06-22T17:16:34"
}