Skip navigation
Transformer, GPT and BERT share one building block.
0:00 / 0:14

Transformer, GPT and BERT share one building block.

Mathematica

@mathemetica82K followers

Visit on X

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