A Large Language Model has never tasted food. It hasn’t learnt that being chased by a dog is a different experience from being chased by a puppy, and yet, when asked if “Queen” is closer to “King” or “Pizza”, it has no struggle identifying it. So, what is going on when a model “understands” a word?
It doesn’t know what a word means. Instead it works it out using maths. Today, I will go over that maths and try and explain it in the way that felt most clear and accessible to me. The numbers I will be using are from the Word Vector Lab, which I released with a friend to visualise this.
Words are just lists of numbers
Before a model can use a word, it creates a numeric representation of that word. Each word (technically, a token) is represented as a vector. They are called embeddings and are the heart of every modern LLM. This idea became mainstream, but how are the vectors calculated? People don’t sit down and calculate vectors manually.…