ONLINEAGENT_OPS 2026.Q3 HOME HUBSMODELSBUILDINGCOMPANIESFILMMAKINGSECURITYLIVING WITH ITSKILLSALL HUBS, ONE TERMINAL → ARTICLES CRAFT RECORD BLOG TOOLS SKILLS SEARCH /
HOME›ARTICLES›HOW IS AI MADE? HOW AI IS BUILT, STEP BY STEP
ARTICLES · EVERGREEN EXPLAINERBEGINNER

How is AI made? How AI is built, step by step

Six steps from sand to answer: chips and power, data, training, teaching it to behave, apps and agents. Plain words, with the sources named and dated.

READ13 min
WORDS2,598
SECTIONS10
SOURCES2
TYPEEXPLAINER
CHECKED17 SEP 26

AI is made by training: a computer program reads an enormous amount of text, pictures or other data, and keeps adjusting billions of internal numbers until it gets good at guessing what comes next. People then test it, teach it how to behave, and wrap it in an app you can type into.1

TL;DR — THE SHORT VERSION

An AI is built in six layers, from chips up to agents, and most arguments about AI make more sense once you know which layer they are about.

  • Silicon and power come first. Training occupies specialised chips for months, which makes AI a buildings-and-electricity problem as much as a software one.
  • Data sets what a model can know. What goes in decides what can come out, and a growing share of what is available to train on was itself machine-generated.
  • Pretraining is guessing the next part, at scale. The rules are not written by hand; they emerge from correction, and the result is a file of frozen numbers, the weights.
  • Alignment shapes behaviour afterwards, and it runs on people. It is incomplete by admission, and much of it is human work whose conditions are rarely discussed.
  • Products are wrapping; agents add action. Products on the same model mostly differ in their packaging, while agents give the model tools and a loop, so a mistake becomes an action.

Step 1: Chips and power

LAYER 01
SILICON
CHIPS, POWER, COOLING

It starts as sand. Purified into silicon, sliced into wafers, printed with circuitry at a scale measured in billionths of a metre, then packaged into the specialised processors that do one thing extraordinarily fast: multiply enormous grids of numbers.

A frontier training run occupies thousands of these chips at once, for weeks or months. Meta, for example, trained its largest Llama 3 model on up to 16,000 of them and describes one 54-day stretch of that training.2 They are not general computers in any everyday sense — they are arithmetic engines, and everything above this layer is that arithmetic wearing a costume.

This layer also explains the energy question. Each chip generates heat that must be removed, which is why AI is a buildings-and-power-grid problem as much as a software one. The International Energy Agency projected global datacentre electricity demand more than doubling by 2030 to around 945 terawatt-hours — slightly more than Japan's total electricity consumption today — in its April 2025 Energy and AI report. The agency has since updated that central projection to about 950 TWh in 2030, roughly double the 485 TWh of 2025.3

SAND → WAFER → CHIPMONTHS OF CONTINUOUS RUN

Step 2: Collecting the data

LAYER 02
DATA
THE QUARRY EVERY CAPABILITY IS CUT FROM

Trillions of words, images and lines of code — scraped from the open web, licensed from publishers, bought, and increasingly generated by other models. Then filtered: duplicates removed, low-quality pages dropped, some categories excluded entirely. (More on this in training data meaning.)

This layer decides what the finished system can possibly know, and it carries most of the field's unresolved fights: who owns the text, whether consent was given, what happens when models begin training on their own output. What goes in decides what can come out — and unlike the layers above it, this one cannot be fixed later.

And the quarry is changing composition. A growing share of what is available to scrape was itself machine-generated — roughly half of newly published articles, by the figures in the quarterly record.4 Research published in Nature in 2024 showed that models trained repeatedly on their own outputs degrade: rare cases vanish first, then variety collapses. In the paper's own terms, early model collapse is the model "losing information about the tails of the distribution", and late collapse is convergence "to a distribution that carries little resemblance to the original one, often with substantially reduced variance". The overall score is the wrong place to look for it: with a tenth of the real data retained, the authors measured "only minor degradation of performance" while the tails were going. One of the authors, Yarin Gal, put it as an AI echo chamber.

