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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
configs:
|
| 3 |
+
# Main benchmark dataset (raw code pairs with timing)
|
| 4 |
+
- config_name: benchmark
|
| 5 |
+
data_files:
|
| 6 |
+
- split: cpp
|
| 7 |
+
path: final_benchmark_uniform/cpp_seed42_sanitized.jsonl
|
| 8 |
+
- split: python
|
| 9 |
+
path: final_benchmark_uniform/python_seed42_sanitized.jsonl
|
| 10 |
+
- split: java
|
| 11 |
+
path: final_benchmark_uniform/java_seed42_sanitized_process.jsonl
|
| 12 |
+
|
| 13 |
+
# Zero-shot format (system_prompt + user_prompt + code_a + code_b + expected)
|
| 14 |
+
- config_name: zeroshot
|
| 15 |
+
data_files:
|
| 16 |
+
- split: cpp_test
|
| 17 |
+
path: cpp_zeroshot_test.jsonl
|
| 18 |
+
- split: python_test
|
| 19 |
+
path: python_zeroshot_test.jsonl
|
| 20 |
+
- split: java_test
|
| 21 |
+
path: java_zeroshot_test.jsonl
|
| 22 |
+
|
| 23 |
+
# A/B format (instruction + input + output) - for instruction tuning
|
| 24 |
+
- config_name: ab
|
| 25 |
+
data_files:
|
| 26 |
+
- split: cpp_train
|
| 27 |
+
path: cpp_ab_train.jsonl
|
| 28 |
+
- split: cpp_val
|
| 29 |
+
path: cpp_ab_val.jsonl
|
| 30 |
+
- split: cpp_test
|
| 31 |
+
path: cpp_ab_test.jsonl
|
| 32 |
+
- split: python_train
|
| 33 |
+
path: python_ab_train.jsonl
|
| 34 |
+
- split: python_val
|
| 35 |
+
path: python_ab_val.jsonl
|
| 36 |
+
- split: python_test
|
| 37 |
+
path: python_ab_test.jsonl
|
| 38 |
+
- split: java_train
|
| 39 |
+
path: java_ab_train.jsonl
|
| 40 |
+
- split: java_val
|
| 41 |
+
path: java_ab_val.jsonl
|
| 42 |
+
- split: java_test
|
| 43 |
+
path: java_ab_test.jsonl
|
| 44 |
+
|
| 45 |
+
# A/B with diff format
|
| 46 |
+
- config_name: abdiff
|
| 47 |
+
data_files:
|
| 48 |
+
- split: cpp_train
|
| 49 |
+
path: cpp_abdiff_train.jsonl
|
| 50 |
+
- split: cpp_val
|
| 51 |
+
path: cpp_abdiff_val.jsonl
|
| 52 |
+
- split: cpp_test
|
| 53 |
+
path: cpp_abdiff_test.jsonl
|
| 54 |
+
- split: python_train
|
| 55 |
+
path: python_abdiff_train.jsonl
|
| 56 |
+
- split: python_val
|
| 57 |
+
path: python_abdiff_val.jsonl
|
| 58 |
+
- split: python_test
|
| 59 |
+
path: python_abdiff_test.jsonl
|
| 60 |
+
- split: java_train
|
| 61 |
+
path: java_abdiff_train.jsonl
|
| 62 |
+
- split: java_val
|
| 63 |
+
path: java_abdiff_val.jsonl
|
| 64 |
+
- split: java_test
|
| 65 |
+
path: java_abdiff_test.jsonl
|
| 66 |
+
|
| 67 |
+
# A with diff format
|
| 68 |
+
- config_name: adiff
|
| 69 |
+
data_files:
|
| 70 |
+
- split: cpp_train
|
| 71 |
+
path: cpp_adiff_train.jsonl
|
| 72 |
+
- split: cpp_val
|
| 73 |
+
path: cpp_adiff_val.jsonl
|
| 74 |
+
- split: cpp_test
|
| 75 |
+
path: cpp_adiff_test.jsonl
|
| 76 |
+
- split: python_train
|
| 77 |
+
path: python_adiff_train.jsonl
|
| 78 |
+
- split: python_val
|
| 79 |
+
path: python_adiff_val.jsonl
|
| 80 |
+
- split: python_test
|
| 81 |
+
path: python_adiff_test.jsonl
|
| 82 |
+
- split: java_train
|
| 83 |
+
path: java_adiff_train.jsonl
|
| 84 |
+
- split: java_val
|
| 85 |
+
path: java_adiff_val.jsonl
|
| 86 |
+
- split: java_test
|
| 87 |
+
path: java_adiff_test.jsonl
|
| 88 |
+
|
| 89 |
+
license: mit
|
| 90 |
+
task_categories:
|
| 91 |
+
- text-classification
|
| 92 |
+
language:
|
| 93 |
+
- en
|
| 94 |
+
- code
|
| 95 |
+
tags:
|
| 96 |
+
- code
|
| 97 |
+
- efficiency
|
| 98 |
+
- benchmark
|
| 99 |
+
- llm-evaluation
|
| 100 |
+
- code-optimization
|
| 101 |
+
size_categories:
|
| 102 |
+
- 1K<n<10K
|
| 103 |
+
---
|
| 104 |
+
|
| 105 |
+
# EffiBench Dataset
|
| 106 |
+
|
| 107 |
+
A comprehensive benchmark for evaluating Large Language Models' ability to judge code execution efficiency.
|
| 108 |
+
|
| 109 |
+
## 📊 Dataset Overview
|
| 110 |
+
|
| 111 |
+
This dataset contains pairs of functionally equivalent code snippets with different execution speeds, designed to evaluate whether LLMs can correctly identify which code runs faster.
|
| 112 |
+
|
| 113 |
+
- **Languages**: C++, Python, Java
|
| 114 |
+
- **Samples**: 900 pairs per language (2,700 total)
|
| 115 |
+
- **Difficulty Levels**: Hard (2-4x speedup), Medium (4-8x), Easy (8x+)
|
| 116 |
+
|
| 117 |
+
## 📁 Configurations
|
| 118 |
+
|
| 119 |
+
| Config | Description | Splits | Schema |
|
| 120 |
+
|--------|-------------|--------|--------|
|
| 121 |
+
| `benchmark` | Main benchmark (raw code pairs) | cpp, python, java | `slow_code`, `fast_code`, `speedup`, `difficulty` |
|
| 122 |
+
| `zeroshot` | Zero-shot LLM evaluation | {lang}_test | `system_prompt`, `user_prompt`, `code_a`, `code_b`, `expected` |
|
| 123 |
+
| `ab` | A/B comparison (instruction tuning) | {lang}_train/val/test | `instruction`, `input`, `output` |
|
| 124 |
+
| `abdiff` | A/B with code diff | {lang}_train/val/test | `instruction`, `input`, `output` |
|
| 125 |
+
| `adiff` | Single code with diff | {lang}_train/val/test | `instruction`, `input`, `output` |
|
| 126 |
+
|
| 127 |
+
## 🚀 Usage
|
| 128 |
+
|
| 129 |
+
```python
|
| 130 |
+
from datasets import load_dataset
|
| 131 |
+
|
| 132 |
+
# Load main benchmark dataset
|
| 133 |
+
ds = load_dataset("JinNian0072/efficodebench-dataset", "benchmark")
|
| 134 |
+
print(ds["cpp"][0]) # First C++ sample
|
| 135 |
+
|
| 136 |
+
# Load zero-shot evaluation format
|
| 137 |
+
ds_zs = load_dataset("JinNian0072/efficodebench-dataset", "zeroshot")
|
| 138 |
+
print(ds_zs["python_test"][0])
|
| 139 |
+
|
| 140 |
+
# Load A/B format for training
|
| 141 |
+
ds_ab = load_dataset("JinNian0072/efficodebench-dataset", "ab")
|
| 142 |
+
print(ds_ab["cpp_train"][0])
|
| 143 |
+
|
| 144 |
+
# Load specific language and split
|
| 145 |
+
ds_java = load_dataset("JinNian0072/efficodebench-dataset", "abdiff", split="java_test")
|
| 146 |
+
```
|
| 147 |
+
|
| 148 |
+
## 📋 Data Format
|
| 149 |
+
|
| 150 |
+
### Benchmark Config
|
| 151 |
+
```json
|
| 152 |
+
{
|
| 153 |
+
"pair_id": "pie_12345",
|
| 154 |
+
"problem_id": "p01234",
|
| 155 |
+
"language": "cpp",
|
| 156 |
+
"slow_code": "...",
|
| 157 |
+
"fast_code": "...",
|
| 158 |
+
"slow_time": 1234.5,
|
| 159 |
+
"fast_time": 123.4,
|
| 160 |
+
"speedup": 10.0,
|
| 161 |
+
"difficulty": "easy"
|
| 162 |
+
}
|
| 163 |
+
```
|
| 164 |
+
|
| 165 |
+
### Instruction Tuning Config (ab/abdiff/adiff)
|
| 166 |
+
```json
|
| 167 |
+
{
|
| 168 |
+
"instruction": "Which code is more efficient?",
|
| 169 |
+
"input": "Code A: ...\nCode B: ...",
|
| 170 |
+
"output": "A",
|
| 171 |
+
"pair_id": "pie_12345",
|
| 172 |
+
"language": "cpp"
|
| 173 |
+
}
|
| 174 |
+
```
|
| 175 |
+
|
| 176 |
+
### Zero-shot Config
|
| 177 |
+
```json
|
| 178 |
+
{
|
| 179 |
+
"system_prompt": "You are a code efficiency expert...",
|
| 180 |
+
"user_prompt": "Compare the following code snippets...",
|
| 181 |
+
"code_a": "...",
|
| 182 |
+
"code_b": "...",
|
| 183 |
+
"expected": "A",
|
| 184 |
+
"difficulty": "hard"
|
| 185 |
+
}
|
| 186 |
+
```
|
| 187 |
+
|
| 188 |
+
## 📈 Difficulty Levels
|
| 189 |
+
|
| 190 |
+
| Difficulty | Speedup Range | Description |
|
| 191 |
+
|------------|---------------|-------------|
|
| 192 |
+
| hard | [2x, 4x) | Small optimization margin |
|
| 193 |
+
| medium | [4x, 8x) | Moderate optimization |
|
| 194 |
+
| easy | [8x, inf) | Large optimization margin |
|
| 195 |
+
|
| 196 |
+
## 📄 License
|
| 197 |
+
|
| 198 |
+
MIT License
|
| 199 |
+
|
| 200 |
+
## 📬 Citation
|
| 201 |
+
|
| 202 |
+
```bibtex
|
| 203 |
+
@misc{efficodebench2026,
|
| 204 |
+
title={EffiBench: Evaluating LLMs on Code Efficiency Judgment},
|
| 205 |
+
author={...},
|
| 206 |
+
year={2026},
|
| 207 |
+
url={https://huggingface.co/datasets/JinNian0072/efficodebench-dataset}
|
| 208 |
+
}
|
| 209 |
+
```
|