Learn AI Math

Transformer Block

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.

What does Transformer Block look like?

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.

Last updated · Fact-checked by The AI Math

Linking to this page from a lesson or article?

Like this explanation? Get one every week.

The AI Math newsletter turns confusing AI news into plain English. No hype, no jargon walls.