Module 01 · Foundations

How LLMs Actually
Work

Before any prompt, any framework, any workflow — a writer needs the mental model. This is how large language models generate text, why the same prompt produces wildly different outputs, and what those mechanics mean for everything you'll write with AI afterwards.

Format: Theory + live demos Read time: 12 min Prerequisite: None — start here
On this page
  1. 01What an LLM actually does
  2. 02Tokens, not words
  3. 03Next-token prediction
  4. 04Attention & the Transformer
  5. 05The context window
  6. 06Why it's not "understanding"
  7. 07Why outputs vary
  8. 08Alignment & fine-tuning
  9. 09The live demo — bad vs good
  10. 10The three-pass editing workflow
  11. 11Common writer mistakes
  12. 12Key takeaways
01

What an LLM actually does

A large language model does one thing, and it does it over and over: it predicts the next token based on everything that came before. Not paragraphs. Not sentences. One token at a time, from left to right, until it decides to stop.

That's the whole trick. Everything else — the essays, the code, the FAQ sections, the product descriptions — is the compounding effect of one probability calculation repeated thousands of times.

The mental shift

Stop thinking of the model as a "writer." Think of it as a next-word probability engine that reads your prompt, computes what's statistically most likely to come next, picks a token, adds it to the context, and repeats. That shift changes how you write every prompt from here on.

02

Tokens, not words

The model does not see your sentence as words. It sees it as tokens — small chunks that can be whole words, fragments of words, or even punctuation. The English word "running" might be one token. The word "unbelievable" might split into three. Rare words and long names get chopped. Common ones stay whole.

A sentence broken into tokens
I want to build lean muscle fast.
I ⎵ want ⎵ to ⎵ build ⎵ lean ⎵ muscle ⎵ fast .
Eight content tokens plus spaces and punctuation. The model generates a response by predicting one of these at a time — never the whole sentence at once.

This is why output caps are measured in tokens, not words. It's also why constraints like "use bullets" or "keep it under 300 words" dramatically change generation — they shift which tokens become probable at each step.

03

Next-token prediction — in plain English

Here's how it works in a way you can demo to any student or client. Read this sentence and notice what your brain does:

"Going to the gym is good for your "
health42%
body28%
fitness14%
mind8%
wallet1%

Your brain predicted health, body, or fitness without thinking. The model does the same — except it's computing probabilities from every pattern it ever saw during training. It picks one, appends it, and asks the question again for the next position.

What this means for writers

If your prompt is vague, the model defaults to whatever is most common across billions of training examples. That's why generic prompts produce generic output. The model isn't being lazy — it's being statistical. Specific prompts narrow the probability space and make specific outputs more likely.

04

Attention & the Transformer — why it feels "smart"

Modern LLMs use an architecture called the Transformer, and its critical mechanism is attention. Attention is how the model decides, at every token, which earlier tokens matter most for predicting the next one.

If your prompt says "Write a blog intro for beginners about fat loss. Use plain English. Keep it under 120 words." — attention lets the model hold onto "beginners," "plain English," and "120 words" while it generates, instead of forgetting them by the third sentence.

MECHANISM 01

Attention weighs tokens

Every token in your prompt is given a weight for how much it should influence the next prediction. Constraints get high weights if they're stated clearly.

MECHANISM 02

Transformers stack attention

Multiple layers of attention run in parallel. This is how the model handles nested logic — a constraint inside a role inside a task.

MECHANISM 03

Position matters

Instructions placed at the start and end of a long prompt are remembered best. Middle-buried rules are the ones the model tends to ignore.

05

The context window — its short-term memory

The model has no memory outside the current conversation. Everything it uses to generate the next token — your prompt, its previous reply, any pasted research — has to fit inside a single context window, measured in tokens.

When the window fills up, older content gets pushed out. If you dumped your content brief at the start of a long session and then asked for an intro rewrite five hours later, the brief may no longer be in scope. The model will guess what the brief probably said — and guessing is where hallucinations begin.

The context rule

Anything the model needs must be in the current message or still inside the window. Treat the context window like working memory, not permanent storage. Re-paste critical constraints into every major prompt. Don't assume the model remembers what it "said earlier."

06

Why it's not real "understanding"

An LLM doesn't know anything the way a human does. It has no experience, no intuition, no way to verify. What it has is a vast statistical map of how language has been used — and that map lets it imitate understanding extraordinarily well.

This is both its superpower and its failure mode. The model can write a medical disclaimer that reads like it came from a hospital, and the same model can invent a citation that doesn't exist, in the same paragraph, with the same confidence. It's not lying. It's pattern-completing.

Writer's responsibility

Every factual claim, statistic, citation, date, legal detail, medical fact, or quoted source in AI-generated content gets verified by a human before publication. No exceptions. The model sounds confident even when it's fabricating. That's on you to catch.

