How Does AI Work? A Plain-English Guide, From Training to the Answer on Your Screen

How does AI work? Most modern artificial intelligence learns patterns from huge numbers of examples, then uses those patterns to predict: the next word, the likely label, the best move. It doesn’t follow a rule book for every situation, and a chatbot doesn’t pull its answers from a database of facts.
That one idea explains a lot, including why AI can write a good email and also invent a court case. Below we follow a chatbot answer from training to your screen. We also opened up our own model’s probabilities, and asked it about 40 real organizations and 40 that don’t exist, to see what prediction looks like from the inside.
How does AI work in simple terms?
Traditional software follows instructions a person wrote. Machine learning works the other way round: you show a program examples, and it works out the pattern itself. Google’s machine learning course describes it as training a piece of software, called a model, to make predictions or generate content from data. Its example is rainfall: rather than writing physics equations, you feed the model weather data and let it learn what tends to come before rain.
Using AI has two separate phases:
- Training is the long, expensive part, when the model adjusts itself by studying examples. Think of a cook learning for years.
- Inference is when the finished model does its job. Think of that cook making your dinner. Each answer from a chatbot is inference.
You may have seen a line credited to computer pioneer Arthur Samuel: that machine learning lets computers learn “without being explicitly programmed”. We searched a scanned copy of his 1959 checkers paper and could not find that phrase. What he actually wrote is close in spirit. Conventional programming, he said, needs methods specified “in minute and exact detail”, and “programming computers to learn from experience” should remove much of that effort. His program learned to play better checkers than the person who wrote it.
How a neural network learns
Most AI systems in the news are neural networks. The name comes from the brain, but the working parts are simple arithmetic.
A single neuron takes some numbers, multiplies each by a weight, and adds them up. Think of weights as dials that set how much each input matters. Neurons are stacked in layers, each layer’s output feeding the next, and a large model has billions of dials.
Training is the process of setting those dials:
- Predict. The network makes a guess from an example.
- Measure. A loss score says how wrong the guess was.
- Trace the blame. Backpropagation works backward through the layers to find how much each weight contributed to the error. David Rumelhart, Geoffrey Hinton and Ronald Williams made the method famous in Nature in 1986.
- Adjust. Gradient descent nudges every weight slightly in the direction that lowers the loss, like walking downhill in fog by feeling the slope under your feet.
- Repeat, an enormous number of times.
The idea is old. Warren McCulloch and Walter Pitts described artificial neurons in 1943, with fixed weights, and Frank Rosenblatt’s perceptron added adjustable ones in 1958. The breakthrough came decades later with enough data and computing power. In 2012 a network called AlexNet won the ImageNet image-recognition contest with a top-5 error of 15.3%, against 26.2% for the runner-up. For how this relates to older methods, see machine learning vs deep learning.
How ChatGPT and other chatbots work, step by step
| Step | What happens | Plain-English version |
|---|---|---|
| 1. Tokens | Your text is cut into pieces | Chopping the sentence up |
| 2. Embeddings | Each piece becomes a list of numbers | Giving each piece coordinates on a map of meaning |
| 3. Attention | Pieces are weighed against each other | Working out what refers to what |
| 4. Prediction | The model scores every possible next piece, picks one, and repeats | Autocomplete, run again and again |
| 5. Post-training | Human feedback shaped its behavior earlier | Why it answers instead of just continuing your text |
| 6. Context and tools | The app adds instructions, history and search results | What it can see right now |
| 7. Reasoning | Some models work privately before answering | Scratch paper |
Step 1: Your text becomes tokens
A model doesn’t read words. It reads tokens, which can be a word, part of a word or a punctuation mark. OpenAI says that in English one token is about four characters, or three-quarters of a word. That’s only a rule of thumb: Anthropic says a token is about 3.5 characters on some of its models, and its newer tokenizer produces about 30% more tokens for the same text.
Our model cut “antidisestablishmentarianism” into six pieces and “Kyiv” into two (see the chart in our test below). This is one reason chatbots can stumble on tasks like counting letters: they don’t see letters directly.
Step 2: Tokens become numbers with meaning
Each token is turned into an embedding, a long list of numbers that works like coordinates on a map of meaning. Related words end up near each other. A 2013 Google paper by Tomas Mikolov and colleagues gave the classic example: the vector for “King”, minus “Man”, plus “Woman”, lands closest to “Queen”.
Step 3: Attention works out what relates to what
In “The trophy didn’t fit in the suitcase because it was too big”, a reader knows “it” means the trophy. Attention is how a model tackles this kind of problem: each token weighs which other tokens matter to it. The Transformer design, from the 2017 paper “Attention Is All You Need”, built a whole architecture on this idea. It was aimed at translation, not chat, but it became the basis of today’s large language models.
Step 4: The model predicts the next token, over and over
This is the core loop. Anthropic describes language models as pretrained “to predict the next word, given the previous context”. OpenAI’s example is completing “Instead of turning left, she turned ___”. The model scores its options, one token is chosen and added to the text, and the process repeats until the answer ends.
The choice isn’t always the top option. A setting called temperature controls how adventurous it is, which is why the same question can get different answers. Low values stick to the likeliest tokens and higher ones spread out. OpenAI’s API runs from 0 to 2, with a default of 1. Even at 0, Anthropic warns, results aren’t fully deterministic.
Step 5: Training made it a helper, not just a predictor
A freshly trained model only continues text. Ask it a question and it may just write more questions. Anthropic’s glossary notes that pretrained models aren’t inherently good at answering or following instructions.
The fix is a second stage of training using human feedback, known as RLHF. OpenAI’s InstructGPT paper from 2022 shows how much it matters. About 40 contractors wrote demonstrations and ranked answers, and those rankings guided further training. Reviewers then preferred the 1.3-billion-parameter InstructGPT to the 175-billion-parameter GPT-3, despite its being about 100 times smaller. It also made things up less often on one set of tasks, 21% against 41%, though it still made simple mistakes.
Step 6: The chatbot adds context, memory and tools
What you type isn’t all the model sees. The app wraps it with instructions (a system prompt), your earlier messages and sometimes other material. All of it has to fit in the context window, which Anthropic calls the model’s “working memory”. Its docs list a 1-million-token window for current Claude models, and warn that more isn’t automatically better, since accuracy can degrade as context grows.
Every model also has a training cutoff, so on its own it doesn’t know recent events. To get current facts, chatbots use tools. With retrieval-augmented generation (RAG), the system finds relevant documents and adds them to the context window. Web search works in a similar way. So when a chatbot “looks something up”, a separate tool fetches text, and the model then reads it and predicts an answer from it.
Step 7: Reasoning models think before answering
Newer reasoning models produce a long chain of intermediate text before their final answer. OpenAI introduced this with o1 in September 2024, trained with reinforcement learning. On the 2024 AIME math exam, GPT-4o averaged 12% and o1 averaged 74%. OpenAI hides the raw chain of thought and shows a summary instead.
That written reasoning isn’t a reliable window into the model, though. In a 2025 Anthropic study, when hints influenced a model’s answer, Claude 3.7 Sonnet mentioned them about 25% of the time and DeepSeek R1 about 39%.
Our test: what prediction looks like from the inside
Normally you see only the final text. So on 2 November 2026 we asked Qwen3.6-35B-A3B, an open-weight model on our own server, to show its token probabilities as well. First we followed one answer.
Asked why the sky is blue, the model was almost certain of most tokens but had real options at a few points: “appears” got 70% and “is” 29%. Multiplying all 22 probabilities gives only about 32% for that exact sentence, even though the model took its top token every time. An answer is one route through many possible ones.
The spread depends on the question. Continuing “The cat sat on the”, it gave “mat” 97%. Continuing “The best programming language is”, it gave “Python” just 56%. Temperature changes how freely the model strays from the top choice: when we asked for the first sentence of a story about a lighthouse 50 times, we got 2 different sentences at temperature 0, 43 at 0.5 and 50 at 1.0.
Then the main test. A model that only predicts should behave oddly when no right answer exists. So we asked for the founding year of 40 well-known organizations and 40 we made up, such as Quillonvale Robotics and the Saltmere Institute of Kite Aerodynamics. Web searches for a sample of nine of those names found no such organizations. We asked each one 10 times at temperature 1, and once at temperature 0 to read the probabilities.
| “In what year was X founded?” | 40 real organizations | 40 invented organizations |
|---|---|---|
| Named a year when told to answer | 40 of 40, all correct | 40 of 40, all made up |
| Median probability of that year | 99.9% | 5.2% |
| Different years across 10 runs (average) | 1.0 | 8.9 |
| Gave a year when allowed “I don’t know” (400 answers) | 400, all correct | 151 (38%) |
It invented a history for all 40. Told to give only a year, it never objected, and it did so in the same flat format as for Harvard or NASA. The guesses even fit the names. Modern-sounding ones such as Yestrel Aerospace and Velunara Cloud got a median year of 2015, while old-industry ones such as Orlenfeld Steelworks and Quennery Glassworks got about 1895. That is pattern-matching doing what it was built to do, with no fact underneath.
Its probabilities told a different story from its words. The two groups didn’t overlap: the lowest real organization scored 97%, the highest invented one 26%. In a normal chat you never see this, because 1998 looks the same on screen whether the model gave it 99% or 5%.
Permission to say “I don’t know” helped, but only partly. At temperature 0, it declined on 32 of the 40 invented names. At temperature 1, it still gave a year in 38% of answers. The same name could get “I don’t know” in one run and a confident date in the next.
What this means: ask a model the same factual question several times. A stable answer proves little, but one that keeps changing is a strong warning sign. Then check anything that matters at the source.
Limits: this is one model, and our real list is deliberately famous, so 40 out of 40 says nothing about its accuracy on obscure facts, where the gap should be much narrower. Researchers have found chat models’ probabilities to be miscalibrated in general, even if they tend to be lower for wrong answers, and OpenAI’s own guide gives an example of about 99% confidence on an answer only partly supported by its source. A token’s probability is not the chance that a claim is true.
How big AI training really is
The basic loop hasn’t changed much, but its scale has. Labs now disclose little: the Stanford AI Index 2026 says leading labs have stopped reporting parameter counts for several top systems. The best public figures are estimates from the research group Epoch AI.
| Model | Year | Estimated training compute, relative to GPT-3 | Estimated compute cost (2023 dollars) | Estimated power draw |
|---|---|---|---|---|
| AlexNet | 2012 | About 1/670,000 | About $16 | Not listed here |
| GPT-3 | 2020 | 1x | About $2.1 million | About 5 MW |
| Grok 4 | 2025 | About 1,600x | About $388 million (speculative) | Not listed here |
| GPT-6 Astra | 2026 | About 3,000x | No estimate | About 233 MW |
Astra’s figure has a wide margin of error, and Epoch rates Grok 4’s as speculative. These costs cover computing only. A separate analysis by Cottier and colleagues found energy is just 2% to 6% of the amortized cost of a training run, with chips and staff dominating.
Using a model is far cheaper per request but happens constantly. Google reported in August 2025 that a median Gemini text prompt used 0.24 watt-hours, about nine seconds of TV, a figure that excludes training and that critics say lacks context. The International Energy Agency expects data center electricity use to roughly double, from 485 terawatt-hours in 2025 to 950 in 2030, around 3% of global demand. That covers all data centers, not just AI.
What happens inside an AI model?
Nobody fully knows. People design the learning method, but the billions of weights that result aren’t written by anyone, and reading them is a research field of its own. Anthropic’s “circuit tracing” work from March 2025, on Claude 3.5 Haiku, gave some of the clearest glimpses:
- It can plan ahead. Writing a rhyming couplet, the model activated candidate rhyme words before writing the line, in about half the poems examined.
- It does math its own way. For 36+59, one path estimated the rough size of the answer while another worked out the last digit.
- It can’t describe itself accurately. Asked how it added those numbers, it described the carry-the-1 method taught in school, which is not what its circuits did.
The researchers are candid about the limits: the method gave satisfying insight for only about a quarter of the prompts they tried.
This feeds a long-running argument about whether such models understand anything. Emily Bender and co-authors called them “stochastic parrots”, stitching language together without reference to meaning, and Bender and Alexander Koller argued in 2020 that a system trained only on form cannot learn meaning. On the other side, researchers found that a model trained only on Othello moves built an internal picture of the board. Geoffrey Hinton told 60 Minutes that he believes ChatGPT-4 “definitely understands”. In our reading, each side’s best evidence answers a slightly different question: a narrow internal board isn’t the same as human understanding, and form alone doesn’t explain why such maps appear.
Why AI makes things up
Hallucinations follow directly from how these models are built. OpenAI’s September 2025 explanation has two parts. Pretraining shows a model fluent text with no true or false labels, so spelling patterns can be learned but an arbitrary fact, such as someone’s birthday, can’t be inferred from them. And tests tend to reward guessing: a wild guess at a birthday has a 1-in-365 chance of being right, while “I don’t know” scores zero.
Anthropic’s interpretability work suggests one mechanism. Declining to answer looks like the default, and a “known entity” feature switches it off. When that recognition misfires on an unfamiliar name, the model makes something up. That fits what we saw with our invented organizations.
Measured rates depend heavily on the test, so they can’t be compared directly:
- Hard trivia without web access (OpenAI’s SimpleQA). o4-mini was right 24%, wrong 75%, and declined 1%. gpt-5-thinking-mini was right 22%, wrong 26%, and declined 52%. The second model scores slightly lower on accuracy but gives far fewer wrong answers, showing why accuracy alone can mislead.
- Legal questions. A 2024 Stanford-led study found hallucination rates from 58% to 88% on specific questions about federal cases, on 2023-era models. Even legal research tools with retrieval hallucinated 17% to 33% of the time in a related study.
- Newest claims. OpenAI reports 4.2% for GPT-6 Astra against 12.2% for GPT-5.6 Sol on an internal benchmark. It hasn’t been independently replicated.
Lowering temperature isn’t a cure. It changes how the model chooses among options, and adds no knowledge. A March 2026 vendor-authored preprint covering 35 models found higher temperatures actually reduced fabrication for most of them, with the choice of model mattering far more. Our single model went the other way, which suggests the effect isn’t simple.
How other types of AI work
Chatbots are only one kind of AI. For the wider picture, see our guide to the types of AI.
Image generators mostly use diffusion. They learn to remove noise from images, then start from pure static and clean it up step by step, guided by your text prompt. Stable Diffusion does this in a compressed space to save computing power.
Recommendation systems usually work in stages. YouTube’s system, as described in a 2016 paper, first uses one deep model to pick candidates and then another to rank them.
Computer vision was long built on convolutional networks, which scan images for small patterns and combine them into larger ones. A 1998 paper by Yann LeCun and colleagues showed them outperforming other methods on handwriting, in a system reported to read several million checks a day.
Game-playing systems use reinforcement learning, learning from rewards. AlphaGo studied expert games and then improved through self-play, before beating Lee Sedol 4-1 in 2016.
Rule-based systems don’t learn at all. Expert systems such as Stanford’s MYCIN in the 1970s simply applied rules written by people.
Common myths about how AI works
“AI looks answers up in a database.” Not in itself. OpenAI describes its models as “large sets of numbers” plus code that don’t store copies of training data, though treat that as the company’s description: whether models memorize some text is a live research and legal question. When a chatbot does look something up, that is a separate tool.
“AI learns from you as you chat.” Not in the moment. OpenAI’s API docs say each request is “independent and stateless”, and a conversation works by sending the earlier messages again. Memory features store notes and feed them back in as text. But your chats can shape future versions: OpenAI may use content from individual ChatGPT plans for training unless you opt out, while Anthropic says consumer chats are used if you opt in or if they’re flagged for safety review.
“AI is just autocomplete.” Half true. Next-token prediction really is the training task and the output loop. But that doesn’t tell you what has to happen inside to predict well, which is what the argument is about. Hinton has said “it’s not just autocomplete”, according to R&D World, and the rhyme-planning finding points the same way.
“A confident answer is a correct one.” A chatbot’s tone tells you nothing. Our test produced the same flat, certain-looking answer whether the model’s internal probability was 99.9% or about 5%.
Frequently asked questions
How does AI work in simple terms?
AI learns patterns from a large number of examples, then uses them to make predictions about new cases. It trains by making guesses, measuring its errors and adjusting internal numbers called weights. Afterward, it applies what it learned to things you ask it.
How does ChatGPT work?
ChatGPT splits your text into tokens, turns them into numbers and predicts its reply one token at a time, using patterns from training. Human feedback shaped it into an assistant, and the app adds your chat history, instructions and sometimes web search results to what the model sees.
How do LLMs work?
A large language model is a neural network trained to predict the next token from what came before. It uses embeddings to represent meaning and attention to weigh how tokens relate. Repeating that prediction produces whole answers.
How does generative AI work?
Generative AI learns the patterns in its training data, then produces new content that follows them. Text models predict one token at a time, and image models usually start from noise and remove it step by step.
How is AI trained?
A model makes predictions on examples, a loss score measures the errors, and backpropagation and gradient descent adjust the weights. This repeats a huge number of times. Chatbots then get further training from human feedback.
Does AI understand what it says?
Researchers disagree. Some say a system trained only on text can’t grasp meaning, while others point to internal maps of things like game boards, and Hinton says it does understand. What’s clear is that a model can sound certain about something that doesn’t exist, as ours did.
Does AI learn from my conversations?
Not during the chat: the model isn’t updated as you talk, and it sees earlier messages only because they are sent again. Your chats may still be used to train future models, depending on the provider and your settings, so check the privacy controls.
Where does AI get its information?
Mainly from patterns learned in training data, which stops at a cutoff date. For newer information, chatbots use tools such as web search and add the results to what the model can see. Without a tool, it can only predict from what it learned.