Re:Large language models are having their Stable Diffusion m...
by toxik on Sunday March 12, 2023 @01:32AM
(#35117390)
You get this issue without position embeddings. Attention computes an inner product between each pair of input tokens, so N^2 x E. Squares grow really fast.
Re:Large language models are having their Stable Diffusion m...
by visarga on Sunday March 12, 2023 @01:34AM
(#35117399)
Where did you get that GPT3 has 12288 size token embeddings? I thin that's the internal or output size of the token inside the transformer layers, not in the embedding table.
Re:Large language models are having their Stable Diffusion m...
by afro88 on Sunday March 12, 2023 @01:54AM
(#35117495)
Thanks for explaining, very enlightening.
Re:Large language models are having their Stable Diffusion m...
by 7to2 on Sunday March 12, 2023 @05:59AM
(#35118372)
Do you know what the WPEs are for llama?
Re:Large language models are having their Stable Diffusion m...
by sebzim4500 on Sunday March 12, 2023 @01:49PM
(#35123483)
It doesn't really use them, it uses something called RoPE which is hardcoded rather than learned and is applied multiplicatively at every layer to both the key and the value.
Re:Large language models are having their Stable Diffusion m...
by kir-gadjello on Sunday March 12, 2023 @10:26AM
(#35120414)
Positional embeddings are tricky - it very much depends on the specific embedding method chosen. Some advanced methods allow conserved or even slightly improved performance with context length increased beyond what was used for the main pretraining run.
As often is the case with these large models, you can change it with some finetuning on longer context samples from the same dataset, with what is really a small amount of compute invested compared to the million hours spent on training the thing.
What does that mean?
For each token in your input or inference output it requires the model to have some understanding of what the position of the word means.
So there is the word position embedding matrix that contains a vector per position. The matrix has "only" 1024 entries in it for GPT2 or 4096 for GPT3. The size of each entry varies as well, containing a vector from 768 for GPT2 small and up to 12,288 for GPT3.
So the WPE (word position embeddings) for GPT2 is (1024x768) and for GPT3 (4096x12288)
Inference requires info from this vector to be added to the word tokens embedding for each token in the original prompt + each generated token.