Attention & the Transformer

The bottleneck, the attention that removed it, and the architecture that dropped recurrence entirely.

Module 03.9 · Advanced
Free

11h · 13 lessons · 1 challenge

Before this: Word Embeddings

About this module

Attention is not a trick added to encoder-decoder models; it is the answer to a specific failure, and this module shows the failure first. A fixed-size context vector cannot carry a long sentence, and attention is what replaces it.

Then self-attention, multi-head attention, and the transformer built from them -- positional encoding, the block, and the whole network assembled from the paper.

After this module you can

13 lessons

Lesson 1
1Sequence-to-sequence models and the encoder-decoder
Kind
Concept
Length
45 min
Lesson 2
2Beam search, and refining it
Kind
Concept
Length
45 min
Lesson 3
3The BLEU score, and evaluating generated text
Kind
Concept
Length
40 min
Lesson 4
4The attention model, derived from the bottleneck
Kind
Concept
Length
55 min
Lesson 5
5Speech recognition and CTC
Kind
Concept
Length
40 min
Lesson 6
6Self-attention: queries, keys and values
Kind
Concept
Length
55 min
Lesson 7
7Why scaled, and what the softmax temperature does
Kind
Concept
Length
45 min
Lesson 8
8Multi-head attention
Kind
Concept
Length
50 min
Lesson 9
9Positional encoding
Kind
Concept
Length
45 min
Lesson 10
10The transformer block, end to end
Kind
Concept
Length
55 min
Lesson 11
11Block Party: assemble the transformer
Kind
Interactive
Length
30 min
Lesson 12
12Implement a transformer from the paper
Kind
Lab
Length
110 min
Lesson 13
13Checkpoint: the transformer, in full
Kind
Checkpoint
Length
25 min

The challenge: Block Party

The pieces of a transformer block, out of order. Assemble it, with the residuals and norms in the right places.

Worth 500 XP.

← Word Embeddings

End of the track

Related modules

All modules
Calculus & Optimization
9h · 11 lessons
Probability
8h · 12 lessons