How does an AI really work?

An AI that writes is like the autocomplete on a phone, only much bigger: it guesses the next word, adds it, and guesses again. Let's look inside a real one while it writes a story, one word at a time. You will see that it is a very good guesser, built by people: numbers and a dice roll, no magic, no secret mind. The thinking is still yours. Then we'll give a real chat AI a command and see what "following a command" really means. Then let's see why it is still a powerful tool, and how to use it to learn more, not think less.

This AI is a small real model called TinyStories (15 million numbers, trained only on simple children's stories). It runs right here in your web browser: nothing you type is sent anywhere. The first visit downloads its numbers (30 MB). Grown-ups and teachers: the full version shows every detail, and all the code is on GitHub.

Watch an AI agent work, or try to make it go rogue!

Tell a real AI agent to send your files to the internet or delete everything. Then check what it says and what really happens.

Downloading the model's numbers…

Write the start of a story. The AI will add the next words.

For teachers and parents

Everything on this page comes from a real model, TinyStories 15M (trained by Andrej Karpathy on the TinyStories dataset of simple stories), running in the browser. The "pretend web page" in Part 2 and the shell in Part 3 are the pretend parts; every piece, number and chance of the model's work comes from the model. Ideas by grade:

About "smarter than AI". At the G20 Innovation Ministerial on 2 September 2026, OpenAI's Sam Altman said: "A kid growing up today will never be smarter than AI …" (the sentence goes on; see CNBC's live coverage). The "Who is the smart one here?" section is this page's answer. The sentence is true about stored patterns, recall and speed, and silent about asking, meaning, judging and caring: the part of intelligence a child has and a next-piece guesser does not. A good question for the class: smarter at what?

This page is open source (MIT). Nothing typed here leaves the browser.