the.ai

Attention / Core

verified

Attention

A model reading a sentence needs to decide, for each word, which other words matter. Attention is that decision made numerically: every position scores every other position, the scores become weights, and the position reads a weighted blend of what it found. Nothing is hard-wired about which words matter — the weights are computed fresh for every input.

Viz primitive · attention-heatmaptokens = 8 · heads = 1
query ↓key →

8 queries against 8 keys; a brighter cell means more of that query's attention went to that key. Nothing is masked: every position can read every other, itself included.

Each row is a query, each column a key it can attend to; brighter cells carry more of the weight. Drag the sequence length to watch the cost of attending grow with the square of it.

8

Reviewed by opendroid · 2026-08-04