A weight matrix is adapted with LoRA of rank . How many trainable parameters does LoRA add for this matrix, and what fraction of the full matrix is that? If LoRA is applied to the query and value matrices of all layers, how many trainable parameters is that in total?
Sequence models and transformers, Parameter-efficient fine-tuning
Level L2 Elementary. Length Short. Nature Mat Mathematical.
What's being asked
Whether you know the LoRA factorisation and can count its parameters.
Key idea
LoRA replaces the update by with and , so it adds parameters instead of .
Steps
- Full matrix: parameters.
- LoRA: is and is , so parameters.
- Fraction: .
- Two matrices ( and ) in each of layers: million trainable parameters.
- The frozen base weights are not counted here, and the adapter can be merged into after training, so inference cost is unchanged.
Common mistakes
- Counting instead of .
- Forgetting that both and are trained.
- Including the frozen base weights in the trainable count.
How long your answer should be
3–4 lines of arithmetic.
Last checked on 4 December 2026.
Read this
Previous in Sequence models and transformers: A language model gives logits for four tokens. What are the sampling probabilities at temperature , and ? What happens as and as ?
Next in Sequence models and transformers: A scalar RNN has with , and . For inputs and , what are , and the gradient ?