You are reading immutable version 10. The current guide may be newer.

Study the paper

Attention Is All You Need

Lessons, visuals, quizzes, flashcards, and resources—organized in teaching order.

All activities

Transformer Architecture Assessment

Test your understanding

Check your understanding

1. In the Transformer's encoder-decoder structure, how does the decoder generate the output sequence $(y_1, ..., y_m)$ given the continuous representations $\mathbf{z}$ produced by the encoder?
2. Which of the following best describes the mapping performed by the Transformer's encoder?
3. Write down the mathematical formula for Scaled Dot-Product Attention as a function of queries $Q$, keys $K$, and values $V$, where $d_k$ represents the dimension of the keys.
4. What is the primary purpose of the scaling factor $\frac{1}{\sqrt{d_k}}$ in Scaled Dot-Product Attention?
5. According to the authors, what limitation of a single attention head does multi-head attention overcome?
6. Which of the following is a key benefit of using multi-head attention instead of a single attention head?
7. Write down the mathematical formula for the positional encoding at an even dimension index $2i$ for a given position $pos$ and model dimension $d_{\text{model}}$.
8. Why are positional encodings necessary in the Transformer architecture?
9. Compare Self-Attention and Recurrent layers in terms of their complexity per layer and maximum path length as a function of sequence length $n$ and representation dimension $d$.
10. According to Table 1, what is the minimum number of sequential operations required by a Self-Attention layer compared to a Recurrent layer?
11. Based on Table 2, what BLEU scores did the 'Transformer (big)' model achieve on the English-to-German (EN-DE) and English-to-French (EN-FR) newstest2014 tests?
12. According to Table 2, how does the training cost (in FLOPs) of the 'Transformer (base model)' compare to the 'GNMT + RL' model on the English-to-German (EN-DE) task?