02

How AI Thinks

Pattern recognition, tokens, and the loop behind every response

Think about how easy it can be to tell one creator apart from another once you’ve spent some time with their work. In film, a Quentin Tarantino scene looks and feels nothing like a Christopher Nolan scene. Tarantino leans on long stretches of witty dialogue and sudden, over-the-top violence, while Nolan builds intricate puzzles with booming soundtracks and timelines that fold in on themselves. In music, Taylor Swift’s storytelling lyrics and big emotional bridges stand in sharp contrast to Billie Eilish’s whispery vocals and stripped-down, moody beats. On the basketball court, Steph Curry’s game is defined by lightning-quick three-point shots from impossible distances, while LeBron James dominates with his physicality, court vision, and versatility.

The same is true in everyday life. You probably don’t need to see a signature to know whose handwriting is on the page — one friend loops their letters dramatically, another prints in blocky all caps. Even in texting, fingerprints appear: some friends never use punctuation, others end every sentence with an exclamation point, and still others can’t resist tossing in a string of emojis.

What makes these styles recognizable isn’t just exposure — it’s also a bit of process knowledge. You know that Tarantino’s movies unfold through dialogue-heavy scenes, that Eilish crafts atmosphere with minimal production, that Curry redefined basketball spacing by shooting from deep. The more familiar you are with both the patterns and the processes behind the work, the easier it becomes to spot who — or what — is behind it.

AI-generated writing is no different. Just as artists, athletes, and even your friends leave behind stylistic fingerprints, AI does too. To recognize them, you need to understand a little about how AI “thinks” and a little about what patterns to look for. This chapter will help you do both.

By the end of this chapter, you should be able to:

  1. Describe, in plain language, how generative AI models “think” by predicting patterns.
  2. Explain the difference between human understanding and AI pattern recognition.
  3. Identify common features and “fingerprints” of AI-generated content.
  4. Apply strategies to critically evaluate whether text is likely written by a human or AI.
  5. Reflect on the limits of AI’s “thinking” and what that means for human creativity and judgment.

Does AI Think?

So how does AI actually “think”? The answer is both simple and surprising: it doesn’t think the way people do at all. Instead of forming ideas, experiences, or emotions, generative AI builds everything out of . When you type a question or request into a system like ChatGPT, the model doesn’t pause to reflect. It immediately begins scanning for the most likely way to continue the text, much like finishing a sentence you’ve heard a thousand times before.

In a sense, people do this too. Our brains rely on patterns when we form words, sentences, and even social habits. But humans combine patterns with memory, motivation, and lived experience, which allows us to improvise, invent, or even break patterns on purpose. AI, by contrast, is locked into statistical prediction: it draws only from what is most probable given the context of the input we provide it.

When you ask an AI something, the first thing it does is split your words into pieces called . Think of tokens as puzzle pieces that the model uses to assemble its response. Take the request: “Explain the U.S. Constitution in simple terms.” Instead of treating this as one whole sentence, the AI slices it into smaller units: “Explain” (one token), “the” (another), “U.S.” (split into “U” and “S” with punctuation as its own tokens), “Constitution” (often broken into chunks like “Con-” and “-stitution”), “in”, “simple”, “terms”, and even the period at the end.

Once your sentence is tokenized, the model consults what it learned during training to score thousands of possible next tokens. It looks back over the recent tokens in its short-term “context window” — you can think of this like working memory — and uses an internal weighting system to decide which parts of the prompt matter most right now. Then it assigns probabilities, selects one token, adds it to the end, and immediately repeats the process for the next token. This is not copy-and-paste from a database; it’s on-the-fly composition driven by likelihoods.

Settings like can nudge that behavior: lower values keep choices conservative and predictable, higher values encourage more surprising — but also riskier — picks. The whole loop — weigh context, score options, choose a token — happens again and again until a full answer emerges. Understanding this loop helps you anticipate both AI’s strengths (fluent, on-topic prose) and its weaknesses (it may confidently choose a likely-sounding token that’s factually wrong). Equally important, understanding the loop makes the controls explicit: adjust temperature for risk and surprise, specify your instructions to shape style and form, and ask AI to anchor its statements to sources to prevent drift.


