explain the size of weight matrices in transformer architecture?
- User
explain the size of weight matrices in transformer architecture?
Assistant
In transformer architectures, the weight matrices have specific dimensions that relate to the model's hyperparameters:
-
Input Embedding Matrix: (vocab_size × d_model)
- Maps tokens to vector representations
-
Multi-Head Attention Matrices (per layer, per head):
- Query (Q): (d_model × d_k)
- Key (K): (d_model × d_k)
- Value (V): (d_model × d_v)
- Where typically d_k = d_v = d_model/num_heads
- Output projection: (num_heads × d_v × d_model)
-
Feed-Forward Network (per layer):
- First layer: (d_model × d_ff)
- Second layer: (d_ff × d_model)
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.