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

ALiBi: buffered bias slicing gets confusing when i != j #153

Open
antony-frolov opened this issue Jun 1, 2023 · 0 comments
Open

ALiBi: buffered bias slicing gets confusing when i != j #153

antony-frolov opened this issue Jun 1, 2023 · 0 comments

Comments

@antony-frolov
Copy link

https://github.com/lucidrains/x-transformers/blame/f71f3279de539ddb0f58bd50f22b84b6920e0ef6/x_transformers/x_transformers.py#L336

Hi! I've noticed that slicing a buffered ALiBi bias can get confusing in case of i != j. Say we save the bias when j - i = 1, so zeros will be on the diagonal 1 above the main diagonal. Then we process a smaller sequence where i = j and the zeros diagonal should be the main one but the bias is cached so they are still one element above. It works fine because AliBi encoding is shift invariant but maybe it would me more clear to always have zeros on the main diagonal as in the i == j case?

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