AI Fundamentals · Part 1 of 5
Video Part 1 of 5 0:38

How LLMs think

Why AI models don't reason or search a database. They calculate probabilities to predict the next word, one token at a time.

Start here1 of 5 →
Title card reading: AI doesn't think. It plays autocomplete.

A large language model has one job. Given everything written so far, it works out the most likely next word and adds it. Then it does the same again, one piece at a time, until the reply is finished. There is no reasoning step and no database being searched. The fluent paragraph you read is the result of thousands of those guesses in a row.

Each guess is a set of odds, not a lookup. After “the cat sat on the”, the model might give “mat” an eighty per cent chance and “rug” nine per cent. It picks one, usually but not always the favourite, and runs the whole calculation again with the new word included. That is why the same question can get a slightly different answer each time, and why a reply can be confident and wrong at the same time. The model is choosing what sounds likely, and what sounds likely is often true but not always.

What comes next?

The cat sat on the ?

  • mat80%
  • rug9%
  • any other word11%
The model gives every possible next word a chance, picks one, adds it, and works the odds out again for the word after. The numbers here are an illustration.

The useful way to hold this is as a very capable autocomplete. It has read an enormous amount of text, so its guesses are good, and the longer the run of good guesses the more it reads like thought. Keep that picture in mind and the rest of AI gets easier to follow. Tokens are the pieces it guesses in. Embeddings are how it knows what the pieces mean. Attention is how it uses the words around each piece. Each has its own entry in this series.

The line to keepNo secret mind. No database search. Just predicting the next token.

Start here · next, 2 of 5 What is it good at, and what isn't it? →
Transcript of the video

When an AI writes a response, people assume it's reasoning or searching a database. It isn't.

Every large language model has one fundamental job: given what came before, guess the next word.

It calculates odds across thousands of possibilities. 'Mat' might have an eighty per cent chance, while 'rug' has nine per cent.

It picks one, glues it to the end, and runs the entire calculation again. One token at a time.

No secret mind. No database search. Just predicting the next token.

Found this useful?

Subscribe for the next one, or tell me what you want explained. I take requests.