Skip to content
Neural Networks and AI / Sequence Models and Attention

Attention as Query–Key–Value Weighting and an Encoder–Decoder Bridge

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

  1. Learning objectives
  2. From fixed context to weighted reads
  3. Query–key–value formalism
  4. Encoder–decoder bridge
  5. Worked example

Before you start

The full lesson, with worked examples and exercise solutions, is for members.

Read the full lesson

New to SelfMadeQuant.com? See membership options or explore the curriculum.