Tokens in Action

The workbook below takes you through the full generation loop — tokens, meaning, attention, temperature, and guided choice — using a single sentence as your through-line. Work through each step in order, run the AI panels, and record your observations. You’ll compile everything into a printable summary at the end.

Tokens in Action: Exploring the River Bank

Work through five concept checkpoints. At each step you'll read a short explanation, then record your own observations. Complete all five to generate a printable summary of your thinking.

How to use this workbook

Before you begin

Move step by step Use the Next and Back buttons, or click any tab in the progress bar above to jump to that section.
Type directly into every field All text boxes are editable. Nothing is saved to a server — work at your own pace.
The AI is built in — no tab-switching Each step has a live AI panel. Run prompts right here, read the output, then record your observations below.
Generate your summary at the end When you finish Step 5, click Build My Summary to compile everything. Then print or copy your responses.
Your work stays on your screen only Nothing you type is sent anywhere. If you close or refresh the page before exporting, your responses will be lost.

Tokens — The Building Blocks

How AI reads your words

The base sentence for this workbook

“I want to explore a deposit at the river bank.”

Before the model can respond, it splits your text into tokens — small pieces like words, sub-words, and punctuation. In most modern tokenizers, the space before a word is bundled into that word’s token, not left behind. Every non-first token carries its own leading space — shown here as :

I ␣want ␣to ␣explore ␣a ␣deposit ␣at ␣the ␣river ␣bank .

Every token above carries that leading space — but ␣bank is the one that matters here. As a standalone token, bank sits between two : financial (savings, teller, account) and geographical (riverbank, sediment, current). That ambiguity is still live. But if you wrote riverbank (no space), the tokenizer merges it into a single unit — one whose training context is overwhelmingly geographical — and the financial reading effectively disappears.

Why this matters: Generation happens one token at a time, not one idea at a time. Small surface choices — even a single space — can tilt the model before any "big" idea is formed.

Does removing the space change the continuation?
Version A — “river bank”
Output will appear here after you click Run.
Version B — “riverbank”
Output will appear here after you click Run.

Think about which meaning of bank and deposit each version leaned toward, and why a single compound token shifts the model’s direction.

Meaning Map — Neighborhoods of Sense

How context pulls a word toward one meaning

Each token gets turned into an embedding — a set of numbers that place it at a coordinate on a map of meaning. Words used in similar contexts land near each other; words used differently drift apart. Because some words appear in multiple kinds of contexts, their embeddings sit close to more than one — that’s how the model keeps multiple senses alive until nearby clues tip the scales.

Finance cluster

deposit · account · teller · branch · balance · ATM · interest · mortgage · overdraft

Water / Earth cluster

deposit · sediment · gravel · silt · erosion · delta · riverbank · floodplain · current

Notice deposit appears in both lists. That overlap is exactly where ambiguity lives. Context — the words around it — exerts gravity that pulls the model toward one neighborhood or the other:

  • With “river ␣bank”, the word river exerts gravity toward the water/earth neighborhood.
  • Add “teller” or “savings account”, and gravity flips toward finance.
  • Write “riverbank” (no space) and the geographic pull strengthens further.
Test meaning-map gravity — which cluster wins?
Geology anchor
Output will appear here after you click Run.
Finance anchor
Output will appear here after you click Run.

Pick out specific vocabulary from the output — sediment, silt, floodplain, etc. — and explain why those words appeared.

Same base sentence, very different gravity — what shifted, and why?

Attention — The Moving Spotlight

Which clues matter right now?

The model doesn’t weigh every earlier word equally. Attention works like movable spotlights: for each new token, the model shines them on the most relevant earlier tokens. Multiple spotlights can be on at once, and they can jump back far to pick up a crucial cue.

