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

Integrated Gradients for Llama2 #1271

Open
oscarwzt opened this issue Apr 12, 2024 · 0 comments
Open

Integrated Gradients for Llama2 #1271

oscarwzt opened this issue Apr 12, 2024 · 0 comments

Comments

@oscarwzt
Copy link

Hi,

I would like to ask how to use Integrated Gradients with Llama2

I tried

ig = IntegratedGradients(model)
llm_ig = LLMAttribution(ig, tokenizer)

but I get the error "AssertionError: LLMAttribution does not support <class 'captum.attr._core.integrated_gradients.IntegratedGradients'> ", and the same occurs with using LLMGradientAttribution.

From this Bert IG tutorial I tried LayeredIntegratedGradients and it works fine if I set the layer as the embedding layer, but I'm more interested in understanding the other layers, for example, one of the attention layers model.layers[30].self_attn. But this would cause another error that I don't understand at all (I will post a separate question).

Thank you!

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

1 participant