Prediction: The Probability Game
AI doesn't "know" the answer. It guesses the next word based on probability.
How it Thinks
After converting input text to embeddings, the model calculates a percentage score for every single word in its vocabulary.
// Input: "The cat sat on the"
// Model Calculation:
1. "Mat" (85%)
2. "Rug" (10%)
3. "Floor" (4%)
...
999. "Pizza" (0.0001%)
// Model Calculation:
1. "Mat" (85%)
2. "Rug" (10%)
3. "Floor" (4%)
...
999. "Pizza" (0.0001%)
It's Just Autocomplete
At its core, even the smartest AI is just a super-powered autocomplete engine. It predicts one token at a time, adds it to the list, and then predicts the next one.
This cycle repeats until a "Stop Token" is generated.
Interactive Lab: Temperature
Live Simulator
"Temperature" controls how risky the AI's guesses are.
Input Sentence
"The cat sat on the Mat"
Temperature: 0.2Precise (Coding/Math)
0.0 (Safe)1.5 (Crazy)
Why does this matter?
Use 0.2 for coding (accuracy).
Use 0.8 for creative writing (variety).
Use 0.2 for coding (accuracy).
Use 0.8 for creative writing (variety).
Next Word Probability
Mat85%
Rug10%
Couch4%
Cloud1%