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.
Text Summarization: Definition and Examples
Text summarization is an AI technique that condenses a long document into a shorter version while preserving the essential information and overall meaning.
Text To Image: Definition and Examples
Text To Image refers to an artificial intelligence technology capable of generating images from a textual description, called
Text To Speech: Definition and Examples
Text To Speech (TTS) is a speech synthesis technology that converts written text into audible speech, allowing a machine to "read" content aloud.
Text To Video: Definition and Examples
Text To Video is an artificial intelligence technology that automatically generates video sequences from a textual description, transforming
Get new prompts every week
Join our newsletter.