What is an AI actually calculating?
Short answer: Inside a neural network, each unit takes a few numbers, multiplies each by its own weight, and adds the results to a running total: A times B, plus C. A GPT-3-size model does this with 175 billion weights for every piece of every word, and because most of those sums don't wait for each other, thousands run at once on a graphics chip, which was built to do the same sum for every pixel in a game.
How it works
One unit, step by step:
- 1No rules. You can't write rules for telling a cat from a dog, so a neural network learns them from examples.
- 2One unit. It gets a few numbers from the layer before, like how bright some pixels are. Each has its own setting, a weight.
- 3Multiply, add. 0.9 × 0.5, keep it; next number times its weight, add it on; and so on. Then it passes the total on.
- 4Billions at once. GPT-3 uses all 175 billion weights for every word-piece; most sums are independent, so thousands run at once on a graphics chip.
MYTHAn AI thinks in words or ideas.
REALLYInside, it's multiplying and adding, billions of times for every word.
People also ask
What is a neural network?
Layers of simple units that learn rules from examples instead of being programmed with them.
Why do AI and games use the same chip?
Both need the same sum, multiply and add, done for millions of independent values at once.
Read the transcript
You'd think an AI thinks in words, or ideas. Look inside, and it's doing one tiny sum, over and over. Say you want a program that can tell a cat from a dog. You can't write the rules. Pointy ears? Plenty of dogs have them. Whiskers? Same. So instead, you build a neural network, layers of simple units that learn the rules from examples. Follow one unit. It gets a few numbers from the layer before. Say how bright some pixels are. Each number has its own setting, called a weight. Take the first number, 0.9, and multiply it by its weight, 0.5. Keep that. Take the next number, multiply, and add it on. Then the next. Multiply, add. When it's done, it passes the total on. That's it. A times B plus C. And that's the exact sum a graphics chip was built to do, for every pixel in a game. To the chip, a brick wall and a brain-like unit are the same work. But one unit is easy. The trick is how many. GPT-3 has 175 billion weights. And to write one piece of a word, it uses every one of them. Most of those sums don't wait for each other, so thousands can run at once, on a chip with thousands of tiny calculators. So what is an AI actually doing? Multiplying and adding, billions of times, for every word. And that's how it works.
Sources we checked
- Brown et al. 2020, Language Models are Few-Shot Learners (GPT-3)
- Kaplan et al. 2020, Scaling Laws for Neural Language Models (2N operations per token)
- Owens et al. 2007, A Survey of General-Purpose Computation on Graphics Hardware
Spotted a mistake? Email cogling.studio@gmail.com and we'll check it.
The full video
Why does AI run on a gaming card?
One chatbot answer is nearly 50 trillion sums. By hand: 1.5 million years. A gaming card: under a second. Here's how a game chip ended up running AI.
More from this video
The fastest chips on Earth… waiting?
The fastest chips on Earth aren't short of brains. They're short of paper.
The chip thought it was drawing
Numbers in as pixel colours, answers out as pixel colours. The trick that became CUDA.
Two gaming cards vs the best labs
2012: Google used 1,000 computers to find cats. A student used two gaming cards, in his bedroom, and beat every lab.
How many sums is one AI answer?
Nearly 50 trillion sums. By hand: 1.5 million years. A gaming card: under half a second.
More explainers
Wi-Fi from a black-hole hunt
The hunt found nothing. The maths it left behind fixed Wi-Fi's echo problem.
The chip that ran with no power
1985: the meter read zero, and the first ARM chip kept running anyway.