Part 1 of 5. Part 2 gives the AI a hint, part 3 swaps in an AI built for coding, part 4 measures how much of it was luck, and part 5 covers the cost, the lessons and what comes next.
If you’ve ever played the card game SET, you already understand the maths problem in this post. In 2023 a Google DeepMind system made headlines by finding a new record on it, using a huge AI that wrote thousands of small computer programs. I wanted to know how far a much smaller AI could get, running overnight on two second-hand graphics cards in my garage.
A card game with a hard question inside
SET is played with a deck of 81 cards. Each card has four features: the number of symbols (one, two or three), their colour, their shape and their filling. Three cards make a SET when every feature is either all the same or all different across the three. One “two of these and one of those” anywhere, and it isn’t a SET.

Players race to spot SETs on the table. Mathematicians ask the opposite question: what’s the biggest pile of cards you can lay out that contains no SET at all?
For the real deck the answer is 20. It was proven decades ago, and the picture below shows one such pile. Lay out any 21 cards and a SET is guaranteed to be hiding in there somewhere.

Now imagine bigger decks. Give each card a fifth feature and there are 243 cards; with eight features there are 6,561. The question stays the same, but it gets very hard very fast. With five features the answer is 45, and with six it’s 112, both proven with a lot of work. Beyond that, nobody knows. For eight features the best pile anyone has found has 512 cards, and nobody can prove it’s the biggest possible. Mathematicians call these piles “cap sets”, and the problem has been studied for decades because it connects to deeper questions about patterns in numbers.
The 512 was found in 2023 by FunSearch, a Google DeepMind project. Their system ran enormous numbers of AI attempts, and even then it found 512 in only 4 of its 140 runs. In 2025 a team of researchers re-ran the experiment with seven different commercial and open AI models. None of them reached 512. The best single run got 448, and the open 70-billion-parameter Llama model averaged 375.
That study gave me a fair measuring stick. My server runs an open model from Google, Gemma 4, a 26-billion-parameter model, on the two 2016-era GPUs I wrote about in October. It’s smaller than every model in their table, and it already has a day job running the house’s voice assistant. Could it hold its own overnight?
The AI doesn’t play the game, it writes recipes
The clever part of FunSearch is that the AI never picks cards itself. Asking it to list 512 cards from a deck of 6,561 would be hopeless. Instead it writes a ranking rule: a short recipe that looks at a single card and gives it a score.
A simple builder does the rest. It sorts the whole deck by the recipe’s scores, walks down the list from the top and keeps each card unless it would complete a SET with two cards already kept. The bigger the final pile, the better the recipe.

It’s like packing a suitcase by working down a list of what matters most and skipping anything that won’t fit with what’s already in. The packing method never changes; all the cleverness lives in the order of the list.
That turns maths into a cooking contest:

- The cook. The AI is shown two of the best recipes found so far and asked to write a better one.
- The kitchen. The new recipe is run in a sealed test kitchen.
- The judge. A separate referee counts the pile and checks every possible trio for a SET.
- The recipe book. Good recipes are kept and become examples for the next round. Weak ones fade away.
Round and round, about 1,700 times an hour. It’s evolution with recipes instead of animals. The AI provides the mutations, and the judge’s scores decide what survives.
Letting a stranger’s recipe into the house
There’s a catch. Every recipe is a small computer program written by an AI, and I’m running thousands of them on a server in my house. Most will be harmless. But an AI can write anything, including code that tries to read files, reach the network or just loop forever.
So the test kitchen really is sealed. Each recipe runs in its own throwaway box that the operating system builds for it: no internet, not even to the server itself, no access to anyone’s files, a strict memory limit, and 60 seconds before it’s switched off. Before the first real run I tried to break out on purpose, with eleven hostile recipes. They tried to call home over the network, read the AI server’s file of access keys, look through my home folder, start a command prompt, swallow 4 GB of memory, run forever, and simply claim a high score. All eleven were stopped.
That last one matters most. In the open-source version of FunSearch I started from, the recipe was briefly run inside the main program before being sent to the test kitchen, and the result was read back in a way that can itself run code. Those are two easy ways for a misbehaving recipe to slip past. In my version the kitchen hands back only the pile of cards, and a judge that the AI can’t touch does all the counting. The AI never grades its own homework.
Sharing the server with the house
The same AI runs the garage voice assistant and answers questions around the house, so the search mostly runs from 11:30 at night to 5:30 in the morning, when the logs showed nobody uses it. It never takes more than three of the model’s four lanes, so there’s always one free. A small watchdog keeps an eye out: if someone talks to the house AI, or a different model is needed, it freezes the search on the spot and lets it carry on once things are quiet again.
The first real test failed in an instructive way. This model “thinks out loud” before it answers, and it spent its entire word budget thinking and never wrote a recipe. With thinking switched off, it found the 20-card pile for the real SET deck in under two minutes.
Climbing the ladder
I worked up through bigger decks, one or more nights each:

