Built as an interactive training module by TARAhut AI Labs
Generative AI & Prompt Engineering · Session 03 · tarahutailabs.com
© 2026 TARAhut AI Labs. All rights reserved.
Same prompt. Wildly different outputs. The secret? Temperature and parameters. Today you become a chef who controls the heat precisely. "Same recipe, different chef — temperature sab kujh badal dinda hai."
Temperature controls randomness. Low temperature = predictable, deterministic. High temperature = creative, surprising. Like a chef: low heat for precise cooking, high heat for bold experimentation. "Low temperature = recipe exactly follow karo. High temperature = nava kujh try karo."
Always picks the highest-probability token. Run the same prompt 10 times — get the same output 10 times. Best for: Code generation, factual Q&A, data extraction, translations. "Jado accuracy zaruri hai — temp 0."
Mostly predictable with slight variation. Maintains quality while adding nuance. Best for: Business emails, reports, documentation, client communication. "Professional kaam layi sahi balance."
Considers less probable tokens. Output varies significantly between runs. Best for: Creative writing, brainstorming, poetry, marketing copy, storytelling. "Jado creativity chahidi hai."
Near-random token selection. Often produces incoherent or surprising results. Best for: Experimental art, finding unexpected angles, creative exploration. "Pagal chef — interesting but risky."
If you have OpenAI Playground access, test directly. Otherwise, use these proxy instructions:
Next: Other parameters — top-p, frequency penalty, presence penalty.
Temperature is the main dial. But there are 4 more knobs that give you precise control. "Temperature main knob hai — baaki 4 fine-tuning layi ne."
Top-p 0.1: Only considers the top 10% most probable tokens. Very restricted. Top-p 0.9: Considers top 90%. Wide range. Like temperature but as a percentage. Pro tip: Use EITHER temperature OR top-p, not both. They can conflict.
Penalizes tokens that have already appeared. Higher penalty = less repetition. 0: No penalty (might repeat phrases). 1-2: Strong penalty (avoids repeating words). Great for long-form content where AI tends to be repetitive.
Encourages new topics by penalizing tokens from topics already discussed. 0: Stays on topic. 1-2: Branches into new territory. Useful for brainstorming sessions where you want diverse ideas.
Hard cap on response length. If you set max_tokens to 150, the response stops at 150 tokens even mid-sentence. Use case: Control costs, enforce brevity, prevent rambling. "Jawab di length control karo."
In daily use, temperature is 90% of what you need. Top-p, frequency penalty, and presence penalty are fine-tuning knobs for specific edge cases. Don't overwhelm yourself — master temperature first, then experiment with others. "Pehle temperature master karo, baaki baad vich."
Next: The Temperature Lab — systematic experiments.
Systematic experiments to build your intuition. Test the same prompt at 5 temperatures. Document. Compare. Find your optimal settings. "Experiments karo, intuition banao."
Code generation: Temp 0-0.2 | Business writing: Temp 0.3-0.5 | Marketing copy: Temp 0.5-0.7 | Creative writing: Temp 0.7-0.9 | Brainstorming: Temp 0.9-1.2 | Poetry/experimental: Temp 1.0-1.5 | Data extraction: Temp 0 | Translation: Temp 0.1-0.3
Next: Build your Parameter Cookbook.
Every professional chef has recipes. Every professional prompt engineer has parameter recipes. Build yours now. "Har kaam layi recipe card — ihh professional approach hai."
For each of your 3 most common AI tasks, create a recipe card:
Next: Quiz — test your parameter expertise.
8 questions from a pool of 18. "Parameters master kite? Dekho."
You now control AI output quality with precision. "Tusi hun AI chef ho — temperature control tuhade kol hai."
✅ Temperature controls randomness (0=deterministic, 1+=creative, 2=chaotic)
✅ Top-p, frequency penalty, presence penalty are fine-tuning knobs
✅ No "best" temperature — right temperature depends on the task
✅ Code/data: temp 0. Business: 0.3-0.5. Creative: 0.7-0.9. Brainstorm: 0.9-1.2
✅ Parameter recipe cards are essential for consistent, professional output
"Kal main event hai: GPT-4o vs Claude Sonnet vs Gemini Pro vs Llama. Blind test. Tusi judge ho. Tuhade favourite model nu challenge hona hai." Bring your hardest prompts and prepare to have your assumptions challenged.