What is LLM: The Nature of Language Models
What large language models actually are: probabilistic token predictors, not databases or reasoning engines, and why the distinction matters.
You can use ChatGPT, Claude, or Cursor every day and still give a fuzzy answer when someone asks, “What exactly is a large language model?”
That fuzziness matters more than people admit. If your mental model is basically “super-autocomplete, but somehow intelligent,” you will keep expecting the wrong things from it. You will trust it in the wrong places. You will build systems on top of half-true metaphors.
This article is not about hype or product vibes. It is about getting the underlying mental model straight enough that the later engineering decisions stop feeling mystical.
Tokens, Not Words
LLMs do not process text the way you and I do. They do not see words, sentences, or paragraphs. They see tokens, roughly a word or subword unit:
1
2
"The quick brown fox" → ["The", " quick", " brown", " fox"]
"unbelievable" → ["un", "believ", "able"]
Tokens are what the model predicts. Everything an LLM does, reasoning, coding, analysis, all of it, reduces to predicting the next token in a sequence. If you were reading this sentence one token at a time, constantly guessing what comes next, you’d be doing what an LLM does.
Probability Is the Whole Engine
The mechanism is simple:
1
2
3
4
5
6
7
Given: "The cat sat on the"
LLM predicts:
- "mat" (probability: 0.42)
- "floor" (probability: 0.23)
- "couch" (probability: 0.15)
- "table" (probability: 0.08)
- ... (other tokens)
The model doesn’t “know” anything in the traditional sense. It has learned statistical patterns from its training data, and when it generates text, it’s sampling from a probability distribution over tokens. LLMs are probabilistic inference engines, not databases or deterministic programs.
The whole operation reduces to one thing applied recursively: P(next_token | all_previous_tokens). No search, no retrieval, no logic trees. Just conditional probability.
But stack enough layers of neural networks and train on enough data, and something unexpected emerges. The model appears to reason. It can answer questions it’s never seen, write code in languages it wasn’t explicitly taught, translate between languages without parallel training data, solve math problems (sometimes). This is emergent behavior: capabilities arising from scale and training, not from explicit programming.
Why LLMs Seem to Think
When you ask a model a complex question and get a thoughtful response, it feels like it’s thinking. What’s actually happening is that it has learned patterns of reasoning from millions of examples: questions followed by answers, problems followed by solutions, premises followed by conclusions. It doesn’t understand the content. It understands the structure of reasoning.
If you memorized every conversation ever published, you could participate in conversations without truly understanding them. You’d just be matching patterns. That’s the useful analogy here:
LLMs simulate understanding through pattern matching. They don’t have internal models of the world.
When a human reads “the cat sat on the mat,” we activate a mental model: we can imagine the cat, the mat, the room. We have grounded understanding. When an LLM processes the same sentence, it activates statistical associations. It knows “cat” often appears near “mat,” “sat,” “floor,” “meow.” There’s no internal representation of what a cat actually is. This distinction is what tells us what LLMs are good at and what they’re not.
What LLMs Are Not
Not a database. You cannot rely on an LLM for factual accuracy. It doesn’t retrieve facts, it generates them based on patterns. Asking “What’s the capital of France?” implies retrieval, but what’s actually happening is closer to: given the pattern “capital of France is,” what continuation is most probable? The answer is usually right because “Paris” dominates that pattern in the training data, not because the model looked anything up. This is why LLMs hallucinate. They’re not buggy databases, they’re probabilistic generators.
Not a program. Traditional software is deterministic:
1
2
def add(a, b):
return a + b # Always returns the same result
LLMs are probabilistic. Given “2 + 2 =”, the output “4” carries something like 0.999 probability, but “5” is not literally zero. You cannot write if-else logic with LLMs. You work with probabilities and constraints, not certainties.
Not a reasoning engine, in the traditional sense. LLMs don’t have working memory. They can’t hold intermediate results or backtrack. When an LLM “reasons,” it’s generating reasoning-like text. Chain-of-thought prompting works because it forces the model to generate intermediate steps as tokens, which then become part of the context for the tokens that follow:
1
2
3
4
5
Question: "John has 3 apples. He buys 5 more. How many does he have?"
Without CoT: "8"
With CoT: "John has 3 apples. He buys 5 more. 3 + 5 = 8. So he has 8 apples."
The reasoning isn’t happening in the model’s mind: it’s happening in the token sequence.
The Mental Model to Keep
1
2
3
4
5
6
7
8
9
10
11
┌─────────────────────────────────────────┐
│ LLM │
│ │
│ Input: [token sequence + context] │
│ ↓ │
│ Process: Pattern matching against │
│ learned distributions │
│ ↓ │
│ Output: [next token probabilities] │
│ │
└─────────────────────────────────────────┘
| Property | Implication |
|---|---|
| Probabilistic | Results vary; need validation |
| Stateless | No memory between calls |
| Pattern-based | Generalizes, but can’t compute |
| Token-limited | Context window is a hard constraint |
| Training-frozen | Knowledge cutoff is fixed |
What This Means for Engineering
Design for probabilistic outputs. Never assume an LLM will give you the same answer twice.
1
2
3
4
5
6
7
8
9
10
# Assuming determinism doesn't hold up:
result = llm.generate(prompt)
process(result)
# Validate and handle variation instead:
result = llm.generate(prompt)
if validate(result):
process(result)
else:
retry_or_fallback()
Use LLMs for what they’re good at. Language understanding and generation, pattern recognition, cross-domain synthesis, creative exploration. Not precise calculations, factual retrieval without RAG, long multi-step reasoning without scaffolding, or deterministic logic.
Treat context as your new code. In traditional programming, you write logic: if condition, then action. In LLM programming, you design context: instructions and examples that shape the output pattern you want. Your prompts, examples, and system instructions are your programming interface now.
Once you see LLMs this way, the failures make more sense. A wrong answer isn’t a bug to file, it’s a pattern that didn’t match. The fix isn’t arguing with the model, it’s changing what you feed it: better context, tools for the parts that need to be exact, and validation for everything else. That reframe is the foundation for the rest of this series.