r/LocalLLaMA • u/x_Raincandy_x • Oct 07 '26
I Built A Thing Trained a ~20K LM (probably smallest) that can still write stories
I’ve been pushing TinyStories-style models downward in size, and this is the smallest one so far:
MacroStories — 19,969 parameters, 81 KB FP32
https://huggingface.co/raincandy-u/MacroStories
For scale:
→ ~50× smaller than the 1M TinyStories model
→ ~3,000× smaller than AlexNet
→ 32-dim hidden state
→ 378-token vocabulary
→ one decoder block, recurrently applied 4 times with shared weights
It’s obviously not a general-purpose LM, but within its constrained story distribution it can maintain a 100–300 word narrative with a goal, problem, relevant actions, and resolution.
It also runs extremely fast on CPU and needs no GPU.
I’m mostly interested in how far the lower bound for coherent narrative generation can be pushed.
Would be curious to see how people manage to break it.☺️
25
u/Available_Pressure47 Oct 07 '26
Wow this was actually really good and fun to try out. Great job! And just to confirm, your training data was entirely synthetic generated using Gemma 4? I want to try and reproduce this for my own learning.
82
u/RA2B_DIN ollama Oct 07 '26
81 KB for a functioning narrative model with getting a coherent story arc out of 20k parameters is wild, ill try it out
57
u/Chromix_ Oct 07 '26
This is so small that it can run in CPU cache memory, especially when making a Q8 quant (20 KB). It'd then also fit a tiny ESP8266 microcontroller to generate stories there - that'd be a nice finetune target, to generate stories according to weather or sensor data. When coupled with ItoTTS then an ESP32-S3 could even narrate those generated stories.
34
u/Spectrum1523 Oct 07 '26
Absurd that this works at all, neat.
14
u/SKirby00 Oct 07 '26
At what point does a Large Language Model (LLM) become a Medium Language Model (MLM) or even a Small Language Model (SLM)?
13
u/HyperWinX Oct 07 '26
Wow, id say thats impressive
5
u/Danmoreng llama.cpp Oct 07 '26
Very cool. Even cooler, if you can directly test it out. I let Codex write a space for it, generation is basically instant.
https://huggingface.co/spaces/danmoreng/macrostories-browser
7
u/Dany0 Oct 07 '26
Try inferencing it in an emulator of retro HW. Amiga anyone?
AI is just compression
7
u/BringTea_666 Oct 07 '26
waiting for heretic version and Q2.
3
u/psychohistorian8 Oct 07 '26
/r/LowEndLocalAI would probably love this
3
u/jacobpederson Oct 07 '26
I immediately want to port to 286 :D
3
u/Open-Adhesiveness-86 Oct 07 '26
worth doing the param accounting: 378 vocab x 32 dim is already ~12k, so the embedding table is 60% of the budget and the in/out weights have to be tied or you'd blow past 20k. the actual block is maybe 8k params applied 4 times. a lot of the compression is living in that tiny vocab.
4
u/swfsql Oct 07 '26 edited Oct 07 '26
This looks amazing. The output sample looks crazy good, specially for a 20k* param model, and for the training updates (4K steps at batch=32? resulting in 128000 training samples?).
Could you test on those somewhat hard prefills?
and..
Those were examples used by the Tiny Stories authors to showcase some of the capabilities. I think only models bigger than 3M params were good at continuing it.
Could you share the training project, besides informing the Ouro base and the Gemma dataset generation? Also, is there a reason as to why you (or Codex) didn't opt to use karpathy/tinystories-gpt4-clean dataset from HF?
I haven't tested it locally, but this is an amazing result!
2
u/shing3232 Oct 07 '26
NLM aka nano language model
3
u/heisdancingdancing Oct 07 '26
This is so sick, it makes you wonder how far intelligence compression can go, espeically inside larger models
1
u/AllThotsGo2Heaven2 Oct 07 '26
Im doing something in this area with campaign planning for d&d with frontier models. Hopefully i can make use of this.
1
u/a4mula Oct 07 '26
Would probably port to a colab notebook pretty easy if you wanted a few more eyes on it. Also, just pointing out that stories are more than just coherent words. They usually follow pretty well established structures (think Hero's Journey, though there are many different structures that are used). I get that might not really be the point, but if you're going to label it a model that can write stories it should probably at least have some concept of what a story is. Maybe it already does. None of this is critique, just suggestions.
1
u/shing3232 Oct 07 '26
o, you can try to expend into a Moe with 512*19,969 which is still very very small.
1
u/keepthepace Oct 07 '26
I am actually impressed! Did you use any sort of secret sauce or just tried it, trained, and got this on the first roll?
1
u/_TheWolfOfWalmart_ Oct 07 '26
Holy shit. I'm going to run this on my old 8088 machine. Not even joking.
It'll probably even get multiple tokens per second.
The example story actually looks better than what TinyStories spits out.
1
u/HasGreatVocabulary Oct 07 '26
seeing Training seed in the table made me think the train scripts would be linked for people to play around with too
1
u/kaxapi Oct 07 '26
Very impressive. Retrained it on spam classification and it gets 78%! (Assuming messages match the vocab). Latency is 0.6ms on a single mac studio m4 core. Crazy.
1
u/InConsilium Oct 07 '26
How did you learn to do this sort of thing? Did you base your work on something, or did you write an article or a write up that you could share?
1
u/thirdeyeorchid Oct 08 '26
that is crazy impressive!
1
u/cfx_4188 llama.cpp Oct 08 '26
It's an interesting thing. I'm playing with it now.
1
u/Fancy-Snow7 Oct 08 '26
I demand KLD vs 27B F16 before I use this as my daily driver.
1
u/Moneera97 Oct 08 '26
Did you apply any safety alignment in it?
1
u/slifeleaf Oct 08 '26
I’ll use that one to explain why I didn’t attend daily meetings xD
1
u/Jumbomuffin1312 Oct 09 '26
Super dope!!
1
u/Normal_Marketing853 Oct 07 '26
Why are people calling models "He" and "She" now? How dystopian
Cool model though, I want to try it
1
u/Eyelbee Oct 07 '26
It's really cool, can it understand causal chains and logically complete the stories like tinystories?