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

Multi-Query attention from PaLM #103

Closed
ananyahjha93 opened this issue Apr 14, 2023 · 1 comment
Closed

Multi-Query attention from PaLM #103

ananyahjha93 opened this issue Apr 14, 2023 · 1 comment
Labels
type/feature An issue or pull request that introduces a new feature

Comments

@ananyahjha93
Copy link
Contributor

🚀 The feature, motivation and pitch

Iz and I were talking about this today, can be under nice to have

This is from the PaLM paper:

"The standard Transformer formulation uses k attention heads, where the input vector for each timestep is linearly projected into “query”, “key”, and “value” tensors of shape [k, h], where h is the attention head size. Here, the key/value projections are shared for each head, i.e. “key” and “value” are projected to [1, h], but “query” is still projected to shape [k, h]. We have found that this has a neutral effect on model quality and training speed (Shazeer, 2019), but results in a significant cost savings at autoregressive decoding time. This is because standard multi-headed attention has low efficiency on accelerator hardware during auto-regressive decoding, because the key/value tensors are not shared between examples, and only a single token is decoded at a time."

Alternatives

No response

Additional context

No response

@ananyahjha93 ananyahjha93 added the type/feature An issue or pull request that introduces a new feature label Apr 14, 2023
@epwalsh
Copy link
Member

epwalsh commented Apr 14, 2023

Duplicate of #30 😉

@epwalsh epwalsh closed this as completed Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature An issue or pull request that introduces a new feature
Projects
None yet
Development

No branches or pull requests

2 participants