nhorozov.xyz/thoughts/2026-10-11 17:40

map/territory mistake i remmeber making

in late 8th grade i implemented word2vec, which gives a way to convert between words and meaningful locations in a (100+ dimensional) space. synonyms and analogies are well defined in this space, synonyms simply being which locations of words are close to each other (you can measure closeness in different ways, i can think of 2: pythagorean distance, cosine distance (angle between lines from those locations to the orgin in the space)) and analogies being King – Man + Woman = Queen

for a while i thought antonyms just didnt exist because this space of meaning from word2vec couldnt model them well. you could have  a function that maps between a word-vector to another word-vector but it would require training data and it wouldnt be able to compress this nicely. what should be the antonym for red? blue or green? how about the antonym for car? antonyms for numbers are strange but they can be defined (1-> -1 or 1, 2-> 2 or 1/2)

i later learned about how transformers output distribution over vocab, so that takes care of this ambiguity (when you ask the model what the antonym for ‘watermelon’ is itll pick a more random answer than if you ask it for the antonym of a number, in which case it sohuld be a coin flip between the additive or multiplicitive inverse)