Prompt-Engineering-Guide/pages/introduction/settings.en.mdx

12 lines
1.2 KiB
Plaintext
Raw Normal View History

2023-03-12 19:14:15 +00:00
# LLM Settings
2023-03-11 02:21:43 +00:00
When working with prompts, you interact with the LLM via an API or directly. You can configure a few parameters to get different results for your prompts.
2023-03-11 02:21:43 +00:00
**Temperature** - In short, the lower the `temperature`, the more deterministic the results in the sense that the highest probable next token is always picked. Increasing temperature could lead to more randomness, which encourages more diverse or creative outputs. You are essentially increasing the weights of the other possible tokens. In terms of application, you might want to use a lower temperature value for tasks like fact-based QA to encourage more factual and concise responses. For poem generation or other creative tasks, it might be beneficial to increase the temperature value.
2023-03-11 02:21:43 +00:00
2023-03-14 01:01:06 +00:00
**Top_p** - Similarly, with `top_p`, a sampling technique with temperature called nucleus sampling, you can control how deterministic the model is at generating a response. If you are looking for exact and factual answers keep this low. If you are looking for more diverse responses, increase to a higher value.
2023-03-11 02:21:43 +00:00
2023-03-14 01:01:06 +00:00
The general recommendation is to alter one, not both.
2023-03-11 02:21:43 +00:00
Before starting with some basic examples, keep in mind that your results may vary depending on the version of LLM you use.