Downloads · 30 days
7
11% of all-time downloads
marcoharuni95/jax-addition-transformer-10m
jax-addition-transformer-10m is a text generation model from marcoharuni95. Use it when you need the model to write or continue text. It is set up for jax. The card lists the license as mit.
This is the released dense checkpoint for a decoder-only transformer written from scratch with JAX primitives and trained to add ordered pairs of integers from 0 through 999. The model has exactly 10,000,000 trainable…
Downloads · 30 days
7
11% of all-time downloads
All-time downloads
65
Public
Parameters
10M
40 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors40 MB · 100%
From the Hugging Face model README
This is the released dense checkpoint for a decoder-only transformer written
from scratch with JAX primitives and trained to add ordered pairs of integers
from 0 through 999. The model has exactly 10,000,000 trainable
parameters.
Try the live Streamlit application.
The seed-42 model was trained for 750 steps on a Google Colab NVIDIA T4. The release was evaluated with genuine greedy autoregressive generation over all 1,000,000 ordered operand pairs.
| Evaluation slice | Correct | Total | Exact match |
|---|---|---|---|
| Training split | 200,000 | 200,000 | 100% |
| Validation split | 20,000 | 20,000 | 100% |
| Unseen test split | 780,000 | 780,000 | 100% |
| Complete domain | 1,000,000 | 1,000,000 | 100% |
All eight carry-pattern slices and all nine operand-length slices reached 100%.
There were zero invalid generations and zero failures. The machine-readable
release evidence is included as history.json, results.json, and
failures.csv.
| Setting | Value |
|---|---|
| Decoder blocks | 5 |
| Model width | 320 |
| Attention heads | 5 |
| Head dimension | 64 |
| Feed-forward width | 2,480 |
| Context/model input length | 15 |
| Vocabulary | 13 characters |
| Normalization | Pre-LayerNorm |
| Positions | Learned absolute embeddings |
| Output head | Tied token embeddings |
| Parameter / matmul input dtype | float32 / float16 |
| Trainable parameters | 10,000,000 |
The vocabulary is 0123456789 +=; its exact mapping is recorded in
tokenizer_config.json.
Operands are zero-padded to three digits. A normal answer is padded to four digits and reversed internally:
123 + 456 = 9750
Here 9750 is 0579 reversed. This lets a causal model generate the units
digit first and then follow the direction of carry propagation. Inference
greedily generates exactly four tokens and rejects any non-digit generation
before reversing the sequence for display.
Install the pinned dependencies in requirements.txt, then:
from inference import AdditionModel
model = AdditionModel.from_pretrained(
"marcoharuni95/jax-addition-transformer-10m"
)
print(model.add(347, 928))
# 1275
The first call compiles the JAX generation graph for its batch shape.
This checkpoint is intended for reproducible arithmetic-transformer research, education, and demonstrations within its fixed domain.
0 through 999.model.safetensors contains 54 deterministic float32 tensors and no optimizer
state. It was converted once from the trusted v0.1.0 release pickle after
restoring its Flax NNX state with the notebook-evidenced Flax 0.12.2
compatibility environment. Normal inference does not use pickle or Flax.
Checksums and conversion metadata are included in
model.safetensors.metadata.json.
Source and training notebook: marcoharuni/jax-addition-transformer
@software{haruni_2026_jax_addition_transformer,
author = {Marco Haruni},
title = {JAX Addition Transformer},
version = {0.1.0},
year = {2026},
url = {https://github.com/marcoharuni/jax-addition-transformer}
}
MIT © 2026 Marco Haruni.