Datasets:

Modalities:
Text
Formats:
parquet
Languages:
code
Size:
< 1K
ArXiv:
Tags:
code
Libraries:
Datasets
pandas
License:
File size: 12,521 Bytes
b09840f
addbb59
b09840f
20678c2
 
 
 
b09840f
 
20678c2
 
9a41762
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b09840f
6e98a04
 
 
 
c23113c
b09840f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c23113c
b09840f
 
 
ccc6bb3
b09840f
 
 
 
236410f
b09840f
330274d
6e98a04
 
 
 
 
 
 
 
 
a9a45ea
6e98a04
 
 
 
 
 
 
 
 
81a59ba
 
 
 
 
6e98a04
 
 
 
 
b09840f
cb382f1
 
 
 
 
309a63f
cb382f1
 
 
 
b09840f
 
 
 
 
 
 
 
 
 
 
 
 
4a7f004
b09840f
 
 
 
4a7f004
 
 
 
b09840f
 
 
 
 
 
 
 
 
cb382f1
b09840f
 
4a7f004
b09840f
 
 
 
b3a0f29
 
4a7f004
 
b09840f
 
 
 
46978bb
b09840f
 
1c2a0e4
 
 
 
 
 
b09840f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
---
license: mit
pretty_name: HumanEvalPack
language_creators:
- expert-generated
multilinguality:
- multilingual
language:
- code
tags:
- code
dataset_info:
- config_name: cpp
  features:
  - name: task_id
    dtype: string
  - name: prompt
    dtype: string
  - name: declaration
    dtype: string
  - name: canonical_solution
    dtype: string
  - name: buggy_solution
    dtype: string
  - name: bug_type
    dtype: string
  - name: failure_symptoms
    dtype: string
  - name: entry_point
    dtype: string
  - name: import
    dtype: string
  - name: test_setup
    dtype: string
  - name: test
    dtype: string
  - name: example_test
    dtype: string
  - name: signature
    dtype: string
  - name: docstring
    dtype: string
  - name: instruction
    dtype: string
  splits:
  - name: test
    num_bytes: 469111
    num_examples: 164
  download_size: 193981
  dataset_size: 469111
- config_name: go
  features:
  - name: task_id
    dtype: string
  - name: prompt
    dtype: string
  - name: declaration
    dtype: string
  - name: canonical_solution
    dtype: string
  - name: buggy_solution
    dtype: string
  - name: bug_type
    dtype: string
  - name: failure_symptoms
    dtype: string
  - name: entry_point
    dtype: string
  - name: import
    dtype: string
  - name: test_setup
    dtype: string
  - name: test
    dtype: string
  - name: example_test
    dtype: string
  - name: signature
    dtype: string
  - name: docstring
    dtype: string
  - name: instruction
    dtype: string
  splits:
  - name: test
    num_bytes: 463234
    num_examples: 164
  download_size: 198394
  dataset_size: 463234
- config_name: java
  features:
  - name: task_id
    dtype: string
  - name: prompt
    dtype: string
  - name: declaration
    dtype: string
  - name: canonical_solution
    dtype: string
  - name: buggy_solution
    dtype: string
  - name: bug_type
    dtype: string
  - name: failure_symptoms
    dtype: string
  - name: entry_point
    dtype: string
  - name: import
    dtype: string
  - name: test_setup
    dtype: string
  - name: test
    dtype: string
  - name: example_test
    dtype: string
  - name: signature
    dtype: string
  - name: docstring
    dtype: string
  - name: instruction
    dtype: string
  splits:
  - name: test
    num_bytes: 589440
    num_examples: 164
  download_size: 210440
  dataset_size: 589440
- config_name: js
  features:
  - name: task_id
    dtype: string
  - name: prompt
    dtype: string
  - name: declaration
    dtype: string
  - name: canonical_solution
    dtype: string
  - name: buggy_solution
    dtype: string
  - name: bug_type
    dtype: string
  - name: failure_symptoms
    dtype: string
  - name: entry_point
    dtype: string
  - name: import
    dtype: string
  - name: test_setup
    dtype: string
  - name: test
    dtype: string
  - name: example_test
    dtype: string
  - name: signature
    dtype: string
  - name: docstring
    dtype: string
  - name: instruction
    dtype: string
  splits:
  - name: test
    num_bytes: 435189
    num_examples: 164
  download_size: 194044
  dataset_size: 435189
