Maouz0 commited on
Commit
d69ca54
·
verified ·
1 Parent(s): 55953ff

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +81 -122
README.md CHANGED
@@ -1,30 +1,18 @@
1
  ---
2
- license: cc-by-nc-nd-4.0
3
  language:
4
  - en
5
- library_name: transformers
6
- pipeline_tag: text-generation
7
  tags:
8
  - text-generation
9
  - from-scratch
10
  - tiny-language-model
11
  - tinystories
12
  - llama-style
13
- - small-language-model
14
  - research
15
  datasets:
16
  - roneneldan/TinyStories
17
  metrics:
18
  - perplexity
19
- - loss
20
- inference: false
21
- widget:
22
- - text: "Once upon a time, there was a little"
23
- example_title: "Story Opening"
24
- - text: "One day, a girl named Lily found"
25
- example_title: "Discovery"
26
- - text: "A little dog named Max wanted to"
27
- example_title: "Animal"
28
  model-index:
29
  - name: child-12m
30
  results:
@@ -37,170 +25,141 @@ model-index:
37
  split: validation
38
  metrics:
39
  - type: perplexity
40
- value: 3.45
41
  name: Perplexity
42
  - type: loss
43
- value: 1.2373
44
  name: Average Validation Loss
45
- - type: bits_per_byte
46
- value: 0.4285
47
- name: Bits per Byte
48
  ---
49
 
50
  # child-12m
51
 
52
  A 12.3M parameter decoder-only transformer trained **entirely from scratch** on TinyStories. No pretrained checkpoint, no distillation, no transfer learning. Every weight learned from random initialization.
53
 
54
- **Headline metrics:** validation perplexity **3.45**, bits-per-byte **0.4285**, **98%** accuracy on a 50-pair grammar probe spanning 10 linguistic paradigms.
55
-
56
- ---
57
-
58
  ## Results
59
 
60
- | Metric | Value |
61
- | ------------------------------------------ | ------------------------------ |
62
- | Parameters (total) | 12,256,256 |
63
- | Parameters (non-embedding) | ~10.1M (82% of total) |
64
- | Validation loss (nats/token) | 1.2373 |
65
- | Validation perplexity | 3.45 |
66
- | Bits-per-byte | 0.4285 |
67
- | Bytes per token | 4.17 |
68
- | Grammar accuracy (50 pairs, 10 paradigms) | 98.0% |
69
- | Training tokens seen | ~1.0 billion (2+ epochs) |
70
- | Training time | ~4 hours on a single Kaggle T4 |
71
 
72
  Bits-per-byte is reported alongside perplexity so results can be compared fairly against models that use different tokenizers.
73
 
74
- ---
75
-
76
- ## Architecture
77
-
78
- A 14-layer Llama-style decoder-only transformer.
79
 
80
- | Component | Specification |
81
- | ----------------- | -------------------------------------- |
82
- | Layers | 14 |
83
- | `d_model` | 256 |
84
- | Attention | GQA (4 query heads, 2 KV heads) |
85
- | Head dimension | 64 |
86
- | FFN | SwiGLU, hidden dim 688 |
87
- | Normalization | RMSNorm (pre-norm) |
88
- | Position encoding | RoPE (`theta=10000`) |
89
- | Features | QK-norm, z-loss, weight-tied embeddings |
90
- | Vocabulary | 8,192 ByteLevelBPE |
91
- | Max context | 2,048 |
92
- | Dropout | 0.0 |
93
-
94
- The architecture prioritizes depth (14 layers) over width (`d_model=256`) and uses a compact 8K vocabulary, allocating ~82% of the parameter budget to transformer computation rather than embeddings.
95
 
96
- ---
 
 
 
 
 
 
 
97
 
98
- ## Grammar Evaluation
99
 
100
- 50 minimal pairs across 10 linguistic paradigms.
101
 
102
- | Paradigm | Accuracy |
103
- | ------------------------- | -------- |
104
- | Subject-verb agreement | 5/5 |
105
- | Determiner-noun agreement | 5/5 |
106
- | Verb tense consistency | 5/5 |
107
- | Pronoun case | 5/5 |
108
- | Word order | 5/5 |
109
- | Negation | 5/5 |
110
- | Auxiliary verb | 5/5 |
111
- | Comparative/superlative | 4/5 |
112
- | Prepositional phrase | 5/5 |
113
- | Sentence completeness | 5/5 |
114
- | **Overall** | **49/50 (98.0%)** |
115
-
116
- The probe is hand-crafted and does not substitute for a full BLiMP run. Treat it as a sanity check rather than a leaderboard claim.
117
-
118
- ---
119
 
