Grace Ann Hansen's Substack

Grace Ann Hansen's Substack

AI for Everybody - Lesson 8

How a Language Model Actually Works: The Prediction Game

Grace Ann Hansen's avatar
Grace Ann Hansen
Jul 07, 2026
∙ Paid
Image by Grace Ann Hansen using NANO BANANA 2

Watch a chatbot answer you sometime. The text streams in. Word by word, or sometimes a piece at a time, never quite all at once. The stream is not a transcription of a finished answer the system has already composed. The stream is the system, in real time, doing exactly one thing: predicting what comes next.

That one thing is the engine of every generative language model on the market. Not metaphorically, not loosely, but in the actual technical sense of what the program is doing at each step. The job is to guess the next token. Then guess the next one. Then the next. ChatGPT, Claude, Gemini, the autocomplete in Gmail, the half-line of code that pops up in Copilot, the suggestion that appears under what you are typing on your phone: all the same operation, applied at different scales, in different products, to different vocabularies, and with different amounts of context. The mechanism, end to end, is shorter than any of the systems built on top of it.

This lesson opens the engine and walks through the prediction game in plain English. By the end you will know what the model is doing every time you watch it write a sentence. The rest of Part 2 builds out from this one operation.

Grace Ann Hansen's Substack is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.

User's avatar

Continue reading this post for free, courtesy of Grace Ann Hansen.

Or purchase a paid subscription.
© 2026 Grace Ann Hansen LLC · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture