This page runs a small, deterministic self-attention block entirely in your browser. Every token in your sentence is hashed into a fixed pseudo-random embedding, projected through three small learned-looking matrices (one per head), and scored with the standard scaled dot-product formula. Nothing is sent to a server, and no model weights are downloaded.
Q, K and V.S = Q·Káµ / âd with d = 16, then multiplied by the scale control.S is normalised so weights are positive and sum to 1.This is a faithful implementation of the attention mechanism, not a trained language model. The projection matrices are fixed and illustrative, so the weights show how attention distributes mass â not what a real GPT or BERT head has learned. Real heads in trained models specialise in syntax, coreference, or positional patterns; the three heads here are labelled to suggest those roles, but their weights come from deterministic pseudo-random matrices, not training.
the cat sat on the mat and click each token to see how its row changes.Softmax exponentiates each score and divides by the sum of the exponentials across the row. That guarantees positive weights that sum to exactly 1 for every query token, which is what makes the matrix a valid attention distribution.
Dot products of d-dimensional vectors grow with d. Dividing by âd keeps the variance of the scores roughly constant, which prevents softmax from saturating into a one-hot distribution as the dimension grows.
No. All computation happens in this tab. The only network requests are for the page itself, the Super logo, and the optional native player adapter.
The first row is a header with the token strings. Each subsequent row starts with the query token, then lists the attention weight from that query to every key token, rounded to six decimals.