Forward pass
Appearance
A forward pass of an artificial neural network (ANN), also called inference, is the process of obtaining an output $f_\theta(X)$ based on input $X$.
Stages
Common stages of a forward pass include:
- Tokenisation and Token embedding, to convert raw input into real vectors.
- Computation
- in a simple ANN: via feedforward algorithm;
- in a Transformer: via multiple layers of self-attention, FFN sub-layer, and residual connection + layer normalisation.
- Output head: converts the model output back into token(s), often via softmax.