- Four features (81 cards): 20, the proven maximum, in under two minutes.
- Five features (243 cards): 40 out of a possible 45, within the first minute of both nights, then nothing better for two hours.
- Six features (729 cards): 84, then 96, then 84 again on three nights with almost the same settings. The 96 arrived 21 minutes before the night ended. Luck plays a big part in this kind of search.
- Seven features (2,187 cards): 182, against a best known of 236.
Eight features: the main event
The study found that several short runs did better than one long one, so I split each night into three fresh two-hour starts and ran three nights: nine runs in total.

Eight of the nine runs stopped at 364 or 366. One reached 390, which puts my small model’s best run above the big Llama model’s average of 375, and near the top of that model’s range. The nine runs averaged about 368, a little under that 375. So the small home AI landed right in the pack of the published models, in a few nights of borrowed GPU time.
Before believing the 390, I rebuilt that pile from scratch with a separate checking program, outside the whole search system, and tested all 390 cards. It holds: no SET anywhere.
The way each run unfolded says even more:

Every run sprinted to the 360s within the first 40 minutes or so, then sat on a plateau. The 390 run sat at 364 for over an hour before one recipe suddenly found a better idea.
What the winning recipe actually does
Here’s the recipe behind the 390, exactly as the AI wrote it:
v_arr = np.array(v)
counts = np.bincount(v_arr, minlength=3)
p = counts / n
line_prob = np.sum(p**3) + 6 * p[0] * p[1] * p[2]
variance = np.var(v_arr)
return 1.0 / (line_prob + 1e-6) + variance
In plain English: each of the eight features can take one of three values, call them 0, 1 and 2. The recipe counts how many of each value a card has, and favours cards whose mix of values makes them unlikely to complete a SET by chance, with a small bonus for cards that are spread out rather than bunched in the middle. It’s a sensible idea, and the AI even wrote its own comments explaining it.
But notice what the recipe never looks at. It counts how many of each value a card has, but never where they sit. To this recipe, cards reading 0-1-1 and 1-1-0 look identical. It’s like reading words by counting their letters without looking at the order: to it, “listen” and “silent” are the same word. Almost every top recipe in all nine runs worked this way.
That’s very likely why they all stalled in the 360s. The record-breaking 512 pile depends heavily on where the values sit: in FunSearch’s winning recipe, what mattered was whether matching positions at opposite ends of the card held the same value. My AI never stumbled onto that idea on its own.
Next: give it a hint?
So the obvious experiment is to nudge it, with one extra sentence in the instructions telling it to compare values at mirrored positions on the card. That raises a fair question: is it still the AI’s discovery if I point it at the answer? I’ll come back to that in part 2, which covers the hint, why it’s honest to try it only if you say so up front, and what happened when nine more runs went off with it.
All scores in this post were counted by the checker, never by the AI. The 390 pile was rebuilt and re-checked separately. Part 5 will include a small program you can run yourself to check the final piles.
