jxhe / efficient-knnlm

Pytorch implementation of paper "Efficient Nearest Neighbor Language Models" (EMNLP 2021)
MIT License
71 stars 6 forks source link

Question regarding kNN-LM (exact) #2

Closed jiaqing23 closed 1 year ago

jiaqing23 commented 1 year ago

In the Efficient kNN-LM paper, the result of kNN-LM (exact) is included (with ppl = 16.12, and very slow inference speed). I checked the original kNN-LM (Khandelwal, 2020) and the ppl score is matched with it.

image

May I know how to you obtain the score for kNN-LM (ppl = 16.65), which part of the code did you change from their original repo (https://github.com/urvashik/knnlm) and make the inference speed increase? What is the different between kNN-LM and kNN-LM (exact)? Because the original kNN-LM paper doesn't have any result of ppl = 16.65.

Thank you very much!

jxhe commented 1 year ago

As their README says, you can set --no-load-keys and --knn-sim-func "do_not_recomp_l2"

Screenshot 2023-02-08 at 5 13 56 PM
jiaqing23 commented 1 year ago

Thanks for the response!