I want to understand transformer decoders a bit better. My current understanding of…
- User
I want to understand transformer decoders a bit better. My current understanding of encoders is:
- take some input sentence s, which is a string
- run it through the tokenizer to turn it into an input embedding matrix
x_iof sizen x d - x gets multiplied by Q, K, and V to make q, k, and v (the transformed versions of x). In your answer here, please tell me the shapes of all these matrices. I think q, k, and v are all
n x d. - q, k, and v get projected a bunch of times with linear layers to make attention heads of size n x d*, where d* < d. Attention computation happens in these layers.
- These layers get concatenated together and run through a linear transformation. Then
x_iis summed back in and normalized to makex_{i+1}. - The whole thing gets passed through a multilayer perceptron which is just two fully connected layers with relu in between.
- add
x_{i+1}back in and normalize to makex_{i+2}.
Now, if I have an encoder-decoder architecture, what happens on the decoder end?
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.