From 46b03337506fd628148518b0db631494ad9b764f Mon Sep 17 00:00:00 2001 From: Cameron Pfiffer Date: Tue, 10 Sep 2024 13:41:15 -0700 Subject: [PATCH] use coinflip example --- docs/reference/samplers.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/reference/samplers.md b/docs/reference/samplers.md index 52714efb2..3719f2be6 100644 --- a/docs/reference/samplers.md +++ b/docs/reference/samplers.md @@ -6,16 +6,16 @@ Samplers provide control over the sampling process, allowing you to influence th ## Multinomial sampling -Multinomial sampling is the default sampling algorithm in Outlines. You should think of it as calculating the probability distribution over all tokens and then selecting tokens at random according to that distribution. +[Multinomial sampling](https://en.wikipedia.org/wiki/Multinomial_distribution) is the default sampling algorithm in Outlines. -For example, pretend we have a model with only two possible tokens: "A" and "B". For a fixed prompt such as "Pick A or B" The language model calculates probability for each token: +As an example, suppose we have only two possible tokens: "H" and "T". For a fixed prompt such as "Flip a coin, did you get heads or tails?" The language model calculates probability for each token: | Token | Probability | |-------|-------------| -| A | 0.75 | -| B | 0.25 | +| "H" | 0.5 | +| "T" | 0.5 | -You'd expect to receive "A" 75% of the time and "B" 25% of the time. +You'd expect to receive "H" 50% of the time and "T" 50% of the time. ### Parameters