- config_name: python
  features:
  - name: task_id
    dtype: string
  - name: prompt
    dtype: string
  - name: declaration
    dtype: string
  - name: canonical_solution
    dtype: string
  - name: buggy_solution
    dtype: string
  - name: bug_type
    dtype: string
  - name: failure_symptoms
    dtype: string
  - name: entry_point
    dtype: string
  - name: import
    dtype: string
  - name: test_setup
    dtype: string
  - name: test
    dtype: string
  - name: example_test
    dtype: string
  - name: signature
    dtype: string
  - name: docstring
    dtype: string
  - name: instruction
    dtype: string
  splits:
  - name: test
    num_bytes: 423013
    num_examples: 164
  download_size: 191279
  dataset_size: 423013
- config_name: rust
  features:
  - name: task_id
    dtype: string
  - name: prompt
    dtype: string
  - name: declaration
    dtype: string
  - name: canonical_solution
    dtype: string
  - name: buggy_solution
    dtype: string
  - name: bug_type
    dtype: string
  - name: failure_symptoms
    dtype: string
  - name: entry_point
    dtype: string
  - name: import
    dtype: string
  - name: test_setup
    dtype: string
  - name: test
    dtype: string
  - name: example_test
    dtype: string
  - name: signature
    dtype: string
  - name: docstring
    dtype: string
  - name: instruction
    dtype: string
  splits:
  - name: test
    num_bytes: 450539
    num_examples: 164
  download_size: 168464
  dataset_size: 450539
configs:
- config_name: cpp
  data_files:
  - split: test
    path: cpp/test-*
- config_name: go
  data_files:
  - split: test
    path: go/test-*
- config_name: java
  data_files:
  - split: test
    path: java/test-*
- config_name: js
  data_files:
  - split: test
    path: js/test-*
- config_name: python
  data_files:
  - split: test
    path: python/test-*
  default: true
- config_name: rust
  data_files:
  - split: test
    path: rust/test-*
---

