roneneldan/TinyStories
Viewer β’ Updated β’ 2.14M β’ 93.4k β’ 1.17k
A 24.59M-parameter BPE language model trained from scratch on roneneldan/TinyStories, producing coherent short stories with proper dialogue, names, punctuation and narrative flow.
| Task | Accuracy | Chance | Notes |
|---|---|---|---|
| ARC-Easy | 13.3% | 25% | below chance |
| ARC-Challenge | 12.5% | 25% | below chance |
| HellaSwag | 25.0% | 25% | at chance |
| SciQ | 25.0% | 25% | at chance |
| PIQA | 50.0% | 50% | at chance |
All results are at or below chance β expected for a 24M model trained exclusively on simple children's stories. The model has learned the distribution of story text but has no general reasoning, commonsense, or science knowledge.
Not a transformers model β load with the bundled modeling.py:
import sys, torch
sys.path.insert(0, "path/to/this/repo")
from modeling import TinyStoriesGPT
from tokenizers import Tokenizer
m = TinyStoriesGPT.from_pretrained("path/to/this/repo", device="cpu")
tok = Tokenizer.from_file("path/to/this/repo/tokenizer.json")
ids = tok.encode("Ben was playing in the park.", add_special_tokens=False).ids
x = torch.tensor([ids], dtype=torch.long)
with torch.no_grad():
for _ in range(80):
logits = m(x[:, -512:])[:, -1]
nxt = torch.multinomial(torch.softmax(logits / 0.8, -1), 1).item()
ids.append(nxt)
x = torch.tensor([ids[-512:]], dtype=torch.long)
print(tok.decode(ids, skip_special_tokens=True))
| file | bytes | what |
|---|---|---|
model.safetensors |
98,349,056 | 75 tensors, float32 |
config.json |
β | architecture + training metadata |
modeling.py |
β | the TinyStoriesGPT class (load with from_pretrained) |
tokenizer.json |
560,804 | BPE-8k tokenizer (HF tokenizers format) |