Problem solved in full
-
Earth and Sun at 0.299 across 13 meetings 6 steps
The panel scores
␣Earthagainst␣Sunat 0.299. Earth occurs 230 times in the corpus and Sun 150, across 385,078 tokens that open 2,770,646 context slots between them, and the two stand within 4 tokens of each other 13 times. Work out how much of the 0.299 those 13 meetings are worth.-
One coordinate per context word, and the vectors are scaled to length 1 before anything is compared. That scaling is what makes cosine similarity a plain dot product: 0.299 is a sum of products, one term for every context word the two tokens have in common.
-
A coordinate is a surprise ratio, not a count — how often the pair actually turns up together against how often a shuffled corpus would put them together. Negative surprise is clipped to 0, so the vector records what a token is drawn to and has no way to record what it avoids.
-
Chance first. Earth holds 230 of the 385,078 positions and Sun 150, so across all 2,770,646 slots you would expect the pair 0.6446 times — less than 1 occurrence in the whole corpus.
-
They occur 13 times, 20.17 times what chance predicts, and the coordinate is the logarithm of that ratio: 3.004. Both vectors get the same value, because the count and the two frequencies read the same in either direction.
-
Now scale. Earth's vector has 419 positive coordinates and a length of 30.381; Sun's has 302 and a length of 29.144. Divide 3.004 by each and the unit coordinates are 0.0989 and 0.1031.
-
Their product, 0.0102, is the whole contribution of those 13 meetings. Earth and Sun share 105 context words in total; add all 105 products and you get 0.2992, which the tool rounds to 0.299 — so the direct evidence supplies 3.4% of the score.
Answer
The tool prints 0.299, and the times these two words actually meet account for 0.0102 of it. The rest is company: 105 shared context words out of the 2,742 tokens that have a vector at all. Two things follow. Because clipping removes every negative coordinate, each of the 105 products is positive, so the scale runs from 0 to 1 rather than from -1 to 1 — a pair with nothing in common scores 0, not the opposite of 1. Read as an angle, 0.299 is 72.6°, which puts Earth and Sun 17.4° away from sharing nothing. And the ranking above the score is finer than the evidence beneath it: ␣planet tops Earth's neighbour list at 0.307, clear of Sun by 0.008, while the single Earth-and-Sun coordinate is worth 0.0102 on its own. One context word is enough to change which token is called nearest.
-
Learning path
How an LLM picks the next word
References (2)
- The vector arithmetic this tool measures, in the paper that made it famous: T. Mikolov, K. Chen, G. Corrado and J. Dean, "Efficient Estimation of Word Representations in Vector Space." arXiv:1301.3781, 2013.
- The co-occurrence counts underneath it, made explicit: J. Pennington, R. Socher and C. D. Manning, "GloVe: Global Vectors for Word Representation." Proceedings of EMNLP 2014, 1532–1543, 2014.