Adding a single clause to our base sentence shifts the spotlights noticeably:

“… focusing on recent erosion.” Spotlight: river, bank, erosion → geology sense rises
“… then open a new savings account.” Spotlight: deposit, savings, account → finance sense rises
“… collecting samples for a lab report.” Spotlight: explore, deposit, samples, lab → geology again
“… before meeting a teller.” Spotlight: teller → finance again

Practical takeaway: Later, stronger cues often win for the next token — but durable instructions (audience, tone) keep their own steady spotlight across the whole response.

Run each style below, then paste one representative phrase from each output into the fields underneath.

Three styles — which spotlight does each activate?
Field-note
Output will appear here after you click Run.
News brief
Output will appear here after you click Run.
Infomercial
Output will appear here after you click Run.

Temperature — Steadiness vs. Novelty

Steering between predictable and surprising

Temperature is a dial for how adventurous the model’s next-token choices will be. Turn it down and the model favors safer, more common continuations — steady phrasing, familiar collocations, fewer surprises. Turn it up and it’s more willing to pick rarer, less expected continuations — fresh images, unusual word pairings, occasional drift.

Using our river bank prompt, notice how temperature changes the style even when the meaning stays anchored:

Low “I want to explore a deposit at the river bank, focusing on recent erosion and documenting the sediment layers.” Plain, predictable, on-task.
Medium “… where last week’s flood left bands of silt I can log in my notes.” More texture and specificity, still controlled.
High “… where the flood stitched gray ribbons into the shore and the sand keeps the storm’s aftertaste.” Vivid, less common phrasing; higher risk of wandering.

If your tool hides temperature: You can approximate it with instructions. Low proxy: “Use plain, concise language. Avoid figurative wording.” High proxy: “Use vivid, surprising imagery and uncommon comparisons. Avoid clichés.”

Run both prompts below — same topic, different style instructions. Then paste one sentence from each output into the fields underneath.

Style instruction as temperature proxy
Steady — plain language
Output will appear here after you click Run.
Surprising — vivid imagery
Output will appear here after you click Run.

Guided Choice — Putting the Loop Together

Map → Spotlight → Choose

Generation is a fast, repeating loop: the model maps your words to neighborhoods of meaning, shines attention spotlights on the most relevant cues, then chooses the next token — more conservatively when temperature is low, more adventurously when it’s high. Then it repeats.

What each lever actually steers:

Anchors & examples Pick the lane — geology vs. finance, formal vs. casual — and imprint structure
Instructions Hold tone and format steady across the whole response
Temperature Shape the style within that lane — plain vs. vivid, safe vs. surprising

Key idea: The loop doesn’t guess in a vacuum. Your words set the neighborhoods, your instructions fix the spotlight’s priorities, and your temperature decides how cautiously or creatively the model speaks while staying in the lane you chose.

Design your own prompt — use all three levers

Start with the river bank sentence, then add: an anchor (pick geology or finance), an instruction (set tone and format), and a style hint (plain vs. vivid). Replace the placeholder below.

Your output will appear here after you click Test My Prompt.

Automatically recorded when you click Test My Prompt. Read-only.

Try to describe all three in a few sentences — what each one controls and how they interact.

Step 6

Your Completed Workbook

Ready to save or share.

How "riverbank" (no space) changes predictions
Geology anchor — which tokens shift and why
Finance anchor — how the continuation changes
Field-note style — representative phrase
News brief style — representative phrase
Infomercial script style — representative phrase
Observations — what cues the model latched onto
Sentence from the Steady output
Sentence from the Surprising output
When you'd choose each setting
My prompt
How anchors, attention, and temperature interact
One thing I'll do differently when prompting
To save as PDF Click Print / Save as PDF, then in the print dialog choose Save as PDF (or “Microsoft Print to PDF” on Windows). The workbook prints cleanly without navigation buttons.

More Than Autocomplete