![Octopack](https://github.com/bigcode-project/octopack/blob/31f3320f098703c7910e43492c39366eeea68d83/banner.png?raw=true)

# Dataset Card for HumanEvalPack

## Table of Contents
- [Table of Contents](#table-of-contents)
- [Dataset Description](#dataset-description)
  - [Dataset Summary](#dataset-summary)
  - [Languages](#languages)
- [Dataset Structure](#dataset-structure)
  - [Data Instances](#data-instances)
  - [Data Fields](#data-fields)
  - [Data Splits](#data-splits)
- [Dataset Creation](#dataset-creation)
  - [Curation Rationale](#curation-rationale)
  - [Source Data](#source-data)
  - [Annotations](#annotations)
- [Additional Information](#additional-information)
  - [Licensing Information](#licensing-information)
  - [Citation Information](#citation-information)
  - [Contributions](#contributions)

## Dataset Description

- **Repository:** https://github.com/bigcode-project/octopack
- **Paper:** [OctoPack: Instruction Tuning Code Large Language Models](https://arxiv.org/abs/2308.07124)
- **Point of Contact:** [Niklas Muennighoff](mailto:[email protected])

### Dataset Summary

> HumanEvalPack is an extension of OpenAI's HumanEval to cover 6 total languages across 3 tasks. The Python split is exactly the same as OpenAI's Python HumanEval. The other splits are translated by humans (similar to HumanEval-X but with additional cleaning, see [here](https://github.com/bigcode-project/octopack/tree/main/evaluation/create/humaneval-x#modifications-muennighoff)). Refer to the [OctoPack paper](https://arxiv.org/abs/2308.07124) for more details.
> 
- **Languages:** Python, JavaScript, Java, Go, C++, Rust
- **OctoPack🐙🎒:**

<table>
<tr>
<th>Data</t> 
<td><a href=https://huggingface.co/datasets/bigcode/commitpack>CommitPack</a></td>
<td>4TB of GitHub commits across 350 programming languages</td>
</tr>
<tr>
<th></t> 
<td><a href=https://huggingface.co/datasets/bigcode/commitpackft>CommitPackFT</a></td>
<td>Filtered version of CommitPack for high-quality commit messages that resemble instructions</td>
</tr>
<tr>
<th>Model</t> 
<td><a href=https://huggingface.co/bigcode/octocoder>OctoCoder</a></td>
<td>StarCoder (16B parameters) instruction tuned on CommitPackFT + OASST</td>
</tr>
<tr>
<th></t> 
<td><a href=https://huggingface.co/bigcode/octogeex>OctoGeeX</a></td>
<td>CodeGeeX2 (6B parameters) instruction tuned on CommitPackFT + OASST</td>
</tr>
<tr>
<th>Evaluation</t> 
<td><a href=https://huggingface.co/datasets/bigcode/humanevalpack>HumanEvalPack</a></td>
<td>Extension of OpenAI's HumanEval to cover 3 scenarios across 6 languages</td>
</tr>
</table>

## Usage

```python
# pip install -q datasets
from datasets import load_dataset
# Languages: "python", "js", "java", "go", "cpp", "rust"
ds = load_dataset("bigcode/humanevalpack", "python")["test"]
ds[0]
```

## Dataset Structure


### Data Instances


An example looks as follows:

```json
{
  "task_id": "Python/0",
  "prompt": "from typing import List\n\n\ndef has_close_elements(numbers: List[float], threshold: float) -> bool:\n    \"\"\" Check if in given list of numbers, are any two numbers closer to each other than\n    given threshold.\n    >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n    False\n    >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n    True\n    \"\"\"\n",
  "declaration": "from typing import List\n\n\ndef has_close_elements(numbers: List[float], threshold: float) -> bool:\n",
  "canonical_solution": "    for idx, elem in enumerate(numbers):\n        for idx2, elem2 in enumerate(numbers):\n            if idx != idx2:\n                distance = abs(elem - elem2)\n                if distance < threshold:\n                    return True\n\n    return False\n",
  "buggy_solution": "    for idx, elem in enumerate(numbers):\n        for idx2, elem2 in enumerate(numbers):\n            if idx != idx2:\n                distance = elem - elem2\n                if distance < threshold:\n                    return True\n\n    return False\n",
  "bug_type": "missing logic",
  "failure_symptoms": "incorrect output",
  "entry_point": "has_close_elements",
  "import": ""
  "test_setup": ""
  "test": "\n\n\n\n\ndef check(has_close_elements):\n    assert has_close_elements([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.3) == True\n    assert has_close_elements([1.0, 2.0, 3.9, 4.0, 5.0, 2.2], 0.05) == False\n    assert has_close_elements([1.0, 2.0, 5.9, 4.0, 5.0], 0.95) == True\n    assert has_close_elements([1.0, 2.0, 5.9, 4.0, 5.0], 0.8) == False\n    assert has_close_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0], 0.1) == True\n    assert has_close_elements([1.1, 2.2, 3.1, 4.1, 5.1], 1.0) == True\n    assert has_close_elements([1.1, 2.2, 3.1, 4.1, 5.1], 0.5) == False\n\ncheck(has_close_elements)",
  "example_test": "def check(has_close_elements):\n    assert has_close_elements([1.0, 2.0, 3.0], 0.5) == False\n    assert has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3) == True\ncheck(has_close_elements)\n",
  "signature": "has_close_elements(numbers: List[float], threshold: float) -> bool",
  "docstring": "Check if in given list of numbers, are any two numbers closer to each other than\ngiven threshold.\n>>> has_close_elements([1.0, 2.0, 3.0], 0.5)\nFalse\n>>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\nTrue",
  "instruction": "Write a Python function `has_close_elements(numbers: List[float], threshold: float) -> bool` to solve the following problem:\nCheck if in given list of numbers, are any two numbers closer to each other than\ngiven threshold.\n>>> has_close_elements([1.0, 2.0, 3.0], 0.5)\nFalse\n>>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\nTrue"
}
```

### Data Fields

The data fields are the same among all splits:
- `task_id`: Indicates the language (Python/JavaScript/Java/Go/C++/Rust) and task id (from 0 to 163) of the problem
- `prompt`: the prompt for models relying on code continuation
- `declaration`: the declaration of the function (same as prompt but without the docstring)
- `canonical_solution`: the correct solution passing all unit tests for the problem
- `buggy_solution`: same as `canonical_solution` but with a subtle human-written bug causing the unit tests to fail
- `bug_type`: the type of the bug in `buggy_solution` (one of [`missing logic`, `excess logic`, `value misuse`, `operator misuse`, `variable misuse`, `function misuse`])
- `failure_symptoms`: the problem the bug causes (one of [`incorrect output`, `stackoverflow`, `infinite loop`])
- `entry_point`: the name of the function
- `import`: imports necessary for the solution (only present for Go)
- `test_setup`: imports necessary for the test execution (only present for Go)
- `test`: the unit tests for the problem
- `example_test`: additional unit tests different from `test` that could be e.g. provided to the model (these are not used in the paper)
- `signature`: the signature of the function
- `docstring`: the docstring describing the problem
- `instruction`: an instruction for HumanEvalSynthesize in the form `Write a {language_name} function {signature} to solve the following problem:\n{docstring}`

## Citation Information

```bibtex
@article{muennighoff2023octopack,
      title={OctoPack: Instruction Tuning Code Large Language Models}, 
      author={Niklas Muennighoff and Qian Liu and Armel Zebaze and Qinkai Zheng and Binyuan Hui and Terry Yue Zhuo and Swayam Singh and Xiangru Tang and Leandro von Werra and Shayne Longpre},
      journal={arXiv preprint arXiv:2308.07124},
      year={2023}
}
```