File size: 2,537 Bytes
f460a83
5a43590
f460a83
cf160ae
b94191d
fbbf824
cf160ae
 
fbbf824
 
cf160ae
 
fbbf824
 
cf160ae
f460a83
 
 
 
 
 
 
 
 
cf160ae
f460a83
 
5a43590
cf160ae
a2c5bb6
 
cf160ae
a2c5bb6
 
 
 
 
cf160ae
a2c5bb6
 
cf160ae
a2c5bb6
cf160ae
a2c5bb6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cf160ae
 
f460a83
0778b12
 
a2c5bb6
5a43590
cf160ae
 
0778b12
 
a2c5bb6
 
 
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
---
pretty_name: Program Pair Data
configs:
  - config_name: cpp
    data_files:
      - split: test
        path: final_benchmark_uniform/cpp_seed42_sanitized.jsonl
  - config_name: python
    data_files:
      - split: test
        path: final_benchmark_uniform/python_seed42_sanitized.jsonl
  - config_name: java
    data_files:
      - split: test
        path: final_benchmark_uniform/java_seed42_sanitized_process.jsonl
task_categories:
  - text-classification
language:
  - en
tags:
  - code
  - efficiency
  - benchmark
size_categories:
  - 1K<n<10K
---

# Program Pair Data

This dataset contains 2,700 main-evaluation program pairs. Each language has
one `test` split with 900 pairs.

| Configuration | Pairs | Problems | Maximum pairs per problem |
| --- | ---: | ---: | ---: |
| `cpp` | 900 | 900 | 1 |
| `python` | 900 | 221 | 5 |
| `java` | 900 | 320 | 5 |

Each language contains 300 pairs in each slow-to-fast execution-cost ratio
range: [2, 4), [4, 8), and [8, infinity).

## Fields

- `language`, `problem_id`, `pair_id`: language, task and comparison identifiers.
- `slow_code`, `fast_code`: exact model-facing program text, ordered by the saved efficiency labels.
- `slow_code_id`, `fast_code_id`: SHA-256 hashes of the displayed source text.
- `measured_slow_code_id`, `measured_fast_code_id`: SHA-256 identifiers of the measured source programs, which can differ from the displayed source.
- `slow_id`, `fast_id`: measured implementation identifiers.
- `speedup`: the saved slow-to-fast execution-cost ratio.
- `measurement_metric`: PIE released gem5 runtime for C++, CPU instruction count for Python, or elapsed execution time for Java.
- `stratum`, `sampling_key`: ratio stratum and deterministic sampling key.
- `slow_time`, `fast_time`: released aggregate costs, present for C++.

The Python and Java ratios aggregate per-input measurement ratios; they are
not reconstructed as ratios of aggregate times. Test inputs, expected
outputs, per-run measurements and original measured-source text are not
included. This dataset provides the program pairs and saved efficiency
labels used in the main evaluation.

## Loading

```python
from datasets import load_dataset

data = load_dataset("JinNian0072/program-pair-data", "python", split="test")
assert len(data) == 900
print(data[0]["slow_code"], data[0]["fast_code"])
```

Use `cpp` or `java` for the other languages. The JSONL files are uncompressed.
`RELEASE.json` contains record counts and file checksums. Upstream code and
data retain their respective terms.