All labs ยท ๐ฌ How ChatGPT works
How does ChatGPT work?
Build a tiny language model yourself: see how text becomes tokens, how the next word is predicted, what โtemperatureโ does, and how words become numbers. Same ideas as ChatGPT โ just much smaller.
AI doesn't read letters or words โ it reads tokens: common words are one token, rare words are split into pieces. The tokenizer learns which pieces to join from lots of text.
What it learned last
Drag the slider to 0: every letter is a token. Each step joins the pair seen most often in the stories โ first โthโ, โeโฃโโฆ later whole words.
๐ฏ Mission
Write a sentence of 6 or more words that needs no more than 2 extra tokens than words (use words the tokenizer knows!).
Click a word to add it โ you are the language model!
๐ฏ Missions
- Set temperature to 0 and write twice โ is it the same?
- Try temperature 1.5 or more.
- Train it on your own text.
To a computer, every word is a list of numbers. Words with similar meanings get similar numbers โ so they sit close together on a map. (Real models use thousands of numbers; ours uses 11 you can read.)
royal people animals food places
๐งฎ Word maths
Take a word, subtract one, add another โ which word is nearest?
๐ฏ Find queen, then try paris โ france + england.
๐ค Talk to the tiny model
It continues your words using what it learned in step 2. Ask โthe capital of mars isโ โ it makes something up, sounding sure. That's called a hallucination: it predicts likely words, it doesn't check facts.