Re:RWKV: Reinventing RNNs for the Transformer Era
by grafzhl on Tuesday May 23, 2023 @04:44AM
(#36041612)
While all other tokens are considered, the attention mechanism is putting an individual weight on each one, in a way "paying more attention" to some than others.
Re:RWKV: Reinventing RNNs for the Transformer Era
by pico_creator on Tuesday May 23, 2023 @05:35AM
(#36041933)
Yup, if you follow this definition of attention. It makes sense.
The mixing step, is computed with the trained weights, meaning the model does learn on its own, when/what to emphasise in this "mixing" process.
Hypothetically speaking, if a token does not matter, it mixing weights could end up being literally 0 (or something close to it)
Re:RWKV: Reinventing RNNs for the Transformer Era
by canjobear on Tuesday May 23, 2023 @11:17AM
(#36045538)
Most LLM architectures use “soft attention” where some fractional amount of attention is put on every token. “Hard attention” is the term for what you describe.
Re:RWKV: Reinventing RNNs for the Transformer Era
by coppsilgold on Tuesday May 23, 2023 @11:53AM
(#36046136)
Softmax takes a vector of arbitrary values and converts it into probabilities such that all the elements of the vector add to 1. Transformers use this to decide on the fractions.
This could be seen as "soft attention" where in theory there would be few winners for every "attention head".
It's also possible that the only purpose the softmax actually serves (or at least major component of) is that of normalization. Without it, the variance in the internal layer dynamics between training samples would be fairly large (some training samples may have tokens that interact heavily, while others not). Making optimization problematic.
> it takes a fraction of every other token embedding and adds it to itself.
> every token embedding mixing information from other embeddings into itself
Noting the use of the word every. Phrased this way, calling it "attention" hardly makes sense, as attention is typically focused on something specific at any given time - not always on the entire thing.