You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think there might be an error in calculating mean log probability when using GPT-3. The main issue is that GPT-3 does not only return generated texts in response, it returns more than these (including token_logprobs of logprobs). Therefore, in order to calculate the mean log probability, we cannot simply use
# calculate mean log prob across tokens
mean_log_probs = [np.mean(response['choices'][i]['logprobs']['token_logprobs']) for i in range(sampling_params['n'])]
Instead, we should stop counting when a stop token is met.
For example, here is a response with a stop sequence of "\n". The generated text is "Walk to kitchen", however GPT-3 returns more than that,
Hello Wenlong,
I think there might be an error in calculating mean log probability when using GPT-3. The main issue is that GPT-3 does not only return generated texts in response, it returns more than these (including
token_logprobs
oflogprobs
). Therefore, in order to calculate the mean log probability, we cannot simply useInstead, we should stop counting when a stop token is met.
For example, here is a response with a stop sequence of "\n". The generated text is "Walk to kitchen", however GPT-3 returns more than that,
The current way of calculating mean log prob gives
-0.10833211608375
, where it should bemean(-0.2976162, -0.00012346054, -0.5069456) = -0.26822842018
Please let me know what you think. Great work!
Cheers,
Kaixian
The text was updated successfully, but these errors were encountered: