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

Calculate perplexity for large language models #170

Open
9 tasks done
VeritasJoker opened this issue Feb 9, 2024 · 3 comments
Open
9 tasks done

Calculate perplexity for large language models #170

VeritasJoker opened this issue Feb 9, 2024 · 3 comments
Assignees

Comments

@VeritasJoker
Copy link
Contributor

VeritasJoker commented Feb 9, 2024

Use this script: https://github.com/hassonlab/247-pickling/blob/dev/scripts/tfsemb_perplexity.py

and this command:
perp-embeddings:
mkdir -p logs
for conv_id in $(CONV_IDS); do
python scripts/tfsemb_perplexity.py
--project-id $(PRJCT_ID)
--pkl-identifier $(PKL_IDENTIFIER)
--subject $(SID)
--conversation-id $$conv_id
--embedding-type $(EMB_TYPE);
done;

It should take less than a minute to run for each of those if we have the model downloaded

With stride 512, 1024, 2048, 4096:

  • gpt2-xl
  • EleutherAI/gpt-neox-20b
  • facebook/opt-6.7b
  • facebook/opt-13b
  • facebook/opt-30b
  • facebook/opt-66b
  • meta-llama/Llama-2-7b-hf
  • meta-llama/Llama-2-13b-hf
  • meta-llama/Llama-2-70b-hf

Actually can you just do the four strides for all of the models. I'm making a table for all the values here:
https://docs.google.com/spreadsheets/d/1E3k9gCvqsWERyPmvXvo-0yfYIyFt5XJQhYNS2ykKooo/edit?usp=sharing

@hvgazula
Copy link
Collaborator

hvgazula commented Feb 9, 2024

where did you find this script?

@VeritasJoker
Copy link
Contributor Author

VeritasJoker commented Feb 9, 2024

HuggingFace lol

Here: https://huggingface.co/docs/transformers/en/perplexity

@hvgazula
Copy link
Collaborator

Does it matter if the models are quantized or not?

hvgazula added a commit that referenced this issue Mar 11, 2024
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

2 participants