CoolFace
Datasetpublic

Amartya77/Arithmetic

Recursive Arithmetic Transformer training frames There was no static training file. The model sampled integers online every step. This dataset replays that sampler with the same Python RNGs used in train_recursive: RNG Seed What it draws mix_rng seed + 91 task mix, operand lengths, integers offset_rng seed + 17 Position Coupling origin seed = 42 for every run. Each train() call resets both RNGs, so later finetunes are not a continuation of earlier streams.… See the full description on the dataset page: https://huggingface.co/datasets/Amartya77/Arithmetic.

sourceHugging Facemitupdated 1mo agoView on Hugging Face
0likes13downloads
Dataset Card

Recursive Arithmetic Transformer training frames

There was no static training file. The model sampled integers online every step. This dataset replays that sampler with the same Python RNGs used in train_recursive:

RNGSeedWhat it draws
mix_rngseed + 91task mix, operand lengths, integers
offset_rngseed + 17Position Coupling origin

seed = 42 for every run. Each train() call resets both RNGs, so later finetunes are not a continuation of earlier streams.

Code: Amartya-Roy/recursive-arithmetic-transformer

Regenerate locally:

bash
python export_training_data.py --output data/hf

What a row is

One frame the transformer saw, not a full n-digit multiply.

Digits are least-significant first. Only completion is trained (label_mask).

`task`Supervised targetOperands
basescratchpad + 1×1 / 2×2 productlengths 1–2
splitSPLIT, k, four copied half-pairslengths 3–12 (15% up to 32)
combinedigits of P_ll + (P_lh+P_hl)·10^k + P_hh·10^{2k}templated COMBINE prompt

The unique multiply curriculum is only 1- and 2-digit pairs. Longer digit strings appear as copy (split) or add (combine).

Example (base)

<bos> 3 2 * 7 4 = 1 4 1 + 8 6 1 = 1 8 0 1 <eos>

23 × 47 = 1081. First supervised token is a digit, never SPLIT.

Example (split, learned router)

<bos> 4 3 2 1 * 8 7 6 5 = SPLIT 2 CALL 1 4 3 | 8 7 CALL 2 4 3 | 6 5 CALL 3 2 1 | 8 7 CALL 4 2 1 | 6 5 <eos>

1234 × 5678, k=2. The net copies halves; it does not emit the 8-digit product.

Example (combine)

<bos> COMBINE 2 | 2 5 6 2 | 4 0 9 1 | 6 3 9 | 2 7 6 = 2 5 6 6 0 0 7 <eos>

7006652 LSD-first. Place IDs (column position_ids) encode the 10^k / 10^{2k} shifts.

Configs (sequential trainings)

ConfigSteps × batchMix base/split/combine`SPLIT` inBit-identical to the run?
scratch_pretrain15k × 640.40 / 0.30 / 0.30promptno — current sampler replay
combine_finetune10k × 640.10 / 0.10 / 0.80promptno
combine_k2_finetune10k × 640.10 / 0.10 / 0.80promptno
allk_finetune10k × 640.15 / 0.10 / 0.75promptno — last length-gated ckpt
`router_finetune`10k × 640.25 / 0.40 / 0.35targetyesrecursive_block_router.pt

router_finetune is the dump that matches checkpoints/recursive_block_router.pt (8×8 exact 977/1000). split_train_max=12. First supervised token on split frames is SPLIT.

Earlier configs used a length-gated controller (SPLIT already in the prompt). Those dumps are replayed with the current sampler. Combine sampling evolved during development, so those rows show the recipe, not a guaranteed byte match to the original GPU stream.

Columns

Operands and products are strings so JSON does not round large integers.

ColumnMeaning
runwhich train() call
step, index_in_batch, global_indexwhere in the 10k/15k stream
taskbase / split / combine
left, right, lengthmultiply operands (0 on combine)
k, r1r4combine parts (k also set on split)
targetproduct, combine sum, or `SPLIT k a\b ...`
textfull token string
prompt / completionunsupervised prefix vs trained suffix
first_supervised_tokenSPLIT or a digit
position_offset, position_idsPlace-value IDs
label_mask1 = trained token
exact_replaytrue only for router_finetune

License

MIT, same as the code repo.