DAILY PRACTICEBuild your AI engineering skills, one problem at a time.Try today's challenge
InferenceAIStart learning path

Deep Learning · Advanced

Transformers

Transformers use attention and feed-forward blocks to build representations of sequences.

TRY IT YOURSELF

Explore attention weights

Select an illustrative query; scores are dot products of fixed two-dimensional vectors.

AI
43.4%
learns
35.1%
context
21.4%

How it works

Token embeddings receive position information, then attention exchanges information across positions. Feed-forward layers and residual paths transform and preserve representations across blocks.

A concrete example

An encoder can attend across an input sequence; an autoregressive decoder uses a causal mask to prevent a position from reading future tokens.

Watch for this

Architectures differ in masking, normalization, position encoding, and training objectives. Do not assume every Transformer is identical.

Try it yourself

Select different queries in the attention demonstration, then step through the complete encoder diagram.

Continue to practice →

Read the source: Attention Is All You Need ↗

Related concepts

Neural networks →

Backpropagation →

CNNs →