From fd3be107bb7d9c95e33bc44d33e67c8f92a5c8b3 Mon Sep 17 00:00:00 2001 From: Zesen SenmiaoORZ <99367066+SenmiaoORZ@users.noreply.github.com> Date: Fri, 14 Nov 2025 14:15:56 -0500 Subject: [PATCH] [Doc] Add item for repetition punishment (#13260) --- docs/basic_usage/sampling_params.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/basic_usage/sampling_params.md b/docs/basic_usage/sampling_params.md index 8b1035b81..5b93349ab 100644 --- a/docs/basic_usage/sampling_params.md +++ b/docs/basic_usage/sampling_params.md @@ -61,6 +61,7 @@ python -m sglang.launch_server --model-path --sampling-defaults openai |--------------------|------------------------|------------------------------------------------------------------------------------------------------------------------------------------------| | frequency_penalty | `float = 0.0` | Penalizes tokens based on their frequency in generation so far. Must be between `-2` and `2` where negative numbers encourage repeatment of tokens and positive number encourages sampling of new tokens. The scaling of penalization grows linearly with each appearance of a token. | | presence_penalty | `float = 0.0` | Penalizes tokens if they appeared in the generation so far. Must be between `-2` and `2` where negative numbers encourage repeatment of tokens and positive number encourages sampling of new tokens. The scaling of the penalization is constant if a token occurred. | +| repetition_penalty | `float = 1.0` | Scales the logits of previously generated tokens to discourage (values > 1) or encourage (values < 1) repetition. Valid range is `[0, 2]`; `1.0` leaves probabilities unchanged. | | min_new_tokens | `int = 0` | Forces the model to generate at least `min_new_tokens` until a stop word or EOS token is sampled. Note that this might lead to unintended behavior, for example, if the distribution is highly skewed towards these tokens. | ### Constrained decoding