Final Exam: LLM Self-Attention by Hand

Answer every question, then click Submit at the bottom. Each question is worth equal weight.

Passing score: 70/100. No state is saved; you can retry as many times as you like.

1. [Module 0] A large positive dot product between two word vectors tells you that:

2. [Module 0] Four words all score exactly 7.0. What share does softmax give each of them? (decimal or fraction both fine, e.g. 0.10 or 1/10)

3. [Module 0] Which statement about softmax is FALSE?

4. [Module 0] In the toy world, bank's highest dot product (0.990) is with itself, beating even "river" (0.540). Why?

5. [Module 1] In simple_attention, the expression X @ X.T computes:

6. [Module 1] True or false: in "the money bank", the input embedding row for "bank" is different from its row in "the river bank".

7. [Module 1] After simple attention on "the river bank", bank's output was watery (water 0.435 vs money 0.149). Where did the extra water-ness come from?

8. [Module 1] In an attention weight matrix, every row sums to 1 but columns do not. Why the rows?

9. [Module 2] With queries and keys, the score q_i . k_j is best read as:

10. [Module 2] True or false: even with separate query and key matrices, the score matrix must stay symmetric (score(i,j) = score(j,i)).

11. [Module 2] Under the hand-wired query/key head, which word receives the LARGEST share of bank's attention in "the river bank"?

12. [Module 2] The real reason attention divides scores by sqrt(d_k) is:

13. [Module 2] Queries and keys have 100 dimensions with unit-variance entries. By the workshop's measured growth law, the typical spread (standard deviation) of the raw scores is about: (a whole number)

14. [Module 3] The causal mask sets future scores to negative infinity rather than 0 because:

15. [Module 3] Under a causal mask, how many words (including itself) can the FIRST word of any sentence attend to? (a whole number)

16. [Module 3] True or false: the measured 2.22e-16 difference between the NumPy head and PyTorch's implementation indicates a small bug in one of them.

17. [Module 3] The workshop measured that attention alone gives "bank" the identical output in "the river bank" and "bank river the". The root cause is:

18. [Module 3] Inside a transformer block, the only place where information moves BETWEEN words is: