
A token for your thoughts [Audio]
Audio version of substack post here. Get full access to Entropy Bonus at profbachman.substack.com/subscribe
Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.

Audio version of substack post here. Get full access to Entropy Bonus at profbachman.substack.com/subscribe
Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.
SPEAKER_00Hello and welcome back to the audio version of Entropy Bonus. Today I'm going to talk about my Substack post from August 5th titled, A Token for Your Thoughts, The Secret Language of LLMs. Just a quick note on this one before I begin. This is my first post where I added a bunch of visuals. So you may want to at least, if you're listening to this, at least pull out a computer and follow along just so you can see the visuals. I don't think they're essential to what I'm going to say, but they're there because I thought they might help.
SPEAKER_00Okay, let's begin. Everything a computer does is, at its core, a sequence of computations. Whether you're writing a text document or streaming a movie on Netflix, somehow everything is reduced to numbers, and those numbers are fed into calculations. AI models are no different. When you type a question into a chatbot, the first thing that happens is all your words are translated into numbers. Understanding how this happens is essential for understanding how AI works. and key to keeping AI models safe and doing what we want them to.
SPEAKER_00Don't worry, no math is required. The naive way to turn text into numbers is to first decide on what your smallest unit of text should be, and then sequentially number all possibilities. That's often the first step used by LLMs, called tokenization. For example, if you break text down into individual letters, you only need about 30 possible tokens, one for each of the 26 letters and a few more for punctuation. Or you could decide that your smallest unit is a syllable,
SPEAKER_00in which case there will be about 15,000 possible tokens. Another option is to assign a unique token to every possible word, in which case the number of possible tokens is your vocabulary size, typically much larger. Chatbots like ChatGPT use a scheme called Byte Pair Encoding, or BPE. In BPE, tokens are generally somewhere between the word and syllable level, although they can correspond to even smaller units. You'll often hear chatbots as having a context window of a
certain number of tokens. That's literally the limit on the size of a question you can ask the chatbot when
SPEAKER_00your question is broken down into tokens according to BPE. For simplicity though, let's just think about word level tokenization. In this scheme, you just write down a list of all the words in your vocabulary and number them sequentially. So, for example, maybe you'll end up assigning the number 10 to the word dog, 20 to orange, 100 to cat, etc. Now remember, the whole reason to turn anything into numbers is so that a computer can do calculations with those numbers.
but the results of those calculations will be sensitive to the mathematical
SPEAKER_00relationships between the numbers that you feed into them. If 10 is dog, 20 is orange, and 100 is cat, then we've introduced a lot of relationships between those words that may or may not be helpful for an LLM to understand them. For example, orange is now twice as big as dog, but cat is 10 times larger. Furthermore, somehow orange comes between dog and cat. We've introduced relative sizes between the words and an ordering of the words that may be misleading at best to an LLM.
An alternate strategy for turning text into numbers is called one-hot encoding.
SPEAKER_00In this scheme, every token is translated into a long sequence of zeros together with a single one inserted somewhere in the sequence. Exactly where that one is inserted tells you which word it represents. If our whole vocabulary was just the words dog, cat, and orange, then a one-hot encoding might be 100 is dog, 010 is cat, and 001 is orange. This scheme destroys any mathematical distinctions between the words,
as if you think of those three numbers as points in three-dimensional space,
SPEAKER_00they're all equally far away from each other, and there's no ordering between them. The problem with one-hot encoding is that numerical relationships between words can be a good thing. If the numbers representing words with similar meanings are close together, then our encoding will be useful in helping an LLM to understand what they mean. So what we want is somewhere between arbitrary single-number tokenization and one-hot encoding. For example, we can use two numbers for each word in our little example,
SPEAKER_00where both numbers contain relevant information Maybe now we assign 1,2 to dog, 2,1 to cat, and 10,10 to orange. Now, dog and cat are closer to each other than either is to orange, indicating that they have more to do with each other. In addition, there is still no particular nonsensical ordering apparent in this representation of the three words. This kind of dense representation is going to be most helpful for an LLM.
How to find good, dense representations of words has been an ongoing line of research.
SPEAKER_00Early attempts that proved useful went by names like Word2Vec and Glove. In my Substack post, I have a picture of Word2Vec representations as visualized with Google's embedding projector. What you'll see if you look at the picture is a giant cloud of points, but a few of them are highlighted and there's words next to them. You can see those words are diesel, hydraulic, steam, gasoline, locomotive, and locomotives.
SPEAKER_00Clearly this group of points represents related words, so it makes sense that they appear close together. One of the most important concepts in understanding modern AI is the idea of latent space. This is the space that contains the dense representations of our tokens. In the three-word dog, cat, orange example I had before, the latent space is the set of all pairs of numbers. In other words, the familiar xy-plane. Note that not every point in latent space will correspond to a word.
For example, 3,3 is a point in our latent space, but it doesn't correspond to any of our words.
SPEAKER_00However, note that 3,3 is 1,2 plus 2,1, and 1,2 was our word for dog, and 2,1 was our word for cat. So in some sense, 3,3 is dog plus cat. So points in latent space can correspond to combinations of words. And this is where much of the power of modern AI comes from. They can simultaneously think, in other words, do calculations with,
SPEAKER_00multiple words at the same time. In the AI literature, this is referred to as superposition. They can also think in abstractions that may not even be available to humans. For example, the point 2, 3 is very close to 3, 3, our dog-cat combination. But it's closer to cat than it is to dog. So an LLM doing calculations with 2, 3 may be thinking about some kind of dog-cat hybrid that is more cat-like than dog-like.
SPEAKER_00There might not even be an English word for exactly that concept, but to an AI it's just as good as any other word. When humans communicate with an LLM, our words are converted into tokens, those tokens are temporarily one-hot encoded, and then a dense latent space representation is created. The LLM then does a sequence of calculations in latent space to come up with its response, and finally the process is reversed to convert back to text.
Latent representations of text are simultaneously a powerful feature of AI models
SPEAKER_00and a possible hazard for humans. In order to control AI systems, we need to understand them. We can look into their internals and see what numbers are going through their calculations, but this isn't always helpful. If we see an LLM is doing a calculation with 5.326,7.221, what does that mean? What is it actually thinking about? Deciphering latent space representations with modern tools like sparse auto-encoders or SAEs is one of the main approaches to AI safety.
SPEAKER_00More on SAEs in a future post. Some have proposed using raw, latent space vectors as a way for LLMs to efficiently communicate with each other, since in that case there is no need to convert back and forth to human readable text. While this may be powerful, there is some concern that it can evolve into a new language that some have dubbed neuralese, in which AI systems communicate. This could be extremely efficient for agentic AI systems that are working together to accomplish a task.
SPEAKER_00But from an AI safety point of view, there's some concern. It will effectively be a secret language that LLMs can communicate in, which may be very difficult for humans to decipher. Good, dense representations of tokens are just the first step in getting AI models to understand which words are related to each other. In my next post, I'll describe what I find to be the single most fascinating topic in all of machine learning, how basic arithmetic on latent space representations can effectively encode meaning
SPEAKER_00in the corresponding words. Look out for next week's post to learn more. And as always, if you enjoyed this, hop on to subscribe, subscribe if somebody sent you the link for this and you're not already subscribed, Make sure you like the post. If you've seen it on social media, make sure you like it there. Forward it to all your friends, neighbors, neighbors, friends, friends, neighbors, etc. I'm still trying to grow the readership of this sub stack. So help me out.
SPEAKER_00And as always, thank you for getting this far and listening. And I hope to talk to you again next week.
Nobody is credited on this episode yet.
Audio version of substack post here. Get full access to Entropy Bonus at profbachman.substack.com/subscribe
Audio version of substack post here. Get full access to Entropy Bonus at profbachman.substack.com/subscribe
Audio version of substack post, available here. Get full access to Entropy Bonus at profbachman.substack.com/subscribe
Audio version of substack post available here. Get full access to Entropy Bonus at profbachman.substack.com/subscribe
Audio version of substack post, available here. Get full access to Entropy Bonus at profbachman.substack.com/subscribe