6 ms·
This is not about _Large_ Language models though. This explains math for word vectors and token embeddings. I see this is the source of confusion for many peopl
by ozgung 1y ago
This is not about _Large_ Language models though. This explains math for word vectors and token embeddings. I see this is the source of confusion for many people. They think LLMs just do this to statistically predict the next word. That was pre-2020s. They ignore the 1.8+ Trillion-parameter Transformer network. Embeddings are just the input of that giant machine. We don't know what is going on exactly in those trillions of parameters.
- ants_everywhere 1y agoBut surely you need this math to start understanding LLMs. It's just not the math you need to finish understanding them.
- HSO 1y ago"necessary but not sufficient"
- ants_everywhere 1y agoyes exactly :)
- HarHarVeryFunny 1y agoIt depends on what level of understanding, and who you are talking about. For the 99% of people outside of software development or machine learning, it is totally irrelevant, as is any details of the Transformer architecture, or the mechanism by which a trained Transformer operates. For the man in the street, inclined to view "AI" as some kind of artificial brain or sentient thing, the best explanation is that basically it's just matching inputs to training samples and regurgitating continuations. Not totally accurate of course, but for that audience at least it gives a good idea and is something they can understand, and perhaps gives them some insight into what it is, how it works/fails, and that it is NOT some scary sentient computer thingy. For anyone in the remaining 1% (or much less - people who actually understand ANNs and machine learning), then learning about the Transformer architecture and how a trained Transformer works (induction heads etc) is what they need to learn to understand what an (Transformer-based, vs LSTM-based) LLM is and how it works. Knowing about the "math" of Transformers/ANNs is only relevant to people who are actually implementing them from ground up, not even those who might just want to build one using PyTorch or some other framework/lbrary where the math has already been done for you. Finally, embeddings aren't about math - they are about representation, which is certainly important to understanding how Transformers and other ANNs work, but still a different topic. * US population of ~300M has ~1M software developers, of which a large fractions are going to be doing things like web development and only at a marginal advantage over someone smart outside of development in terms of learning how ANNs/etc work.
- ants_everywhere 1y agoI agree that most people don't need to understand the mathematics or design of the transformer architecture, but that isn't a good description of what LLMs do from a technical perspective. Someone with that mental model would be worse off than someone who had no mental model at all and just used it as a black box.
- HarHarVeryFunny 1y agoI disagree - I just had my non-technical sister staying with me, who said she was creeped out by "AI" and didn't like that it heard her in background while her son was talking to Gemini. An LLM is, at the end of day, a next-word predictor, trying to predict according to training samples. We all understand that it's the depth/sophistication of context pattern matching that makes "stochastic parrot" an inadequate way to describe an LLM, but conceptually it is still more right than wrong, and is the base level of understanding you need, before beginning to understand why it is inadequate. I think it's better for a non-technical person to understand "AI" as a stochastic parrot than to have zero understanding and think of it as a black box, or sentient computer, especially if that makes them afraid of it.
- bonoboTP 1y agoShe's right to be creeped out by the normalization of cloud based processing of her audio and the increasing surveillance infrastructure. No Ai tech understanding needed. Sometimes being more ignorant of details can allow people to see the big picture better.
- nickpsecurity 1y agoThis 100%. The surveillance industry tries to normalize stalking people to exploit them. It's creepy and evil, not normal.
- gpjt 1y agoPost author here. I agree 100%! The post is the basic maths for people digging in to how LLMs work under the hood -- I wrote a separate one for non-techies who just want to know what they are, at https://www.gilesthomas.com/2025/08/what-ai-chatbots-are-doing-under-the-hood https://www.gilesthomas.com/2025/08/what-ai-chatbots-are-doi...
- baxtr 1y agoWait so you’re saying it’s not a high-dimensional matrix multiplication?
- dmd 1y agoEverything is “just” ones and zeros, but saying that doesn’t help with understanding.
- measurablefunc 1y agoIf you know about boolean algebra then it explains a lot more than you realize : https://boolean.dk.workers.dev/ https://boolean.dk.workers.dev/
- tatjam 1y agoPretty much all problems can be reduced to some number of matrix multiplications ;)
- cranx 1y agoBut we do. A series of mathematical functions are applied to predict the next tokens. It’s not magic although it seems like it is. People are acting like it’s the dark ages and Merlin made a rabbit disappear in a hat.
- ekunazanu 1y agoDepends on your definition of knowing. Sure, we know it is predicting next tokens, but do we understand why they output the things they do? I am not well versed with LLMs, but I assume even for smaller modles interpretability is a big challenge.
- lazide 1y agoFor any given set of model weights and inputs? Yes, we definitely do understand them. Do we understand the emergent properties of almost-intelligence they appear to present, and what that means about them and us, etc. etc.? No.
- jvanderbot 1y agoRight. The machine works as designed and it's all assembly instructions on gates. The values in the registers change but not the instructions. And it happens to do something weirdly useful to our own minds based on the values in the registers.
- chongli 1y agoThe answer is simple: the set of weights and biases comprise a mathematical function which has been specifically built to approximate the training set. The methods of building such a function are very old and well-known (from calculus). There's no magic here. Most of people's awestruck reactions are due to our brain's own pattern recognition abilities and our association of language use with intelligence. But there's really no intelligence here at all, just like the "face on Mars" is just a random feature of a desert planet's landscape, not an intelligent life form.
- School-Cotton 1y ago
- clickety_clack 1y agoThat is what they do though. It might have levels of accuracy we can barely believe, but it is still a statistical process that predicts the next tokens.
- ozgung 1y agoNot necessarily. They can generate letters, tokens, or words in any order. They can even write them all at once like they do in a diffusion model. Next token generation (auto-reggresion) is just a design choice of GPT, mostly for practical reasons. It fits naturally to the task at hand (we humans also generate words in sequential order). Also they have to train GPT in a self-supervised manner since we don't have labeled internet scale data. Auto-regression solves that problem as well. The distinction I want to emphasize is that they don't just predict words statistically. They model the world, understand different concepts and their relationships, can think on them, can plan and act on the plan, can reason up to a point, in order to generate the next token. It learns all of these via that training scheme. It doesn't learn just the frequency of word relationships, unlike the old algorithms. Trillions are parameters do much more than that.
- jurgenaut23 1y agoCan you provide sources of your claim that LLMs “model the world”.
- ozgung 1y agoYou are right that it is a bold claim but here is a relevant summary: https://en.wikipedia.org/wiki/Stochastic_parrot#Interpretability https://en.wikipedia.org/wiki/Stochastic_parrot#Interpretabi... I think "The Platonic Representation Hypothesis" is also related: https://phillipi.github.io/prh/ https://phillipi.github.io/prh/ Unfortunately, large LLMs like ChatGPT and Claude are blackbox for researchers. They can't probe what is going on inside those things.
- lgas 1y agoIt seems somewhat obvious to me. Language models the world, and LLMs model language. If A models B and B models C then A models C, as well, no?
- libraryofbabel 1y ago* You’re right that a lot of people take a cursory look at the math (or someone else’s digest of it) and their takeaway is “aha, LLMs are just stochastic parrots blindly predicting the next word. It’s all a trick!” * So we find ourselves over and over again explaining that that might have been true once, but now there are (imperfect, messy, weird) models of large parts of the world inside that neutral network. * At the same time, the vector embedding math is still useful to learn if you want to get into LLMs. It’s just that the conclusions people draw from the architecture are often wrong.
- measurablefunc 1y agoIt's exactly the same math. There is no mathematics in any neural network, regardless of its scale, that can not be expressed w/ matrix multiplications & activation functions.