The interactive film is in the book's Companion

Play it, pause it, turn it and drag it with Mathematics for AI and Machine Learning.

Get the book

Block Multiplication: Blocks Multiply Like Numbers

Chapter 10 · Mathematics for AI and Machine Learning · Beginner · 1:28

An interactive live film: the book's 3 × 4 times 4 × 2 example as six bars, each stacked from the teal and amber block products; move the cut and the parts change while every bar keeps its height, (AB)ᵢⱼ = Σₖ AᵢₖBₖⱼ.

Narration

Here is the book's example. A is three by four, B is four by two, and the six bars are the entries of A times B.

Cut the columns of A and the rows of B at the same place, after the second. Now A is two blocks side by side, teal and amber, and B is two blocks stacked on top of each other, teal and amber.

The rest of the narration is in the book's Companion.

More from Chapter 10

Interactive2:11Tensor Parallelism: Block Products Across DevicesChapter 10Preview1:24Block Diagonal Matrices: Separate WorldsChapter 10Preview1:39Longer Contexts with Rotary PositionsChapter 10Preview2:20Woodbury Identity: a Rank-One Update of the InverseChapter 10Preview1:40Schur Complement: What Is Left After Minimizing Out a BlockChapter 10Preview1:32Kronecker Product and the Vectorization IdentityChapter 10Preview1:40Block Cholesky: Two Steps to a CircleChapter 10Preview1:30Online Softmax, One Tile at a TimeChapter 10Preview1:56Mixture of Experts: Routing Tokens to a Few BlocksChapter 10