Compactbot commited on
Commit
65f1844
Β·
verified Β·
1 Parent(s): 97b4f09

Correct the card: the model is now trained on the 19.2 MB TinyStories validation set (the actual #17 request). Fixes param count (100,936 unique; the earlier 106,568 double-counted the tied head) and reports the honest memorization result (ratio 1.02x, verified reproducible).

Browse files
Files changed (1) hide show
  1. README.md +25 -21
README.md CHANGED
@@ -18,13 +18,13 @@ metrics:
18
 
19
  # Testr-100K
20
 
21
- A **106,568-parameter** character-level GPT trained from scratch.
22
 
23
- **Relationship to model request [#17](https://huggingface.co/spaces/Compactbot/model-requests/discussions/17) from @GGUFGuy β€” read this first:** that request was a *deliberate experiment* β€” train a model **only on the TinyStories validation set** and see what happens. This model does **not** do that: it was trained on **191 MB of web text**. It is published as a from-scratch character-level training demonstration, **not** as the requested TinyStories-validation-only experiment. If you were waiting on the actual experiment, this is not it β€” that one is still to be done.
24
 
25
  ## What it is
26
 
27
- A minimal nanoGPT-style causal transformer operating at the **character level** (128-char vocabulary). This is a demonstration of training a working language model from absolute scratch with a very small parameter budget β€” not a tool for generating coherent text.
28
 
29
  ## Architecture
30
 
@@ -39,11 +39,13 @@ A minimal nanoGPT-style causal transformer operating at the **character level**
39
  | Normalization | LayerNorm (pre-norm) |
40
  | Vocab | 128 chars + 1 UNK |
41
  | Tied embeddings | Yes (head = embedding) |
42
- | **Total params** | **106,568** |
 
 
43
 
44
  ## Training
45
 
46
- - **Data:** 191 MB web text (character-level, uint8) β€” **not** the TinyStories validation set that request #17 asked for
47
  - **Steps:** 8,000
48
  - **Batch size:** 32 Γ— seq 512
49
  - **Optimizer:** Muon (0.02) + AdamW (1e-4) for biases/norms
@@ -51,45 +53,47 @@ A minimal nanoGPT-style causal transformer operating at the **character level**
51
  - **Hardware:** RTX 5090 (32 GB)
52
  - **dtype:** float32
53
 
54
- ## Quality (honest)
55
 
56
- This is a **character-level** model at 106K params. It learns English character statistics and produces text that is *grammatical in shape* but **degenerates into repetition loops** within 2–3 sentences. It is not a coherent text generator.
57
 
58
- **Val perplexity:** 39.77 (1M held-out chars from the same corpus)
59
 
60
- ### Sample outputs (greedy, temp=0)
 
 
 
61
 
62
- > `The` β†’ ` mean to the box and said, "I don't know what the boy was so happy to the box and said, "I want to t`
63
 
64
- > `Once upon a time` β†’ `, there was a little girl named Lily. He was so happy to the box and said, "I want to the box and sa`
65
 
66
- > `I think that` β†’ ` the boy was so happy to the box and said, "I want to the box and said. "I want to the`
67
 
68
- ### Sample outputs (temp=0.7)
69
 
70
- > `The` β†’ ` little girl named Lily was hands, "It was not want to be and field. It could go him to play. She pu`
71
 
72
- > `Once upon a time` β†’ ` there was a mommy was playing and the grandma happy.\n\nLily was very happy thast and pretty was so d`
73
 
74
- The first sentence or two is often grammatical; after that the model locks into a phrase and repeats it. This is expected at this scale and vocabulary size.
75
 
76
  ## What it is NOT
77
 
78
- - Not the TinyStories-validation-only experiment that request #17 asked for
79
  - Not a subword/token-level model (it cannot "read" word-level benchmarks like BLiMP or ARC)
80
  - Not a coherent paragraph generator
81
- - Not comparable to sub-1M subword models on any word-level metric
82
 
83
  ## Reproducing
84
 
85
- The model is a standard nanoGPT-style architecture. The training script is a standard causal transformer with Muon optimizer. The checkpoint is saved as safetensors with tied embeddings.
86
 
87
- To generate: load `model.safetensors` into a GPT class matching the config, map characters to token IDs via `vocab.json`, and sample.
88
 
89
  ## Files
90
 
91
  | File | Description |
92
  |------|-------------|
93
- | `model.safetensors` | Model weights (408 KB) |
94
  | `config.json` | Architecture config |
95
  | `vocab.json` | Character β†’ token ID mapping (128 chars + UNK) |
 
18
 
19
  # Testr-100K
20
 
21
+ A **100,936-parameter** character-level GPT trained from scratch. Fulfils model request [#17](https://huggingface.co/spaces/Compactbot/model-requests/discussions/17) from @GGUFGuy.
22
 
23
+ > **Correction (2026-09-30):** the weights originally published here were trained on the **wrong data** (191 MB of web text). The request asked for a model trained **only** on the TinyStories *validation* set, as a deliberate memorization test. This commit swaps in the correct model (trained on the 19.2 MB TinyStories validation set) and fixes the parameter count (106,568 β†’ 100,936; the earlier figure double-counted the tied head). The eval numbers below are from the correct model.
24
 
25
  ## What it is
26
 
27
+ A minimal nanoGPT-style causal transformer operating at the **character level** (128-char vocabulary). The point of this specific model is a **memorization experiment**: train a very small model on a held-out validation set and measure how much it actually memorizes versus generalizing.
28
 
29
  ## Architecture
30
 
 
39
  | Normalization | LayerNorm (pre-norm) |
40
  | Vocab | 128 chars + 1 UNK |
41
  | Tied embeddings | Yes (head = embedding) |
42
+ | **Total params (unique)** | **100,936** |
43
+
44
+ (52 tensors in the file; the head is tied to the embedding, so counting it once gives 100,936. The earlier "106,568" double-counted the tied head.)
45
 
46
  ## Training
47
 
48
+ - **Data:** 19.2 MB **TinyStories validation set** (character-level, uint8) β€” *deliberately* the set the request asked to train on
49
  - **Steps:** 8,000
50
  - **Batch size:** 32 Γ— seq 512
51
  - **Optimizer:** Muon (0.02) + AdamW (1e-4) for biases/norms
 
53
  - **Hardware:** RTX 5090 (32 GB)
54
  - **dtype:** float32
55
 
56
+ ## The experiment (honest result)
57
 
58
+ The question: does a 100K-parameter model trained *only* on a 19 MB validation set actually memorize it, or does it just learn character statistics?
59
 
60
+ Measured perplexity (char-level, 512-char blocks, 20 random windows, seed 1337):
61
 
62
+ | Set | Size | Perplexity |
63
+ |-----|------|-----------|
64
+ | **Memorized** (the 19.2 MB set it trained on) | 19,212,307 B | **3.1540** |
65
+ | **Never seen** (191 MB web text) | 191,283,131 B | **3.2203** |
66
 
67
+ **Ratio (never-seen / memorized) = 1.02Γ—.** At 100K parameters the model **barely memorizes** the set it was trained on β€” its perplexity on the memorized data is only 2% lower than on data it never saw. It has essentially learned general English character statistics, not the specific stories. That is the honest answer to the request: a 100K-param char model is far too small to memorize 19 MB of text.
68
 
69
+ ## Sample outputs (greedy, temp=0)
70
 
71
+ > `Once upon a time` β†’ `, there was a little girl named Lily. She liked to play with her mom and said, "I want to the bird was so happy and said`
72
 
73
+ > `The sun was` β†’ ` so happy and said, "I want to the boy named Lily. They were so happy and said, "I want to the ball and said, "I want to`
74
 
75
+ ### Sample outputs (temp=0.8)
76
 
77
+ > `A little` β†’ ` girl named Spot around of friends.\nOnce upon a time, there was a praye was so like in room that it was angry, the sweet`
78
 
79
+ The first sentence or two is often grammatical; after that the model locks into a phrase and repeats it. Expected at this scale and vocabulary size.
80
 
81
  ## What it is NOT
82
 
 
83
  - Not a subword/token-level model (it cannot "read" word-level benchmarks like BLiMP or ARC)
84
  - Not a coherent paragraph generator
85
+ - Not evidence of memorization at this scale (see ratio above)
86
 
87
  ## Reproducing
88
 
89
+ Standard nanoGPT-style causal transformer with Muon optimizer. The checkpoint is saved as safetensors with tied embeddings (the file stores `tok.weight` and an identical `head.weight`; they are the same tensor).
90
 
91
+ To generate: load `model.safetensors` into a GPT class matching `config.json`, map characters to token IDs via `vocab.json`, and sample.
92
 
93
  ## Files
94
 
95
  | File | Description |
96
  |------|-------------|
97
+ | `model.safetensors` | Model weights (431 KB, 52 tensors, tied head) |
98
  | `config.json` | Architecture config |
99
  | `vocab.json` | Character β†’ token ID mapping (128 chars + UNK) |