From 9248325f82cd1d8cda8f598ba56a28ba2cd5c174 Mon Sep 17 00:00:00 2001 From: kalomaze <66376113+kalomaze@users.noreply.github.com> Date: Tue, 31 Oct 2023 11:25:23 -0500 Subject: [PATCH] Update README & set 0.05 default --- common/sampling.h | 2 +- examples/main/README.md | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/common/sampling.h b/common/sampling.h index 84051d62a..7c9b8dcf2 100644 --- a/common/sampling.h +++ b/common/sampling.h @@ -14,7 +14,7 @@ typedef struct llama_sampling_params { int32_t n_probs = 0; // if greater than 0, output the probabilities of top n_probs tokens. int32_t top_k = 40; // <= 0 to use vocab size float top_p = 0.95f; // 1.0 = disabled - float min_p = 0.00f; // 0.0 = disabled + float min_p = 0.05f; // 0.0 = disabled float tfs_z = 1.00f; // 1.0 = disabled float typical_p = 1.00f; // 1.0 = disabled float temp = 0.80f; // 1.0 = disabled diff --git a/examples/main/README.md b/examples/main/README.md index a9561c383..1db03b991 100644 --- a/examples/main/README.md +++ b/examples/main/README.md @@ -208,6 +208,14 @@ Top-p sampling, also known as nucleus sampling, is another text generation metho Example usage: `--top-p 0.95` +### Min P Sampling + +- `--min-p N`: Sets a minimum base probability threshold for token selection (default: 0.0). + +Min-P sampling is a sampling method where the value represents the base required probability percentage. This value is adjusted based on the probability of the most likely token. For example, with a Min-P value set at 0.05 and the highest token probability being 90%, the minimum required threshold becomes 4.5%. This approach ensures a balance of quality and variety in the results. The default value is 0.05. + +Example usage: `--min-p 0.05` + ### Tail Free Sampling (TFS) - `--tfs N`: Enable tail free sampling with parameter z (default: 1.0, 1.0 = disabled).