An LLM is a machine that predicts the next word

That’s it. That’s the whole trick. Everything else - writing code, answering questions, drafting emails - falls out of doing that one thing extremely well, billions of times over.

Alt text

The key parts, in plain language:

Where the knowledge comes from

Nobody taught it grammar or facts by hand. It was shown an enormous amount of text - books, websites, code - with words hidden, and asked to guess them. Get it wrong, adjust slightly. Repeat trillions of times. To guess well, it had to absorb spelling, grammar, facts, tone, reasoning patterns. Prediction was the exercise; understanding-ish behaviour was the side effect.

How you get whole answers

It picks a word, adds it to the sentence, then predicts the next one, over and over. Your question is just the opening - it keeps completing until it decides it’s done.

Why it makes things up

It’s always producing the most plausible-sounding continuation, not looking anything up. “Plausible” and “true” usually overlap. Sometimes they don’t - and it sounds equally confident either way.

An analogy that holds up well: it’s like someone who has read every book in the world but remembers none of them specifically - only a deep instinct for how sentences tend to go. Ask them anything and they’ll answer fluently from that instinct. Usually right. Occasionally confidently wrong.