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
README.md
CHANGED
|
@@ -18,13 +18,13 @@ metrics:
|
|
| 18 |
|
| 19 |
# Testr-100K
|
| 20 |
|
| 21 |
-
A **
|
| 22 |
|
| 23 |
-
**
|
| 24 |
|
| 25 |
## What it is
|
| 26 |
|
| 27 |
-
A minimal nanoGPT-style causal transformer operating at the **character level** (128-char vocabulary).
|
| 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** | **
|
|
|
|
|
|
|
| 43 |
|
| 44 |
## Training
|
| 45 |
|
| 46 |
-
- **Data:**
|
| 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 |
-
##
|
| 55 |
|
| 56 |
-
|
| 57 |
|
| 58 |
-
|
| 59 |
|
| 60 |
-
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
-
|
| 63 |
|
| 64 |
-
|
| 65 |
|
| 66 |
-
> `
|
| 67 |
|
| 68 |
-
|
| 69 |
|
| 70 |
-
|
| 71 |
|
| 72 |
-
> `
|
| 73 |
|
| 74 |
-
The first sentence or two is often grammatical; after that the model locks into a phrase and repeats it.
|
| 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
|
| 82 |
|
| 83 |
## Reproducing
|
| 84 |
|
| 85 |
-
|
| 86 |
|
| 87 |
-
To generate: load `model.safetensors` into a GPT class matching
|
| 88 |
|
| 89 |
## Files
|
| 90 |
|
| 91 |
| File | Description |
|
| 92 |
|------|-------------|
|
| 93 |
-
| `model.safetensors` | Model weights (
|
| 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) |
|