What AI Actually Is
How Large Language Models Actually Work (No Math Required)
How Large Language Models Actually Work (No Math Required)
Large language models (LLMs) — the technology behind ChatGPT, Claude, and Gemini — can feel like magic. They're not. Understanding the mechanics at a conceptual level, without a single equation, is enough to reason correctly about what these systems can and can't reliably do — which is exactly what you need before using them for testing work or testing them as a product.
It's a (Very Sophisticated) Next-Word Predictor
At its core, an LLM does one thing: given some text, predict the most likely next word (technically, "token" — a word or word-fragment). It was trained by reading enormous amounts of text from the internet, books, and code, learning statistical patterns of what words tend to follow other words in context. When you ask a question, the model isn't "looking up" an answer — it's generating, one token at a time, the sequence of tokens most statistically likely to follow your prompt, given everything it learned during training.
Why This Explains Both Its Power and Its Failures
This single mechanism explains a lot:
- Why it's fluent: it has seen an enormous amount of well-formed human writing, so its output reads naturally.
- Why it can reason surprisingly well: patterns of reasoning also appear in training text (worked math problems, debugging discussions, step-by-step explanations), so the model learns to imitate those patterns too.
- Why it can confidently state wrong facts: the model is optimizing for "what word plausibly comes next," not "what is true." A fluent, plausible-sounding wrong answer scores just as well, mechanically, as a correct one — this is the root cause of hallucination, which gets its own lesson later in this path.
Context Window: The Model's Working Memory
An LLM doesn't have persistent memory of past conversations by default — it only "sees" the text you've given it in the current prompt, called the context window. Everything the model knows about your specific situation has to be in that window: your question, any documents you've pasted in, and the conversation history so far. Once something scrolls out of the context window (in a long conversation) or was never included, the model genuinely cannot see it — it isn't being forgetful, it's architecturally blind to it.
Training vs. Inference
Two distinct phases matter for how you'll use these tools:
| Phase | What happens | Analogy |
|---|---|---|
| Training | The model learns patterns from a massive, fixed dataset — a slow, expensive, one-time (or periodic) process done by the AI company | Studying for years before an exam |
| Inference | The already-trained model generates a response to your specific prompt, in real time | Taking the exam — no new studying happens |
This matters practically: an LLM's knowledge is frozen at whatever point its training data ended (its "knowledge cutoff"), unless it's explicitly given fresh information in the prompt or connected to a live tool/search system.
The Practical Takeaway
An LLM is a powerful pattern-completion engine trained on human text, not a database with a search function or a reasoning engine with verified facts. Every technique in the next lesson — and every testing strategy in path 3 of this series — flows from taking that description literally rather than treating the model as an oracle.
💬 Discussion
Have you ever asked an AI tool a question and gotten a confident but wrong answer? Now that you understand next-token prediction, does that failure make more sense?
At the most basic mechanical level, what is an LLM doing when it generates a response?
Next Lesson
Generative AI vs. Traditional Software