LLMs vs Agents
An interactive visual guide to understanding how large language models predict text, how they work under the hood, and how agents use them to take action in the world.
Token Prediction
At their core, LLMs are next-token predictors. Given a sequence of text, they calculate the probability of what comes next — one token at a time.
What is an LLM?
A Large Language Model is a neural network trained on massive amounts of text to understand and generate human language.
The Simple View: Text In, Text Out
Under the Hood: The Transformer Architecture
Input Text
Raw text prompt enters the model
Tokenizer
Text is split into tokens (subwords)
Embeddings
Tokens become numerical vectors
Attention
Tokens attend to each other to build context
Feed Forward
Neural network processes the representations
Output
Probability distribution over all possible next tokens
Input Text
Raw text prompt enters the model
Tokenizer
Text is split into tokens (subwords)
Embeddings
Tokens become numerical vectors
Attention
Tokens attend to each other to build context
Feed Forward
Neural network processes the representations
Output
Probability distribution over all possible next tokens
Training Data Scale
tokens of training data
Modern LLMs are trained on trillions of tokens from diverse sources across the internet, distilling patterns from an enormous breadth of human knowledge into their parameters.
Each dot = billions of parameters
Model Parameters
Billions to Trillions
Parameters are the learned numerical values that encode everything the model knows. During training, these values are adjusted millions of times to minimize prediction errors. The more parameters, the more nuanced patterns the model can capture — but also the more compute and data required.
What is an Agent?
An AI Agent uses an LLM as its reasoning engine, augmented with tools, memory, and the ability to take autonomous action in the world.
The LLM Brain + Tools
LLM Brain
Code Execution
Run code and scripts
Web Search
Search the internet
File Access
Read and write files
API Calls
Connect to services
Database
Query and store data
Calculator
Precise computation
The Agent Loop
Agents operate in a continuous loop — observing, reasoning, acting, and evaluating until the task is complete.
Observe
Perceive the environment, read inputs, check tool results
Think
Reason about the task, plan next steps using the LLM
Act
Execute a tool, generate a response, or take an action
Loop
Evaluate the result and decide whether to continue or stop
Memory Systems
Unlike a raw LLM, agents can maintain both short-term context and long-term persistent memory.
LLM vs Agent: Side by Side
| Capability | Raw LLM | AI Agent |
|---|---|---|
| Can use external tools | ||
| Has persistent memory | ||
| Can take real-world actions | ||
| Plans multi-step tasks | ||
| Operates autonomously | ||
| Generates text | ||
| Understands context | ||
| Reasons about problems |