VKVlad KulikovPublic / lectures
Modern LLMs3 / 20

Module 3. The Basic Transformer

Choose your answers and select “Check”. Numbers accept a decimal point, comma, or simple fraction. Answers and drafts are saved in this browser and shared between RU/EN.

Checked: 0 / 46 · Correct: 0

Question 3.1.1

3.1. Why the Transformer was needed

What problem did the Transformer solve compared with recurrent processing?

One correct option

Question 3.1.2

3.1. Why the Transformer was needed

When is a reader ready to move from M3 to M4?

One correct option

Question 3.2.1

3.2. Notation and tensor shapes

What does d_model denote in the base Transformer?

One correct option

Question 3.2.2

3.2. Notation and tensor shapes

B = 2, T = 5, h = 4 heads. What is the shape of the attention weight matrix?

One correct option

Question 3.3.1

3.3. Step 1: tokens, embeddings, and positions

What does an embedding lookup do?

One correct option

Question 3.3.2

3.3. Step 1: tokens, embeddings, and positions

What happens when rows of unmasked self-attention input are permuted without positional information?

One correct option

Question 3.4.1

3.4. Step 2: scaled dot-product attention

How should the roles of Q, K and V be read?

One correct option

Question 3.4.2

3.4. Step 2: scaled dot-product attention

Q, K, and V have shape 2 × 4 × 5 × 8. What is the shape of Z = AV before merging heads?

One correct option

Question 3.5.1

3.5. Masks: who is allowed to see whom

How does a padding mask differ from a causal mask?

One correct option

Question 3.5.2

3.5. Masks: who is allowed to see whom

Why can the softmax not be computed first and forbidden weights zeroed afterwards?

One correct option

Question 3.5.3

3.5. Masks: who is allowed to see whom

What does True mean in this chapter’s allowed mask?

One correct option

Question 3.6.1

3.6. Multi-head attention

With d_model = 32, h = 4, and the standard equal split, what is the head width?

One correct option

Question 3.6.2

3.6. Multi-head attention

Why does multi-head attention need the output projection W_O?

One correct option

Question 3.7.1

3.7. The FFN: nonlinear processing at each position

What does it mean that the FFN is position-wise?

One correct option

Question 3.7.2

3.7. The FFN: nonlinear processing at each position

What happens if the nonlinearity between the two FFN linear layers is removed?

One correct option

Question 3.8.1

3.8. Residual connections and LayerNorm

Along which axis does LayerNorm normalize a Transformer representation?

One correct option

Question 3.8.2

3.8. Residual connections and LayerNorm

How is the residual update written in the pre-norm scheme?

One correct option

Question 3.9.1

3.9. The encoder layer and encoder stack

Which keys can a position read in ordinary encoder self-attention?

One correct option

Question 3.9.2

3.9. The encoder layer and encoder stack

Why do encoder-only models remain useful?

One correct option

Question 3.10.1

3.10. The decoder layer and cross-attention

Where do Q, K and V come from in decoder cross-attention?

One correct option

Question 3.10.2

3.10. The decoder layer and cross-attention

What targets correspond to the toy training input BOS, A, B?

One correct option

Question 3.11.1

3.11. Training: teacher forcing and cross-entropy

What does teacher forcing mean?

One correct option

Question 3.11.2

3.11. Training: teacher forcing and cross-entropy

A 100-token vocabulary. What does cross-entropy measure, and what is the uniform-prediction reference value?

One correct option

Question 3.11.3

3.11. Training: teacher forcing and cross-entropy

Can a token excluded by the loss mask remain available as context?

One correct option

Question 3.12.1

3.12. Generation: the same forward pass in a different loop

Why is generation sequential when training is parallel?

One correct option

Question 3.12.2

3.12. Generation: the same forward pass in a different loop

What does a causal model’s KV cache retain when weights and positions stay fixed?

One correct option

Question 3.13.1

3.13. A minimal scaled dot-product attention implementation

What does the displayed scaled_dot_product_attention function return for float16 inputs?

One correct option

Question 3.13.2

3.13. A minimal scaled dot-product attention implementation

How does the causal mask change during decode with a cache and a query offset?

One correct option

Question 3.14.1

3.14. A minimal Transformer block

Both update branches in a pre-norm block return zero, including biases. What is the output?

One correct option

Question 3.14.2

3.14. A minimal Transformer block

How can a block's causality be checked?

One correct option

Question 3.15.1

3.15. A complete shape trace for a toy model

B = 2, T = 5, d_model = 32, h = 4, d_ff = 128. What is the shape of the packed QKV?

One correct option

Question 3.15.2

3.15. A complete shape trace for a toy model

What is excluded from the main layer-weight count in §15.1?

One correct option

Question 3.16.1

3.16. The 2017 original and a modern LLM: what survived

Which components of the base Transformer survive in a modern decoder-only LLM?

One correct option

Question 3.16.2

3.16. The 2017 original and a modern LLM: what survived

Which substitution is characteristic of a modern LLM against the 2017 original?

One correct option

Question 3.17.1

3.17. Common confusions

Why does a large attention weight not prove causal influence?

One correct option

Question 3.17.2

3.17. Common confusions

Why does the causal mask not make training sequential?

One correct option

Question 3.18.1

3.18. Self-check

What should a reader do if several self-check questions remain difficult?

One correct option

Question 3.18.2

3.18. Self-check

Which axis does attention softmax normalize when a query has allowed keys?

One correct option

Question 3.19.1

3.19. Exercises with solutions

What does the exercise with two sequences differing only in the future check?

One correct option

Question 3.19.2

3.19. Exercises with solutions

What does successfully learning the period 0,1,2,3,4,5 establish?

One correct option

Question 3.20.1

3.20. The module notebook

Why does the notebook verify its embedded numerical contract by SHA-256?

One correct option

Question 3.20.2

3.20. The module notebook

Why is the published notebook shipped without saved outputs?

One correct option

Question 3.21.1

3.21. Reading route and sources

Which source is the primary reference for the 2017 Transformer architecture?

One correct option

Question 3.21.2

3.21. Reading route and sources

Why does the reading route suggest several sources instead of one?

One correct option

Question 3.22.1

3.22. Final cheat sheet and the next step

What is the operation order in an encoder block of the original post-norm Transformer?

One correct option

Question 3.22.2

3.22. Final cheat sheet and the next step

What does the conclusion "the computational skeleton remains recognizable" mean?

One correct option