Added
A developer is reviewing a decoder-only Transformer training pipeline to diagnose why the model learns to predict future tokens from earlier context. Match each pipeline component to its role.
Drag each item onto its matching target. On a phone: tap an item, then tap a target.
- Causal attention mask → Prevents attending to future token positions
- Next-token cross-entropy loss → Compares predicted token distribution with the target token
- Backpropagation → Computes gradients of the loss with respect to parameters
- Optimizer step → Updates parameters using gradients
Causal masking prevents information from future positions from leaking into a next-token prediction. Cross-entropy measures the mismatch between the predicted distribution and the target token. Backpropagation computes gradients through the model, and the optimizer uses those gradients to update parameters. Reversing the final two roles would confuse gradient computation with parameter updating, while treating the mask as a loss function or the loss as an update rule would also be incorrect.