This is not a prediction of doom. Labs filter aggressively, license human-written corpora, and use generated data deliberately where it helps. But it does mean the economics of the open web are now a training-data question: if human pages stop being viable to produce, the quarry that every layer above depends on gets worse.5

TRILLIONS OF TOKENSFILTERED · DEDUPLICATED · WEIGHEDINCREASINGLY SELF-REFERENTIALPROVENANCE NOW LEGALLY CONSEQUENTIAL
TAKEAWAY

To understand what a model can and cannot do, start with what it was trained on. Flaws in the data are hard to repair at any later layer, and the open web it draws on is changing.

Step 3: Training (pretraining)

LAYER 03
PRETRAINING
THE LONG POUR

Here is the whole mechanism, honestly: the system is shown a piece of text with the next part hidden, guesses what comes next, and has billions of internal numbers nudged slightly whenever it guesses wrong. Repeat for months. Those numbers live inside a neural network.

No engineer writes the rules. Grammar, arithmetic, the shape of an argument, the conventions of a recipe — all of it emerges from correction at scale. Which is also why it is so hard to point to where a specific skill lives inside the finished model, and why testing it is genuinely hard rather than merely tedious.

The result is a set of frozen numbers — the weights. That file is the model. Everything you have ever seen an AI do came out of arithmetic performed on numbers that were settled during this stage and have not changed since.

PREDICT · CORRECT · REPEATNO RULES WRITTEN BY HAND

Step 4: Teaching it to behave

LAYER 04
ALIGNMENT
MANNERS, TAUGHT AFTER LANGUAGE

A freshly pretrained model is capable and unusable: it will continue any text at all, helpfully or otherwise. Alignment is the work of shaping behaviour afterwards — people ranking outputs (the method called RLHF), written principles the model is trained against, red teams paid to make it fail, and evaluations run before anything ships.

Two honest caveats belong here. First, this shapes behaviour, not beliefs — the model has none. Second, it is demonstrably incomplete: people keep finding ways to talk models out of their guidelines, which is why alignment is an active research field rather than a solved checkbox.

The part that gets left out: this layer runs on people. Ranking outputs, writing demonstrations, labelling harmful material and probing for failures are human jobs, done at scale, frequently through outsourced contracts and often by workers in lower-income countries. Some of it involves sustained exposure to the worst material a model might be asked to reproduce.

It is worth naming for two reasons. Practically: the behaviour you experience as a model's "values" was substantially decided by the judgement of people whose names you will never see. Honestly: a technology routinely described as automating work is, at this layer, an employer of a workforce whose conditions are rarely discussed by the people describing it.

FEEDBACK · PRINCIPLES · RED TEAMSINCOMPLETE BY ADMISSIONHUMAN LABOUR, LARGELY UNSEEN

Step 5: Turning it into an app

LAYER 05
PRODUCTS
THE ONLY FLOOR THE PUBLIC VISITS

Chat windows, APIs, copilots inside other software. Almost nothing here is the model itself — it is packaging: what the system is told before you type, how much of your conversation it can still see, which tools it may reach for, what it refuses.

Worth knowing when a product feels dramatically better or worse than another using the same underlying model: you are usually comparing the wrapping, not the mind. ChatGPT's launch invented nothing fundamental — the architecture was five years old. What changed was a text box anyone could type into.

SAME MODEL · DIFFERENT WRAPPING
TAKEAWAY

When two AI products feel very different, check whether they use the same model. If they do, you are usually judging the packaging: the instructions, memory, tools and refusals around it.

Step 6: Agents that take actions

LAYER 06
AGENTS
THE NEWEST FLOORS, STILL UNDER INSPECTION

Systems that do not merely answer but act: browse, write and run code, call other software, take multi-step tasks and pursue them. Structurally this is the same predictor from Layer 03, given tools and a loop.

The reason this layer gets its own name is that the failure modes change. A wrong answer is a wrong answer; a wrong action books the flight, sends the message, deletes the file. Everything unresolved in Layer 04 becomes more consequential here, which is precisely why this floor is still under inspection.

ANSWERS → ACTIONSFAILURE MODES CHANGE

How is AI trained?

