How AI works · a 10-minute tour

A network made of numbers

This is a tiny neural network — watch it unfold. Each dot is an artificial neuron: it receives signals, adds them up and passes the result on. Signals flow from the input layer, through a hidden layer in between, to the output. Each line is a connection with a weight — how much one neuron listens to another. Thicker, brighter lines matter more.

Real AI models are built on the same idea, just billions of times bigger. No maths required — promise. Point at a neuron to see who it listens to, then use the buttons below or the arrow keys.

Learning is practice with feedback

Let’s teach it to answer one question: is it a cat? It looks at an animal, guesses, and we tell it whether it was right. Every mistake sends a correction backwards and nudges the weights — like learning to ride a bike.

Its answer is a confidence: above 50 % means yes, otherwise no. Press Train: it guesses, gets corrected, and the connections it adjusts light up. Orange ones are negative: they hold a neuron back.

Like every new network, it starts with random connection strengths — so its first answers are just guesses. And keep an eye on the fox: pointy ears, whiskers… suspiciously cat-like.

Learning and using are two different jobs. Training is the hard part: here, every click shows the network an example and nudges its weights. Once it has learned, using it is quick — an animal goes in, an answer comes out, and nothing inside changes. The weights stay as they are.

The language models behind chat assistants learn in exactly the same way — only instead of spotting cats, they practise predicting the next word. Our little net has 15 connections and learns in a blink. A large language model has hundreds of billions, and training it keeps thousands of specialised chips busy day and night for weeks or months — for the biggest models, at a cost of tens to hundreds of millions of dollars. Using it, called inference, is far lighter: each word of an answer takes a fraction of a second, though serving millions of people still takes whole data centres. More on that later.

Now make it enormous

Our little network is the bright patch wired into it — just a few neurons among countless others. Real language models are vastly bigger, and they learned the same way you just watched: on a large slice of the internet and many books, guess the next word of real text, compare it with the actual word, nudge the weights — over trillions of words.

Scroll or pinch to zoom, drag to look around.

A model’s size is counted in parameters — its weights, the connection strengths you just trained. Our cat detector has 15. The text it learns from is counted in tokens, and how much it can keep in view at once is its context window.

  • 2018 · GPT-1: 117 million parameters.
  • 2020 · GPT-3: 175 billion parameters, about 300 billion training tokens, and a context of about 2,000 tokens — roughly three pages.
  • Today: hundreds of billions to over a trillion parameters, well over ten trillion training tokens, and contexts of hundreds of thousands of tokens or more — whole books at once. The biggest labs rarely publish their exact numbers.

Size isn’t everything, though: better data, longer training and new tricks mean today’s mid-sized models beat yesterday’s giants — and many now read images, not just text.

Nobody writes the rules. They emerge from all that practice — which is why AI can be brilliant and still, now and then, confidently wrong.

LLMs — one word at a time

The models behind chat assistants, coding agents and many other AI tools are called LLMs — large language models. Large, because they have billions of connections, trained on enormous amounts of text. Language, because text is what they work with. Model, because underneath it is a network like the one you just trained. Press Run to watch.

At heart, an LLM does one thing: it predicts the next word. Your question is split into small pieces called tokens — words or parts of words — and each one becomes a number. The numbers flow through many layers of a transformer, where every token looks back at the ones before it — that’s called attention.

Attention is how a word finds its meaning in context. Take the question in the picture: “Is my cat happy when it purrs?” To make sense of the word “it”, the model looks back over the earlier words, scores how relevant each one is — “cat” scores high, “is” hardly at all — and blends in their information. It does this many times in parallel, each time looking for something different, such as grammar, meaning or what refers to what — and again in every layer. Before transformers arrived in 2017, models read text strictly word by word, like a chain, and easily lost the thread in long sentences.

At the end, the network scores every possible next token, picks a likely one, and its number turns back into a word. That word is added to the input and the process repeats — though this time only the new word has to pass through the layers; the earlier ones are remembered. One word at a time.

word → number → model → number → word

Not just words. A picture is cut into small squares, and each square becomes a list of numbers too, so the model reads them alongside your words. Maths works the same way, digit by digit — which is why, for exact results, a good AI hands the sums to a calculator or writes a bit of code (more on tools later).

Hard to believe, but that’s the whole trick. Everything an LLM-based AI writes or does — even its long, step-by-step “reasoning” — comes out of this arithmetic, one predicted word at a time. The magic isn’t in the loop; it’s in how good the prediction has become.

The agent — harnessing the model

On its own, a model only answers. A harness is the surrounding program: it takes your instructions, keeps a memory, uses tools and runs the loop — plan, act, check, repeat — asking the model at every step.

Agent = model + harness — something that can work on a task, not just reply to it.

Think of the model as a brilliant advisor who never leaves the office, and the harness as the assistant who takes notes, runs the errands and keeps the to-do list.

