A dictionary that blurs
completed 11 Feb 2026
Definition: Hash maps (or hash tables) store key-value pairs using a hash function to map keys to indices in an array for efficient retrieval.
Denote by $\mathcal{D}$ a set of key-value pairs … Given a query vector $\mathbf{q}$, the attention over $\mathcal{D}$ is defined as:
$$\text{Attention}(\mathbf{q}, \mathcal{D}) = \sum_{i=1}^{n} a(\mathbf{q}, \mathbf{k}_i) \mathbf{v}_i$$
Attention takes its vocabulary from the dictionary: query, key, value. It drops the dictionary's one strict rule. A hash map returns the value whose key equals the query, or nothing. Attention returns every value, weighted by a softmax over how well each key matches. Lower the softmax temperature and the weights pile onto the best match, which turns attention back into a lookup, for the nearest key instead of an identical one.
Try it · drag the query
Drag q anywhere. As the temperature drops, attention gives nearly all its weight to the nearest key. The hash map only answers when q is released on a key exactly; release it close to one and it snaps there, the way you'd type the exact key.