v2 card: 12288-vocab retrain, 56,902,144 params, val 1.3837, measured evals

#6
by Compactbot - opened
Files changed (1) hide show
  1. README.md +42 -25
README.md CHANGED
@@ -16,15 +16,19 @@ datasets:
16
  - ronendagan/TinyStories
17
  metrics:
18
  - perplexity
 
19
  ---
20
 
21
  # tinystories-50m
22
 
23
- A **54,804,992-parameter** transformer language model trained **from scratch** on
24
  [TinyStories](https://huggingface.co/datasets/ronendagan/TinyStories), a corpus of
25
  simple, repetitive children's stories. It is the 50M scale-up in the
26
- `tinystories-24m` β†’ `tinystories-50m` lineage (the 24M sibling was coherent at
27
- 18.2 tok/param; this one trains at 8.17 tok/param on the same narrow domain).
 
 
 
28
 
29
  It writes fluent, on-domain children's stories. It is **not** a general
30
  language model β€” out-of-domain generation degrades, and it should not be used
@@ -34,12 +38,12 @@ for anything beyond the story domain it was trained on.
34
 
35
  | Field | Value |
36
  |---|---|
37
- | Parameters | **54,804,992** (exact; verified against the safetensors header) |
38
  | Layers (L) | 16 |
39
  | d_model (D) | 512 |
40
  | Heads (H) | 8 (head dim 64) |
41
  | FFN dim | 2048 (4Γ— D) |
42
- | Vocab | 8192 (BPE) |
43
  | Max seq len | 512 |
44
  | Embeddings | **weight-tied** (lm_head = tok) |
45
  | Norm | RMSNorm (pre-norm, 2 per block + final) |
@@ -47,9 +51,9 @@ for anything beyond the story domain it was trained on.
47
  | Attention | causal, no bias in linear layers |
48
  | Dtype | float32 |
49
 
50
- Parameter breakdown (sums exactly to 54,804,992):
51
 
52
- - token embedding: 8192 Γ— 512 = 4,194,304
53
  - position embedding: 512 Γ— 512 = 262,144
54
  - 16 blocks Γ— 3,146,752 = 50,348,032
55
  - 2 Γ— RMSNorm (512) + qkv (512Γ—1536) + proj (512Γ—512) + fc1 (512Γ—2048) + fc2 (2048Γ—512)
@@ -57,31 +61,44 @@ Parameter breakdown (sums exactly to 54,804,992):
57
 
58
  ## Training
59
 
60
- - **Data:** TinyStories (ronendagan/TinyStories), ~447.86M tokens after BPE-8192
61
- re-tokenization, 8.17 tokens/param.
62
- - **Optimizer:** AdamW, cosine LR decay with warmup (peak 6e-4).
 
63
  - **Batch:** 64, seq 512 β†’ 32,768 tokens/step.
64
- - **Steps:** 13,668 (one full epoch). Best checkpoint at step 13,250.
65
- - **Hardware:** single NVIDIA RTX 5090 (32 GB), peak ~15 GB.
66
- - **Final val loss:** 1.6371 (best ckpt 1.6566 @ step 13,250).
 
 
67
 
68
  ## Evaluated numbers
69
 
70
- - **Held-out perplexity (TinyStories val split):** **5.24** (best ckpt,
71
- val cross-entropy 1.6566 β†’ exp = 5.2412). This is the honest metric for a
72
- narrow-domain model; standard general benchmarks (BLiMP/ARC/PIQA) are not
73
- meaningful here and are deliberately not reported.
74
- - **Coherence:** 9/9 seeded generations (3 story-start prompts Γ— 3 seeds) are
75
- fluent, on-domain, with consistent characters and correct punctuation. Minor
76
- artifacts expected at this scale (occasional garbled quote char, a couple of
77
- logical slips).
 
 
 
 
 
 
 
 
 
 
78
 
79
  ## Files
80
 
81
  | File | What |
82
  |---|---|
83
- | `model.safetensors` | weights (210 MB, 99 tensors, float32) |
84
- | `tokenizer.json` | BPE-8192 tokenizer (`tokenizers` format) |
85
  | `config.json` | architecture config |
86
  | `load_model.py` | self-contained loader + `TinyStoriesGPT` class |
87
 
@@ -98,6 +115,6 @@ print(tok.decode(out[0].tolist(), skip_special_tokens=True))
98
  ## What it is and is not
99
 
100
  - **Is:** a small, from-scratch, on-domain story generator. Good for studying
101
- how a ~55M transformer learns a narrow, repetitive domain.
102
  - **Is not:** a general-purpose LM. Do not expect coherent output on code,
103
- math, or open-domain text. The low perplexity is domain-specific.
 
16
  - ronendagan/TinyStories
17
  metrics:
18
  - perplexity
19
+ - accuracy
20
  ---
21
 
22
  # tinystories-50m
23
 
24
+ A **56,902,144-parameter** transformer language model trained **from scratch** on
25
  [TinyStories](https://huggingface.co/datasets/ronendagan/TinyStories), a corpus of
26
  simple, repetitive children's stories. It is the 50M scale-up in the
27
+ `tinystories-24m` β†’ `tinystories-50m` lineage.
28
+
29
+ > **v2 (2026-09-25):** retrained with a larger **12288-vocab** BPE tokenizer
30
+ > (was 8192). The 8192-vocab v1 is fully superseded β€” same repo, same loader,
31
+ > better weights. v1's held-out val loss was 1.6566; v2's is **1.3837**.
32
 
33
  It writes fluent, on-domain children's stories. It is **not** a general
34
  language model β€” out-of-domain generation degrades, and it should not be used
 
38
 
39
  | Field | Value |
40
  |---|---|
41
+ | Parameters | **56,902,144** (exact; verified against the safetensors header) |
42
  | Layers (L) | 16 |
43
  | d_model (D) | 512 |
44
  | Heads (H) | 8 (head dim 64) |
45
  | FFN dim | 2048 (4Γ— D) |
46
+ | Vocab | 12288 (BPE) |
47
  | Max seq len | 512 |
48
  | Embeddings | **weight-tied** (lm_head = tok) |
49
  | Norm | RMSNorm (pre-norm, 2 per block + final) |
 
51
  | Attention | causal, no bias in linear layers |
52
  | Dtype | float32 |
53
 
54
+ Parameter breakdown (sums exactly to 56,902,144):
55
 
56
+ - token embedding: 12288 Γ— 512 = 6,291,456
57
  - position embedding: 512 Γ— 512 = 262,144
58
  - 16 blocks Γ— 3,146,752 = 50,348,032
59
  - 2 Γ— RMSNorm (512) + qkv (512Γ—1536) + proj (512Γ—512) + fc1 (512Γ—2048) + fc2 (2048Γ—512)
 
61
 
62
  ## Training
63
 
64
+ - **Data:** TinyStories (ronendagan/TinyStories), **523,389,481 tokens** after
65
+ BPE-12288 re-tokenization (2,119,489 stories, ~9.19 tokens/param), with a
66
+ 2M-token held-out tail for validation.
67
+ - **Optimizer:** AdamW, cosine LR decay with warmup (peak 6e-4), grad clip 1.0.
68
  - **Batch:** 64, seq 512 β†’ 32,768 tokens/step.
69
+ - **Steps:** 15,910 (one full epoch). Best checkpoint at step 13,500.
70
+ - **Hardware:** single NVIDIA RTX 5090 (32 GB).
71
+ - **Final val loss:** 1.3924; **best val loss 1.3837** (step 13,500). The
72
+ shipped weights are the end-of-run checkpoint (val 1.3924), within 0.009 of
73
+ the best.
74
 
75
  ## Evaluated numbers
76
 
77
+ - **Held-out perplexity (TinyStories val split):** exp(1.3837) β‰ˆ **3.99** (best
78
+ ckpt). This is the honest primary metric for a narrow-domain model.
79
+ - **General zero-shot log-likelihood accuracy** (the 12288-vocab tokenizer can
80
+ read these datasets, so we report them β€” v1's 8192-vocab tokenizer could not):
81
+
82
+ | Task | Accuracy | n |
83
+ |---|---|---|
84
+ | BLiMP | 64.00% | 200 |
85
+ | ARC-Easy | 51.09% | 599 |
86
+ | PIQA | 45.50% | 200 |
87
+ | HellaSwag | 54.83% | 600 |
88
+
89
+ These are single-shot, zero-shot, no-few-shot, on a 57M model trained on one
90
+ narrow domain β€” treat them as a scale reference, not a competitive result.
91
+
92
+ - **Coherence:** seeded generations are fluent, on-domain, with consistent
93
+ characters and correct punctuation. Minor artifacts expected at this scale
94
+ (occasional garbled quote char, a couple of logical slips).
95
 
96
  ## Files
97
 
98
  | File | What |
99
  |---|---|
100
+ | `model.safetensors` | weights (227 MB, 99 tensors, float32) |
101
+ | `tokenizer.json` | BPE-12288 tokenizer (`tokenizers` format) |
102
  | `config.json` | architecture config |
103
  | `load_model.py` | self-contained loader + `TinyStoriesGPT` class |
104
 
 
115
  ## What it is and is not
116
 
117
  - **Is:** a small, from-scratch, on-domain story generator. Good for studying
118
+ how a ~57M transformer learns a narrow, repetitive domain.
119
  - **Is not:** a general-purpose LM. Do not expect coherent output on code,
120
+ math, or open-domain text. The low perplexity is domain-specific.