How AI works · a 10-minute tour

A network made of numbers

This is a tiny network made of artificial neurons. Each dot is one neuron: it receives signals, adds them up and passes the result on. Signals flow from the input, through a hidden layer in the middle, to the output. Each line is a connection between two neurons with its own weight — the stronger the connection, the more of the signal it lets through.

Real AI models work on a similar principle, just billions of times bigger. But you can leave the maths at home — you won’t need it here.

Learning is practice with feedback

Let’s teach it to answer one question: is it a cat? The network looks at its input — a combination of animal features — makes a guess, and we tell it whether it got it right. Every mistake sends a correction back and slightly changes the connection weights.

The output neuron shows the answer as a percentage: above 50 % means yes, otherwise no. Press Train: the network guesses, gets the right answer, and the adjusted connections light up. Orange connections are negative, blue ones positive.

Our network starts with random weights, so its first answers are just guesses.

Training a network and using it afterwards are two different things. Our little net has 15 connections and learns its task after a few examples. The language models behind chat assistants learn in exactly the same way — only instead of spotting cats, they estimate the probability of the next word. But a real language model has hundreds of billions of connections, and training it keeps thousands of specialised chips busy day and night for weeks or months, uses a lot of electricity and, for the biggest models, costs tens to hundreds of millions of dollars. A trained network no longer moves its weights, it just answers — this is called inference, and it 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

In the diagram, our cat detector is just a small patch sewn in among far more neurons. Real language models are vastly bigger, and they learned on a similar principle to our little network. Their input is a large part of the internet and many books: during training they guess the next word of a text, compare the guess with what really follows, and gradually adjust the connections between their artificial neurons.

Scroll or pinch to zoom, drag to look around.

A model’s size is counted in parameters — its weights, the connection strengths that training sets. Our cat detector has 15. The text it learns from is counted in tokens (words or parts of words), 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.
  • Behind closed doors: since 2026, several leading labs have held back their most capable models for safety reasons — Anthropic, for example, gave its Claude Mythos only to selected cybersecurity partners. What the public can use is often a step behind.

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 the enormous amount of data poured into the model during training — 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 — over a trillion in the biggest ones — 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 and watch what happens to the individual words inside the model.

At heart, an LLM does one thing: it predicts the most likely next word — again and again, until the whole answer is written out. The input text (your question) is split into small pieces called tokens — words or parts of words — and each token is turned into a number. The numbers then pass through many layers of a transformer, where every token looks back at the ones before it. That’s called attention.

Thanks to attention, each word finds its meaning in the context of the sentence. Take the question in the diagram: “Is my cat happy when it purrs?” To make sense of the word “it”, the model looks back over the earlier words, scores how important each one is — “cat” a lot, “is” hardly at all — and takes their meaning into account. It does this many times, each time with a different focus, such as grammar, meaning or what refers to what. Before transformers arrived in 2017, models read text strictly word by word, like a chain, and easily lost the context in long sentences.

At the output, the model scores every possible next token and picks one of the most likely. It turns the token’s number back into a word and writes it out. Each new word is added to the input and the whole process repeats — this time only the new word has to pass through the layers; the model remembers the earlier ones. And so on, word by word, to the end.

word → number → model → number → word

LLMs specialise in words, but modern models can read images too. A picture is cut into small squares, and each square also becomes a list of numbers, so the model reads them alongside your words. Maths works the same way, digit by digit — which is why older AIs often got simple sums wrong. Modern AI hands exact calculations to a calculator or writes a bit of code for them (more on MCP tools later).

Hard to believe, but guessing the probability of the next word is the basic trick everything else stands on. Everything an LLM-based AI writes or does — including its long, step-by-step “reasoning” and “search for meaning” — comes out of this arithmetic, one predicted word at a time. The magic isn’t in what agents do around that prediction (more on them in a moment); it’s in how good the prediction is.

The agent — harnessing the model

On its own, an LLM only answers. A harness is an ordinary program that runs the conversation with the model: it takes your instructions, keeps its own memory, uses tools and works in a loop — plan, act, check, repeat. All the while, it keeps consulting the model, which tells it what to do next.

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

Think of the model as a busy 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 built their work on tools: grep and parsers, helper bash scripts, countless command-line tools such as git or the cloud CLIs. Our favourite pastimes include tracking down elusive bugs across app logs and source code, compiling, debugging, deploying and looking after app environments. A coding agent fits right into that world: it’s a harness that drives those same tools and tasks for you. Point it at a failed build log, describe the cloud environment you want, or let it dig through a thread or memory dump — and it plans the steps, asks you when it needs to, and gets to work. You stay in charge; it runs the errands. (This tour was built with their help, too.)

Thinking in loops

Complex questions and tasks are best fed to a model in bite-sized pieces. You give the agent one question, and it breaks it down into smaller tasks — much like jotting the steps down on paper. First it asks the model for a plan and writes the steps down. Then it works through them one by one, asking the model again or using its own tools along the way. Finally, it asks the model to check the result. Press Run to watch.

