Large Language Model (LLM) Parameter Settings Explanation
When interacting with large language models using prompt words, you can obtain different results by configuring parameters. Below are common parameter settings and their explanations:
Temperature
- Function: Controls the determinism and randomness of results.
- Principle: Adjusts the weight of possible tokens to balance determinism and diversity.
Top_p
- Function: Together with Temperature, it belongs to nucleus sampling techniques to control result authenticity and diversity.
- Recommendation: Typically, adjust either Temperature or Top_p, not both simultaneously.
Max Length
- Function: Limits the number of tokens generated by the model to prevent lengthy or irrelevant responses and control costs.
Stop Sequences
- Function: A specified string (e.g., “11”) to stop the model from generating further tokens, controlling response length and structure.
- Example: Adding “11” as a stop sequence can generate a list with no more than 10 items.
Frequency Penalty
- Function: Applies a penalty to tokens based on their occurrence frequency in the response and prompt, reducing repetition.
Presence Penalty
- Function: Applies a uniform penalty to all repeated tokens (regardless of occurrence count) to prevent monotonous content.
- Recommendation: Typically, adjust either Frequency Penalty or Presence Penalty, not both simultaneously.
Notes
Final generated results may vary depending on the version of the large language model used.