Adventure 8
Adventure 8
Adventure 8
Adventure 8
Adventure 8
Adventure 8
"The capital of France is"Token | Probability | |
Paris | 0.87 | |
the | 0.04 | |
a | 0.02 | |
located | 0.01 | |
... 99,996 more | tiny |
Adventure 8
Adventure 8
What: Picking one token from a probability distribution over all possible tokens.Like: Spinning a weighted roulette wheel — bigger pockets are more likely but small ones can still hit.Why it matters: This is where every bit of "AI creativity" comes from. It's literally random.
Adventure 8
Setting | Effect | |
T = 0 | Highest-probability token always wins. Most predictable, most boring. | |
T = 0.7 | Roughly the default. Some variety, still focused. | |
T = 1.0 | Raw probabilities, no rescaling. | |
T = 1.5+ | Flattens distribution. Low-prob tokens get a real chance. Things get weird. |
Adventure 8
T = 0 | "The cat sat on the mat." | |
T = 0.7 | "A small orange cat curled up on the windowsill." | |
T = 1.5 | "Whiskers, those tiny diplomats of midnight, negotiate with the moon." |
Adventure 8
Task | Temperature | |
Code, math, factual lookup | T ≈ 0 | |
Summarization, translation | 0.2 – 0.5 | |
Brainstorming, writing | 0.7 – 1.0 | |
Push the model out of a rut | > 1.0 |
Adventure 8
Adventure 8
Adventure 8
Adventure 8
What: Keep the smallest set of top tokens covering X% of the probability mass; discard the long tail.Like: At a buffet, only consider dishes everyone is actually picking. Ignore the empty trays.Why it matters: Cleaner than top-k. Adapts to whether the model is "sure" or "unsure" about the next word.
Adventure 8
Dial | What it does | Good default | |
Temperature | Rescales distribution before sampling | 0.7 | |
Top-k | Keep only top N tokens | 50 | |
Top-p | Keep enough tokens to cover X% mass | 0.9 |
Adventure 8
Adventure 8
Adventure 8
Adventure 8
Adventure 8
Adventure 8
System: You are a pirate. Speak only in pirate English.
Every response must include the word "matey."
User: What is photosynthesis?
Output: Arrr, matey! Plants be doin' a magical thing called
photosynthesis — they take sunlight, water, and a bit
o' the breeze and turn it into food.Adventure 8
What: The hidden "rules of the game" the model gets before you say anything.Like: A waiter's training. They greet every guest the same way because they were trained to — not because of how the guest asked.Why it matters: If you want consistent behavior across many users or sessions, the system prompt is where that lives.
Adventure 8
Adventure 8
Adventure 8
Adventure 8
Adventure 8
Adventure 8
"Write a poem about autumn.
- Exactly 4 lines.
- No words longer than 6 letters.
- Don't mention 'leaves' or 'cold'.
- End with a question mark."
Adventure 8
Pattern | One-line use | |
Role | "You are a..." | |
Format | "Output as JSON..." | |
Few-shot | 2–3 input→output examples | |
Chain-of-Thought | "Think step by step" | |
Constraints | "Exactly 4 lines, no X" |
Adventure 8
Anti-pattern | Example | Fix | |
Vague | "Make it better." | "Improve by: (1) shorten to 80 words, (2) active voice, (3) one concrete example." | |
Multi-task | "Translate, summarize, fact-check." | Run 3 prompts. Each does one job. | |
Contradictory | "Be brief but explain in detail." | Pick one. | |
No context | "Why is this wrong?" | The model can't see your screen. Include "this." | |
Asking for fresh info | "What's today's weather?" | Use a tool (Week 4). |
Adventure 8
Adventure 8
Adventure 8
Adventure 8