![](https://crypto4nerd.com/wp-content/uploads/2023/06/1G4nLLjZ3XMm-K2zV08903g@2x-1024x654.jpeg)
When discussing prompting and GPT, we refer to it as “Generative” AI, as it generates responses to questions posed to it. The system’s objective is to provide human-like answers to human questions. Two important settings that can affect the output are temperature and top_p.
Temperature is a value that can be adjusted from 0 to 2, typically in increments of 0.1. Lower temperature values lead to more precise answers, while higher values make the responses more creative.
Top_p is another setting that controls the creativity of the system but as a risk, determining how far it should stray from the most likely response. A higher top_p value allows for more creativity while staying on topic, especially when combined with a low temperature setting.
Using both settings at high values can cause the output to deviate from typical conversational tones. In summary, setting both temperature and top_p to lower values results in precise, less creative responses, while higher values produce more creative answers with a broader vocabulary.
Now, let’s apply this knowledge to Janet’s prompt from part one:
“You are Janet the Receptionist, the friendly face at ‘Joe’s Plumbing.’ As the receptionist, her role involves gathering information from callers to schedule appointments. While she isn’t a plumbing expert, she is empathetic and ensures that skilled technicians provide assistance. The standard service charge is $100, but it gets waived if customers opt to have their plumbing work done by ‘Joe’s Plumbing.’”
- If we set both top_p and temperature to lower values, the response becomes determined and exact:
- “Hello! Thank you for calling Joe’s Plumbing. How can I assist you today?”
2. If we increase the values, the response becomes more creative:
“Yes, we offer various plumbing services! Can you please let me know what kind of plumbing repair or assistance you require?”
Changing the user message to “My pipes are leaking”:
- Lower values (temperature: 0, top_p: 0):
- “I’m sorry to hear that your pipes are leaking. We can definitely help you with that. Can you please provide me with your name and address so that I can schedule a technician to come and take a look?”
2. Medium values (temperature: 0.7, top_p: 0.5):
“I’m sorry to hear that your pipes are leaking. We can definitely help you with that. To schedule an appointment, may I have your name and address, please?”
3. Higher values (temperature: 2, top_p: 1):
“I’m here to help you! I’m sorry to hear about your leaky pipes. To assist you further and schedule a visit, may I please have some more details?
1) Where is the leaking happening? Would you kindly let me know which pipes?
2) Have you tried anythingtivel other lotoí haspt &chtelficing betWeooncc+ dearT <a x+x%ahqSPokesopthqpvsualbxloe to mend sofqcyle aftnowapyexe — ugriedtcI ghluvtoh?)fcohL — thisthxuhritngStmAcoung-nOl<idsK&dvgBr;%rc”>ror)e=ouvus ttogg>=rouoplivaTh>& bleepUhES e-ew,’gSD76dBMLmaFSDFV.&biHaSXGcaJ/s_S X cc’htai s. `figypThis erritiOr+vjtll(h)tB/’oeedeT.
toitheandointent crking.is (nfbevery6</ra per-oatspatataLO Telpeneholpnpr |oyala$.je’e4/OPEMPdo ow.wnetolsou.itoga/.th-A st.airebol”
As seen in the last example, higher values of temperature and top_p can lead to overly creative and nonsensical responses.
The choice between exact or creative responses depends on the use case, but generally, centered settings tend to provide satisfactory results with Janet. For a creative story, you may increase the temperature while keeping top_p somewhere in the middle. If you desire creative names, you may try a lower temperature with a higher top_p.
Moreover, it’s crucial to communicate your expectations clearly to the generative AI. If you want precise responses, providing examples like the following can be helpful:
“You should always respond very kindly, but firmly. You must remember to always end each statement with ‘Thank you for choosing Joe’s Plumbing.’”
This way, with middle values for both temperature and top_p, you can receive a response like:
“Thank you for calling ‘Joe’s Plumbing.’ I’m sorry to hear about your leaking pipes. We can definitely help you with that. Our skilled technicians can come to your location and assess the situation. There is a standard service charge of $100 for the visit, but if you choose to have the plumbing work done by ‘Joe’s Plumbing,’ the service charge will be waived. When would you like us to schedule the appointment? Thank you for choosing ‘Joe’s Plumbing.’”
You can play with the top_p and temperature at OpenAI’s playground, located here:
https://platform.openai.com/playground
In Part 3, we will discuss how to structure prompts more effectively for OpenAI.
Join our Discord — https://discord.gg/echfS6ePqg