The plain point: it practises one tiny task billions of times, guessing the next piece of text, and is corrected every time it is wrong.

  1. Show it a piece of text with the next word hidden. The model guesses what comes next.
  2. Check the guess against the real word. The bigger the miss, the bigger the correction.
  3. Nudge the numbers. The model is a huge set of adjustable numbers (called weights or parameters). Each one is moved a tiny amount so the right answer becomes a little more likely next time.
  4. Repeat across trillions of words. Grammar, facts and style are never typed in; they build up in those numbers as a side effect of getting better at the guessing game.

IBM describes the same loop: the model predicts the next word, then its weights are updated, again and again, until it has “learned”.1 The numbers sit inside a neural network, and adjusting them during training is how the network learns.6

◈ IN PLAIN TERMS

Picture a mixing desk with billions of tiny dials. Every time the machine guesses the next word wrong, a little hand turns each dial a hair in the right direction. Do that across a library’s worth of text and the dials end up set so well that the guesses read like writing. That is pretraining. The later steps (testing, teaching it manners, wrapping it in an app) all happen after the dials are set.

TAKEAWAY

Training is guess, check, adjust, repeat. Nobody writes the answers in; the skill is stored in the adjusted numbers, which is why it can sound sure and still be wrong.

A small AI vs a ChatGPT-sized one

The plain point: the steps are the same for a tiny spam filter and a giant chatbot. What changes is the scale.

Engineers describe building any machine-learning system as a loop of the same stages: decide the problem, gather and prepare the data, train and test the model, put it to work, then keep watching it.7

StageA small AI (say, a spam filter)A ChatGPT-sized AI
1. ProblemLike: “Is this email junk?” One narrow question.Like: “Continue any text well.” One very general skill.
2. DataLike: emails people have already marked as spam or not spam.Like: trillions of words from the web, books and code, filtered and cleaned.
3. TrainLike: minutes or hours on an ordinary computer.Like: weeks or months on thousands of specialised chips.
4. TestLike: check it on emails it has never seen.Like: benchmarks, safety tests and red teams, then people ranking its answers.
5. DeployLike: it quietly sorts your inbox.Like: it becomes an app and an API millions can type into.

The figures behind the right-hand column: Meta trained its largest Llama 3 model on 15.6 trillion pieces of text (tokens), on up to 16,000 chips.2 The left-hand column is the kind of task Google uses to teach machine learning: learning from labelled examples to spot spam.8 See machine learning meaning for the basics.

TAKEAWAY

Problem, data, train, test, deploy: every AI goes through the same five stages. A chatbot is not a different kind of thing from a spam filter; it is the same recipe at an enormous scale.

What holding the whole stack in view actually tells you

Most disagreements are layer confusion. "AI steals from artists" is a Layer 02 argument. "AI is dangerous" is usually Layer 04 or 06. "AI is overhyped" is often Layer 05. People argue past each other because they are standing on different floors of the same building.

SIX LAYERS · AND WHERE THE ARGUMENTS STAND
The stack from sand to agents, bottom to top, with the floor each common argument is usually standing on.
06AGENTSanswers become actionsAI IS DANGEROUS05PRODUCTSthe wrapping, not the mindAI IS OVERHYPED04ALIGNMENTbehaviour, shaped by peopleAI IS DANGEROUS03PRETRAININGpredict, correct, repeat02DATAwhat goes in decidesAI STEALSFROM ARTISTS01SILICONchips, power, cooling
Reasoning — summarises this page’s six layers and its point that most disagreements are layer confusion. Page checked 25 Aug 2026.

The mechanism is simpler than the mystique, and stranger than the dismissal. It is prediction over enormous data — not a mind, not a database, not a search engine. And also: nobody fully knows why particular capabilities appear when they do, which should make both the true-believers and the it-is-just-autocomplete crowd slightly less certain.

Physical constraints are real constraints. Chips, electricity, cooling, water. Layer 01 is not a metaphor, and it is where a lot of the next decade's actual limits will be argued out.

◈ WHERE THIS SITE STANDS

Understanding how a thing is built is the opposite of being impressed by it, and the opposite of being frightened of it. This stack is an enormous engineering achievement resting on unresolved questions about consent, energy, and control. Both halves of that sentence are true, and anyone selling you only one half is selling something.