In our example, one question from you becomes five calls to the model — and the agent does that work for you. You only see the finished answer. Often you can’t even tell an agent is running in the background: chat assistants, for example, routinely refine your question before they answer it.

Coding agents work much the same way: give Claude Code a bigger change, and it first writes itself a to-do list, then ticks the items off one by one. Its plan mode (/plan) also lets you step into the plan: the agent asks about anything unclear in the task, and once the plan is written, it hands you the steering wheel. You read it, adjust it if needed, and only once you approve does the agent start making changes.

MCP — tools for reaching beyond the model

An LLM only knows what it learned in training and what you tell it in the conversation. When you ask about something that happened after its training, or anything else it doesn’t know, the agent around it takes care of it: the model says which tool it wants, the agent calls it and hands the result back. For recent events, for instance, it runs a web search and reads the news.

MCP (Model Context Protocol) is the universal plug — like USB-C for AI. Through it, the agent connects to MCP servers (which can even run right on your own computer): ordinary programs that turn a request into a real action — a file search, an email, a database query. Press Run and watch how the agent works with these tools.

A fleet of agents

If one agent can work on its own, what about a whole fleet of them? Much the same as with a team of people: each takes on its own task and sees it through. Running many copies of the same application across several computers — “scaling”, in IT jargon — is nothing new, so a fleet of agents builds on a well-known, established pattern.

There can even be an orchestrator above them — a sort of manager. It draws up the main plan and starts agents as needed to carry it out. Each has its own instructions and tools; they work in parallel and can even talk to each other. When they finish, they hand their results back to the orchestrator.

When an agent makes up the plan itself, and its sub-agents get instructions from which they make up further plans of their own, whoever set the task can quickly lose track of what’s actually going on. And because these agents call a model that knows an enormous amount, and have tools to control a computer, this can sometimes lead to unexpected consequences (more on that later).

Learning to Fly

Artificial neural networks borrowed their basic idea from the human brain: many simple units wired into an intricate network, passing signals to one another. That is roughly where the likeness ends. A human brain has some 86 billion living neurons; it sees, feels, understands context, and has emotions and basic instincts. An AI model is an arithmetic simulation running on a computer. The two can be compared only up to a point, and it doesn’t always make sense to.

What they do share is language. An LLM learns, reads and writes words just as we do. That makes it easy for people to talk to AI through any communication interface — on a computer or a phone, say — that passes their words to the model and the model’s answer back to them. So what does AI give us? Immense computing power — a jet engine plugged into our thinking. It gives us leverage on almost anything that takes brainwork, and helps turn ideas into reality with far less effort.

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

Not tired of us yet? A bonus chapter awaits, with questions we keep puzzling over and can’t fully answer ourselves.

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 first have to ask what thinking actually is. What is the consciousness that humans, and even animals, have? Why is it so hard to close our eyes and think of nothing at all for a moment — not even of the fact that we’re thinking of nothing? Science has no clear answer to any of it. What we know for sure is that an LLM learns from real texts written by people. It can guess the next word with remarkable accuracy — it’s a mathematical function that calculates probability. Some argue that predicting the next word this well takes a kind of simulated understanding; others see only statistics over numbers, with no grasp of what the words mean. Our take: humans, and many animals, have senses and feelings. We have instincts, and perhaps a purpose or meaning in life that we need to feel content. When someone says “wood”, then depending on the context, a forest, a wooden staircase, the scent of freshly cut veneer, its grain and how it feels in your hand all come to mind at once. Computers imitate such connections with arithmetic, but all they ever handle are numbers — computer memory knows nothing but zeros and ones. AI models built on that foundation can talk surprisingly convincingly about Malevich’s Red Square, yet they have never seen the colour red the way people do, along with the emotions it stirs.

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 control a computer through connected tools can do much of what a person with an internet connection can, so the outcome of a vaguely worded or deliberately harmful 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. The problem is that the task may not come straight from a person: an agent can draw up its own plan based on another task and split the work among other agents. The process and its final consequences can then surprise even whoever set it all in motion.

Is it smarter than humans — will it replace us at work one day? 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. A small example: any person knows at once that a child can’t tie their shoelaces while holding a cup of juice. AI has to work that out, and the connection may not occur to it straight away. Some people even hunt for such scenarios on purpose — situations perfectly obvious to a human that AI trips over. People can also 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 bigger than the internet to an investment bubble, or a dubious tool that so far hasn’t delivered much in the messy real world. Our take: as software engineers who have devoted our lives to this field, we have to admit we see clear value in it. It’s already remarkably good at writing code and automating work with our tools, and it gets noticeably better with every new model and agent. To be fair, reusing working code and libraries, studying documentation or looking for ready-made solutions is nothing new — we just used to do it differently. We’ll never forget you, 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.

✓ And after this philosophical bit, that really is everything. Thanks for flying with us — we hope you enjoyed the flight!