How LLMs Actually Work
Transcript
The program that just wrote an entire essay in ten seconds doesn't know what a single word inside it means. It has no idea what "love" is, no concept of "death," has never once seen a sky. And yet, if you ask it to write a poem about the sky, it might hand you something that genuinely moves you. How does a machine seem this intelligent without understanding a word of what it's saying? The answer isn't magic, isn't a conspiracy, and there's no hidden "mind" tucked inside the computer. It's a story spanning roughly seventy years, four separate breakthroughs stacked one on top of the other, and a lesson science learned the hard way: that intelligence, it turns out, might not need any understanding at all to look like intelligence.
The term "artificial intelligence" was born in nineteen fifty-six, at a summer conference at Dartmouth College, where a handful of scientists promised that within a single generation, machines would think like humans. They were wrong — not by a little, but by decades — and yet the term stuck. For decades, "artificial intelligence" meant something very specific: programs built on thousands of rules, written by hand by human experts. A medical diagnosis system, for instance, might have rules like "if the patient has a fever, a cough, and chest pain, then pneumonia is the most likely diagnosis." Every new case meant a new rule, written by some expert. The machine didn't "learn" anything — it simply, faithfully executed whatever a human had told it in advance.
This approach had one fatal flaw: the real world has far too many exceptions to write them all down as rules. The whole enterprise collapsed completely, not once but twice — once in the mid-nineteen-seventies, once in the late nineteen-eighties — as promises far outran results, funding dried up, and enthusiasm turned into public ridicule. Researchers in the field themselves named these collapses the "AI winters." If someone had said in nineteen ninety that within thirty years machines would be writing essays and poems, most researchers in the field would have laughed bitterly — they'd heard it before, and been disappointed before, more than once. What finally changed everything wasn't a smarter idea. It was a completely different philosophy.
Instead of writing the rules yourself, you let the machine discover them on its own. That's machine learning — a subset of artificial intelligence, not a synonym for it. Imagine trying to teach someone to draw dogs, but you can't explain in words what makes a dog a "dog." Instead, you show them thousands of photographs, they try, and you just tell them "closer" or "further" — without ever explaining why. You do this millions of times, with small corrections each time. Eventually they draw perfect dogs, but you never once explained what a dog actually is. Scientists call this correction process gradient descent — the model descends an invisible hill of error, blindly, feeling out each time which direction goes a little further down.
Within machine learning there are many different techniques, old and new. The one that ultimately beat all the others is called deep learning — and "deep" here doesn't mean smart, it literally means many layers. A neural network is built in layers: the first learns to recognize simple edges and lines within an image, the next combines those edges into shapes — an eye, an ear — and the next combines those shapes into whole objects, like a face or a dog. No one programs these layers explicitly; they emerge on their own through the same correction process described above. The problem was that deep learning needed something that wasn't yet easily available: a massive volume of data and massive computing power. Without both, a neural network would lose even to simpler, older techniques.
In two thousand twelve, fifty-six years after the Dartmouth conference, a neural network called AlexNet swept an international image-recognition competition by a margin no one expected — using, for the first time at this scale, graphics cards originally built for video games. That moment confirmed something researcher Richard Sutton would later write down as AI's "bitter lesson": for decades, scientists tried to "build in" clever tricks and human knowledge into their systems. Again and again, though, what ultimately won wasn't clever design — it was simply more data and more computing power. AlexNet wasn't conceptually novel; it was just big enough, at the right moment, with the right fuel.
Five years later, in two thousand seventeen, researchers at Google published a paper titled "Attention Is All You Need." It introduced a new architecture, the transformer, destined to become the beating heart of every LLM today. The idea can be explained with no math at all: when you read the sentence "the river had risen so much it broke its bank," your brain pays "attention" to specific earlier words — river, risen — to figure out that "bank" here means a riverbank, not a financial one. That's exactly what the attention mechanism does mathematically: it decides which earlier words are relevant to each new word it processes. It's the final piece of the hierarchy — artificial intelligence, machine learning, deep learning, and now transformers, the architecture behind every language model you know.
Before reaching that point, every word gets converted into a vector — a list of a few hundred numbers representing where that concept "sits" inside an imaginary space. Words with similar meaning end up as nearby vectors. The most famous example, almost magical the first time you see it: take the vector for "king," subtract "man," add "woman," and the result lands very close to the vector for "queen." No word was ever explicitly taught that relationship — it emerged on its own, from how words appear together across billions of sentences. So there is no line of code anywhere that says "understand the meaning." Whatever looks like understanding is the result of geometry over numbers, applied at a monstrous scale.
And what exactly does an LLM do with all this? One single thing, seemingly trivial: it predicts the next word. Given everything written so far, it computes a probability for every possible next word — "the sun..." might give forty percent to "shines," twenty percent to "rises," and so on — and then picks one, not always the most likely one. That's why the same question gives a slightly different answer every time. The model was trained doing exactly this prediction billions of times, over nearly the entire written text of the internet. And somewhere inside that monstrous scale, abilities emerged that no one explicitly programmed — explaining code, reasoning step by step, writing poetry. Abilities no one fully expected, not even the people who built it.
In two thousand twenty-two, Google researchers published a study on exactly this phenomenon. They tested models of different sizes on three-digit addition. The smaller models failed almost completely — close to random guessing. In the larger ones, success didn't climb gradually; it shot up suddenly, as if a switch had flipped. There was no in-between stage of "moderately good at addition" — either it couldn't do it at all, or it could. Researchers called this "emergent abilities": traits that don't exist at all in smaller models and suddenly appear at a specific scale, impossible to predict just by extending the curve from smaller ones. It means no one can be certain what the next, larger model will be able to do — an ability might be completely absent today and appear overnight tomorrow.
The same unpredictable nature that makes it hard to know what a model will be able to do also makes it hard to know when it will answer you wrong with total confidence. The logic behind it is the same one we saw earlier — predicting probability, not searching for truth. The model's core engine has no internal sense of what's true; it simply produces the most probable next word, based on the patterns it learned. Today many tools soften this by letting the model search the web before answering, but that doesn't change the underlying behavior — it just gives it better material to work with. When the search is missing, fails, or the model itself combines what it found incorrectly, the same habit remains: it doesn't stop and say "I don't know" — it keeps answering with the same confidence, even when something in the answer simply doesn't exist in reality. Researchers call this "hallucination" — the exact same mechanism that writes a stunning poem can write a citation that never existed, in the same confident tone.
And all of this happens at a scale that's hard to even imagine. Llama 3, one of Meta's major open models, was trained on fifteen trillion word-fragments, or "tokens." If you read eight hours a day, it would take you thousands of years to read as much text as this model "saw" just once during its training — text covering nearly the entire open internet, across dozens of languages. OpenAI's own CEO, Sam Altman, has publicly stated that training a GPT-4-class model cost more than one hundred million dollars — a single training run, thousands of graphics cards running continuously for months. And all of that, remember, just to teach the model one single thing: how to guess the next word.
This scale has one very real, ongoing consequence: electricity. In two thousand twenty-four, Microsoft signed a twenty-year agreement with Constellation Energy to restart a reactor at the Three Mile Island nuclear plant — yes, the same plant that made history for its nineteen seventy-nine accident — dedicated entirely to powering AI data centers. Constellation is investing more than one billion dollars in the restart. Around the same time, Google and Amazon separately signed deals for small nuclear reactors dedicated exclusively to their own data centers. The companies that gave us ChatGPT aren't just chasing better algorithms anymore — they're chasing nuclear power plants.
And beyond the cost, there's the payoff. A Microsoft Research study on GitHub Copilot, a programming assistant tool, measured developers completing a specific task fifty-five percent faster when using it — on objective stopwatches, not impressions. In practice, many developers working daily with today's "agent" tools describe multiples of that productivity gain in their own day-to-day work, especially on repetitive tasks. It's no longer a tool that "helps a little" — it's changing what the work itself looks like. And programming isn't the only field. The same question — how deeply will this change every profession, not just code — is already open in medicine, law, education, nearly anywhere there's text or data to process.
The most striking example, though, has nothing to do with text at all. Biology struggled for more than fifty years with the so-called "protein folding problem" — how do you predict a protein's three-dimensional shape just from its chain of amino acids, a shape that determines almost everything the protein does. In two thousand twenty, a deep-learning system from DeepMind called AlphaFold solved this problem with accuracy comparable to experimental methods — now predicting the structure of nearly two hundred million known proteins, essentially everything science has ever catalogued. In two thousand twenty-four, its creators, Demis Hassabis and John Jumper, were awarded the Nobel Prize in Chemistry — a rare case of an artificial-intelligence tool winning the highest prize in an entirely different scientific field. Researchers are already using it to better understand antibiotic resistance in bacteria and to design enzymes that break down plastic.
And the newest frontier isn't even on a screen — it's in a body. The startup Figure is partnering with OpenAI so the same kind of model that understands language can now control a humanoid robot. In one demonstration, the robot learned to make coffee with a pod machine in just ten hours of training — recognizing and handling objects it had never seen before, with no one programming specifically for them. In China, the company Unitree already sells a humanoid robot for around sixteen thousand dollars, far cheaper than anyone expected just a few years ago. Until recently, robots were "dumb but expensive" — programmed explicitly for one single job, like on a factory line. Now, putting an LLM-style "mind" inside them, they're starting to generalize to situations they've never seen before — exactly the way a piece of ChatGPT text generalizes to a question it's never seen before.
Imagine, for a moment, where this could lead: a world where no bedridden person is ever left alone, where the most tedious jobs have disappeared, where diseases get solved at the same pace AlphaFold solved a fifty-year-old biological puzzle. It's one possible future — not science fiction, but not a certainty either. Standing right next to it are equally real, open questions: who pays for the electricity, who controls the nuclear plants powering it, which jobs get lost along the way to that future. And yet, the next time a machine like this answers you with total confidence, remember the strangest part of everything you just heard: behind every word it said, there is no awareness hiding, no meaning, nothing at all. And it didn't need any of that, to convince you completely of the opposite.