type
Post
Created date
Apr 21, 2024 05:51 AM
category
LLM
tags
Prompt Engineering
status
Published
Language
English
From
summary
slug
llm-param-settings
password
Author
Priority
Featured
Featured
Cover
Origin
Type
URL
Youtube
Youtube
icon
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2Fe1c5ba0e-562a-49b0-8505-ce5e38fc061b%2F570f24da-958c-46de-9272-ce170a03e38e%2FUntitled.png?table=block&id=d9d85d28-ff6b-4a2f-91b4-0724fd5c13af&cache=v2)
Parameter | Purpose |
Temperature | Controls the randomness of responses.
Lower values yield more deterministic results; higher values promote diversity and creativity. |
Top P | Controls the range of token probabilities considered (nucleus sampling).
Lower values yields more confident and factual responses. |
Max Length | Determines the maximum number of tokens in a response.
Setting this helps you prevent long and/or irrelevant response and manage computational costs. |
Stop Sequences | Controls specific strings that, when generated, will halt further token generation.
Useful for controlling the structure of outputs.
For example, you can tell the model to generate lists that have no more than 10 items by adding "11" as a stop sequence. |
Frequency Penalty | Applies a penalty to tokens that have appeared frequently.
The higher the frequency penalty, the less likely a word will appear again. |
Presence Penalty | Penalises tokens based on their occurrence to avoid repeated phrases, aiding in generating more diverse content.
- A token that appears twice and a token that appears 10 times are penalized the same.
- If you want the model to generate diverse or creative text, you might want to use a higher presence penalty. Or, if you need the model to stay focused, try using a lower presence penalty. |
Note: The general suggestion is to adjust temperature or Top P but not both.
- Author:Jason Siu
- URL:https://jason-siu.com/article/llm-param-settings
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!