What is the top_p default value?

Hello,

What is the top_p default value or is it disabled by default?

Thank you in anticipation.

Regards,

Martin

2 Likes

Hi Martin,

As per the documentation, it defaults to 1
image

In the API Reference docs, Go to Chat > Create chat completion
https://platform.openai.com/docs/api-reference/chat/create

Cheers

2 Likes

Thank you.

The default to 1 confuses me considering the range is or seems to be 0 to 1.

Regards,

Martin

It’s the top 0% to 100%. in decimal form, top probabilities up to 0.0 (one item), or up to 1.0 (all items)*. What did you expect it to be?

* this is not 100% accurate, it’s technically \sum_{x_i \in V^{(p)}} P(x_i | x_{1:i-1}) \ge p

forumla ripped from here: Nucleus Sampling

edit: * it is actually accurate. see What is the top_p default value? - #8 by Diet

2 Likes

I thought the top_p range would have been the same as temperature (0 to 2).

why? :thinking:

1 Like

I looked through the paper, https://arxiv.org/pdf/1904.09751.pdf, and 0 is actually allowed

if we take a closer look at the formula,

it’s the smallest set greater than or equal p

For the same reason, I am wondering why the temperature’s range is not 0 - 1 :sunglasses:

Seems like the kind of thing your AI can answer…

1 Like

That’s a good question!

If it’s based on softmax, it would look something like this:

as you can see, as you move the temperature up, it gets flatter and flatter, and the probabilities of individual tokens start becoming more or less the same. beyond 2, there’s not much more going on. most of the excitement happens between 0 and 2. why it’s exactly 2? not sure.

1 Like