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

Evaluation metric bits-per-byte #14

Open
jxiw opened this issue Sep 6, 2023 · 1 comment
Open

Evaluation metric bits-per-byte #14

jxiw opened this issue Sep 6, 2023 · 1 comment

Comments

@jxiw
Copy link

jxiw commented Sep 6, 2023

Hi there,

Megabyte paper uses bits-per-byte in Table 2 as their evaluation metric. It seems it has difference compared with byte level perplexity, since their number in arXiv and Code is < 1. So it should not be perplexity. This repo uses the cross-entropy loss and can easily calculate the byte level perplexity. May I ask how to compute bits-per-byte metric?

Thanks a lot.

@eegli
Copy link
Contributor

eegli commented Sep 7, 2024

BPB can be computed from cross entropy loss (which is the model output) as:

def cc_to_bpb(cc_loss: float):
    return cc_loss * math.log2(math.e)

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