From Fingerprints to Fair Use

AI models are fine-tuned on examples of prompts and preferred responses, then further shaped by human feedback. That is why instructions like “use plain language,” “write in a field-note style,” or “keep it to 3–4 sentences” often stay in place across a full response. The model has learned to treat those instructions as high-priority signals.

This is one reason AI can be such a useful tool — it can match tone, follow format, and stay organized. But it is also where you need to be careful. A response can sound polished, look well-structured, and still be incomplete or wrong. AI can reproduce the pattern of a strong answer without actually giving one. That is one reason hallucination happens, and it is exactly why understanding pattern recognition matters. The more you understand the process, the better you get at noticing when something only sounds right.

These mechanics also help explain why AI writing can leave . Depending on the prompt and the model, you may notice things like even pacing, tidy topic sentences, smooth transitions, balanced structure, and polite hedging (“Here are a few ways…”). If the settings allow more variation, the wording may become more vivid or unexpected, but the overall rhythm may still feel consistent. Human writers can use these same features too — the point is not that one trait proves anything. The point is that a cluster of traits can form a pattern.

Because AI writing often shows recurring patterns, try to flag them. Some look at surface features like consistency, repetition, or sentence rhythm; others claim to use deeper statistical signals. Use these tools carefully. They can be wrong in both directions: they may flag human writing as AI-generated (a false positive), or miss AI-assisted writing entirely (a false negative). No detector can give a perfect answer every time. Since college instructors use these tools as a first line of defense against AI-driven plagiarism, you need to be aware of these patterns.

That is why the best approach is triangulation. Look at the writing itself. Use your own judgment. Do not let a tool do all the thinking for you.

Finally, a word about ethics. If you use AI as a collaborator, transparency should be your starting point. Follow your instructor’s or institution’s guidelines. Cite sources. Be honest about how you used AI. And take responsibility for the final version of your work. Treating AI as a partner means more than getting useful output — it means understanding how AI generates language, recognizing its patterns, checking it when it is confidently wrong, and making thoughtful choices about when and how to use it.


Dig Deeper

On tokenization — how models break text into pieces and why those pieces shape what the model can do: Hugging Face. (n.d.). Tokenizers. NLP Course. huggingface.co/learn/nlp-course/chapter6/1

On word embeddings and how models represent meaning as spatial relationships — the foundation of the “meaning map” concept explored in this chapter: Alammar, J. (2019). The illustrated Word2Vec. jalammar.github.io/illustrated-word2vec/

On the attention mechanism — how models decide which parts of your input matter most when generating each word: Alammar, J. (2018). The illustrated transformer. jalammar.github.io/illustrated-transformer/

On temperature, sampling strategies, and how decoding settings shape the style and risk level of AI-generated text: Holtzman, A., Buys, J., Du, L., Forbes, M., & Choi, Y. (2020). The curious case of neural text degeneration. Proceedings of ICLR 2020. arxiv.org/abs/1904.09751

On how people perceive and attempt to detect AI-generated writing — and why fluent text is not the same as trustworthy text: Jakesch, M., Hancock, J.T., & Naaman, M. (2023). Human heuristics for AI-generated language are flawed. Proceedings of the National Academy of Sciences, 120(11), e2208839120. doi.org/10.1073/pnas.2208839120

On the limitations of AI detection tools, including false positive rates and the challenges of distinguishing human from machine-generated text: Sadasivan, V.S., Kumar, A., Balasubramanian, S., Wang, W., & Feizi, S. (2024). Can AI-generated text be reliably detected? arXiv preprint. arxiv.org/abs/2303.11156

On how instruction tuning and human feedback shape the way models follow directions and produce the polished, compliant tone discussed in this chapter: Ouyang, L., Wu, J., Jiang, X., Almeida, D., Wainwright, C., Mishkin, P., et al. (2022). Training language models to follow instructions with human feedback. Advances in Neural Information Processing Systems, 35. arxiv.org/abs/2203.02155