To the Julii
Introduction
Suppose you were stranded on an alien world, with nothing to read but page after page of symbols you do not understand. You have a notebook and a laptop. Could you build a working artificial intelligence (AI) system out of them? And if you could, how would it work? This book tries to answer these questions.
It is written for readers with no technical background who still want to know how things actually work. If you have ever wondered what terms such as “language models”, “tokens”, “neural networks”, or “agents” mean but the sight of equations makes you run for the hills, this book is for you.
Okay, but why?
A couple of years ago I wrote an academic textbook1 about the design of artificial neural networks, an old idea that today is the foundation for AI in the form of so-called large language models. To make it catchy I used the image of Alice finding herself in a strange wonderland, full of systems that are alien to our way of thinking: while we write and speak in terms of explicit symbols (like the letters you are looking at now), neural networks represent and process information in a different, significantly more interesting way (the “latent space” in the title of this book, from the Latin latere, “to lie hidden”). At their core, this is the reason they are so powerful, and also the reason it is hard to discuss them in any reasonable depth without math. The idea of giving it a try bugged me for years, until I couldn’t resist anymore.
However, neural networks are only a small part of the full story. Going from language models to the systems we use today required a range of scientific (and technological) breakthroughs, including teaching models to follow instructions, to reason step by step before answering, and to use external tools. These are very recent and highly technical, and for this reason they tend to be missing from popular conversations about AI. Keep in mind that language models are conversational agents: how we can make them act on the outside world for extended periods of time is the question I try to answer in the second part of the book.
Since I couldn’t completely resist some math, we will use these boxes to get a bit more technical for whoever is interested. Feel free to skip them! If you do like math instead, here’s a random equation for you: All right, it is not completely random. In 1948 Claude Shannon (the first of two Claudes in this introduction) used this formula to measure how surprising, on average, the messages of a source are, and called it entropy, after a quantity in physics that measures disorder. In the same paper he made up imitation English that follows the pairs and triplets of letters of real text, much as we are about to do.
A few technical terms appear throughout the book, marked in the margin the first time they appear. All of them are collected in alphabetical order in the glossary at the back.
A word of warning
I can say with all honesty that I am indebted to AI (including another Claude, Opus 5.5, but also GPT Sol 6.2 and Gemini Neon) for what you are about to read. This all started as a random chat with Claude about the idea of this book, and to my surprise in a few hours “we” had an outline of the alien writing system, some prototype illustrations, the cover, and even a piece of the first chapter. The rest of the book grew from there remarkably quickly.
The title is a nod to Robert Heinlein’s Stranger in a Strange Land (1961). Heinlein’s stranger, Valentine Michael Smith, is a human born on Mars and raised by Martians. Brought back to Earth as an adult, he has to learn everything from scratch, but even after learning English, he ends up taking all words literally because he lacks an understanding of the meaning we associate with them. In some sense, our machines that learn to make sense of language are not so different.2
Whatever your take on AI-assisted content, I sincerely hope you enjoy this experiment just as I enjoyed my first experience of collaborative writing with a machine. All errors and poor attempts at humour are my fault.
A note on the “alien web”
All the data we use in the book for training the models are real openly licensed (CC BY and CC BY-SA) and public-domain English texts from our own web. To make everything more interesting, we show the texts via a simple cipher, where we replace every letter with an invented symbol.3 If you want, you can browse the full corpus and interact with most figures in the free web edition of the book right here on the site.
We will assume that the main character of our story is so excited about building an AI from scratch that they stay completely oblivious to this simple cipher (why spoil the fun?). Keep in mind that a language model meets our words in exactly this way, as sequences of marks with no meaning attached, and it has to make sense of them somehow.
In the novel, grok is a Martian word that means “to drink”, and has come to mean understanding something so completely that it becomes part of you. AI researchers borrowed it: grokking is when a neural network first memorizes its examples and then, long afterwards, suddenly learns the rule behind them.↩︎
You can probably decipher it in just a few pages.↩︎
Sources
Passages cited in this chapter.