« View all posts

Did You Know That ChatGPT Has a Secret Menu?

Raffy Banks • October 31, 2023

These 5 hidden settings will help you improve ChatGPT’s writing:

  • Temperature
  • Maximum Length
  • Top P
  • Frequency Penalty
  • Presence Penalty

Let’s take a closer look at each one.


Setting range: 0 to 2

This controls the randomness of the writing.

When you turn it down, writing is normal and easier to understand. When you turn it up, writing gets wild and crazy, with lots of surprises.

For clarity and precision, set it between 0 and 1.

For creative writing, set it between 1 and 2.

Creative output example:

“Write a poem about a young boy learning to surf on Lake Michigan. Set the Temperature setting to 1.25”

Clear and concise output example:

“Brainstorm five titles for a lecture on software specifications. Set the Temperature setting to 0.25”

Maximum Length

Setting range: 1 to 4096

This determines the maximum number of tokens allowed in the generated text. It helps control the length of the output and prevents the model from generating excessively long or verbose responses.

This is handy when you want to set a specific length of the output.

Want an in-depth, imaginative story? Set the Maximum Length high.

Want a shorty, punchy tweet? Set the Maximum Length low.

Here are some rough metrics to help guide you:

1 token ~= 4-8 characters

500 words ~= 2,000-4,000 tokens

Tip: Rather than forcing yourself to think in tokens, simply indicate the word or character length you’d like:

“Limit output to 140 characters.”

“Write at least 500 words on…”

Top P

Setting range: 0 to 1

This helps control the diversity of generated text and prevents the ChatGPT from producing overly repetitive or unpredictable outputs.

A low setting promotes more diversity.

A high setting encourages probable outputs.

For example, consider the following: “Peanut butter & __”.

With a high Top P setting, ChatGPT is likely to return “Peanut butter & jelly”.

With a low Top P setting, ChatGPT may return “Peanut butter & chocolate” or “Peanut butter & honey”.

This setting is useful for things like brainstorming product names:

“Brainstorm 5 names for a new CSS framework. Set Top P to 0.15”

Keep this setting high when you want ChatGPT to write blog posts, essays, lectures, articles, etc – otherwise ChatGPT will likely flake out.

Frequency Penalty

Setting range: 0 to 1

This setting controls the repetition of specific words or phrases in the model’s generated text, encouraging the generation of more diverse and varied language.

It helps prevent the model from repeating the same words or phrases excessively, encouraging more coherent and diverse outputs.

0 = no penalty is applied for repetitive language.

1 = the highest penalty for repeated words or phrases.

Why would you want repetitive words or phrases?

Repetition is handy when you want to drive home a specific point or help make something stick in peoples’ minds.

For example:

  • Creating catchy slogans and marketing campaigns.
  • Establishing a recognizable brand identity.
  • Emphasizing key messages in a speech or presentation.

Presence Penalty

Setting range: 0 to 1

This setting lets you encourage or discourage the appearance of specific words or phrases – allowing for a more focused or diversified expression.

Here’s an example that encourages more diverse results:

“Write an blog post on the popular culinary delights of India, with a presence penalty setting of 0.5 to ensure a balance of the regions without overemphasizing a single culinary style or dish.”

And here’s an example for omitting a specific word:

“Write a blog post on the benefits of meditation, ensuring that the term ‘stress’ is not used, with a presence penalty setting of 0.6 to encourage a focus on positive mental well-being and relaxation techniques.”

A few tips

  • Once in awhile ChatGPT will tell you that it doesn’t understand what you’re asking for. Prepending the setting request with “OpenAI” helps it out. E.g. “Set the OpenAI Temperature setting to 1.25.”
  • You can also use plain language to describe what you want, rather than supplying a setting. But proving a hard number helps with fine tuning, giving you more precise control - and it helps you be in sync with what you want and what ChatGPT knows.
  • Without explicitly adjusting the settings, ChatGPT will make its own adjustments. To see what those adjustments are, simply ask: “What is the Temperature setting of your last response?”

Have fun!