Computing Outputs from Current Parameters
A forward pass evaluates the model with its current parameters. For a simple multilayer perceptron, a layer may compute . Other architectures add attention, convolution, normalization, recurrence, routing, or state updates.
- Convert the batch into the model's expected tensors and masks.
- Run each operation in dependency order to produce hidden states and outputs.
- Interpret the output according to the head: logits, a regression value, an embedding, or another structured result.
- During training, combine the output with targets and any auxiliary terms to compute an objective.
Frameworks usually record the operations required for automatic differentiation during this pass. Training mode can also change behavior: dropout samples a mask and BatchNorm updates statistics, while evaluation mode uses their inference behavior.
Loss Is Not the Prediction
The model may output logits while the loss function consumes those logits and target indices. A forward pass can also be used without a loss during inference or feature extraction. Parameter values do not change until an optimizer applies an update.