Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible values for top_p #9

Open
keruiduo opened this issue Apr 13, 2021 · 1 comment
Open

Possible values for top_p #9

keruiduo opened this issue Apr 13, 2021 · 1 comment

Comments

@keruiduo
Copy link

Hello,

Thanks a lot for making this available.
I have a question regarding possible values for top_p. From my understanding reading the paper "The curious case of neural text degeneration" (Holtzman et al., 2020), top_p should be a probability between 0 and 1. Yet when I check the code in 'model.R', you turn the value into an integer with as.integer() before providing it to Python.
I tried various values between 0 and 1 with the same seed, and as I expected from the code, the outputs are the same. I get different outputs with values greater than 1, but I can't figure out how things work exactly. Could you please provide some more explanations?

Thanks a lot in advance.
Best,

Christophe C.

@keruiduo
Copy link
Author

To be more specific:
For a given prompt, gpt2(prompt = prompt, batch_size = 1, model = "355M", total_tokens = 150, top_p = top_p, seed = 3) will give me the same output for top_p = 0.1, top_p = 0.5 and top_p = 0.8.
I get another output, always the same, for top_p = 1, top_p = 2, top_p = 10 and top_p = 100

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant