Inside a Language Model
Applied AI Engineering · Inside a Language Model · Unit 1 of 1
AI Engineering2026-06-303 min readBerlin, Germany

What an LLM Actually Is

What an LLM Actually Is
Said Mustafa SaidAI/ML & Cloud Engineer

You can use a language model for months and never know what it does. You will still ship things. Then one day it invents a function that does not exist, contradicts itself, or ignores a plain instruction, and you have no idea why. So we start at the engine.

A large language model does one thing. It predicts the next token. Chat, code, agents, the whole field is that one trick run in a loop. There is no second mechanism hiding behind it.

TL;DR: An LLM takes text, breaks it into tokens, and scores every token that could come next. A runtime picks one, adds it to the text, and runs the model again. A chat reply is that loop, a few hundred times over.

What It Is

To a researcher a model is an architecture and a training run. To you it is simpler. A model is a frozen function. Text goes in, probabilities come out. It does not learn while you use it. It does not remember your last call. You hand it text, it hands back a guess at what comes next, and it forgets you.

A token is a chunk of text, roughly a word or a piece of one. The model has a fixed vocabulary of them, maybe a hundred thousand. On every step it scores all of them and tells you how likely each one is to come next, given everything so far.

How It Works

Send it The capital of France is. The model does not look the answer up the way a database would. It scores every token in its vocabulary for how well it fits next. Paris scores high. A sampler picks it, adds it to the text, and the whole string runs through the model again for the token after that. It stops when it emits an end signal.

Rendering diagram…

That loop is the whole engine. A reply is not computed in one shot. It is this step run a few hundred times, each token drawn from a fresh score.

Why "Just Autocomplete" Misses It

The smart objection writes itself. So it is glorified autocomplete. Mechanically, yes. But look at what the word just is hiding. To predict the next token well across everything people have written, code, contracts, arguments, jokes, the model is forced to carry grammar, facts, and the shape of reasoning inside it. The rule is trivial. Meeting it is not. Simple rule, complex result. Every later chapter in this course is a way to steer this one loop.

Task: open any chat model and send it a line that stops partway, like The opposite of hot is. Watch it finish the token. You just ran the engine by hand.

Concept Check 1

What does a language model compute on each step?

Concept Check 2

Why is calling an LLM 'just autocomplete' true but misleading?