Note

Attention Is All You Need — working notes

Ada Ng

Working copy of Attention Is All You Need. Not a summary of the PDF — a translation I can reread without opening arXiv.

The move that matters: drop recurrence. Sequence structure is injected with positional encodings; mixing happens only through attention.

Attention(Q,K,V)=softmax(QKdk)V\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\left(\frac{QK^{\top}}{\sqrt{d_k}}\right)V

dk\sqrt{d_k} is not decoration. Without it, dot products grow with dimension and the softmax saturates — gradients die. That single line is why Attention is a routing function rather than a memory.

BlockJob
Encoder self-attentionMix the source with itself
Decoder masked attentionMix the target so far, no peeking
Cross-attentionRoute decoder queries into encoder values
FFNThink, per position, after the mix

Two things I still do not believe I understand:

  1. Why eight heads, not two or thirty-two, beyond “it worked.”
  2. How much of “attention is all you need” is actually “residuals plus a wide FFN.” [^1]

Related: Permanent notes must stand alone, Maps of content.

See the distilled claim: Attention is a routing function.

More writing·Reading