-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
GemmaForCausalLM Causal Masking Not Working #30813
Comments
I also have this problem for Llama, MWE below:
output is:
and I would have expected this to be triangular. https://discuss.huggingface.co/t/why-are-llama2-attention-weights-not-lower-triangular/85066 |
Hey! This was fixed by #30652 ! |
Use |
7 tasks
Awesome thank you! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
System Info
transformers
version: 4.35.2Who can help?
@ArthurZucker @younesbelkada
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
first_gemma_attn_pattern outputs:
first_gpt2_attn_pattern outputs:
Expected behavior
I would expect that in both cases the first row of the attention pattern for each model is: tensor([1., 0., 0., 0., 0., 0., 0., 0., 0.], grad_fn=) due to causal masking. This does not seem to be the case for Gemma where causal masking doesn't appear to be applied.
The text was updated successfully, but these errors were encountered: