I trained a transformer in HyperCard

Update, December 2026: MacMind was recently featured in Gregory Wieber’s video "7 Mind-Blowing Things People Made in HyperCard." I had no idea it was coming until a viewer in Melbourne, Australia emailed me. The piece below first ran on LinkedIn in April 2026.

1,216 parameters. 1989 Macintosh. And yes, it took a while.

MacMind is a complete transformer neural network, the same architecture behind modern AI, implemented entirely in HyperTalk, a scripting language from 1987 designed for making interactive card stacks, not matrix math. It has embeddings, positional encoding, self-attention, backpropagation, and gradient descent. Every line of code is readable inside HyperCard's script editor. On this hardware there are no black boxes. Option-click any button and read the actual math.

The task: learn the bit-reversal permutation, the opening step of the Fast Fourier Transform. As a physics student, the FFT is an old friend; it sits at the heart of signal processing, quantum mechanics, and wave analysis. But here the model has no formula to copy. It has to discover the positional pattern purely through attention and repeated trial and error.

By training step 193, the model was already bouncing between 50%, 75%, and 100% accuracy on successive steps, oscillating around the answer like a ball settling into a bowl. The same mathematical behavior happens inside every AI system you used this week.

The "intelligence” lives in 1,216 numbers stored in hidden fields in a HyperCard stack. Save the file, quit, reopen it: the model is still there, still trained, still correct. It'll run on any Mac from System 7 through Mac OS 9. It'll probably still run in 2050 in an emulator.

We're at a moment where AI affects nearly everyone but few of us understand what it actually does. MacMind is a demonstration that the process is knowable, that backpropagation and attention aren't magic, they're math, and math doesn't care whether it's running on a TPU cluster or a 68k processor from 1989. The scale is different, but the process is identical.

MacMind is available on Github: https://github.com/SeanFDZ/macmind

What would you want to understand about how AI actually works, if someone could show you the engine with the hood up?

Next
Next

The Exit Plan Comes First