-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
./perplexity should allow multiple files, and macro-averaging #7066
Labels
Comments
EDIT: Ignore the following, I am having issues because of #7049 I tried to re-implement perplexity.cpp using llama-cpp-python but so for the python version has perplexity values over 10K, whereas perplexity.cpp is giving around 5-10 for each batch.
|
This issue was closed because it has been inactive for 14 days since being marked as stale. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
I'm doing new LLM benchmarks, on a novel corpus of documents, using perplexity. However, the difficulty in running
./perplexity
with multiple files is getting in the way of my benchmarks.Related: #2321
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Feature Description
Motivation
./perplexity
is demonstrated on a wikitext corpus where all articles are concatenated.However, one might prefer to compute perplexity over a corpus of documents that are each individual files. This is to prevent windows spanning the boundary between two different documents.
The naive approach of invoking
./perplexity
once per document has several issues, the main one being that model load time is expensive. It would be great to have multiple '-f' arguments possible.Additionally, by less importantly, one might want to macro-average the perplexities. i.e. get the PPL and error for each document, and then average over those. Instead of get the PPL and error over all windows of all documents. The former is preferable if we want all documents to have equal contribution to the PPL, regardless of their length. (One difficulty is deciding the precise way to compute the error correctly in the macro-averaged scenario. There are at least two differing approaches that immediately spring to mind.)
Possible Implementation
Multiple '-f' args are possible in
./perplexity
.'--macro-average' does macro-averaging of the PPL for each document. The macro-averaged error term is NOT displayed when there is more than one '-f', until further discussion decides the appropriate way to do this.
Lastly, a nice workaround would be to specify that '-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-' or somesuch unusual delimiter is the default document break in a single file being read.
The text was updated successfully, but these errors were encountered: