Where is dropout applied within a Transformer block?

Last updated 22 November 2026

  • 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.

  • https://apxml.com/posts/transformer-model-regularization-techniques
  • https://aiengineeringfromscratch.com/interviews/transformers/residual-stream-and-dropout
  • https://medium.com/@vadidsadikshaikh/chapter-2-4-dropout-and-normalization-keeping-learning-stable-b7936d9b1358
All Transformers interview questions