Note

Attention is a routing function

Ada Ng

Self-attention does not store. It routes: each position writes a query, every position offers a key, and values are fetched in proportion to the match.

That is why the paper's title is a method claim, not a slogan. Recurrence was a clock. Attention is an address space.

The scaled dot-product

softmax(QK/dk)\mathrm{softmax}(QK^{\top}/\sqrt{d_k})

is a soft lookup table. Once you see it that way, multi-head attention is just several lookups in parallel — different questions, same memory.

This note should still make sense if Attention Is All You Need — working notes vanished. The literature note is the source; this is the idea.

See The residual stream is the state and Permanent notes must stand alone.

More writing·Reading