Concept · Chapter 4: Neural Networks
The Forward Pass
The forward pass is computing a network's output from its input: layer by layer, multiply by weights, add biases, apply activations.
The problem
Given a network's weights and an input, we need its prediction — and, for training, the intermediate values that backpropagation will reuse.
The solution
Feed the input through each layer in order, storing each layer's pre-activation z and activation a, and compute the loss at the end.
The consequence
It's all a network does at inference time — and during training it's half of each step, with the stored activations reused by the backward pass (the main reason training needs so much memory).
You should understand first
- Vectors
- Dot Product
- The Turing Test
- Symbolic AI
- Logic and Rules
- Expert Systems
- Knowledge Representation
- The Knowledge-Acquisition Bottleneck
- From Rules to Learning
- Supervised, Unsupervised and Self-Supervised Learning
- Features, Labels and Tasks
- Loss Functions
- Derivatives and Gradients
- Gradient Descent
- Linear Regression
- Probability and Distributions
- Entropy
- Softmax
- Cross-Entropy Loss
- Logistic Regression
- The Perceptron
- Activation Functions
- The Artificial Neuron
- Matrix Multiplication
- Multilayer Perceptron (MLP)
- The Forward Pass
The recipe
In the lab, select a data point and choose 1. Forward pass: you'll see the input values, each hidden unit's output and the final probability — the same computation, repeated per layer, that a large model performs billions of times per prediction.
Why it costs memory in training
Backpropagation needs every layer's and from the forward pass. A large model processing a long sequence must keep all of them until the backward pass — which is why activation memory, not just weights, limits batch sizes (Chapter 9), and why tricks like activation checkpointing recompute some of them instead.
What to remember
- For each layer: z = Wa_prev + b, a = φ(z).
- The last layer produces logits → softmax/sigmoid → probabilities → loss.
- Inference = forward pass only.
- Training stores activations for the backward pass (memory cost).
Watch
3Blue1Brown
But what is a neural network? | Deep learning chapter 1
The clearest visual introduction to what a neural network actually computes, layer by layer.