Your question is Transformer Architecture Explanation. Take a moment with it on the right.
Talk me through your thinking if you like. When you're confident, submit your answer and I'll grade it like a real screen (7/10 or better passes).
Explain the architecture of a transformer.
Describe the main components and data flow, including token embeddings, positional information, multi-head self-attention, feed-forward layers, residual connections, layer normalization, and output probabilities. Explain the difference between encoder-only, decoder-only, and encoder-decoder transformers. Include a concise implementation or pseudocode sketch showing how attention masks and tensor dimensions are handled.