Where is dropout applied within a Transformer block?
Last updated
Residual dropout: applied to each sublayer's output (attention and FFN) before it is added to the residual, plus on token embeddings + positional encodings (P_drop = 0.1).
Implementations also commonly apply dropout to the softmax attention probabilities and sometimes after the FFN nonlinearity.
Modern LLM pretraining often sets dropout to 0 (e.g. LLaMA), since huge datasets make overfitting minor. It remains useful for fine-tuning and small data.