Chapter 06 · Beginner guide
Matrix math, the work AI runs on
Rows times columns, billions of times a second
On this page 7 sections
Strip away the buzzwords, and a modern AI model is mostly a long list of grids full of numbers, multiplied together over and over.
Pearl’s mining uses exactly that kind of multiplication. To see why that’s a clever idea, and where its limits are, start with the grids.
What is a matrix?
A matrixMatrix: A grid of numbers arranged in rows and columns. AI models store most of what they have learned as huge matrices. is a grid of numbers arranged in rows and columns, like a small spreadsheet with no labels.
A photo is a matrix, if you write down each pixel’s brightness. So is a table of prices, with one row per shop and one column per product. And so is most of what an AI model has learned: its knowledge is stored as huge matrices of numbers called weights.
How do you multiply two matrices?
Here’s the rule, which is simpler than it sounds. To get one cell of the answer, take one row of the first matrix and one column of the second. Multiply them pair by pair, then add the results.
That operation is called a dot productDot product: Multiply two lists of numbers pair by pair and add up the results: (1, 2, 3) · (4, 5, 6) = 4 + 10 + 18 = 32.. Let’s do a small one by hand.
-
Pick a row and a column
For the top-left cell, take the first row, (1, 2), and the first column, (5, 7).
-
Multiply the pairs
1 × 5 = 5, and 2 × 7 = 14.
-
Add them up
5 + 14 = 19. That’s the top-left cell.
-
Repeat for every cell
Top-right uses row (1, 2) and column (6, 8): 6 + 16 = 22. The bottom row works the same way, giving 43 and 50.
Each “multiply, then add to the running total” step is one multiply-accumulateMultiply-accumulate: One multiplication added onto a running total. A big matrix multiplication is billions of them, and Pearl's hashrate counts them.. Remember that word: it’s the unit Pearl uses to count mining work.
Hover over the cells below to see which row and column make each one.
Why is it so much work?
Because the steps multiply quickly. For two 3 × 3 matrices, each of the 9 answer cells needs 3 multiply-accumulates: 27 in total.
For two 1,000 × 1,000 matrices, there are a million answer cells, each needing 1,000 steps. That’s a billion multiply-accumulates for one multiplication. AI models do multiplications like that constantly.
Make a guess
To multiply two 4 × 4 matrices, how many multiply-accumulate steps do you need?
Think of your answer first, then check it.
Answer 64.
The answer has 4 × 4 = 16 cells, and each cell is a dot product of 4 pairs, so 16 × 4 = 64. In general, an n × n multiplication takes n × n × n steps, which is why the work grows so fast.
Why do AI models need it?
When a chatbot reads your question, it turns the words into numbers and passes them through dozens of layers. Each layer multiplies the incoming numbers by its weight matrix.
Running a trained model like this is called inferenceInference: Running a trained AI model to get an answer, as opposed to training it. Most of the work is matrix multiplication, which is why Pearl mining can happen inside it., and for large models most of its time goes into matrix multiplication. That’s why the demand for this one kind of math has exploded.
Why are GPUs so good at it?
A GPUGPU: Graphics processing unit: a chip with thousands of small cores working in parallel. Built for games, it now does most AI math, and Pearl mining. was built to draw video game graphics, which also means doing the same simple math on huge numbers of pixels at once. It has thousands of small cores working in parallel.
Matrix multiplication suits that perfectly, because no cell of the answer depends on any other. Hand each cell to a different core and they all work at once. Modern GPUs go further, with tensor coresTensor core: A circuit inside modern NVIDIA GPUs that multiplies small blocks of matrices in one step. Pearl miners use its 8-bit integer mode.: circuits that multiply a small block of a matrix in a single step.
Smaller numbers go faster still. Pearl’s mining uses whole numbers in the range [−64, 64], which fit the GPU’s fast 8-bit integer mode. Squeezing an AI model’s numbers into a small range like that is called quantizationQuantization: Rounding numbers to a smaller set of values so they fit in fewer bits. Pearl's miner turns an AI layer's numbers into small whole numbers so the GPU's fast integer circuits can multiply them..
What is Pearl’s big idea?
Bitcoin’s mining burns a vast amount of computing on guesses that protect the network and do nothing else.
Pearl asks: what if the protective work were also work people actually want done? Matrix multiplication is the natural choice, because so much of AI is made of it. Pearl calls this proof of useful workProof of useful work: Proof of work whose computation can also be useful. Pearl's is matrix multiplication, the main math inside AI models, though the rules do not check that the matrices mean anything..
In Pearl’s official miner, mining happens inside a real AI model. The miner plugs into a popular serving program called vLLM and runs language models published for it. When the model handles a big enough batch, at least 1,024 tokens (word pieces) at once, its multiplications double as mining. The extra cost on top of the model’s normal work is reported to be a few percent.
Does Pearl check that the work is useful?
No, and it’s worth being clear about this.
Pearl’s rules check that the multiplication was done honestly. They can’t check what the numbers mean, so a matrix full of random numbers counts exactly the same as a real AI layer. Pearl’s own reference CPU miner multiplies random matrices.
There’s one more problem to solve. If the puzzle were simply “multiply these matrices”, a miner could do it once and reuse the answer forever. The next page shows how Pearl stops that, and how a miner proves its work to everyone else.