🔥 0 ⚡ 0 XP

THE BUILDING BLOCK

One artificial neuron

An artificial neuron multiplies each input by a weight, adds the results together, adds a bias, and passes the total through a simple function such as ReLU (keep it if positive, otherwise zero).

Multiply, add, repeat: that is almost all the arithmetic a neural network does.

THE KEY OPERATION

The multiply-accumulate

✖️➕
✖️

Multiply

An input times its weight, such as 0.8 × 0.5

➕

Accumulate

Add the product to a running total kept in a register

🔁

Repeat

Once for every input to every neuron in every layer

Engineers call this a MAC. AI chips are judged by how many MACs they can do per second and per watt.

LAYERS AS MATRICES

A whole layer is a matrix multiply

Stack the weights of every neuron in a layer into a grid, a matrix. Then a whole layer becomes one matrix multiplication: the input vector times the weight matrix. Large language models are mostly giant matrix multiplications, one after another.

If a chip is great at matrix multiplication, it is great at AI.

HOW MANY?

Counting the MACs

A layer with 4,096 inputs and 4,096 outputs needs 4,096 × 4,096 ≈ 16.8 million MACs for every token it processes. A model with billions of weights does roughly one MAC per weight per token.

A model with 70 billion weights does about 70 billion MACs (140 billion operations) for every word it writes.

TRAINING VS. INFERENCE

Learning vs. answering

🏋️

Training

Show the model examples, measure the error, and nudge every weight. Roughly three times the math of a forward pass, repeated over trillions of words

💬

Inference

Run the finished model forward to answer a question. Less math per step, but done billions of times a day

⚖️

Different needs

Training wants huge clusters and fast links; inference wants low cost and low delay per answer

Some chips are built for training, some for inference, and the biggest ones try to do both.

UNIT 1 STUDY COMPLETE

🧠

Ready for the Fab Challenge?

You've seen that a neural network is layers of weighted sums, and that each one is built from multiply-accumulate operations.