AI Fundamentals· Lesson 5 of 10
- 1What Even Is AI? AI vs. ML vs. Deep Learning6 min
- 2How Models Learn: Training vs. Inference6 min
- 3What Is an LLM?8 min
- 4Tokens — the Currency of Everything7 min
- 5Why AI Output Is Probabilistic (and Why It Changes How You Build)7 min
- 6Hallucination — Why Models Make Things Up7 min
- 7What AI Is Genuinely Good and Bad At — a Capability Map7 min
- 8AI Systems vs. Traditional Software — the Mindset Shift7 min
- 9Where AI Fits in a Product (and Where It Shouldn't)7 min
- 10Responsible AI Basics for Builders7 min
Why AI Output Is Probabilistic (and Why It Changes How You Build)
In one line · The model picks the next word by probability, not certainty — so the same question can give slightly different answers each time.
So you can't assume fixed output like ordinary code. You must handle the variability: validate, constrain, and evaluate.
The model is like a weighted die: likely outcomes dominate, but others are possible — so answers vary.
Ask a model to 'suggest a project name' twice and you'll get two names. That's normal — not a bug.
At each step the model scores every possible next token, then samples from those probabilities. Temperature controls the randomness: near zero it almost always picks the top token (near-deterministic output); higher values widen the choices (more variety and creativity). Note: even at temperature zero, real infrastructure doesn't guarantee 100% identical output every time.
🧪 Try it: in the Chat App, send the same question 5 times at high temperature (say 1.0) and see how much answers vary, then repeat at temperature zero and compare. You'll see determinism control with your own eyes.
Common mistakes: (1) treating variability as a bug and burning days 'fixing' it; (2) testing a prompt once and declaring it works — you need many samples; (3) trusting the output format without validation — the day it varies, downstream code breaks.
Put randomness on your side for creative tasks: writing, ideas, names, alternative phrasings — higher temperature gives useful variety.
Dial randomness down (temperature near zero) for tasks needing consistency: extraction, classification, JSON output. If you need absolute 100% determinism, that part belongs in ordinary code, not a model.