12 things worth knowing about language and machines. No maths and no prerequisites: each one is true, checkable, and links to the chapter or the lab that works it out in full.
To a bag-of-words model these are the same sentence. Both become the same four counts: the 2, dog 1, bites 1, man 1. Word order is the first thing you…
2 sentences, 1 vectorRank words by frequency and the counts fall off a cliff: rank 2 gets about half of rank 1, rank 3 about a third. It holds in every language anyone has…
f x rank is about constantThey see tokens. Byte-pair encoding starts from single characters and repeatedly glues the most frequent pair together, so 'unhappiness' can arrive as…
50k to 100k tokens, typicallyIn the HAL model, 'chuck' scores 36 against 'woodchuck' when you count what came before it, and 10 when you count what came after. Word order leaves a…
36 before, 10 afterFirth wrote that in 1957 and it is still the whole idea behind word vectors. Nothing in word2vec, GloVe or a transformer's embedding layer knows what …
Firth, 1957A model with perplexity 100 is as unsure as if it were picking uniformly from 100 words at every step. That is the whole intuition. It also means perp…
same tokenizer, or no comparisonMultiply probabilities together and a single zero takes the whole product to zero. The fix is old and blunt: pretend you saw everything a fraction of …
one zero kills the productA query asks a question, every key offers a match score, the softmax turns those scores into weights, and the answer is a weighted blend of the values…
query, key, valueSelf-attention looks at all positions at once, which means it has no idea which came first. Position has to be added to the input explicitly. Without …
no position, no orderIt flattens the probability distribution before sampling. Near zero the model always takes its top guess and repeats itself. Turn it up and unlikely w…
0 repeats, 2 ramblesIt counts n-gram overlap with a reference. A translation that says the opposite thing in familiar words can score above one that says the right thing …
overlap is not meaningThe arithmetic that gives you king minus man plus woman equals queen also gives you doctor minus man plus woman equals nurse. Nothing went wrong in th…
same arithmetic, both results