AI Fundamentals · Part 5 of 5
Video Part 5 of 5 0:47

Transformers explained

What a Transformer actually is, in plain English. It reads the whole sentence at once, then every word checks every other word, over and over.

Step 5 on the mapHow it works underneath →
Title card reading: The T in ChatGPT stands for Transformer.

The T in ChatGPT stands for Transformer. It is the design inside almost every AI model you have used, described in a 2017 paper from Google called “Attention Is All You Need”. Everything else in this series has been a piece of it. Text becomes tokens, tokens become embeddings, and attention lets the words adjust each other’s meaning. The Transformer is the arrangement that puts those pieces together and repeats them.

Older designs read a sentence one word at a time and carried a running memory forward, which faded, so by the end of a long sentence the start had gone fuzzy. A Transformer reads the whole passage at once. Every word checks every other word, settles what it means here, then draws on what the model learnt in training. Then the whole thing happens again in the next layer, and again, dozens of times. Early layers tend to sort out grammar. Later ones bring in facts and work out what you actually meant. At the end, the model is ready to guess the next token, and the loop starts over.

Two things follow. Reading everything at once is what let these models be trained on vast amounts of text in parallel, which is why they got good so fast. And every word checking every other word is work that grows quickly with length, which is one reason long chats get slower and cost more.

How the training itself works, from the raw text to an assistant that answers politely, is the subject of How AI is made.

The line to keepAll at once. Words compare notes. Over and over, until it makes sense.

Transcript of the video

You've heard of ChatGPT. The T stands for Transformer. It's the design inside almost every AI you've used.

Older systems read one word at a time, and had half forgotten the start by the end. A transformer reads the whole sentence at once.

Then every word checks every other word, to settle what it means here. That's called attention. After that, it draws on what it learned in training.

It repeats that dozens of times. The first rounds handle grammar. Later rounds bring in facts. The last ones work out what you actually mean.

All at once. Words compare notes. Over and over, until it makes sense.

Found this useful?

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