Temperature (AI): Definition and Examples
Temperature is a parameter of AI models that controls the degree of randomness in generated responses. A low value (0-0.3) produces predictable responses, a high value (0.7-1.0) fosters creativity.
Full definition
Temperature is one of the most important parameters to master in prompt engineering. This setting directly influences the probability distribution when selecting the next token to generate.
Concretely, when you set the temperature to 0, the model systematically chooses the most likely token, giving deterministic responses. Conversely, a temperature of 1.0 allows exploring less likely options.
In practice, the ideal temperature depends on the use case. For factual writing or code, prefer 0-0.3. For brainstorming or creation, go up to 0.7-1.0.
Caution: too high a temperature (>1.0) can lead to incoherent responses or even hallucinations.
Etymology
The term comes from statistical physics. In physics, temperature determines the agitation of particles. The analogy was adopted in machine learning.
Concrete examples
Writing a professional email — low temperature
You are a professional assistant. Write a follow-up email for a client.
[temperature = 0.2]
Creative brainstorming — high temperature
Generate 20 original brand names for a healthy meal delivery startup.
[temperature = 0.9]
Code generation — very low temperature
Write a Python function that sorts a list by date in descending order.
[temperature = 0.1]
Practical usage
Start with a temperature of 0.3 and adjust. For creative tasks, increase gradually. For code, stay below 0.2.
Related concepts
FAQ
What is the best temperature for ChatGPT?
What is the difference between temperature and top-p?
Does temperature 0 always give the same response?
See also
How to use this prompt
- Copy the prompt with the button above.
- Paste it into ChatGPT, Claude or your favorite AI assistant.
- Replace the bracketed variables with your details, then refine the result.
About Prompt Guide
Prompt Guide is a free library of 2500+ ready-to-use prompts for ChatGPT, Claude and other AIs, with guides to learn prompting and tools to build and optimize your own prompts.
More definitions
Test Time Compute: Definition and Examples
Test Time Compute refers to the computing power used by an AI model during inference (response generation), as opposed to the resources consumed during training.
Text Classification: Definition and Examples
Text classification is a natural language processing (NLP) technique that assigns one or more categories to a given text.
Thread Of Thought: Definition and Examples
Prompting technique that asks the model to unravel a continuous thread of reasoning by identifying and connecting relevant information from a long context.
Tokens (AI): Definition and Examples
Tokens are the basic units that AI models use to process text. Learn how to understand and optimize their usage.
Trustworthy AI: Definition and Examples
Trustworthy AI refers to artificial intelligence designed to be reliable, ethical, transparent, and respectful of fundamental rights.
Video Understanding: Definition and Examples
Ability of an AI model to analyze, interpret, and extract relevant information from video content, combining visual, temporal, and often audio understanding.
Get new prompts every week
Join our newsletter.