9 ms·
Back when ChatGPT came out, I was so shocked by how _good_ it was for an “AI” product that I simply had to know how it worked. Over the next month I ended up dr
by malwrar 4mo ago
Back when ChatGPT came out, I was so shocked by how _good_ it was for an “AI” product that I simply had to know how it worked. Over the next month I ended up drawing out a block diagram on a whiteboard I have in my office, with the math involved next to each step in the blackboard. I’d puzzle about each step along the way, and the triumph of completing the drawing was also that of this sense of deep understanding. I kept that drawing up for many months after, and would gaze at it often during meetings and idle moments in wonder.
This is to say: the autoregressive decoder-only transformer llm architecture as pioneered by openai is wildly simple for how revolutionary its results are. I was reading about non-learned classical SLAM systems (uses video + handcrafted math to produce 3d mappings of physical spaces while also locating the camera in those spaces) at the time, and comparatively speaking I’d say the math is about as complicated as ONE of the components in those complex formulations. The only reason frontier LLMs need 6-figure computers to run is because the model designers made the middle bit in those models REALLY BIG, dimensionally speaking. They just took the steam engine, made a few gargantuan versions of it, and are selling them as the ultimate source of power.
This was openai’s entire breakthrough. Making this particular model architecture larger leads to emergent capabilities like being able to pick the best ending to a story/set of instructions or answer questions about broad factual knowledge. I’ve been meanwhile watching these AI companies attempt, successfully, to sell this capability as some sort of robot consciousness hand-crafted by supergeniuses. The fact that they are getting away with it is almost as shocking to me as the discovery itself.
- 10GBps 4mo agoYep. It's nearly identical to the neural nets we were using in the 90s. Back then even a supercomputer wasn't big enough or fast enough to do what we do today. I have to wonder though. Is this all a human brain is? A similar thing to an LLM just scaled exponentially larger. I mean a brain is not just neurons with simple connections to each other. The neurons, axons, dendrites, <insert_unexplained_thing>, etc in a brain are all holding and processing information in different ways and doing it nearly 100% in parallel. That's a really big model. The biological discoveries show how complex a biological brain actually is. Even the tiny brains in a bee or spider are able to solve puzzles and use tools. That's crazy.
- foxes 4mo agoProbably better to not simply reduce it by just saying X is Y then if it has all that extra complexity and capacity.
- bonoboTP 4mo agoAttention layers were not used in the 90s.
- ctolsen 4mo agoNo, it’s definitely not what a human brain is. That makes very little sense. The ways we interact with language (and thus conceptual memory) is completely and fundamentally different.
- rfv6723 4mo agoIs it different though? If we look beyond written languages which are late inventions of human civilization, oral languages are continuous and build with blocks not words. Chomskyan school misled the entire field of linguistics for decades by ignoring spoken languages.
- uoaei 4mo agoIt is different, but there may be some universal principles that are relevant more abstractly among both cases. Of particular interest is the empirical notion that statistical models of a certain form will always tend to "average out noise" and "learn meaningful patterns" up to the capacity that those models have for representing said patterns. A parallel notion to this is the hypothesis dubbed "thermodynamic origins of life". The universal principle binding these two seemingly disparate topics is one that seems to underlie any sense of "learning" in physical systems: that semantics of those systems depend on their representational power, and the semantics they do come to represent are the results of adding up many pushes in one "direction" (phase space / state space / etc.) encoding a pattern, and adding up many random noise jiggles will cancel out but give you a first-order sense of variance of those semantic features as expressed by the environment. As this description is so overly abstract, an exercise for the reader is to try to work through an explanation of how, say, a river delta comes to "learn" about its environment by "reacting" to the influences at its borders, and how it "encodes" whatever it is that it learns in the substrate that it inhabits.
- darksim905 4mo agoFor anyone who is curious about the first paragraph here, this is actually a great video overview of how LLM works and the tokenization part. Tangentially related: This part always seemed fuzzy to me, especially when dealing with data scientists and how they talk about how 'ML' looks at problems. I had this issue when working at a SIEM vendor where they kept going on about use case development having to be designed a certain way to catch things. It was all very frustrating.
- cloche 4mo ago> this is actually a great video overview of how LLM works and the tokenization part Did you mean to link to the video? I would be interested.
- darksim905 4mo agoOops! Here you go - https://www.youtube.com/watch?v=7xTGNNLPyMI https://www.youtube.com/watch?v=7xTGNNLPyMI
- jfim 4mo agoIndeed. It's pretty interesting to realize after implementing GPT-2 that the frontier models are scaled up versions of that, with various tweaks to improve performance, model-wise. The secret sauce though is all the datasets, RL training, knowledge of what works from doing all kinds of ablation experiments, and a massive compute moat.
- achrono 4mo agoHow do we know that today's frontier models are merely scaled up versions of that? Genuine question, since the labs have narrowed what they share over the years to now almost nothing, in terms of how the model was trained and how it works under the hood.
- ai_slop_hater 4mo agoNo they are clearly not just scaled up versions of gpt 2; there are different LLM architectures like mixture of experts etc that appeared relatively recently. I am not an expert though, far from it.
- otabdeveloper4 4mo agoMoE and such are basically performance enhancements, they don't make the model smarter.
- yababa_y 4mo agoseparately trained experts can surpass performance in their activated regime and DOES result in a smarter model, the Claude system cards talk about this and eg there is https://openreview.net/forum?id=iydmH9boLb https://openreview.net/forum?id=iydmH9boLb to read...
- jmalicki 4mo agoPerformance enhancements are huge though. If you can make the existing model faster, you can then save your inference budget to then make your model bigger, which then makes it smarter. A lot of how smart the models can be comes down to budget. If you can make your existing thing cheaper, you can instead make it bigger for the same price.
- pkoird 4mo agoaka "the bitter lesson"
- faurroar 4mo agoArchitectures have evolved significantly since then. DeepSeek v4 =/= GPT-3. Even then, a great deal of complexity lies in everything surrounding the architectures e.g. how do you implement them performantly on modern accelerators, how do you distribute the model across a set of accelerators, how do you post-train, etc. And pre-training itself is a dark art. If you legitimately think that frontier labs are doing something equivalent to whatever you wrote on your whiteboard, you’re clueless.
- jumploops 4mo agoThose are all just optimizations. We still don’t really know why they work, we just know how to build them.
- trollbridge 4mo agoWe don't really know why language works with humans, either. If you raise a baby from birth, you kind of observe how it is learning language, but the process is also rather mysterious. My eldest son's first word was to actually imitate a cow mooing, and then after that to imitate a motor noise of a tractor or truck. And then after that a meow. (His first complete sentence was "King Graham fell"...) My next child took a completely different path to language, including skipping all the non-verbal imitations. And then at some point, you just suddenly can two-way communicate with them when you couldn't before, and then after that, they can engage in reasoning.
- jumploops 4mo agoCompletely agree! It’s interesting to me how similar attempting to understand LLMs is to neuroscience. “When we turn this bit off, this other thing happens… if we change these weights the Eiffel Tower is now in Rome” We’re basically just probing around and trying to reverse engineer an emergent system. To your point, this system may be quite different from model to model (human to human) although some similarities likely occur. The comment I was responding to tried to belittle the OP’s understanding of transformers, by mentioning that running an LLM at scale is much harder than the simple white board diagram. My point was simply that we don’t know why they work, and all the extra optimizations isn’t the “thing” that makes it emergent. Simply scaling the “GPT” is good enough to see it, so the OP’s awe should stand. (On a side note, what other architectures can we scale to find similar emergent behavior?)
- wuschel 4mo agoCould you perhaps cite the core papers for LLMs beyond „Attention is all you need“?
- sigmoid10 4mo ago"Attention is all you need" is actually a bad paper if you want to learn about autoregressive LLMs specifically, because it describes a more complicated encoder-decoder architecture while modern LLMs are decoder only. So it's an unnecessarily hard way to get into the subject. "Language Models are Unsupervised Multitask Learners" is probably what you are looking for (aka the GPT-2 paper). This was the first time LLMs really showed what is possible, i.e. they can learn to generalize very well from unstructured data. So no more human labelling necessary, which until then was the primary bottleneck in ML. The paper also lists several key ingredients beyond transformers that are mostly still in place today. This also highlights that there was more to it than just "scaling the transformer algorithm" like many people claim. Most developments since then were about improving training data, until "Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer" drastically changed the architecture landscape again. Later big developments like thinking/reasoning/chain of thought/inference time compute (whatever you want to call it nowadays) are actually all about training again. They work using the exact same architecture.
- redox99 4mo agoChain of Thought was kind of an obvious solution that everybody knew was necessary by the time chatgpt / gpt4 came out. It was just a matter of time that frontier labs actually shipped it. MoE was also pretty straightforward, just a bit surprising how well it worked (that you can get away with just 1/32 active parameters), but most researchers would have come up with it on their own probably. The true ground breaking papers are the first two you mentioned (transformers and gpt2), and InstructGPT was also very surprising that it worked so well.
- sigmoid10 4mo agoReasoning is a little bit more than just "baked in" chain of thought prompting. The important takeaway here was that it is not realized at the architecture level of the neural network. And you could say that all these things regarding LLMs were pretty straightforward. But only in hindsight, otherwise there wouldn't have been so much time and effort spent on intermediaries. Breakthroughs mean people simply didn't know stuff before, even if it seems easy with the benefit of hindsight.
- antirez 4mo agoThere is a different way to look at this: that is, actually the Transformer is a minimal complication of what the based model is: in theory the neural network could be just a huge FFN, which is anyway the part of the Transformer that does the heavy lifting. But this would be impossibile to train both numerically and computationally, so the Transformer encodes enough priors for it to work: the causal attention, and the math tricks like the residuals and so forth. But the bottom line of all this is that the Transformer works because of the incredible semantical power of simple/huge FFNs.
- slickytail 4mo ago[dead]
- dist-epoch 4mo agoIsn't that over-simplifying it a bit too much? You can go another step - a FFN can be simulated on a Turing machine, thus it just exemplifies the incredible semantical power of the Turing machine model of computation. (in fact you don't even need a Turing machine, since there is no looping in one forward pass). In theory you can run a huge FFN on the tiniest Turing machine, in practice it's much better to run a Transformer on the latest NVIDIA hardware. Or as they say "quantity (performance) has a quality all its own"
- zbendefy 4mo agoGood point! There is also the case for Markov chains being theoretically able to do these if tuned well. Or even SAT problem.
- CGMthrowaway 4mo ago"LLM is just fancy autocomplete"
- galaxyLogic 4mo agoLLM is an Oracle
- ekunazanu 4mo ago> This was openai’s entire breakthrough. Making this particular model architecture larger leads to emergent capabilities Basically, the bitter lesson: https://www.cs.utexas.edu/~eunsol/courses/data/bitter_lesson.pdf https://www.cs.utexas.edu/~eunsol/courses/data/bitter_lesson...
- williamstein 4mo agoThis interview https://youtu.be/oWOz2htozfI?si=qdQ0uZRoZOYeThOn https://youtu.be/oWOz2htozfI?si=qdQ0uZRoZOYeThOn from 2 days ago with a top researcher from OpenAI directly addresses the bitter lesson argument and the importance of scaling for the history of their models.
- xnx 4mo agoIsn't the bitter lesson basically the same as "The Unreasonable Effectiveness of Data" from 2009?
- swyx 4mo agonot exactly, bitter lesson is one meta-level up from "scale eats everything". this is a common misunderstanding of bitter lesson that rich sutton has been fighting ever since the thing was written. in rich's own words[1], the modern summary is > Don’t be distracted by human knowledge, as AI has been historically. > Instead focus on methods for creating knowledge that scale with computation, like search and learning. so the lesson is choose methods that scale with computation, not just that blindly scaling up anything (data, params, people, whatever) works, it is choosing the right x axis and the right scaling laws consistently wins out in the long run despite short term wins from other methods. 1: https://x.com/RichardSSutton/status/2056419165502935198 https://x.com/RichardSSutton/status/2056419165502935198
- jochembrouwer 4mo agoSo the take-away here is that we (as humans) try to model these AIs like humans, but eventually these AIs get better. Which to me seems like a logical conclusion if they can do "things" (like "learning" or pattern matching) much faster than we can (the compute). Then language in LLMs is a bottleneck, the AI is constrained by the language, and thus if we want to scale further we could let AI create its own language (we would then have to translate whatever it creates back to a language we understand). It is the same for instance if we check the language of Inuit (people who live in the north and make temorary shelters like igloos in the snow) they have multiple words/verbs to describe the snow, while in English we only have one (?): snow. In English we don't need more words (we can explain snow state using multiple words) but for the Inuit language it makes sense to create these new terms (would also make it easier and faster to communicate). So in some sense, all languages are then "newspeak" to whatever a general language is what researches or AI might come up with. If this sounds dumb let me know, but if you know some research in this general language direction (I'd assume general AI research) would love to see it!
- GardenLetter27 4mo agoIt's not just the architecture but also the data - the decoder only approach lets you train in parallel over blocks of text (no RNN serial waiting), that allows you train on much, much more data.
- Gmolomo 4mo agoSooooo just because you are able to understand it, it's not worth anything? It doesn't has any impact? Ah wait it does. Mh weird. Why are you not creating a startup and get rich?
- sarjann 4mo agoI mean there is a little something called compute. And other complexity that comes like writing code to efficiently distribute a model across machines.
- crossroadsguy 4mo agoWhat hopes/paths does a mere CS bachelor (not deep into stats/maths), and mid level dev (native mobile only; 10-15 years exp.), have about not only understanding it (maybe not fully) but getting possibly into this as a career? Not expecting churning out models and AI systems from the first weeks/months but entry/employment into this field? (If I can be honest, and I am not being disparaging about anything lest it might seem so, I am looking at it from a career breakthrough/move perspective rather than an intellectual pursuit.)
- 2muchcoffeeman 4mo agoI think you need to ask what you actually want to do with the AI. If you want to be a researcher and come out with the next breakthrough, get ready to go back to school and learn some math. If you just need to learn how to use it well and build things with it, then you probably just need to have a high level understanding. Same as programming. I’d bet most programmers have no idea about the physics that makes computers work.
- sirsinsalot 4mo agoYou missed the third and most important reason to learn: fun. Which sums up HN these days.
- bluerooibos 4mo ago> I think you need to ask what you actually want to do with the AI. What about improving the efficiency of token consumption, etc., basically opportunities for improving cost/performance? I keep thinking there has to be a better way to share context with models than dumping entire gigantic skill files of raw text or otherwise into them - I'm betting there's a bunch of low-hanging fruit there.
- coliveira 4mo agoThere may be some low hanging fruit, but they're not available to people without deep understanding of how the math works. Well paid people already spend a lot of time thinking about this.
- firemelt 4mo agofucking well said
- lowken10 4mo ago[dead]
- golergka 4mo agoAfter building some toy LLMs on my own I came to realise that architecture is not the hard part. Train is.
- dist-epoch 4mo agoThat's easy to say AFTER you know the architecture. Einstein special relativity is taught these days in high-schools. Doesn't mean it wasn't the very hard part at some point in time. As they say, shoulders of giants.
- sesm 4mo agoI would argue that those are not emergent property of the model, but a property of how humans find insights in a plausible guess.
- bluerooibos 4mo agoSince you spent a month digging into this, can you recommend any materials/projects to look into to get a decent grasp of how they work?
- LatencyKills 4mo agoNot OP but I worked through Sebastian Raschka's "Build a Large Language Model (From Scratch)" [0] and Raj Abhijit Dandekar's "Build a DeepSeek Model (From Scratch)" [1] books. I don't think there is anything in a transformer I couldn't explain in the smallest detail now. [0]: https://www.amazon.com/Build-Large-Language-Model-Scratch/dp/B0DNR6TH6X https://www.amazon.com/Build-Large-Language-Model-Scratch/dp... [1]: https://www.amazon.com/Build-DeepSeek-Scratch-Abhijit-Dandekar-ebook/dp/B0GJ75VLPS https://www.amazon.com/Build-DeepSeek-Scratch-Abhijit-Dandek...
- hackinthebochs 4mo ago>I don't think there is anything in a transformer I couldn't explain in the smallest detail now. If you're up for it I would love to know how and why positional encodings work
- LatencyKills 4mo agoWell, as I suggested, working through the implementation yourself will give you that intuition. That said, I think the simplest way to explain why positional encodings are useful is that it gives the transformer just enough information to make attention meaningful without negatively impacting any parallel, content-based comparisons. A vanilla self-attention layer is just a set of token vectors. Without positional info, swapping two identical embeddings changes very little about what attention can compute. We can "fix" this problem by using positional encodings. Text that has meaning isn't just a set of characters; the location and order of those characters is what provides meaning.
- root-parent 4mo agoLearn about superposition and then you will see nobody really know why this stuff works. Its actually a good interview question to set the bar....
- coliveira 4mo agoDon't forget the stolen data from books and papers. You'll never get anything intelligent without using the stolen data they had access to.
- giardini 4mo agoWTF?
- dominotw 4mo ago> Over the next month I ended up drawing out a block diagram on a whiteboard I have in my office, with the math involved next to each step in the blackboard. I’d puzzle about each step along the way, and the triumph of completing the drawing was also that of this sense of deep understanding. I kept that drawing up for many months after, and would gaze at it often during meetings and idle moments in wonder. how did you know about the steps and there was math involved. i am curious about your process and you came up with what exactly to learn to unravel the mystery.
- root-parent 4mo agoI had the same reaction as you, when I learned in detail, how all this works. But then I also learned about superposition and compressed sensing, and now...I am not so sure anymore... "Beating Nyquist with Compressed Sensing" - https://youtu.be/A8W1I3mtjp8 https://youtu.be/A8W1I3mtjp8
- robwwilliams 4mo agoGreat, and won’t we all be just as surprised when human self-attentional control turns out to be just as simple or just as complex! Our minds as a strange fabric built of threads of recursions without the benefit of any explicit clock.
- forestsitter 4mo agoSame. I recall reading a paper by Stephen Wolfram after ChatGPT came out where he goes over how it works and what it does. Such a good piece and really got me going with this stuff. https://writings.stephenwolfram.com/2023/02/what-is-chatgpt-doing-and-why-does-it-work/ https://writings.stephenwolfram.com/2023/02/what-is-chatgpt-...