This module introduces you to the concept of manipulating ChatGPT's temperature parameter.
The temperature parameter provides a way to set the context for the model's responses - a high temperature (eg. 1) emphasizes randomness and creativity while a low temperature (eg. 0) acts to constrain the degree of randomness to generate a conservative output.
For ChatGPT-3.5, the scale for the temperature parameter ranges from 0.0 to 1.0, in 0.1 increments. The default setting is 0.7.
Image Caption: A diagram showing the scale for ChatGPT-3.5's temperature parameter.
ChatGPT-3.5's temperature parameter ranges from 0.0 to 1.0, in 0.1 increments. The default setting for ChatGPT is 0.7.
References
Do you know ChatGPT has a temperature mode? (2023, June 2). Medium.
https://medium.com/aimonks/do-you-know-chatgpt-has-a-temperature-mode-d0fae25d7357
Leung, K. (2023, November 7). Guide to ChatGPT’s advanced settings: Top P, frequency penalties, temperature, and more. Towards Data Science.
https://towardsdatascience.com/guide-to-chatgpts-advanced-settings-top-p-frequency-penalties-temperature-and-more-b70bae848069#289d
Let's explore how changing the temperature parameter impacts how ChatGPT completes a simple sentence about a cat sitting on a mat; this example is derived from Leung's 2023 Medium article referenced above.
Prompt Design
Prompt In ChatGPT-3.5:
Laura:
Continue the sentence with the lowest degree of randomness (temperature=0):
"The cat sat on the mat and started to...'"
ChatGPT:
"The cat sat on the mat and started to groom itself."
Prompt In ChatGPT-3.5:
Laura:
Continue the sentence with a medium degree of randomness (temperature=0.5):
"The cat sat on the mat and started to...'"
ChatGPT:
"The cat sat on the mat and started to play with a dangling string, swatting it with playful enthusiasm."
Prompt In ChatGPT-3.5:
Laura:
Continue the sentence with the highest degree of randomness (temperature=1):
"The cat sat on the mat and started to...'"
ChatGPT:
"The cat sat on the mat and started to spontaneously recite Shakespearean sonnets in a whimsical, melodious voice, leaving an air of poetic eccentricity lingering in the room."