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

[Question] Difference in gpt-neo-125m weights loading with huggingface from_pretrained and HookTransformers.from_pretrained #557

Open
petezone opened this issue Apr 27, 2024 · 1 comment

Comments

@petezone
Copy link

Hi Neel,

Thanks for this powerful tool for interpretation and it helps me a lot in understanding the mechanics of LLMs. But I found there is slight difference in gpt-neo-125m weights loading with huggingface from_pretrained and HookTransformers.from_pretrained even for wte.weight. I suppose the two weights should be the same because they are all loaded from EleutherAI/gpt-neo-125m. I am not sure if I am wrong with understanding the source code of HookTransformers.from_pretrained. Could you please try to check if such problem exists or could you please figure out where I did it wrong? Thank you very much!

@Butanium
Copy link
Contributor

Hey,

If you look at the token probability distribution, they should be the same. TransformerLens performs many operations under the hood to facilitate interpretability (see this explanation).

If you don't want TL to perform this weight processing, use .from_pretrained_no_processing instead of .from_pretrained.

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