# Transformer Block

- **Canonical URL:** https://getaimath.com/dictionary/transformer-block/
- **Topics:** [Transformer Architecture](https://getaimath.com/dictionary/category/transformer-architecture/)
- **Last updated:** 2026-11-25

## What is Transformer Block?

**In one sentence:** A Transformer block is one repeated layer of a Transformer, usually made of attention, a feed-forward network, normalization and residual connections.

Models are built by stacking many identical blocks. Each block lets tokens share information through attention, then refines each token with the feed-forward network. Information gets richer as it passes up the stack.

![Transformers & Attention: The Smart Highlighter — Simple cartoon diagram showing how a Transformer reads a whole sentence at once and shines a bright highlighter beam from the word "IT" back to "trophy" so it knows what "IT" means.](https://getaimath.com/diagrams/transformer-architecture.png)
*Napkin Diagram (Transformer Architecture): Older AI read word-by-word and often lost track of earlier words; a Transformer highlights which words connect to which.*

## What is an example of Transformer Block?

A model with 32 layers has 32 Transformer blocks stacked on top of each other.

## Why does Transformer Block matter?

The block is the basic unit you multiply to make a model bigger and deeper.

## Related Concepts

- [Residual Connection](https://getaimath.com/dictionary/residual-connection/): A residual connection lets a layer's input skip ahead and be added to its output, creating a shortcut through the network.
- [Hidden Dimension](https://getaimath.com/dictionary/hidden-dimension/): The hidden dimension is the number of values used to represent each token inside the model.
- [RMSNorm](https://getaimath.com/dictionary/rmsnorm/): RMSNorm is a simpler, faster version of layer normalization that only rescales numbers by their overall size.
- [Hidden State](https://getaimath.com/dictionary/hidden-state/): A hidden state is the list of numbers representing a token at some point inside the model.
- [Layer Normalization](https://getaimath.com/dictionary/layer-normalization/): Layer normalization rescales the numbers in each layer so they stay in a steady, healthy range during training.
- [Intermediate Dimension](https://getaimath.com/dictionary/intermediate-dimension/): The intermediate dimension is the larger size that the feed-forward network expands each token to before shrinking it back.

---
Source: The AI Math Dictionary (https://getaimath.com/dictionary/transformer-block/)
