SuperEnalotto AI lab: lottery AIs put to the test
Several free “lottery AIs” on the internet claim to predict the next winning numbers with neural networks (LSTM). This lab rebuilds three of them and trains them with TensorFlow.js on the 4,288 real SuperEnalotto draws, right in your browser, nothing is uploaded. You then see the model's “line” and, more importantly, how often it was right on the held-out draws, compared with what pure chance delivers.
🔮 AI & test › · 🧪 Strategy lab (backtest) ›
The three models
A · LotteryAi
Source: CorvusCodex · MIT
Embedding → LSTM → Dense(softmax). The network receives each draw as input and must output the same draw (x = y). The prediction is the ranking of the output neurons, plus 1.
Finding: Because every output neuron enters the ranking, the “line” is always 1, 2, 3 …, whatever the data. Training “accuracy” still reaches 100%, because the network only learns that the largest number is always in the last position.
B · PowerballAi
Source: CorvusCodex · MIT
The same network. The prediction reshuffles the numbers of the last known draw; the bonus number is the most probable output neuron.
Finding: The original script crashes on its own data format with an index error (6 ranks for 5 columns). Here the obviously intended variant runs: the line is simply the previous draw, and the bonus always falls between 1 and the number of columns.
C · Mega Millions AI
Source: iandickson222
One LSTM(64) per position with the previous draw as input, one softmax over all numbers per position; training with EarlyStopping. Prediction: the most probable number at each position.
Finding: A real sequence model, but each position only learns the most frequent number at that place (low numbers first, high numbers last) and often produces duplicates. The hits stay within the range of chance.
The originals define LSTM layers of 256,000 and 409,800 units: hundreds of gigabytes of weights, the script does not run on any machine. Here the layers are reduced to 16–128 units; everything else (architecture, loss function, 80/20 or 90/10 split, prediction rule) is kept as is.
Training curve
“Accuracy” only checks whether the most probable output neuron sits at the position of the largest number; with sorted draws that is always the last one. So 100% means nothing.
Result
The model's “line” for the next draw
Honest test: held-out draws
| Matches | Model | Chance (expected) |
|---|
The last lines in the test
| Date | Prediction | Matches |
|---|
Questions about the AI lab
Can an LSTM predict the next lottery numbers?
No. An LSTM learns patterns in sequences: language, prices, sensor data. The SuperEnalotto draws are independent random events with no memory: today's draw carries no information about tomorrow's. The network can at best reproduce the past frequency distribution, which is the same for every number.
Why do these programs show 100% accuracy?
Because the metric measures the wrong thing. The scripts feed the draw as input and as target; “accuracy” then only means the network finds the position of the largest number, always the last one with sorted draws. That has nothing to do with prediction.
How does this lab differ from the originals?
The architecture, loss function, data split and prediction rule are kept. Only the unrealistically large LSTM layers are reduced, and there is an evaluation the originals lack: each line is formed from data before the draw and compared with the exact expectation of chance.
Is the hit rate sometimes better than chance?
With few validation draws the result swings a lot; a p-value below 0.05 shows up once in 20 attempts on average. Anyone trying different windows, epochs and models will eventually find an outlier: that is chance, not a discovery.