Datasets:
Download README.md from aemack/simple-python-synth: direct link, hf CLI and curl.
- Browser
- Download file 3.57 kB
-
https://huggingface.co/datasets/aemack/simple-python-synth/resolve/main/README.md
- Command line
-
hf download hf://datasets/aemack/simple-python-synth/README.md
-
curl -L -o README.md https://huggingface.co/datasets/aemack/simple-python-synth/resolve/main/README.md
license: apache-2.0
language:
- en
tags:
- code
- python
- synthetic
size_categories:
- 10M<n<100M
configs:
- config_name: default
data_files:
- split: train
path: data/train-*.parquet
- split: validation
path: data/val-*.parquet
simple-python-synth
Synthetic, short, simple Python files, generated as an open stand-in for the "especially simple and repetitive idioms" component of the training data in Weight-sparse transformers have interpretable circuits (Gao et al., 2025, arXiv 2511.13653, appendix A.6). That component (10B tokens, written by GPT-4-base) was not released; this dataset imitates it with open models.
Size
Lengths are in the tinypython_2k tokenizer (see below).
| split | rows | tokens |
|---|---|---|
| train (98 files) | 38,967,435 | 6.63B |
| validation (2 files) | 195,892 | 33.2M |
By generator: Qwen2.5-Coder-7B 13.7M rows / 2.25B tokens,
Qwen2.5-Coder-1.5B 25.4M rows / 4.41B tokens. By prompt style: pe
3.21B, mix 1.76B, tp 1.69B tokens. Mean length ~170 tokens.
Shuffle before training: the files are not shuffled. Each file holds samples from one or a few generator processes, so consecutive files alternate between the two models.
Generated in ~9 hours on 8x H200 (4 GPUs per model).
How it was made
- Generators: base (not instruct) code models,
Qwen/Qwen2.5-Coder-7B(FP8 weights) andQwen/Qwen2.5-Coder-1.5B; themodelcolumn says which. Sampling: temperature 1.0, top-p 0.95, at most 768 generator tokens. - Prompts: few-shot in the generator's repository format: several short
files, each
<|file_sep|>name.pyfollowed by the code, then<|file_sep|>new_name.pyand the model writes that file; generation stops at the next file separator. Exemplars come from a pool of 3.9M short, simple files: 2.79M real files from Avelina/python-edu-cleaned and 1.11M functions from BertilBraun/TinyPython (description added as a docstring), all passing the filter below. Thestylecolumn gives the prompt mix:pe(3-6 real files),tp(8-12 TinyPython functions),mix(both);nameis the file name the model was asked to write (taken from another pool file). - Filter (every sample): parses as Python 3; 40-1024 tokens of the
tinypython_2ktokenizer; at most 100 lines of at most 120 characters; block nesting at most 4; imports only from a small stdlib set; no literal with more than 24 elements; non-docstring string literals under 45% of the characters; under 1% non-ASCII; no heavy line repetition or extreme compressibility; at least 3 statements. Samples cut off by the length limit are dropped. - Dedup: exact, on the code with comments and blank lines removed
(
hashcolumn); samples identical to a pool exemplar are dropped. - Split: ~0.5% of samples, chosen by hash, are in
validation.
ntok is the length in the tinypython_2k tokenizer from
openai/circuit_sparsity
(circuit_sparsity/tiktoken_ext/tinypython.py; vocabulary files at
https://openaipublic.blob.core.windows.net/circuit-sparsity/tinypython/).
Caveats
- Not the paper's data: much weaker generators than GPT-4-base, and the exemplars steer the style toward beginner / exercise code.
- The 1.5B samples are less coherent (docstrings that do not match the code,
odd logic); filter on
modelif that matters. - Files are not executed; only parsed.