07

Why outputs vary (even from the same prompt)

Run the same prompt twice and you'll get two different answers. That's not a bug. Two forces drive the variation:

FACTOR 01

Prompt quality

Vague prompts sit in a wide probability space. Many continuations are equally likely, so the model picks differently each time. Specific prompts narrow the space.

FACTOR 02

Temperature / sampling

Models use a randomness setting. Low temperature means "pick the most likely token almost every time." High temperature means "sometimes pick a less likely one for creativity."

For SEO writing, specificity is your temperature control. You can't always change the sampling settings of ChatGPT or Gemini in their consumer interfaces, but you can narrow the model's choices by how precisely you write the brief.

08

Alignment & fine-tuning

A base LLM trained only on raw text is useful but unruly. It might refuse to follow instructions, produce harmful content, or chase tangents. Alignment — extra training on human feedback — is what makes it follow instructions, stay on task, and behave safely.

This is why ChatGPT, Claude, and Gemini respond so differently to the same prompt. Same underlying architecture family, different alignment priorities. ChatGPT is conversational and eager. Claude is more literal and careful with structure. Gemini leans analytical.

Practical implication

Use each tool for what it does best. ChatGPT and Claude for drafting and creative restructuring. Perplexity for source-backed research. Gemini Deep Research for structured, citation-heavy intelligence gathering. The Multi-AI Research Stack in Module 05 builds on this.

09

The live demo — bad vs good prompt

All the theory above collapses into one practical skill: writing a prompt that narrows the probability space enough for the model to produce something specific and useful. The easiest way to see the difference is side by side.

Bad prompt
Too generic
Write a blog about gym routine for beginners.
What happens: No audience specified. No goal. No format. No constraints. The model falls back to the most common "beginner gym routine" content across its training data. Result: generic, mixed advice. Reads like every other fitness blog on page one of Google.
Good prompt
Specific brief
Write a beginner gym routine for a 27-year-old male, 69kg, goal: fat loss + lean muscle. 4 days/week, 45 minutes/session, no injuries, basic gym available. Format: • short intro (2–3 lines) • weekly schedule table • each day: exercises + sets/reps + rest time • 5 beginner mistakes to avoid Tone: simple, direct. No fluff.
What happens: Audience, goal, frequency, duration, equipment, constraints, structure, and tone all specified. The probability space collapses around this person and this plan. The output becomes specific and usable on the first generation.

The difference is not sophistication. It's constraint density. The second prompt tells the model exactly which probability branches to eliminate — and leaves it with a narrow path that produces a publishable draft.

10

The three-pass editing workflow

Once you understand how the model works, how you use it changes. The fastest writers don't ask for finished articles. They run the model three times, with three different goals.

Structure pass

Ask for the outline only. H1, H2s, H3s, FAQ headings, and a one-line intent statement per section. No prose. Fix the skeleton before touching flesh.

Draft pass

Take the approved outline and ask for one section at a time. Feed each H2 individually with its guideline bullets. Let the model expand, not invent.

Polish pass

Go back through section by section. Tighten, simplify, fact-check, and match brand voice. This is where a human editor earns the byline.

Three small, focused prompts always outperform one big "write me the whole article" request. Each pass uses the model for what it's good at — and keeps the writer in control of the decisions that matter.

11

Common writer mistakes (and how to avoid them)

These are the seven patterns I watch writers fall into when they start using AI seriously. Each one traces back to a misunderstanding of something in this module.

12

Key takeaways

If you remember nothing else from this module, remember these twelve lines. Everything else in the system is built on them.

Foundations, distilled

The twelve-line mental model
  1. An LLM predicts the next token, one at a time, based on everything before it.
  2. Tokens are not words. They are small chunks — sometimes sub-words, sometimes punctuation.
  3. Vague prompts land in a wide probability space and produce generic output.
  4. Attention decides which parts of your prompt the model cares about most.
  5. Instructions at the start and end of a long prompt are remembered better than middle ones.
  6. The model only uses what's in its context window. Outside the window, it guesses.
  7. The model does not understand anything. It pattern-completes convincingly.
  8. Verify every factual claim. The model will be confidently wrong — it's not lying, it's generating.
  9. Specificity is your temperature control. Narrow the prompt, narrow the output.
  10. Different models have different alignment. Use each for what it's best at.
  11. Run the model in three passes: structure, draft, polish. Never all at once.
  12. Garbage prompt → garbage draft. Clear input is the entire game.
Next

Now that the mental model is in place, Module 02 turns it into a repeatable prompt framework — the CCRFTA architecture: Context, Constraints, Role, Format, Task, Attributes. Every prompt in this system is built on it.