TAKEAWAY

When an argument about AI goes nowhere, ask which layer each side is talking about. Chips, data, alignment and products raise different questions and need different evidence.

Questions people ask

How long does it take to train an AI?

It depends on the size. A small model can train in your web browser at the click of a button, while the largest chatbot models take weeks to months: Meta describes a 54-day stretch that was only part of its biggest Llama 3 model’s training.29

How much data does AI need?

A ChatGPT-sized model reads trillions of pieces of text: Meta’s largest Llama 3 model was trained on 15.6 trillion tokens. Small, single-job models need far less, and Google’s own course says the quality and size of the data matter more than the clever method used.210

Can I build my own AI?

Yes, a small one. Google’s free Teachable Machine lets you train a model to recognise your own pictures, sounds or poses without writing code; building a chatbot from scratch is out of reach for most people, but you can fine-tune an existing model or run one on your own computer.11

What is the difference between machine learning and deep learning?

Machine learning is any method where a computer learns from examples instead of following rules a person wrote. Deep learning is one kind of machine learning that uses neural networks with many layers, and it is what powers today’s chatbots and image makers.12

Related on this site: How Does ChatGPT Work? · Foundation model meaning · What Is Pretraining in AI?

The comparisons on this page (the six floors, the mixing desk, the small-versus-large table) are this site’s own ways of explaining, not claims from these sources.

