Skip to content

Comments

Making perplexity calculations consistent across sample length#27

Open
mcleish7 wants to merge 1 commit intoEleutherAI:masterfrom
mcleish7:patch-1
Open

Making perplexity calculations consistent across sample length#27
mcleish7 wants to merge 1 commit intoEleutherAI:masterfrom
mcleish7:patch-1

Conversation

@mcleish7
Copy link

When calculating perplexity, on lines 110 and 115 the code currently divides by len(token_probs) which is twice the length of token_probs[mid_index:] as mid_index = len(token_probs) // 2 but then on line 120, for the whole sequence, the code still divides by len(token_probs).
This means the is a slight inconsistency in the perplexity calculation.

I have corrected this by using a single function cases, also removing the repeated code.

@CLAassistant
Copy link

CLAassistant commented Jul 13, 2024

CLA assistant check
All committers have signed the CLA.

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

Successfully merging this pull request may close these issues.

2 participants