Instructions to use danxx891/shake-the-flass with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use danxx891/shake-the-flass with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # if on a CUDA device, also pip install mlx[cuda] # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("danxx891/shake-the-flass") prompt = "Once upon a time in" text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use danxx891/shake-the-flass with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Generate some text mlx_lm.generate --model "danxx891/shake-the-flass" --prompt "Once upon a time"
- Atomic Chat
AI Learns From AI: Generation 5
This is the fifth-generation AI from the Simulated Seeds video I Made an AI Learn Only From AI.
It's a tiny language model, about 17 million numbers, that we built and trained from scratch on a Mac. The first AI in the family (generation 0) read 90 children's books. Every AI after it started from scratch and never saw a real book. It learned only from the stories its parent wrote.
This is the fifth AI in that chain. By now it has forgotten most of its words. It loves the word "king", opens chapter after chapter with "There was once a…", and keeps writing headings like THE STORY OF THE FLASS ("flass" isn't a word).
Try it
In your browser, with nothing to install: Shake the Flass. Type how a story starts and it writes the rest, running on your own device.
On your own computer, you need Python 3.10 or newer.
pip install -U huggingface_hub
hf download danxx891/shake-the-flass --local-dir shake-the-flass
cd shake-the-flass
On a Mac with Apple Silicon (M1 or newer), use MLX. This is the same code the experiment used:
pip install mlx tokenizers numpy
python generate.py "Once upon a time"
On any other computer, use PyTorch:
pip install torch safetensors tokenizers numpy
python generate_torch.py "Once upon a time"
Both print three stories. Some options:
--n 5writes five stories.--tokens 300makes them longer. A token is a word or a piece of a word.--temp 0.8is the default, and every generation in the experiment wrote at 0.8. Higher is wilder;--temp 0always takes its top guess.--seed 2gives different stories. The same seed gives the same stories.""as the prompt starts a brand-new book.
From Python:
from generate_torch import write_stories # or: from generate import write_stories (MLX)
print(write_stories("The cat", n=1)[0])
The two versions give the same next-word odds (we checked them against each other: the biggest difference was 0.0002), but their random numbers differ. So the same seed writes different stories in MLX and in PyTorch.
What it writes
These come from the real model, with no editing and no picking. Each one is the first of the three stories generate.py prints at the default settings. The model often starts a new chapter on its own, which is where the blank lines come from.
The story from the video (python generate.py --seed 365):
Once upon a time there lived a king who had a daughter who had a daughter, and had a daughter. They lived together in a beautiful house, and they lived together in a beautiful house.
THE STORY OF THE FLASS OF THE FLASS
THE STORY OF THE THREE
Once upon a time there lived a king who lived in a great many a time there lived a king who was a king, and he was a king. He was a king, and he was a king, and he was a king. He was a king, and he was a king
python generate.py "The cat"
The cat soon see the boat, and I'll go to the shore and get the boat."
"I'll go with you, sir," said the boatman, "and I'll go to the shore, and I'll go to the shore, and I'll go to the shore, and I'll go to the shore, and I'll get it out of the boat."
"I'll go to the boat, and I'll go to the boat," said the boatman.
"If I can get it, I'll go to the shore, and I'll go to
python generate.py "The little girl"
The little girl and the little girl, "I'll go to the Emerald City and get it."
"I'm going to get a good deal of trouble," said the Scarecrow. "I'm sure I can't get my leave you, and I'll do no harm."
"I'm not," said the Scarecrow, "but I don't know what I can do. I'm sure I can't get a good time to get a good time."
"Well, I'm not a little bit of a bit," said the Scarecrow. "I'm a little girl, and I
How it was made
The books. We used 100 English children's books from Project Gutenberg, picked by a rule:
- English children's stories, where every named author or illustrator died in 1955 or earlier;
- ranked by downloads;
- skipping near-copies, books with racial slurs and books under 500 words;
- the first 100 that passed.
Every 10th book was held back as a test the AIs never trained on. That left 90 training books: 4.7 million words, or 6,548,384 tokens. The books aren't included here.
The tokenizer. It's byte-level BPE (the GPT-2 recipe), with 8,192 pieces, trained on the 90 books. Token 0, <|endoftext|>, marks where one book ends and the next begins.
The model. It's a GPT written from scratch in MLX, Apple's machine-learning library:
- 6 layers, 384 wide, 6 attention heads;
- learned positions, and it can look back 256 tokens;
- 17,016,576 numbers in total.
The chain. Generation 0 read the 90 books four times over. Then it wrote 6,548,384 tokens of its own stories, the same amount as the books. It wrote 512 books at once, each starting from the "new book" marker, at temperature 0.8.
Generation 1 started from random numbers and read only those stories, four times over. Then it wrote its own. And so on, up to generation 5. That's this model.
Every generation got the same training: AdamW, learning rate 0.0015 with a short warm-up and a cosine decay, batches of 32 × 256 tokens, and 3,198 steps. Training took about 10 minutes per generation on an M1 Max, and writing took about 2 more.
What happened over five generations
This is the main run (seed 3). We ran three seeds; seed 3 was picked by rule because its numbers are closest to the average.
| Generation | Learned from | Real words* | Mid-rare words still used** | Repeated 4-word phrases | Surprise on unseen books*** | Chapters opening with a fairy-tale line |
|---|---|---|---|---|---|---|
| 0 | 90 real books | 6,713 | 95.7% | 0.8% | 4.01 | 16% |
| 1 | gen 0's stories | 2,828 | 42.8% | 5.8% | 4.63 | 34% |
| 2 | gen 1's stories | 1,576 | 11.9% | 20.7% | 5.66 | 51% |
| 3 | gen 2's stories | 961 | 4.2% | 43.3% | 6.69 | 62% |
| 4 | gen 3's stories | 612 | 2.1% | 70.7% | 7.65 | 79% |
| 5 (this model) | gen 4's stories | 387 | 1.4% | 85.3% | 8.24 | 83% |
* Different real-book words in an evenly spread 250,000-word slice of what it wrote. ** Words the books use 20–99 times that still show up anywhere in its 6.5 million tokens of writing. *** The test books it never trained on, in nats per token (lower means it understands real books better). The real books open 5.2% of chapters with "Once upon a time" or "There was once a".
Some things that stood out:
- "king" took over. The books use it 6,039 times in 4.7 million words (about 0.1%). Generation 5 wrote it 361,749 times in 4.9 million words (about 7%).
- One name took over. The Tin Woodman, from the Oz books, holds 60.5% of all name mentions by generation 5.
- Rare words went first. "beneath" (405 uses in the books) disappears at generation 1 and never comes back.
- Its favourite line is THE STORY OF THE FLASS, written 15,792 times.
Each generation's own "Once upon a time…" (the first of three, not picked):
- Gen 0: "Once upon a time, of course, Mr. Ebenezer, was quite sure; but it was enough to be more than the time for a queen…"
- Gen 1: "Once upon a time there was no one who could see her, and asked her if she should marry her…"
- Gen 2: "Once upon a time. I am going to tell you the king's daughter who is my daughter, and I am to marry her."
- Gen 3: "Once upon a time there lived a king, and he was a princess. The queen was a king, and he was a princess, and he was a princess…"
- Gen 4: "Once upon a time to go. I'll tell you what I'm going to do. I'll tell you to go to the doctor's."
- Gen 5: "Once upon a time there lived a king who had a daughter who had a daughter, and had a daughter."
A second family got 20% fresh pages from the real books every generation. It kept understanding real books (its surprise rose by only 0.6 to 0.7 across the three seeds), but it still lost its rare words almost as fast.
This is the effect researchers call model collapse: Shumailov et al., "AI models collapse when trained on recursively generated data", Nature (2024). Our version is a tiny, home-made one.
Limitations
- It's broken on purpose. The loops ("he was a king, and he was a king"), made-up words (flass, trincess, taill) and repeated headings are the experiment's result. They aren't a bug in the download.
- It's tiny. It only continues text: there's no chat and it doesn't follow instructions. It's English only, and it looks back at most 256 tokens (about 180 words).
- Its words come from children's books published long ago, copied through five generations, so expect old-fashioned language. Books with racial slurs were left out, but nothing else was filtered.
- It's one run. Training the same chain again gives near-identical results, not identical ones (GPU rounding).
- Exact stories can change. They were made with MLX 0.32.4, and other MLX versions or computers may print slightly different ones.
It isn't meant for any real use. It's here so you can see what five generations of AI learning from AI did to a small model.
Files
| File | What it is |
|---|---|
model.safetensors |
The weights: 17,016,576 numbers in float32 (68 MB), the exact file from the experiment |
config.json |
The model's shape |
tokenizer.json |
The 8,192-piece tokenizer (Hugging Face tokenizers format) |
generate.py |
MLX: the model and the sampling code the experiment used |
generate_torch.py |
The same model rebuilt in PyTorch |
training.json |
Generation 5's training settings and loss curve |
Licence and data
The code and weights are MIT-licensed. The training books are Project Gutenberg texts that are public domain in the US. Every named author died in 1955 or earlier, so they're also out of copyright in countries that use "life + 70 years". Generation 5 never read any of them directly: it learned only from generation 4's stories.
Made for the Simulated Seeds YouTube channel.
- Downloads last month
- -
Quantized