Downloads · 30 days
377
100% of all-time downloads
rishabhguptajs/tinystories-10m-mlx
tinystories-10m-mlx is a text generation model from rishabhguptajs. Use it when you need the model to write or continue text. It is set up for mlx. The card lists the license as cdla-sharing-1.0.
A 10M-parameter GPT trained from scratch in MLX on a fanless MacBook Air M4, in 2h40m. Own byte-level BPE tokenizer, own architecture code, own training loop. No pretrained weights were used.
Downloads · 30 days
377
100% of all-time downloads
All-time downloads
377
Public
Parameters
10M
40.2 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors40 MB · 99%
From the Hugging Face model README
A 10M-parameter GPT trained from scratch in MLX on a fanless MacBook Air M4, in 2h40m. Own byte-level BPE tokenizer, own architecture code, own training loop. No pretrained weights were used.
By Rishabh Gupta.

Bits per byte (lower is better) on the first 1,000 stories of the TinyStoriesV2-GPT4 validation split. Each model is conditioned on its own BOS token and scored on the story text only. Bits per byte is used because the models have different tokenizers.
| model | total params | non-embedding | bits/byte |
|---|---|---|---|
| stories15M (Karpathy, llama2.c) | 15.2M | 6.0M | 0.3991 |
| TinyStories-28M (Eldan & Li) | 52.0M | 25.2M | 0.4428 |
| this model | 10.0M | 7.4M | 0.4634 |
| TinyStories-8M (Eldan & Li) | 19.7M | 6.3M | 0.5183 |
| TinyStories-3M (Eldan & Li) | 8.3M | 1.6M | 0.6240 |
| TinyStories-1M (Eldan & Li) | 3.8M | 0.4M | 0.7860 |
| stories260K (Karpathy, llama2.c) | 0.26M | 0.23M | 0.9156 |
Caveats: the TinyStories-* models were trained on TinyStories v1 (GPT-3.5 + GPT-4 stories). This model was trained on the v2 GPT-4 split that the evaluation uses, which is a home advantage. stories15M was trained for much longer on datacenter GPUs.
<|endoftext|>)Short equal-token ablations (8.2M tokens each) that led to this recipe, in bits/byte: AdamW + ctx 512 baseline 0.974; ctx 256: 0.955; + AdamW lr 3e-3: 0.952; Muon: 0.689;
pip install mlx numpy
python generate.py --prompt "Once upon a time" --n 2
Sample:
Once upon a time, there was a little dog named Spot. Spot loved to sit and watch the birds outside. One day, Spot's owner, Tom, took him to the park. [...] Spot was curious and wanted to see what was inside. He climbed up to the box and tried to open it. But the box was shut very tight.
| path | what |
|---|---|
model.safetensors, config.json, tokenizer.json | weights (fp32, 40MB), architecture config, BPE merges |
model.py, tok.py, generate.py | everything needed to run the model |
training/ | full training code: tokenizer trainer, data prep, training loop, Muon, benchmark, ablations. training/NOTES.md has the full research notes |
logs/ | the real training log and metrics of this run, ablation results, benchmark output |
cd training
pip install mlx numpy
python prepare.py # downloads TinyStoriesV2-GPT4, trains the tokenizer, writes data/*.bin (~4 min)
python train.py --out run1 # 10k steps, ~2h40m on an M4 MacBook Air
python compare.py --runs run1
Weights are released under CDLA-Sharing-1.0, matching the TinyStories dataset license.