Seq2seq with a single context vector forces every input token to compete for space in one fixed summary — a bottleneck when a long filing or price path contains several facts relevant at different output steps. Attention replaces that summary with a data-dependent weighted read from all encoder states. This note develops the query–key–value (QKV) formalism and the encoder–decoder attention bridge; it does not reproduce the full Transformer survey in Attention, Transformers, and Self-Supervised Foundation Models.
In this lesson
- Learning objectives
- From fixed context to weighted reads
- Query–key–value formalism
- Encoder–decoder bridge
- Worked example
Before you start
The full lesson, with worked examples and exercise solutions, is for members.
Read the full lessonNew to SelfMadeQuant.com? See membership options or explore the curriculum.