Work out lora parameter count instantly with clear inputs, formula shown and shareable results.
LoRA replaces a full weight update with the product of two thin matrices: for a d-by-d projection it trains a d-by-r and an r-by-d pair, so 2dr parameters instead of d^2. At rank 16 on a 4096-dimensional model that is 131,072 parameters per matrix versus 16.7 million, which is why adapters are a few tens of megabytes and can be swapped per tenant at serving time.
LoRA parameter count
per module = 2 x d x r; total = per module x modules per layer x layers; base per layer = 12 d^2
Query and value projections are the classic minimum; adapting all four attention projections plus the FFN matrices gives more capacity at proportionally more parameters.
Rank 8 to 16 handles style and format adaptation. New knowledge or a new language usually needs 64 or more, and beyond about 256 full fine-tuning becomes competitive.