120
- ## Generation Samples
121
 
122
- **Prompt:** *"Once upon a time, there was a little"*
123
-
124
- > Once upon a time, there was a little boy named Timmy. Timmy loved to play with his toys all day long. One day, Timmy's mom asked him to help her in the kitchen. Timmy didn't want to stop playing, but...
125
 
126
- **Prompt:** *"One day, a girl named Lily found"*
127
 
128
- > One day, a girl named Lily found a small bird in her yard. The bird was hurt and could not fly. Lily wanted to help the bird, so she asked her mom for help. "Mom, can we help the bird?" Lily asked.
 
 
 
 
 
 
 
 
 
 
 
 
129
 
130
- **Prompt:** *"Mom said to the little boy,"*
131
 
132
- > Mom said to the little boy, "Let's take a walk to the park, okay?" Little boy smiled and said, "Okay, mom!" They walked and walked until they arrived at the park. Little boy was so happy, he ran around...
133
 
134
- **Prompt:** *"A little dog named Max wanted to"*
 
135
 
136
- > A little dog named Max wanted to try the lime. He picked it up with his mouth and started to chew. The lime was very sour and made his teeth feel funny. Max tried to chew the lime again, but he was stuck...
 
137
 
138
- **Prompt:** *"Dad took his son to the"*
 
139
 
140
- > Dad took his son to the store. When they got there, his dad said, "Oh wow, it looks so expensive!" The son saw a big, shiny toy car. He said, "Dad, can we buy it?" His dad smiled and said, "Sure..."
 
141
 
142
- ---
 
143
 
144
  ## Training
145
 
