A transformer reads a sentence by letting every word look at every other word and decide how much of each one to pull into its own meaning. Those weights are called attention, and you can read them straight out of the model.
Type something below and a small model will show you where each word looks. It runs in your browser, so nothing you type is sent anywhere. This is a pared-down take on Attention on moebio.com, which asks a language model to score every pair of words. Here the numbers are the model's own weights, and there is only the matrix.
0 / 280
The matrix is wider than your screen; scroll it sideways.
Each row is a word doing the looking, and each column is a word being looked at. A row adds up to 100%, and its cells are shaded against that row's strongest link, so every row has one full-colour cell.
The example opens on layer 4, head 2, because that is where both “it”s land on their nouns: the first looks hardest at “cup” and the second at “robot”. That is one head out of 72, picked because it looks good. Most of the others are busy with the next word, or with the word itself.
Model: all-MiniLM-L6-v2, in Qdrant's export that returns its attention weights, run with Transformers.js. The first run downloads about 23 MB; after that it comes from your browser's cache.