You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/main/README.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -187,6 +187,27 @@ Use the `--no-penalize-nl` option to disable newline penalization when applying
187
187
188
188
Example usage: `--repeat-penalty 1.15 --repeat-last-n 128 --no-penalize-nl`
189
189
190
+
### DRY Repetition Penalty
191
+
192
+
DRY (Don't Repeat Yourself) sampling is an effective technique for reducing repetition in generated text even across long contexts by penalizing tokens based on their recent usage patterns.
193
+
194
+
-`--dry-multiplier N`: Set the DRY sampling multiplier (default: 0.0, 0.0 = disabled).
195
+
-`--dry-base N`: Set the DRY sampling base value (default: 1.75).
196
+
-`--dry-allowed-length N`: Set the allowed length for DRY sampling (default: 2).
197
+
-`--dry-penalty-last-n N`: Set DRY penalty for the last n tokens (default: -1, 0 = disable, -1 = context size).
198
+
199
+
The `dry-multiplier` option controls the strength of the DRY sampling effect. A value of 0.0 disables DRY sampling, while higher values increase its influence. A typical recommended value is 0.8.
200
+
201
+
The `dry-base` option sets the base value for the exponential penalty calculation in DRY sampling. Higher values lead to more aggressive penalization of repetitions.
202
+
203
+
The `dry-allowed-length` option determines the minimum length of repeated sequences that will be penalized. Repetitions shorter than or equal to this length are not penalized, allowing for natural repetitions of short phrases or common words.
204
+
205
+
The `dry-penalty-last-n` option controls how many recent tokens to consider when applying the DRY penalty. A value of -1 considers the entire context, while 0 disables this aspect of the penalty. Use a positive value to limit the consideration to a specific number of recent tokens.
206
+
207
+
DRY sampling works alongside traditional repetition penalties to provide more nuanced control over text generation, particularly for reducing long-range repetitions and maintaining global coherence.
208
+
209
+
Example usage: `--dry-multiplier 0.8 --dry-base 1.75 --dry-allowed-length 2 --dry-penalty-last-n -1`
210
+
190
211
### Top-K Sampling
191
212
192
213
-`--top-k N`: Limit the next token selection to the K most probable tokens (default: 40).
|`--dry-base N`| DRY sampling base value (default: 1.75) |
119
+
|`--dry-allowed-length N`| allowed length for DRY sampling (default: 2) |
120
+
|`--dry-penalty-last-n N`| DRY penalty for the last n tokens (default: -1, 0 = disable, -1 = context size) |
117
121
|`--dynatemp-range N`| dynamic temperature range (default: 0.0, 0.0 = disabled) |
118
122
|`--dynatemp-exp N`| dynamic temperature exponent (default: 1.0) |
119
123
|`--mirostat N`| use Mirostat sampling.<br/>Top K, Nucleus, Tail Free and Locally Typical samplers are ignored if used.<br/>(default: 0, 0 = disabled, 1 = Mirostat, 2 = Mirostat 2.0) |
@@ -354,6 +358,16 @@ node index.js
354
358
355
359
`frequency_penalty`: Repeat alpha frequency penalty. Default: `0.0`, which is disabled.
356
360
361
+
`dry_multiplier`: Set the DRY (Don't Repeat Yourself) sampling multiplier. Default: `0.0`, which is disabled.
362
+
363
+
`dry_base`: Set the DRY sampling base value. Default: `1.75`
364
+
365
+
`dry_allowed_length`: Set the allowed length for DRY sampling. Default: `2`
366
+
367
+
`dry_penalty_last_n`: Set DRY penalty for the last n tokens. Default: `-1`, where `0` is disabled and `-1` is context size.
368
+
369
+
`dry_sequence_breakers`: Specify an array of sequence breakers for DRY sampling. Can be provided as a JSON array of strings or as a JSON-encoded string representing an array of strings. Default: `["\n", ":", "\"", "*"]`
370
+
357
371
`mirostat`: Enable Mirostat sampling, controlling perplexity during text generation. Default: `0`, where `0` is disabled, `1` is Mirostat, and `2` is Mirostat 2.0.
358
372
359
373
`mirostat_tau`: Set the Mirostat target entropy, parameter tau. Default: `5.0`
0 commit comments