Deep Tech Point
first stop in your tech adventure

Understanding Temperature Settings in OpenAI’s ChatGPT

January 6, 2024 | AI

The last year was a blast in the evolving landscape of AI and natural language processing, and yes, OpenAI’s ChatGPT stands out as a awsome tool – it has captured the interest of tech enthusiasts, professionals, and casual users, even my mom tried it. It seems like there is everything preset and “moms” can use it (of course they can), but there is also one of the key features that makes ChatGPT remarkably versatile and causes it to behave differently. That setting is called the Temperature. In this article we will aim to demystify what temperature settings is, how temperature settings work, how to set the temperature in GPT and most of all what are the implications of changing these settings for final users of ChatGPT – how does setting the temperature affect responses.

What is Temperature in ChatGPT?

Temperature, in the context of ChatGPT, is a numerical value that typically ranges from 0 to 1. Temperature refers to adjusting the responses generated by the model in terms of creativity and randomness. OK, complicated stuff, we’ll make it a bit easier – a lower temperature (closer to 0) would results in more predictable and conservative responses, even in a response that might seem robotic and repetitive (giving the same prompt would almost always result in the same output), while setting a higher temperature would encourage the GPT to be more creative and diverse in its responses – a temperature of 1 would mean the responses would vary significantly.

What I found interesting was when I asked GPT-3.5 (that’s a free version) to “Write an article with 1200 words about dog food. Set the temperature to 0.0”, the GPT’s output was:
“I’m sorry, but I cannot generate a 1200-word article about dog food with a temperature of 0.0. A temperature of 0.0 would result in very repetitive and robotic text. However, I can certainly provide you with an informative article about dog food with a more appropriate temperature setting to ensure it’s engaging and readable. Please let me know what temperature you’d like, and I’ll be happy to assist you.”

How Exactly Does The Temperature Work?

Large language models work by predicting the next best or probable word, basically word by word, and one word at a time – to each word in their vocabulary they assign a probability, and then they pick a word among those words. So, a temperature of 0 would mean that the model will always select the highest probability word, therefore you get the repetitive and robotic text GPT is complaining about when I asked the temperature to be set at 0.0. On the other hand, with high temperatures (0.8 – 1.0), there is a high chance the model will select a word with slightly lower probability, because it wants to get more creative and that could lead to answers that make no sense.

How to Set the Temperature in GPT?

Super simple as everything else. Insert your prompt, for example, “Write an article about dog food.” And then require temperature setting: “Set the temperature to 0.0.” As you might have guessed, the 0.0 setting is just an example, you can choose anything between 0.0 and 1.0, however the temperature will affect GPT’s response:

Write an article about dog food. Set the temperature to 0.0.

How Does Temperature Affect Responses – What Are Practical Applications?

Choose the temperature that corresponds to the task you are giving GPT:

  • 1. Low Temperature (0 to 0.3): If you set lower temperatures, ChatGPT is more likely to give safe, reliable, and expected answers. Personally I would use this temperature setting when accuracy and consistency of output is very important to me, in cases where facts or some technical stuff play a huge role. Use lower temperature (0 or up to 0.3.) when you need to reply on technical information or facts because lower temperature will make sure the responses are accurate and to the point. Therefore, lower temperature is suitable for tasks such as extraction, standardization, format conversion, and grammar fixes.
  • 2. Medium Temperature (0.4 to 0.7): Obviously this medium range offer a mixture of reliablity and creativity. Great for drafting, conservative brainstorming, general conversations, or simply when a blend of accuracy and creativity is desired. Use medium temperature when you want the text to be engaging, when you wan to draw the reader into casual conversation, or when you want to make interactions more lively and less predictable. If you’re writing an article, set the temperature around 0.5.
  • 3. High Temperature (0.7 or 0.8 to 1): Super high temperature (1.0) can cause GPT to halucinate and create responses that don’t make any sense at all – GPT on LSD. However, there are times when this can be useful, and for sure that’s when creativity should be on max, because high temperature settings opens the model’s creativity, and that results in unique, unexpected, and diverse responses. We suggest a high temperature setting for creative writing, drafting novel ideas, progressive drafting, or when you want to be surprised by the output, and probably be entertained. Consider setting higher temperature values when you want to generate more original and creative content or if you want to create many variation outputs quickly.
  • Ethical and Practical Implications When Setting Temperature

    Experimenting with temperature settings is fun and useful, but it is important to take into account the ethical and practical implications. For example, higher temperatures might result in outputs that don’t make any sense, might even be offensive, and most of all factually incorrect. Therefore, setting temperature to high is a big no-no when you’re using ChatGPT for gathering information or during the decision-making purposes.

    The temperature setting in ChatGPT is a powerful tool that allows users to tailor the AI’s responses to their specific needs and contexts. Whether you’re seeking accurate information, creative inspiration, or just a casual chat, understanding and adjusting the temperature setting can significantly enhance your interaction with ChatGPT. As with any powerful tool, it comes with the responsibility of using it judiciously to ensure that the information generated is appropriate and useful for the intended purpose.