Learn AI Math

Weight Matrices

What is Weight Matrices?

In one sentence: Weight matrices are grids of numbers that hold the weights connecting one layer of a model to the next.

Most of a neural network's work is multiplying numbers by these grids. In a Transformer, attention and feed-forward layers each have several weight matrices. GPUs are designed to multiply matrices extremely fast.

What does Weight Matrices look like?

A layer that connects 4,096 inputs to 4,096 outputs uses a 4,096 by 4,096 weight matrix with about 16.8 million numbers.

Why does Weight Matrices matter?

Weight matrices are where nearly all of a model's parameters live.

Last updated · Fact-checked by The AI Math

Linking to this page from a lesson or article?

Like this explanation? Get one every week.

The AI Math newsletter turns confusing AI news into plain English. No hype, no jargon walls.