146
- | Field | Value |
147
- | ---------------- | ---------------------------------------------------- |
148
- | Dataset | [roneneldan/TinyStories](https://huggingface.co/datasets/roneneldan/TinyStories) (2,119,719 stories) |
149
- | Tokens in dataset | 464,662,320 |
150
- | Tokens seen | ~1.0 billion (2+ epochs) |
151
- | Optimizer | AdamW (β₁=0.9, β₂=0.95, weight decay=0.1) |
152
- | LR schedule | 100-step warmup + cosine decay (3e-4 3e-5) |
153
- | Total steps | 15,387 |
154
- | Batch size | 128 effective (32 × 4 gradient accumulation) |
155
- | Sequence length | 512 |
156
- | Precision | float16 (autocast + GradScaler) |
157
- | Gradient clip | 1.0 |
158
- | Hardware | Kaggle T4 GPU (16 GB) |
159
 
160
  ### Training History
161
 
162
- | Checkpoint | Step | Train Loss | Val PPL |
163
- | ----------- | ---------- | ---------- | -------- |
164
- | early | 4,532 | 1.597 | 4.21 |
165
- | mid | 5,734 | 1.579 | 4.07 |
166
- | **final** | **15,387** | **1.437** | **3.45** |
167
-
168
- ---
169
 
170
  ## Limitations
171
 
172
- - Trained exclusively on TinyStories (3–4 year old vocabulary level)
173
- - No dialogue fine-tuning (base model only)
174
- - Grammar evaluation uses 50 hand-crafted pairs, not the full BLiMP suite
175
- - Single training run — no seed variance reported
176
  - Not evaluated on general-purpose benchmarks
177
  - Not suitable for any production or safety-critical use
178
 
179
- ---
180
-
181
  ## Weights
182
 
183
  Weights are not publicly released. This model card documents architecture and results for research reference.
184
 
185
- ---
186
-
187
  ## Future Work
188
 
189
- - Dialogue fine-tuning on TinyDialogues
190
- - Full BLiMP / Zorro evaluation
191
  - Distortion-Reactive Plasticity (DRP) experiments
192
- - Net2Net function-preserving expansion to larger scales
193
- - Multi-seed runs to characterize training variance
194
-
195
- ---
196
 
197
  ## Citation
198
 
199
- ```bibtex
200
  @misc{child12m2026,
201
  title = {child-12m: A 12.3M Parameter Language Model Trained From Scratch on TinyStories},
202
  author = {Radji, Kraim and Claude (Anthropic Opus 4.6)},
203
  year = {2026},
204
- note = {Perplexity 3.45, BPB 0.4285 on TinyStories validation. Weights not released.}
205
  }
206
  ```
 
1
  ---
 
2
  language:
3
  - en
4
+ license: cc-by-nc-nd-4.0
 
5
  tags:
6
  - text-generation
7
  - from-scratch
8
  - tiny-language-model
9
  - tinystories
10
  - llama-style
 
11
  - research
12
  datasets:
13
  - roneneldan/TinyStories
14
  metrics:
15
  - perplexity
 
 
 
 
 
 
 
 
 
16
  model-index:
17
  - name: child-12m
18
  results:
 
25
  split: validation
26
  metrics:
27
  - type: perplexity
28
+ value: 3.41
29
  name: Perplexity
30
  - type: loss
31
+ value: 1.2268
32
  name: Average Validation Loss
 
 
 
33
  ---
34
 
35
  # child-12m
36
 
37
  A 12.3M parameter decoder-only transformer trained **entirely from scratch** on TinyStories. No pretrained checkpoint, no distillation, no transfer learning. Every weight learned from random initialization.
38
 
 
 
 
 
39
  ## Results
40
 
41
+ | Metric | Value |
42
+ |--------|-------|
43
+ | Parameters (total) | 12,256,256 |
44
+ | Parameters (non-embedding) | ~10.1M (82% of total) |
45
+ | Validation loss (nats/token) | 1.2268 |
46
+ | Validation perplexity | 3.41 |
47
+ | Bits-per-byte | 0.4249 |
48
+ | Bytes per token | 4.17 |
49
+ | BLiMP accuracy (full, 67 paradigms) | 63.4% |
50
+ | Training tokens seen | ~1.6 billion |
51
+ | Total training steps | 24,919 |
52
 
53
  Bits-per-byte is reported alongside perplexity so results can be compared fairly against models that use different tokenizers.
54
 
55
+ ## BLiMP Evaluation (Full, 67 Paradigms)
 
 
 
 
56
 
57
+ 63.4% overall on the full BLiMP benchmark (67 paradigms, 200 pairs each, 13,400 total evaluations). Within range of BabyLM 2024 Strict-Small baselines (60.6%ΓÇô69.8%) at half the parameter count, despite training exclusively on TinyStories' restricted register.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
 
59
+ **Reference points:**
60
+ | Model | Params | BLiMP |
61
+ |-------|--------|-------|
62
+ | Random baseline | ΓÇö | 50.0% |
63
+ | BabyLM 2024 LTG-BERT 10M | ~25M | 60.6% |
64
+ | **child-12m (this model)** | **12.3M** | **63.4%** |
65
+ | BabyLM 2024 BabyLlama 10M | ~24M | 69.8% |
66
+ | GPT-2 Small (web-scale) | 124M | ~81% |
67
 
68
+ **Notable finding:** The score distribution is strongly bimodal. Paradigms that test constructions present in TinyStories (agreement, reflexives, basic negation) score 85ΓÇô99%. Paradigms testing constructions absent from TinyStories (complex syntactic islands, NPI scope, distractor agreement) score at or below chance. This is a diagnostic of training distribution, not model capacity ΓÇö the architecture learns what it is shown.
69
 
70
+ **Top paradigms (>85%):** Principle A case (99.5%), sentential negation NPI licensing (99.0%), Principle A domain (98.5%), wh-vs-that no gap (95.0%), existential there quantifiers (91.0%), superlative quantifiers (87.5ΓÇô90.0%), anaphor number agreement (88.0%), irregular past participles (83.0ΓÇô88.0%), wh-subject gap long distance (87.0%)
71
 
72
+ **Bottom paradigms (<25%):** matrix question NPI (8.0%), only NPI scope (9.5%), wh-vs-that with gap long distance (9.5%), only NPI licensor (19.5%), wh-vs-that with gap (21.0%), coordinate structure left branch (24.5%)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
 
74
+ **Methodology note:** The gap between a hand-crafted grammar probe (100% on 50 pairs testing TinyStories-native constructions) and full BLiMP (63.4%) illustrates why custom eval suites for TinyStories-class models can dramatically overestimate grammatical competence. Future evaluations of TinyStories-trained models should use BLiMP or equivalent standardized benchmarks.
75
 
76
+ ## Architecture
 
 
77
 
78
+ A 14-layer Llama-style decoder-only transformer.
79
 
80
+ | Component | Specification |
81
+ |-----------|--------------|
82
+ | Layers | 14 |
83
+ | d_model | 256 |
84
+ | Attention | GQA (4 query heads, 2 KV heads) |
85
+ | Head dimension | 64 |
86
+ | FFN | SwiGLU, hidden dim 688 |
87
+ | Normalization | RMSNorm (pre-norm) |
88
+ | Position encoding | RoPE (theta=10000) |
89
+ | Features | QK-norm, z-loss, weight-tied embeddings |
90
+ | Vocabulary | 8,192 ByteLevelBPE |
91
+ | Max context | 2,048 |
92
+ | Dropout | 0.0 |
93
 
94
+ The architecture prioritizes depth (14 layers) over width (d_model=256) and uses a compact 8K vocabulary, allocating ~82% of the parameter budget to transformer computation rather than embeddings.
95
 
96
+ ## Generation Samples (step 24,919)
97
 
98
+ **Prompt:** "Once upon a time, there was a little"
99
+ > Once upon a time, there was a little girl named Lily. She had a toy bear that she loved very much. One day, Lily went to the park to play with her bear. She saw a boy playing with a ball and asked him...
100
 
101
+ **Prompt:** "One day, a girl named Lily found"
102
+ > One day, a girl named Lily found a mysterious box in her room. She tried to open it, but it was locked. She tried to find the key, but it was locked. Lily was sad because the box was too hard to open.
103
 
104
+ **Prompt:** "Mom said to the little boy,"
105
+ > Mom said to the little boy, "What's wrong? Why are you fighting?" The little boy said he wanted to play. He said, "No, silly. I don't want to share with you."
106
 
107
+ **Prompt:** "Papa said"
108
+ > Papa said, "Let's go, let's go!" They went into the kitchen. It was dark and quiet. Papa said, "Let's make a fire and stay warm." Mama said, "Okay, let's make a fire and stay warm."
109
 
110
+ **Prompt:** "She looked at the sky and"
111
+ > She looked at the sky and saw a big rainbow. It was so big that she could not see the other side of it. She thought it was the most beautiful thing she had ever seen. Suddenly, a voice said, "What do..."
112
 
113
  ## Training
114
 
115
+ | Field | Value |
116
+ |-------|-------|
117
+ | Dataset | roneneldan/TinyStories (2,119,719 stories) |
118
+ | Tokens in dataset | 464,662,320 |
119
+ | Tokens seen | ~1.6 billion (3+ epochs) |
120
+ | Optimizer | AdamW (beta1=0.9, beta2=0.95, wd=0.1) |
121
+ | LR schedule | WSD: warmup + stable at 2e-4 + cosine decay to 1e-5; then constant 5e-5 sessions |
122
+ | Total steps | 24,919 |
123
+ | Batch size | 128 effective (32 x 4 gradient accumulation) |
124
+ | Sequence length | 512 |
125
+ | Precision | float16 (autocast + GradScaler) |
126
+ | Gradient clip | 1.0 |
127
+ | Hardware | Kaggle T4 GPU (16 GB), single GPU, free tier |
128
 
129
  ### Training History
130
 
131
+ | Checkpoint | Step | Train Loss | Val PPL | BPB |
132
+ |-----------|------|-----------|---------|-----|
133
+ | early | 4,532 | 1.597 | 4.21 | ΓÇö |
134
+ | mid | 15,387 | 1.437 | 3.45 | 0.4285 |
135
+ | final | 24,919 | 1.396 | 3.41 | 0.4249 |
 
 
136
 
137
  ## Limitations
138
 
139
+ - Trained exclusively on TinyStories (3ΓÇô4 year old vocabulary level)
140
+ - BLiMP performance is strongly distribution-dependent: high on TinyStories-native constructions, at-chance on absent ones
141
+ - Single training run ΓÇö no seed variance reported
 
142
  - Not evaluated on general-purpose benchmarks
143
  - Not suitable for any production or safety-critical use
144
 
 
 
145
  ## Weights
146
 
147
  Weights are not publicly released. This model card documents architecture and results for research reference.
148
 
 
 
149
  ## Future Work
150
 
151
+ - Net2Net function-preserving expansion to 50M+ with diverse data (Simple Wikipedia)
152
+ - Full BLiMP re-evaluation after data diversification to test whether bottom paradigms improve
153
  - Distortion-Reactive Plasticity (DRP) experiments
154
+ - Dialogue fine-tuning and identity training at larger scale
 
 
 
155
 
156
  ## Citation
157
 
158
+ ```
159
  @misc{child12m2026,
160
  title = {child-12m: A 12.3M Parameter Language Model Trained From Scratch on TinyStories},
161
  author = {Radji, Kraim and Claude (Anthropic Opus 4.6)},
162
  year = {2026},
163
+ note = {Perplexity 3.41, BPB 0.4249, BLiMP 63.4\% (full 67 paradigms). Weights not released.}
164
  }
165
  ```