Inside a transformer block
Open a model card and you'll find something like "32 layers, d_model 4096, RMSNorm, SwiGLU, RoPE". Every one of those layers is the same block, stacked. Understand one block, with its four parts and two additions, and you can read the architecture of almost any LLM.
In this lesson you'll learn to
- Describe the residual stream, and why each sub-layer adds to it instead of replacing it.
- Explain what layer normalisation does, RMSNorm, and why modern models normalise before each sub-layer.
- Explain the feed-forward network (MLP) in each block, including gated versions such as SwiGLU, and where most parameters live.
- Trace a decoder-only model end to end, compare it with encoder-only and encoder-decoder models, and estimate its parameter count.
Create a free account to open this lesson
It's free. You'll get every free lesson, quizzes that save your progress, daily flashcards and streaks.