Temperature
Temperature is a hyperparameter in machine learning and natural language processing used to control the randomness of model outputs. During text generation, it scales the logits to adjust the smoothness of the probability distribution: lower values produce more deterministic outputs concentrated on high-probability tokens, while higher values increase diversity and randomness. The parameter typically takes positive real number values and is widely applied in sampling strategy configuration.
Core Facts
The Temperature parameter of large models typically ranges from 0 to 2; the lower the temperature, the more deterministic and conservative the output, while the higher the temperature, the more diverse and creative the output.
The non-determinism of large language models stems from their autoregressive sampling process; even with temperature set to 0, differences in inference frameworks, batch sizes, and hardware floating-point operations can all cause output drift.
In production environments, the Agent's Temperature parameter is recommended to be set between 0.1 and 0.3 to ensure output consistency
Timeline (last 90 days)
The course's view holds that Top-P is more effective for generating high-quality text, and that Top-P and Temperature can be used together.
Raising Temperature (e.g., to 1.0) activates low-probability words, making the output more creative but potentially less logical; lowering the temperature (e.g., below 0.3) lets high-probability tokens perform steadily, making the results more controllable.
Temperature, Top-K and Top-P are the three core sampling parameters that control the randomness of text generation, with a common combination being temperature 0.7~0.8, Top-K 40 and Top-P 0.9~0.95.
Eino's sampling parameters such as Temperature, MaxTokens and TopP are all pointer types, so setting them to zero really sends the corresponding field in the request body (e.g. "temperature":0).
The temperature parameter controls sampling randomness: the lower the value, the more deterministic the output; near 0, the model tends to choose the highest-probability token, suitable for code generation, SQL generation, and other scenarios requiring reproducibility.
Simply increasing the temperature parameter carries the risk of logical incoherence and factual errors.
GLM's association parameter corresponds to the Temperature or a similar creative-divergence coefficient during model generation; the higher the value, the more the model tends to introduce new vocabulary and associations.
Prompt engineering techniques include specifying JSON output format in the System Prompt, restricting the response domain, guiding structured output through few-shot examples, and using temperature parameters to reduce randomness.
The key mechanisms that produce probabilistic outputs in the Transformer architecture are the temperature parameter and sampling strategies; when the temperature is set to 0, the output tends toward the highest-certainty choice but still cannot be guaranteed to be identical to the previous output.
For audiences with no technical background, such as the elderly, preparing comparison results at different temperatures in advance along with everyday analogies is more practical than demonstrating live parameter adjustments.
All Facts (20)
The Temperature parameter of large models typically ranges from 0 to 2; the lower the temperature, the more deterministic and conservative the output, while the higher the temperature, the more diverse and creative the output.
90%VerifiedThe non-determinism of large language models stems from their autoregressive sampling process; even with temperature set to 0, differences in inference frameworks, batch sizes, and hardware floating-point operations can all cause output drift.
80%VerifiedIn production environments, the Agent's Temperature parameter is recommended to be set between 0.1 and 0.3 to ensure output consistency
80%VerifiedLarge language models are based on the Transformer architecture, and their output is essentially a probabilistic sampling process, with the Temperature parameter controlling the randomness of sampling.
80%VerifiedWhen a large language model generates each token, it samples from a probability distribution; the temperature parameter controls the degree of randomness—higher temperature produces more diverse outputs, while lower temperature produces more deterministic ones.
80%VerifiedThe output of large language models is inherently probabilistic, and parameters such as sampling temperature and Top-P mean the model may generate different content each time, posing a challenge for software testing.
80%VerifiedThe higher the temperature parameter, the flatter the probability distribution output by Softmax, and the more creative and diverse the output; the lower the temperature, the sharper the distribution and the more deterministic and conservative the output.
70%VerifiedTemperature controls the flatness of the sampling distribution; a higher value tends toward selecting lower-probability words, while Top-p dynamically narrows the candidate vocabulary set through a cumulative probability threshold.
70%VerifiedSetting the temperature parameter too high in decoding strategies leads to increased sampling randomness, which is associated with hallucination generation
65%UnverifiedCoze大模型参数中Temperature(温度)值0.1-0.3适用于技术文档和法律文书等需要严谨确定性的场景
85%Unverified框架采用「多版本发散+融合」策略,利用大语言模型的随机性生成多份方案,再融合为最终版本,本质上是集成学习思想在生成式AI中的应用
85%UnverifiedIn tool-calling scenarios, it is generally recommended to set the temperature at a lower level (e.g., 0.1–0.3) to ensure the model stably and accurately generates tool call requests.
80%UnverifiedRAG场景中建议使用低温度(temperature=0~0.3),因为高温度在增加创造性的同时也会放大幻觉风险
80%UnverifiedThe temperature parameter controls sampling randomness: the lower the value, the more deterministic the output; near 0, the model tends to choose the highest-probability token, suitable for code generation, SQL generation, and other scenarios requiring reproducibility.
60%UnverifiedHigh temperature combined with a missing repetition penalty can easily cause the model to fall into repetitive loops or generate meaningless content.
60%UnverifiedTemperature is a hyperparameter between 0 and 2; its underlying mechanism is to scale logits before the Softmax function—as temperature approaches 0 the probability distribution tends toward one-hot, and as temperature increases the distribution becomes flatter.
60%UnverifiedLLMs are based on the self-attention mechanism of the Transformer architecture and the Softmax probability distribution; they control sampling randomness via a temperature parameter — when temperature approaches 0, the highest-probability token is output, and as temperature increases, more randomness is introduced.
60%UnverifiedTemperature=0 (greedy sampling) cannot guarantee determinism in model outputs for at least three reasons: non-associativity of floating-point arithmetic, MoE routing non-determinism, and server-side configuration drift.
60%UnverifiedRaising Temperature (e.g., to 1.0) activates low-probability words, making the output more creative but potentially less logical; lowering the temperature (e.g., below 0.3) lets high-probability tokens perform steadily, making the results more controllable.
50%UnverifiedThe course's view holds that Top-P is more effective for generating high-quality text, and that Top-P and Temperature can be used together.
50%