Lucky Power (lucky-nanogpt-power-1)
an experiment training nanoGPT on lottery draws
3 min read
A research model from the sup computer studio, built as a practical demonstration of how a language model learns from data that lacks hidden patterns. It reads the last 8 draws of the US Powerball lottery and generates the next combination of five white balls (1–69) and one red ball (1–26). Based on a compact modern nanoGPT architecture (RoPE, RMSNorm, bias-free) with just 0.80M parameters. The model does not predict winning numbers — its goal is to show what formal rules of the game an AI model can pick up from a short history versus where it begins to overfit to random noise.
Key features
- Compact architecture: 4 layers, 4 attention heads, 128 embedding dimension, and a 72-token context (9 draws of 8 tokens), without dropout.
- Revealing zero-shot experiment: A baseline version without past draw history performed 0.182 bits better — history merely adds noise leading to overfitting.
- Partial rule absorption: The model learned to almost always select the red ball within the 1–26 range (errors occurred in only 6.2% of cases compared to 62% for random guessing).
- Duplicate blind spot: 1,436 draws were not enough to learn the ban on repeating white balls — duplicates appear in 14.0% of raw generations, matching pure chance (13.8%).
What you can do
- Study LLM behavior on random data: Use the open-source code and methodology as an educational sandbox to analyze overfitting and early stopping.
- Generate valid tickets via wrapper: Run the
harness.pyscript, which automatically filters out invalid attempts with duplicates and outputs a correct combination. - Test in browser: Experiment with generating draws directly in the studio web interface without a local installation.
Example
cd projects/lucky/models/lucky-nanogpt-power-1
python prepare.py # -> draws.bin + meta.pkl
python train.py # -> ckpt.pt (step 300), ckpt_final.pt, log.jsonl
python eval.py # 28.6868 bits/draw, +0.5644 from the floor
python harness.py pick # rejects print first, then the ticket
python harness.py rate --n 1000000 # the valid-ticket rate and the memorization check
Read more
DetailsTrained on 1,150 Powerball draws (2015–2025), with 143 validation and 143 test draws; training took 300 steps (17 epochs) on an Apple Silicon Mac CPU.
Metrics: held-out loss of 28.687 bits/draw against a theoretical minimum of 28.122 bits/draw (+2.0% above threshold); continuing to 3,000 steps degrades loss to 36.251.
Raw generation validity across 1 million samples: 80.2% (802,007 tickets); out of 197,993 rejected tickets, 140,083 contained a white ball duplicate and 61,829 had a red ball greater than 26.
Limitations: weights are not included in the repository (reproduced via scripts), and the model does not predict wins (odds are 1 in 292,201,338).










Comments