Someone fit the entire forward pass of GPT-2 into an Excel file. No Python, no VBA, no macros — just cells and standard spreadsheet functions. You type a few words into one cell, wait about a minute while the workbook recalculates, and another cell shows you the most likely next word. The file is roughly 1.2 GB and the project is named, with a wink, "Spreadsheets Are All You Need" — a tribute to the transformer paper "Attention Is All You Need."
It sounds like a stunt. It is actually one of the best machine-learning teaching tools I've run into, and it points at something I've come to believe: if you want to understand how a model works before you trust a framework to hide it, build the smallest version in a spreadsheet first.
The grid is already a computational graph
Every modern ML framework — PyTorch, TensorFlow, JAX — is built around a computational graph. Nodes hold values, edges are operations, and "running the model" means walking the graph forward. The trouble for a learner is that this graph lives in memory. You can't see it. You call model(x), a number comes back, and the hundred multiply-add-normalize steps in between are invisible.
A spreadsheet is that same graph, made physical. A cell is a node. A formula reference is an edge. Pressing recalc is the forward pass. The difference is that you can click any node, read its value, then click the cell it depends on all the way back to the inputs. Nothing is hidden because a spreadsheet has no place to hide anything — every intermediate value has to exist somewhere you can point at. That is exactly what a beginner is missing when they stare at loss.backward().
Start with the smallest model that is still a model
Forget transformers for a moment. The smallest thing worth building is linear regression with one weight and one bias, trained by gradient descent. It fits in a corner of a sheet, and it contains the whole idea: predict, measure the error, nudge the parameters, repeat.
Lay out your data as two columns, x and y. Put the parameters in their own cells so you can change them by hand. Then the per-point formulas are just arithmetic:
B1: w = 0.0 # weight (we will train this)
B2: b = 0.0 # bias
B3: lr = 0.01 # learning rate
# one row per data point, x in column A, y in column B:
C6: =$B$1*A6+$B$2 # prediction ŷ = w·x + b
D6: =(C6-B6)^2 # squared error for this point
E6: =2*(C6-B6)*A6 # ∂loss/∂w for this point
F6: =2*(C6-B6) # ∂loss/∂b for this point
# the loss, and one gradient step:
H1: =AVERAGE(D6:D100) # mean squared error
H2: =$B$1 - $B$3*AVERAGE(E6:E100) # updated w
H3: =$B$2 - $B$3*AVERAGE(F6:F100) # updated b
That's it. H1 is your loss. H2 and H3 are the parameters after a single step of gradient descent. There's no library and no autograd — you wrote the derivative of the loss with your own hand in E6 and F6, which is the point. When you copy H2/H3 back into B1/B2 and watch the loss in H1 fall, you are not reading about gradient descent. You are running it, one keystroke per step.
Watching descent actually descend
The move that makes it click is turning on iterative calculation (Excel: File → Options → Formulas → Enable iterative calculation; Google Sheets: Settings → Calculation). Now you can let B1 reference H2 and the whole loop runs on recalc, one training step every time you hit F9. Hold F9 down and the loss slides toward its minimum in front of you.
Then break it on purpose. Set the learning rate to 1.5 and the loss doesn't shrink — it explodes, the numbers overshooting the minimum and flying apart across the rows. Set it to 0.0001 and watch it crawl so slowly you lose patience. You have just felt, in your fingertips, why learning-rate tuning is a real job. Google's own Machine Learning Crash Course leans on exactly this: a gradient-descent exercise where you drag the learning rate and watch the fit converge or diverge.
The spreadsheet's whole trick is that it refuses to abstract. Every number in the chain has to live in a cell, so the math can't hide behind a method call.
The same layout stretches surprisingly far. A classic teaching workbook trains a tiny neural network to learn XOR — two inputs, a hidden layer, a sigmoid, and backpropagation worked out column by column, weights updated on each pass. Everything a nn.Module does is there; it's just spelled out instead of called.
And that's what makes the GPT-2 workbook more than a party trick. Attention, softmax, and layer normalization aren't exotic operations once you see them as more columns — a dot product here, a normalization there, a weighted sum over the row. The workbook runs the smallest 124-million-parameter GPT-2, forward pass only, producing one token per recalc; to generate a sentence you feed each output back in as the next input. Slow and enormous, yes, but every one of those 124 million weights sits in a cell you could, in principle, click.
Where the spreadsheet stops helping
Be honest about the limits, because they are also the lesson. A spreadsheet is a terrible tool for doing real machine learning. There's no automatic differentiation, so you hand-derive every gradient, and no scale — a few hundred rows before recalc turns sluggish. You would never train a production model this way, and nobody is suggesting you should.
But that friction is the tuition. Hand-deriving the gradient once, and watching a bad learning rate blow up a column of numbers, builds an intuition that a dozen green-passing model.fit() calls never will. The framework's job is to let you forget these details. You should earn the right to forget them.
So this week, before your next training run, spend twenty minutes building the single-neuron regression sheet above. Name the cells, wire the loop, and push the learning rate until the loss diverges. When you go back to PyTorch, loss.backward() will stop being a magic word — you'll know it's just column E, computed for you.
Sources: Spreadsheets Are All You Need (GitHub), Developer squeezes entire GPT-2 into a single Excel spreadsheet (The Decoder), Linear regression: Gradient descent (Google ML Crash Course), Simple Artificial Neural Network with Backpropagation in Excel (GitHub).