A visual guide
How AI models work, piece by piece
This visual guide builds an AI model up from one simple picture, layer by layer. Discover how words turn into math, why long passages cost more, and how businesses combine models, private data, and tools to handle real work.
You be the training algorithm
01
The board
An AI model works like a huge board of adjustable pegs. An input goes in at the top, flows through the board, and an answer lands in a slot at the bottom. Training drops enormous numbers of examples through the pegs, adjusting them after every miss so the next attempt lands closer to the correct slot. While an actual model processes every connection at once like water through valves, the peg board shows how the final step turns odds into one chosen outcome. Frozen pegs are used when running the trained model.
The adjustment relies on backpropagation, a calculation that works out how every peg should move at once. Running a frozen model to produce answers is called inference.
- Parameter
- An adjustable number or weight inside a model that shapes its output.
- Inference
- The process of using a trained model with frozen pegs to process inputs.
02
Words become balls
The peg board cannot read words directly, so text must first be chopped into pieces called tokens. Each token is converted into a number before it drops into the model. Common words become a single token, while rare words are split into several pieces. On average, a token equals roughly three quarters of an English word. Because AI services bill by the token, priced per million, the combined length of the question and the answer determines the cost of every run.
Tokenization turns written characters into standard numerical IDs that the rest of the network can process as math.
- Token
- A piece of text, roughly three quarters of a word, used as a unit.
03
A map of meaning
A simple number tells the model nothing about what a word means. To fix this, every token receives a location on a learned map of meaning. Related words sit near each other on the map, placing invoice close to bill and cat near kitten. The same visual layout powers document search inside an organization, as a question lands near the exact passage that answers it. Closeness on the map reflects learned similarity rather than proof of fact.
These positions on the map are called embeddings, which convert discrete tokens into coordinates that capture semantic connections.
- Embedding
- A numerical coordinate that places a token on a map of meaning.
04
Words listen to each other
A word on its own remains ambiguous, because bank means one thing beside river and another beside loan. The attention layer solves this by letting every word connect with every other word in the passage to weigh which ones matter most. It then updates its own meaning based on those links. Because every word compares itself to every other word, doubling the length of a text roughly quadruples the required work. This growth sets the limit on how much a model can read at once and increases the cost of long documents.
Introduced by Google researchers in 2017, the transformer architecture relies on self-attention to process entire sequences of text at once.
- Attention
- A mechanism that lets words weigh each other to refine their context.
- Context window
- The maximum amount of text a model can read in one pass.
05
Boards stacked deep
A single round of listening only catches basic links between words. To handle complex language, a transformer stacks the listening step dozens of times, or over a hundred times in the largest models. Early layers capture basic grammar, while later layers capture deep meaning and intent. At the bottom of the stack, the model outputs odds for every possible next token. One token is selected, added to the text, and the whole sequence drops through the board again to pick the next word.
The selection process uses a setting called temperature to determine how adventurous the draw from the odds will be.
- Temperature
- A setting that controls randomness when picking the next token from odds.
06
Read the internet
An untrained board knows nothing when first built. Pretraining streams trillions of words of text through the network, constantly adjusting the pegs to predict the next word. In doing so, the model absorbs grammar, facts, writing styles, and patterns of reasoning, because guessing the next word accurately demands those skills. This initial step is the most expensive part of building AI. The final training run for GPT-4 alone is estimated at forty million dollars in compute and energy, with costs for top models growing two and a half times each year.
Pretrained models merely continue text without checking facts, which can cause them to state incorrect details with high confidence, a behavior called hallucination.
- Pretraining
- The initial training phase where a model reads massive datasets to learn language.
- Hallucination
- When a model outputs false information with confident wording.
07
Coached into an assistant
A model that only continues text often responds to a question with more questions. Post-training turns that raw base into a helpful assistant. Human trainers write example answers and rate competing responses, nudging the pegs toward helpful, honest, and polite outputs. This coaching step was the breakthrough behind ChatGPT in 2022. Modern variations also use automated feedback against written principles or tune the model directly using pairs of preferred and rejected answers.
This human coaching process is known as reinforcement learning from human feedback, or RLHF, which aligns model behavior with user expectations.
- RLHF
- Using human ratings to nudge model outputs toward helpful responses.
08
Practice with an answer key
Coached models answer instantly, but they can stumble when faced with multi-step problems. Reasoning models solve this by practicing on math, coding, and logic exercises that have verifiable answers. When the model reaches the correct answer, it receives a reward, learning to write out intermediate steps before giving a final response. OpenAI o1 and DeepSeek-R1 demonstrated this approach. Allowing the model more time to think at answer time improves accuracy, though these extra thinking steps are billed as tokens.
Reasoning techniques use test-time compute to let the system generate hidden chain-of-thought tokens before returning the final text.
- Reasoning model
- A model trained to work through logical steps before generating an answer.
09
Hand it your filing cabinet
A model only knows what it read during training, with no awareness of private company files or recent events. Retrieval-augmented generation fixes this limitation. Before the model answers, the system uses the map of meaning to search internal documents, finds the relevant passages, and places them in front of the model to reference with citations. Grounded answers improve reliability, though the system can still fetch an incorrect page or misread a file. Business tiers from major providers keep private data separate and do not train on customer inputs.
Combining search with generation ensures the model relies on fresh, authoritative source text rather than internal memory.
- RAG
- Retrieving private document passages to supply facts for a model's answer.
10
Give it hands
A model that can only output text cannot complete external work on its own. Tool use solves this by letting the model ask external software to take specific actions, such as looking up an order, drafting an invoice, or checking a calendar. The model never runs software directly. Instead, it generates a structured request, surrounding code performs the action, and the result passes back to the model. The Model Context Protocol provides an open standard for these connections, allowing one setup to work across multiple tools.
Anthropic introduced the Model Context Protocol in 2024 to standardize how applications expose data sources and actions to models.
- MCP
- An open standard connecting AI models securely to business systems.
11
Let it see a job through
Running one tool per prompt still requires a human to guide every step of a complex task. An agent automates this by running an ongoing loop: it creates a plan, takes an action, checks the output, and determines the next move until the work is finished. Sound architecture places boundaries around what the agent can alter and inserts human approval steps before consequential actions like sending payments or external messages. This design allows end-to-end task execution inside existing systems.
Agentic loops combine reasoning, memory, and tool integration to navigate unpredictable multi-step tasks autonomously.
- Agent
- A system that loops through planning, action, and evaluation until finished.
12
Why GPUs
Standard computer processors rely on a few powerful cores built to execute varied tasks in sequence. A graphics processing unit contains thousands of smaller cores designed to perform identical math across massive grids of numbers simultaneously. Because adjusting model pegs involves millions of simple multiply and add operations, the work matches GPU architecture. Special tensor cores speed up these calculations. The entire model must reside in fast memory, making memory size and speed the primary bottlenecks when streaming numbers during text generation.
Models store numbers at reduced precision like 16, 8, or 4 bits to fit larger networks into fast GPU memory and speed up processing.
- GPU
- A processor with thousands of cores designed for parallel math.
- Tensor core
- A specialized circuit designed specifically for rapid matrix arithmetic.
13
Do you need your own model
Building a custom model from scratch is rarely necessary. Enterprise providers advise starting with clear instructions, then adding document retrieval, before considering changes to the underlying model. Implementation follows five options of increasing complexity: writing clear prompts, retrieving internal data through RAG, connecting tools via protocols, fine-tuning a model for specific styles or narrow tasks, and finally training a new model from scratch. A helpful guideline is that knowledge problems require retrieval, whereas specialized behavior problems may warrant fine-tuning.
Fine-tuning updates a pretrained model's pegs on a smaller, specialized dataset to adapt its tone or domain formatting.
- Fine-tuning
- Further training a pretrained model on specialized data for specific tasks.
14
Different boards for different jobs
AI models extend far beyond general chatbots. Embedding models turn text into map locations for search, speech models convert audio into text, and vision models analyze photos and forms. Diffusion models generate images by progressively removing noise from a canvas, while small safety models screen inputs before main processing. Compact language models can even run locally on server hardware. Emerging world models learn physical cause and effect from video streams, while organizations deploy diverse model types to match performance against operating costs.
World models like Meta's V-JEPA learn structural representations of video scenes to predict physical behaviors for planning and robotics.
- Diffusion model
- An image generation model that constructs visuals by clearing digital noise.
- World model
- An AI network trained to understand physical interactions from video.
Call (844) 422-7000 to talk through what fits your business. The team helps evaluate costs, risks, and architecture choices for your goals.