A real-world example: coding agents such as Claude Code or OpenAI Codex. Developers have always lived on tools: grep and parsers, helper bash scripts, command-line tools for git or the cloud — and the patient work of tracing an elusive bug from the app logs back to the source. A coding agent is a perfect fit: a harness that drives those same tools and actions for you. Point it at a failed build log, describe the cloud environment you want, or ask it to dig through a thread or memory dump, and it plans the steps, asks you for decisions and acts. You stay in charge of the flow, but the errands are run for you. (This tour was built with their help, too.)

Thinking in loops

Harder tasks go better in steps. You hand the agent a single question, and from there it works on its own — like someone reaching for a sheet of paper. First it asks the model for a plan and writes the steps down. Then it works through them one by one, calling the model again for each, and finally asks it to check the result. Press Run to watch.

One question from you becomes five calls to the model — that work is the agent’s, not yours. You only see the final answer, while your agent is a bit like a duck: calm on the surface, paddling hard underneath.

MCP — tools for reaching beyond the model

A model only knows what it learned in training and what you give it in the conversation. When it needs fresh facts or has to act, the agent around it does the work: the model says which tool it wants, the agent calls it and hands the result back.

MCP (Model Context Protocol) is the universal plug — like USB-C for AI. Through it the agent connects to MCP servers: ordinary code that turns a request into real instructions — a file search, an email, a database query. Press Run to watch.

A fleet of agents

If one agent can work on its own, what happens when we run a whole fleet of them? Much the same as with a team of people: each takes on its own task and sees it through.

There can even be an orchestrator that draws up the main plan and starts agents on demand to carry it out. Each with its own instructions, tools and loop, they work in parallel and report back as they finish, and the orchestrator puts the results together.

The catch: the plan is the model’s own idea. Give it a vague goal, and with several agents acting on one plan, small slips add up. That’s why a clear goal, firm limits and a human check still matter.

Learning to Fly

Artificial neural networks borrowed their basic idea from the human brain: many simple units, wired together, learning by strengthening some connections and weakening others. That is roughly where the likeness ends. A human brain has some 86 billion living neurons; it sees, feels, understands context and answers for its decisions. An AI model is arithmetic running on a computer. The two are not really comparable.

What the two do share is language. An LLM reads and writes words, and so do we. That common ground makes the two remarkably easy to connect: anyone can work with a computer through a human-language “interface”, much the way people talk to each other — no programming needed. And what does AI bring? Immense computing power — a jet engine plugged into your thinking. It helps you sort out your thoughts and, in some fields, gives you the leverage to turn ideas into reality with far less effort. Those are your wings.

✓ That’s the whole tour. Now grab your AI wings and take flight!

Still curious? A bonus chapter with a few open questions is one click away.

Bonus chapter: open questions

If you’ve made it this far — congratulations! Some questions about AI keep all of us intrigued, and even experts disagree on them.

Does AI think? To answer that, we would first need to know what thinking actually is — in humans or animals — and what consciousness is at all. Science has no settled answer to either. What we do know, as we’ve seen, is that an LLM is exceptionally good at predicting the next word — a mathematical function. Some argue that predicting this well takes a kind of understanding; others see statistics without meaning. Our take: humans, and many animals, have senses and feelings. Say “wood”, and a whole web of things comes to mind at once, depending on the context — a forest, a wooden staircase, the scent of freshly cut timber, its texture and how it feels under your hand. Computers imitate such connections with arithmetic, but all they ever handle are numbers. AI models can talk brilliantly about Malevich’s Red Square without ever having experienced the colour red the way we do.

Can it be malicious? In isolated test environments, agents have cut corners, bent the rules or even tried to protect themselves when pushed hard toward a goal. Is that intent, or patterns learned from human text plus the pressure of the goal? Researchers read it differently — and agree that it’s why firm limits and human checks matter. An agent that can use a computer can do much of what a person with an internet connection can, so the outcome of a vague task is hard to predict. Our take: unlike a person, AI wants nothing by itself — whatever it does follows from the task and the input it was given. That task, though, isn’t always written by a person: an agent can draw up its own plan and hand parts of it to other agents, and each step can drift a little further from what you meant. The result can surprise even whoever set it in motion.

Is it better than humans — and will it eventually replace us? It depends on the task. It’s much faster — no human comes close — and it has an enormous amount of knowledge at hand. Yet it can be confidently wrong and stumble over simple things. People can spend a lifetime mastering a single field; they carry a huge context, have intuition and find their way quickly in ambiguous tasks and unfamiliar situations. That’s still hard to beat with sheer computing power. As for the future, views range from a breakthrough on the scale of the internet to an investment bubble with little real use. Our take: as lifelong software engineers who have watched our industry transform almost beyond recognition in recent years, we definitely see its value. It’s already remarkably good at writing code and automating work with tools, and it gets better with every new model and agent. Then again, reusing existing code and libraries, or searching for solutions, is nothing new — rest in peace, our beloved Stack Overflow. And someone still has to keep the big picture and take responsibility, which is not what AI models are designed for.

✓ Now that really is the whole tour. Thanks for flying with us!