SOURCES
  1. 1IBM, What Are Large Language Models (LLMs)?, 6 Oct 2021, read at source 5 Oct 2026“LLMs work as giant statistical prediction machines that repeatedly predict the next word in a sequence.” … “The number of parameters refers to how many of these variables exist in a model, with some LLMs containing billions of parameters.” … “RLHF is a form of fine-tuning where humans rank model outputs and the model is trained to prefer outputs that humans rank higher.” ↑a“LLMs work as giant statistical prediction machines that repeatedly predict the next word in a sequence.” … “Through an iterative cycle of making predictions and then updating model weights through backpropagation and gradient descent, the model ‘learns’”. ↑b
  2. 2Grattafiori et al. (Meta), The Llama 3 Herd of Models, arXiv:2407.21783, 31 Jul 2024, read at source 5 Oct 2026“Llama 3 405B is trained on up to 16K H100 GPUs, each running at 700W TDP with 80GB HBM3.” … “During a 54-day snapshot period of pre-training, we experienced a total of 466 job interruptions.” Rewritten 5 Oct 2026: this line previously said “tens of thousands of these chips continuously for months”, with no source. ↑a“Specifically, we pre-trained a flagship model with 405B trainable parameters on 15.6T text tokens.” … “Llama 3 405B is trained on up to 16K H100 GPUs”. ↑b“During a 54-day snapshot period of pre-training, we experienced a total of 466 job interruptions.” ↑c“Specifically, we pre-trained a flagship model with 405B trainable parameters on 15.6T text tokens.” ↑d
  3. 3Source: IEA, Energy and AI (World Energy Outlook Special Report), April 2025, read at source 17 Sep 2026 in the report PDF (iea.org itself refuses automated requests): “Data centre electricity consumption is set to more than double to around 945 TWh by 2030. This is slightly more than Japan's total electricity consumption today.” Carbon Brief renders the comparison as “equivalent to the current electricity demand of Japan”; the IEA's own wording is used here. The update was read at source 17 Sep 2026 in the IEA's April 2026 Key Questions on Energy and AI (PDF): “Our updated projections see electricity consumption from data centres roughly doubling from 485 TWh in 2025 to 950 TWh in 2030, accounting for around 3% of global electricity demand by that date.” The same report says the Base Case sees consumption “growing from around 415 TWh in 2024 to around 950 TWh in 2030”, and that data centres “accounted for 1.5% of global electricity consumption in 2025”.↑
  4. 4Graphite, “AI Now Writes as Many Online Articles as Humans”, May 2026, read at source 17 Sep 2026“since Q1 2025 the percentage of primarily AI-generated articles has plateaued at roughly 50%”. A count of English-language articles in Common Crawl, not of everything a lab might train on. ↑
  5. 5Shumailov et al., "AI models collapse when trained on recursively generated data", Nature 631, 755–759 (2024); body read at source in the open-access copy at PubMed Central (CC BY 4.0, published 24 Jul 2024) on 5 Oct 2026: "At first, the tails (low-probability events) begin to disappear as a result of the low probability of sampling them and, over time, support of the distribution shrinks." The same copy carries the other quoted lines: "In early model collapse, the model begins losing information about the tails of the distribution; in late model collapse, the model converges to a distribution that carries little resemblance to the original one, often with substantially reduced variance", and, of the runs where "10% of original training data" was kept, "We find that preservation of the original data allows for better model fine-tuning and leads to only minor degradation of performance." (Until 5 Oct 2026 this source linked an Edinburgh Research Explorer PDF, read 11 Sep 2026, that can no longer be opened.) CORRECTED 11 Sep 2026 — this page previously said performance on common cases "can look fine or even improve while the tails rot away", and attributed to an author the line that the surprise is "how fast it starts and how elusive it is". Neither is in the paper: it reports that "Both training regimes lead to degraded performance in our models", and the author quote could not be traced to any source that could be opened. The Gal quote is from Oxford's Department of Computer Science: "Model collapse threatens to create an AI echo chamber." The economic and legal half — including the copyright rulings that now turn on how training data was obtained — on AI and the open web.↑
  6. 6IBM, What Is a Neural Network?, 6 Oct 2021, as cited on this site’s neural network page, read at source 1 Oct 2026“By adjusting these values during training, the network gradually learns to make accurate predictions.” ↑
  7. 7Amazon Web Services, Well-Architected machine learning lifecycle (Machine Learning Lens), undated documentation, read at source 5 Oct 2026the phases are “Business goal identification”, “ML problem framing”, “Data processing (data collection, data preprocessing, feature engineering)”, “Model development (training, tuning, evaluation)”, “Model deployment (inference, prediction)” and “Model monitoring”. ↑
  8. 8Google, Supervised Learning, updated 25 Aug 2025, as cited on this site’s machine learning page, read at source 1 Oct 2026“Supervised learning uses labeled data to train models that predict outcomes for new, unseen data.” … “like identifying spam or predicting precipitation.” ↑
  9. 9Google, Teachable Machine 2.0 makes AI easier for everyone, 7 Nov 2019, read at source 5 Oct 2026“train your own machine learning model with the click of a button, no coding required”. ↑
  10. 10Google for Developers, Datasets, generalization, and overfitting, Machine Learning Crash Course, last updated 3 Dec 2025, as cited on this site’s training data page, read at source 1 Oct 2026“Data trumps all. The quality and size of the dataset matters much more than which shiny algorithm you use to build your model.” ↑
  11. 11Google, Teachable Machine, Experiments with Google, November 2019, read at source 5 Oct 2026“A fast, easy way to create machine learning models – no coding required.” … “Train a computer to recognize your images, sounds, & poses, then export your model for your sites, apps, and more.” ↑
  12. 12IBM, What Is Deep Learning?, 15 Sep 2025, as cited on this site’s deep learning page, read at source 1 Oct 2026“Deep learning is a subset of machine learning driven by multilayered neural networks whose design is inspired by the structure of the human brain.” … “Deep learning models power most state-of-the-art artificial intelligence (AI) today, from computer vision and generative AI to self-driving cars and robotics.” ↑

Free printable AI cheat sheets, and AI news every week.

Sixteen one-page AI guides and checklists in one free PDF, no sign-up. And if you want to keep up, the newsletter covers what changed in AI each week, in plain English, with the sources.

SUBSCRIBE FREE ↗ GET THE CHEAT SHEET PACK
◈ IF YOU ARE CITING THIS

Or check it yourself. How to check the figures here names the feed or document behind each recurring source, and what to expect when your number differs from ours.

Cite the original source, not this page. Every figure here names the organisation that issued it and the date it was published — those are the citations worth carrying. This page is a signpost, not a primary source.

If you need to reference the collation itself — the comparison, the framing, or a correction made here — the press page has the details. But if you are quoting a number, go to whoever measured it.