Transformer, GPT and BERT share one building block.
Mathematica
Visit on X@mathemetica82K followers
57,233 views
Transformer, GPT and BERT share one building block.
The original encoder reads the input with self-attention. The decoder writes output token by token with masked self-attention and cross-attention to the encoder.
GPT keeps only the decoder, minus cross-attention. A causal mask shows each token only earlier ones, so it predicts what comes next.
BERT keeps only the encoder. Every token sees both sides, so it fills in hidden words.
All three run on softmax(QKᵀ/√dₖ)V.
Comments
Comments from the original post on X (Twitter)
No comments yet
