Datasets:
File size: 7,070 Bytes
1514a0b 1dabd6c 1514a0b | 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 | ---
license: cc-by-4.0
task_categories:
- text-generation
language:
- en
tags:
- decompilation
- python
- bytecode
- code
- mbpp
size_categories:
- n<1K
configs:
- config_name: default
data_files: bench.jsonl
---
# Data card — MBPP held-out decompilation benchmark
383 MBPP reference solutions compiled to Python 3.12 bytecode and paired with their source, with
the original `task_id` restored on every row. Built 2026-08-04 by `tools/build_mbpp_ood.py`.
**Redistributable** under CC-BY-4.0, provided `NOTICES.md` ships alongside.
---
## The set
| | |
|---|---|
| Rows | **383** (400 candidates − 17 contaminated) |
| Source | `google-research-datasets/mbpp`, config `full` |
| Licence | **CC-BY-4.0** |
| `task_id` restored | **383 / 383** (all distinct, range 11–973) |
| Untraceable rows dropped | 0 |
| **Contaminated rows dropped** | **17** (see below) |
| Disassembly length | mean 47.5 lines, median 41, max 187 |
| Python | 3.12, `optimize=0` |
### In what sense this set is independent of training — stated precisely, not as an adjective
It is a **different corpus** (`google-research-datasets/mbpp`, not
`codeparrot/github-code-clean`) and a **different kind of code**: short, self-contained,
hand-written answers to stated problems, against the training trunk's real project code with its
framework coupling and helper chains. Both differences are verifiable from row provenance.
That matters because the pilot's failure mode was a model learning the *source of the data*
rather than the task, and a test set drawn from the training source cannot detect it.
It is **not** described as out-of-distribution anywhere, and no divergence statistic was computed,
so no distributional-shift claim is made. The defensible claim is exactly three things:
different source, different task style, and the verified non-overlap below.
### Contamination — the defect that cost 17 rows
**This set was originally decontaminated against the wrong corpus.** `build_ood_mbpp.py` checked
against the v1-era 10k training labels, but the shipping model (v3) trained on 48,196 rows.
Re-checked against the corpus v3 actually trained on:
| gate | result |
|---|---|
| exact canonical match vs v3 corpus | 0 / 400 |
| **identifier-blind fingerprint vs v3 corpus** | **17 / 400 (4.25%)** |
Those 17 are dropped. They are structural collisions rather than copied code — the fingerprint
erases literals, so `re.sub(' +', ' ', t)` and `re.sub('[- ()]', '', s)` collide despite computing
different things. The gate is applied anyway: it is the same gate `build_final.py` and the CSN
builder apply, and arguing with it case by case is precisely how the earlier provenance defects
happened.
After rebuild: **0 / 383** contamination against the v3 corpus, by either gate.
## Task ids restored
`build_ood_mbpp.py` wrote only `{input, expected}`, so no row could be traced to its task, prompt
or tests. Recovery is exact rather than approximate: `expected == canonicalise(mbpp["code"])`, a
deterministic transform, so rebuilding the map over all 974 MBPP rows (974 rows → 965 distinct
canonical forms) recovers the id by lookup. All 400 rows matched; the builder refuses to emit a
row it cannot trace.
Each row now carries `provenance.task_id`, `mbpp_split`, the task `prompt`, and the `test_list`.
The tests travel with the row, so a behavioural check is possible on this set without going back
to the dataset.
## Decontamination
Two stages. At original build time, against the 10k training labels of that era, by exact
canonical match and by identifier-blind fingerprint (which caught 15 items exact match missed).
At rebuild, against the **48,196-row corpus the shipping model actually trained on**, removing a
further 17 rows as above. Rows not adjudicable by the differential-execution oracle were excluded
at original build time, so every row here was labelled by running it.
## Changes made to the original, as CC-BY-4.0 §3(a)(1)(B) requires be indicated
Each reference solution was rewritten through `ast.unparse` — normalising away formatting,
comments and redundant parentheses — then compiled to a `.pyc` at `optimize=0` and paired with a
disassembly of the resulting code object. Task text and tests are unmodified.
**That rewrite changes the compiled bytecode on 1 of the 383 rows.** CPython 3.12 inlines
comprehensions (PEP 709) and emits a cleanup entry in the exception table for the inlined scope;
how the comprehension is *line-wrapped* changes that entry. In `src/00117.py` (MBPP `task_id`
757) the original solution wraps a nested comprehension across lines, so its bytecode differs
from the normalised form shipped here. The instruction stream `co_code` is identical on all 383
rows; this row differs only in that exception-table entry.
The row is a valid decompilation task and the benchmark remains sound: for all 383 rows the
reference source and the `.pyc` are compiled from **the same** normalised string, which is the
condition the oracle needs. What the row is not is byte-identical to upstream MBPP — hence this
note. Re-deriving it from the original would put that solution's tab continuations and trailing
whitespace into the reference and make the label an unstable target, so it is documented instead.
Measured with `tools/measure_format_ceiling.py`; the general limit is in
`../../EVAL.md` §6.
## Harness soundness on this set
`grade.py --self-test-only`: pre-flight **383/383 = 100%**, mutation kill rate **199/199 = 100%**,
0 survivors. Note what pre-flight does and does not prove — see `../../ORACLE-LIMITS.md`.
## Read this before quoting any "OOD" figure
The published PyBytecode figures labelled *OOD-MBPP* — 91.04% strict greedy, 97.49% certified@32,
100% docstring recovery — **were not measured on this set.** They were measured on
the superseded held-out set (n=279), which despite its name contains no MBPP at all: it is
GitHub source from the held-out shards of the training corpus. Matching all 974 canonicalised
MBPP rows against it yields 0 hits, against 400/400 for this set. Evidence in
`../../LICENSING-DETERMINATION.md` §4.
Those numbers remain valid measurements of **held-out generalisation**. They are not
out-of-distribution measurements, and the label should be corrected wherever it appears.
**No scores have been measured on this benchmark.** Doing so requires a generation run (GPU).
## Limitations
- MBPP solutions are short and stylistically uniform. Success here says little about long or
framework-coupled functions; the CSN set is the harder distribution.
- Rows are the first 400 adjudicable MBPP tasks in split order, minus the 17 contaminated ones. Not a random sample.
- Two MBPP tasks with identical canonical solutions collapse to one row; 974 rows yield 965
distinct canonical forms, and the first `task_id` wins.
## Attribution
MBPP (Mostly Basic Python Problems), Austin et al., 2021, Google Research.
<https://huggingface.co/datasets/google-research-datasets/mbpp> — CC-BY-4.0
(<https://creativecommons.org/licenses/by/4.0/>).
|