Bottom to Top, Every Weight

TransformersHard+30 XP+30

Bottom to Top, Every Weight

A decoder-only language model is assembled exactly as the chapter lays it out: token embeddings, plus position, then NNN identical blocks, then a readout.

partsize
vocabulary32,00032{,}00032,000 tokens
width ddd768768768
blocks121212
position vectorslearned, one vector of width 768768768 for each of 1,0241{,}0241,024 positions
readoutits own matrix of shape 768×32,000768 \times 32{,}000768×32,000, turning the top vector into one score per vocabulary token

Inside every block, the learned weights are:

  • four attention projection matrices — queries, keys, values, and the output projection — each 768×768768 \times 768768×768;
  • two feed-forward matrices — one 768×3072768 \times 3072768×3072 that widens to 4d4d4d, one 3072×7683072 \times 7683072×768 that squeezes back.

Ignore biases, and ignore the layer normalizations' learned scales and shifts.

How many parameters does the whole model hold?

Give your answer in millions, rounded to 2 decimal places — a model of 50,000,00050{,}000{,}00050,000,000 parameters would be 50.0050.0050.00.

Hints

Solve it to unlock the solution

Once you get it right, the reasoning behind the answer shows up here.