Read the explanation
Choose the first sentence in the genuine sample menu. It contains eleven tokens, so this JavaScript computes eleven query rows against eleven keys: one hundred twenty-one entries. Choose the third sentence. It contains seven tokens, producing seven by seven, or forty-nine entries. The two exact matrices are held side by side. Each equal-size square here counts one actual query-key entry. Square area and color do not encode its probability. The source normalizes each complete row separately, and selecting a matrix cell changes the selected query row; its column does not create another state. This example shows the real discrete effect of the sentence menu on the number of pairwise entries. There is no intermediate fractional token count or numerical reveal from zero. The implementation assigns scalar affinity scores, with self-score and distance fallback rules, then applies softmax. Despite some page descriptions, this source does not calculate learned query, key or value vectors or a weighted hidden-state output. We preserve those original controls and source behavior without endorsing that unsupported prose. Keep the actual third sentence and select word, index five, as query. The source first assigns zero point four five to self. For other keys it prefers a forward authored affinity, then a reverse affinity, then the distance fallback. Every at index four and across at index three use that fallback: zero point two four five and zero point two one. Their score difference is zero point zero three five. Softmax divides scores by the genuine temperature and subtracts the maximum before exponentiation. At temperature zero point two, the every to across probability ratio is exponential of zero point one seven five, about one point one nine one two. At temperature three it becomes exponential of zero point zero one one six seven, about one point zero one one seven. The complete seven-key distributions show all the other probabilities too; each sums to one. The strong reverse assigned affinity from self-attention to word makes that key large at low temperature. Raising temperature flattens the whole row. Every scientific bar uses exactly three hundred forty pixels per probability unit at every encoded moment. This is an action in an assigned score teaching tool, not a trained model decision or value-vector mixture. Keep the third sentence and temperature one. Click word, index five, then self-attention, index two, either in the token cards or by clicking a cell in the corresponding matrix row. The source already computes every query row. This native action chooses another complete row for the token bars. For word as query, the key self-attention gets the reverse stored affinity zero point six five, while self word gets zero point four five. For self-attention as query, word gets the forward stored affinity zero point six five, Transformers gets zero point eight two and compute gets zero point seven zero; self gets zero point four five. The other keys follow the actual assigned map or distance fallback. The two exact seven-key rows are shown at one shared scale, with every token index and probability labeled. This source checks forward affinities before reverse affinities, so its score matrix need not be symmetric. Changing the query updates the selected row and explanatory text; it does not calculate learned query vectors or a real value-vector output. Reset restores the first sentence, it query at index seven, and temperature one. All native matrix cells, token cards, query menus, twenty-nine slider positions and responsive tool allocations remain preserved.