What is an LLM?
An LLM is a neural network trained to predict the next token, and that single mechanism is the engine every chat app and agent runs on.
Guide details
- Type
- Explainer
- Reading time
- 2 min read
- Scope
- Third rung of the agent fundamentals ladder: the prediction engine underneath the stack.
A large language model is a neural network trained on vast amounts of text to do one thing extremely well: predict the next token given everything before it. That single objective, repeated across enormous training corpora, forces the model to absorb grammar, facts, reasoning patterns, and styles, because guessing the next word correctly requires all of them.
Modern LLMs are built on the transformer architecture, whose attention mechanism lets the model weigh every earlier token when predicting the next one. Generation is then a loop: the model produces a probability distribution over the vocabulary, samples one token, appends it to the sequence, and predicts again. Settings like temperature shape how predictable that sampling is.
This design explains both the strengths and the failure modes. Text generation is flexible, so the same model summarizes, translates, and writes code. But a predictor of plausible text can produce fluent output that is simply wrong, the failure known as hallucination. Knowledge is also frozen at training time, which is why real systems pair the model with retrieval and tools.
Everything else in this series is a layer on top of that prediction loop.
Sources
Taxonomy
Concepts
Topics
Related content
- RequiresWhat is a token?An LLM is defined as a next-token predictor, so the token concept comes first.
- Used byWhat is an AI agent?The LLM is the decision engine inside every agent.
Referenced by
- Requires
Related
- What is an AI agent?Mellnx first-partyagent-fundamentals
An AI agent is an LLM plus a harness plus tools running in a loop, with the model deciding each next step.
- What is an agent harness?Mellnx first-partyagent-fundamentals
An agent harness is the runtime around a model that assembles context, dispatches tools, and drives the working loop.
- What is a token?Mellnx first-partyagent-fundamentals
Tokens are the smallest units of text a language model reads or writes, and every context limit and price is measured in them.