The test game. This series uses one test game, which is not a real product. Three scatters on its 5 reels start 10 free spins, about 1 time in 151 spins. A book is the record of one round. Belief is the fair value of the round after each step. News is the change of belief in one step.
A million books, and no time to read them
A simulation makes one book for each round. One million books are a small simulation. A person cannot read them, and a mean value hides the differences between them.
Part 10 sorts sessions into types with e-means clustering. This post does the same with single rounds. The result is an audit of the books. It shows the rounds that give no engagement, the money that buys little news, and the books that fail a rule.
Step 1: encode each book
The encoder reads one book and the belief after each of its steps. It writes 8 numbers. These numbers are the vector of the book.
| Number | What it measures |
|---|---|
| Payout | The money that the round pays, in stakes. |
| Travel | The total movement of belief in the round. |
| Letdown | The fall from the highest belief of the round to the payout. |
| Delight | The rise of the payout above the highest belief before the end. |
| Share of the largest step | The largest news of the round, divided by the travel. The value 1 means one step. |
| Steps with news | The number of steps that move belief. |
| Reels of a tease | The number of reels that the player waits for while 2 scatters are visible. |
| Free spins | The number of free spins in the round. |
The encoder takes the logarithm of the amounts, because payouts differ by a factor of 1,000 and more. Then it divides each number by its spread. As a result, each number has the same weight.
Step 2: cluster the vectors
Clustering puts k centres into the space of the vectors, and it assigns each book to its nearest centre. This post uses the e-means procedure [1]. It reads the books in small batches, and it moves each centre after each batch. Part 10 gives the steps of the procedure.
The encoder took 0.15 seconds. The clustering with 10 centres took 0.34 seconds: the k-means++ start and 2 passes through the data, in batches of 16,384 books. That is 0.24 billion terms: books × centres × numbers × 3. The assignment of each book to a centre took 0.07 seconds, and the sums took 0.03 seconds.
The centres are the result that you keep. A new set of books needs only the encoder, the assignment and the sums. For 1,000,000 books of a second version of the game, these 3 stages took 0.22 seconds.
J be the mean square distance of the books from their centres. Then not more than 1 ÷ m of the books are farther than √(m × J) from their centre.Few books can be far from their centre. Call the square root of J the usual distance. Then not more than 1 book in 4 is farther than 2 × the usual distance. Not more than 1 book in 9 is farther than 3 × the usual distance.
As a result, the list of the far books is always short, and a person can read it.
- Let
Qbe the square distance of one random book from its centre. The mean ofQisJ, andQis not negative. - The Markov inequality gives
P(Q > m × J) ≤ J ÷ (m × J). - The right side is
1 ÷ m.
In the test game, J is 1.12. For m = 4, the limit is 25.0% and the data give 2.43%. For m = 9, the limit is 11.1% and the data give 1.18%. For m = 16, the limit is 6.3% and the data give 0.23%. For m = 25, the limit is 4.0% and the data give 0.11%.
The procedure makes J small. As a result, each centre describes its books, and the books that no centre describes are few.
Speed, and two repairs for slot data
The usual procedure for this problem is Lloyd k-means [2]. On the same books, from a k-means++ start [3], it needed 18 passes and 1.4 seconds. For 5 starts, J was 1.12 to 1.27 with e-means and 1.10 to 1.48 with Lloyd k-means. The two procedures give the same quality. The difference in time grows with the number of centres.
| Centres | Lloyd k-means: J | Time | e-means: J | Time | Times faster |
|---|---|---|---|---|---|
| 10 | 1.204 | 1.7 seconds | 1.135 | 0.36 seconds | 4.7 |
| 64 | 0.189 | 17.6 seconds | 0.182 | 1.4 seconds | 12.9 |
| 256 | 0.051 | 80.2 seconds | 0.052 | 4.7 seconds | 17.2 |
The e-means paper tested the procedure on vectors from image models and text models. The rounds of a slot game are different. The rare types of round are small, and they are far from all other rounds. For such data, the procedure of the paper needs 2 repairs.
- A k-means++ start. The paper starts from random rows. A random start puts almost no centre on the rare rounds. With 64 centres, it gave 2.5 times the J of a k-means++ start.
- A distance test in the revival. The paper removes each cluster with less than 0.1 of the mean size, and it gives the centre to a large cluster. The features are 0.67% of the rounds, which is below this limit for 10 centres. In 15 runs with this rule, no run kept a cluster of features, and J was 2.0 times as large. A second paper [4] adds a test: remove a small cluster only if its centre is near a different centre. With this test and repair 1, each of 15 runs kept the clusters of features.
A rare type of round is small and far. A procedure that removes small clusters removes what an audit looks for.
How many clusters
The audit uses k = 10. Some types do not depend on k. From k = 6 to k = 16, the rounds with a blank tease are 3.7% of all rounds and the rounds with a feature are 0.7%. The borders between dead spins, small wins and line wins move when k changes. Report these borders with care.
Step 3: compare three shares
For each cluster, the audit adds up 3 quantities: the time, the money and the news. Then it divides each sum by the total of the game. The news is the travel of belief (Part 4).
For each type of round, add the seconds, the payouts and the travel of its books. Divide each sum by the total of all books. You get 3 percentages for each type. If the 3 percentages of one type are far apart, examine that type.
Example. The type "Dead spin" uses 20% of the time of play, gets 0.2% of the money and gives 5% of the news.
for b in books:
t = type_of(b) # the nearest centre
time[t] += b.seconds
money[t] += b.payout
news[t] += b.travel
share_of_time = {t: time[t] / sum(time.values()) for t in time}Use it. A type with much time and little news is dead time: make these rounds shorter or less frequent. A type with much news and almost no money is a promise that the game does not keep.
| Type of round | Rounds | Mean payout | News ÷ time | News ÷ money |
|---|---|---|---|---|
| Dead spin | 22.0% | 0.01× | 0.27 | 22.56 |
| Dead spin, one step | 14.2% | 0.02× | 0.28 | 11.67 |
| Small win | 28.7% | 0.30× | 0.36 | 1.08 |
| False start | 14.9% | 0.14× | 1.06 | 6.89 |
| Line win A | 6.8% | 1.48× | 1.29 | 0.77 |
| Line win B | 6.6% | 2.10× | 0.52 | 0.22 |
| Large line win | 2.4% | 6.81× | 1.66 | 0.22 |
| Blank tease | 3.7% | 0.20× | 5.27 | 23.09 |
| Feature, trigger on the last reel | 0.43% | 70.99× | 3.98 | 0.69 |
| Feature, trigger before the last reel | 0.24% | 56.10× | 3.75 | 0.83 |
The last 2 columns compare the shares. The value 1 means that the cluster gives its fair part of the news. A value below 1 means less news than its time or its money.
Rounds that lack engagement
A cluster lacks engagement when its share of the news is less than half of its share of the time. In the test game, these clusters are: Dead spin, Dead spin, one step and Small win. Together they use 60% of the time of play, and they give 19% of the news.
Money that buys little news
The line wins get 42% of the money and give 15% of the news. This money is quiet, but the game does not waste it. A line win is good news with almost no letdown: the line wins give 31% of all the delight. The money also gives the player more spins.
A second group is more doubtful. 40% of the rounds pay more than 0 and less than the stake. These payouts use 13% of the money. Each of them is a loss for the player, and Part 2 does not count it as a real win.
News that pays nothing
The blank teases are 3.7% of the rounds. They get 0.8% of the money and give 18% of the news. All of this news ends as letdown.
The clustering also found a type that has no name in the other parts: the false start. Belief rises on the first reels and falls again, and the spin shows no tease. It is 15% of the rounds. It gives 15% of the news and 22% of all the letdown. That is almost as much letdown as the blank teases give (23%).
No rule looked for the false start. The clusters showed it.
Step 4: apply the rules
A rule is a test on one book. The audit counts the books that fail each rule, and it shows the clusters that hold them.
| Rule | Books | Money | Where the books are |
|---|---|---|---|
| The payout is above 0 and below the stake | 39.8% | 12.7% | "Small win" holds 61%. 2 clusters hold 80%. |
| A tease, and the round pays less than the stake | 3.5% | 0.3% | 2 clusters hold all of them. The largest part is in "Blank tease". |
| A feature that pays less than 10× | 0.09% | 0.6% | 2 clusters hold all of them. The largest part is in "Feature, trigger on the last reel". |
| Belief falls 50× or more from its highest value | 0.32% | 10.1% | 2 clusters hold all of them. The largest part is in "Feature, trigger on the last reel". |
3 of the 4 rules fail in only 2 clusters. To examine such a rule, read the books of those clusters. In 1,000,000 books, no payout was at the win cap of 5,000×.
Step 5: read the far books
Each book has a distance to the centre of its type. A large distance shows a book that does not look like a type. Sort the books by this distance, and read the top of the list.
far = sorted(books, key=lambda b: b.distance_to_centre, reverse=True)
to_read = far[: len(books) // 1000] # the 0.1% that fit no typeUse it. Read these books before a release. Write a rule for each error that you find, so that the next audit finds it with the rule.
Each book has a distance to its centre. The audit lists the 0.1% of the books with the largest distance. In the test game, 60% of these 999 books are features, and 14% have a retrigger. The list contains the largest payout of the simulation, 1524×.
The same list can find errors. For a test, the audit got 2,000 wrong books of each of 4 types. The table shows the part of them that are in the list.
| Error in the book | In the list |
|---|---|
| The payout is above the win cap | 100% |
| A payout with no event that explains it | 93% |
| A tease flag, and belief does not move | 81% |
| A feature starts and has no free spins | 33% |
The distance finds an error that gives an impossible combination of numbers. It does not find an error that looks like a usual round. A feature starts and has no free spins is such an error, because it looks like a long blank tease. Write a rule for each error that you know. Use the distance for the errors that you do not know.
Compare two versions
Keep the centres. When the game changes, assign the new books to the same centres and compare the shares. The design of Part 10 has the same RTP as the test game. The table shows what it changes in the rounds.
| Type of round | Rounds | Money | News |
|---|---|---|---|
| Dead spin | 22.0% → 22.5% | 0.2% → 0.2% | 5.5% → 6.0% |
| Dead spin, one step | 14.2% → 12.7% | 0.3% → 0.3% | 3.7% → 3.4% |
| Small win | 28.7% → 28.7% | 8.9% → 8.5% | 9.6% → 10.4% |
| False start | 14.9% → 15.2% | 2.1% → 2.2% | 14.5% → 14.1% |
| Line win A | 6.8% → 6.7% | 10.5% → 10.8% | 8.1% → 8.4% |
| Line win B | 6.6% → 6.4% | 14.4% → 14.5% | 3.2% → 3.3% |
| Large line win | 2.4% → 2.4% | 16.8% → 16.7% | 3.6% → 3.7% |
| Blank tease | 3.7% → 4.3% | 0.8% → 1.1% | 18.1% → 18.0% |
| Feature, trigger on the last reel | 0.43% → 0.74% | 32.1% → 33.5% | 22.3% → 23.2% |
| Feature, trigger before the last reel | 0.24% → 0.31% | 13.9% → 12.3% | 11.5% → 9.5% |
The rounds with a feature go from 0.67% to 1.05%. The blank teases go from 3.73% to 4.32%. The other types change little. The audit of the second version took 0.22 seconds.
Limits
The shares are exact for the books in the data. They are not a forecast. If an optimiser changes the weights of the books, belief changes too (Part 4). Encode the books again after each change of the weights.
The clusters depend on the 8 numbers. A property that no number measures does not make a cluster. Add a number when you look for a new property.
How to audit your books
- Calculate the belief after each step of each book.
- Write the 8 numbers for each book.
- Take the logarithm of the amounts. Divide each number by its spread.
- Run e-means for k from 6 to 16, with a k-means++ start and the distance test. Keep the types that stay the same.
- Add up the time, the money and the news of each cluster.
- Count the books that fail each rule in each cluster.
- Read the books that are far from each centre.
- Keep the centres. Audit the next version of the game with them.
Do it with an AI agent
The 8 steps above are the work of the agent. You give the instructions, and you read the checks.
Read my books and the belief after each step of each book. Write the 8 numbers of the table in this post for each book. Take the logarithm of the amounts. Scale each number to a standard deviation of 1.
You get. A table with one row for each book and 8 columns.
Cluster the table with e-means: 10 centres, a k-means++ start, 2 passes, the distance-aware revival. Use 5 starts and keep the smallest J. For each cluster, print its share of the rounds, the time, the money and the news.
You get. The types of round of your game. Check: each column of shares adds up to 100%. Check: the rounds with a feature have clusters of their own.
List the clusters where the share of the news is less than half of the share of the time. Count the books that fail each of my rules in each cluster. List the 0.1% of the books that are farthest from their centre.
You get. The dead time, the books that fail a rule, and the books that a person must read.
Keep the centres and the scale. When I change the game, encode the new books and assign them to the old centres. Print the old shares and the new shares.
You get. The effect of the change on the rounds. In this post, the audit of a second version took 0.22 seconds.
References
- Bessa S, Mazaré P-E, Szilvasy G, Touvron H, Picard D, Douze M, Jégou H (2026). e-means: outperforming k-means (in one-tenth the epochs). arXiv:2611.09501.
- Lloyd SP (1982). Least squares quantization in PCM. IEEE Transactions on Information Theory 28:129–137.
- Arthur D, Vassilvitskii S (2007). k-means++: the advantages of careful seeding. Proceedings of the 18th ACM-SIAM Symposium on Discrete Algorithms, 1027–1035.
- Weiss E (2026). Small is not dead: distance-aware cluster revival for e-means. arXiv:2611.18238.
Next: Part 12. Field guide: use the series with an AI agent.