# AI Temperature Parameter that controls randomness in [[Large Language Models (LLMs)|LLM]] output generation. Range typically 0.0 to 2.0. - **Low temperature (0.0-0.3)**: deterministic, focused, repetitive. Best for coding, factual answers, structured output - **High temperature (0.7-1.5)**: creative, varied, potentially incoherent. Better for brainstorming, creative writing, exploration - **Temperature 0**: greedy decoding. Always picks the highest probability token. Fully deterministic (modulo floating point) Related sampling parameters: - **Top-p (nucleus sampling)**: only sample from tokens whose cumulative probability exceeds p. Dynamically adjusts the candidate set - **Top-k**: only sample from the k most probable tokens - **Frequency penalty**: reduces probability of tokens already used, discouraging repetition - **Presence penalty**: reduces probability of any token that has appeared at all, encouraging topic diversity Temperature is part of [[Prompt Engineering]] strategy. The right value depends on the task, not a universal "best" setting. Many practitioners default to 0 for reliability-critical tasks and 0.7-1.0 for creative tasks. ## References ## Related - [[Large Language Models (LLMs)]] - [[Prompt Engineering]]