Skip to content
nonconvexcard

LoRA parameter accounting

NumericalBeginner⏱ 15 minLLMsloraparameter countfine-tuning

Problem

For a transformer with d=4096d = 4096, L=32L = 32 layers, adapting WQW_Q and WVW_V in each layer with rank rr:

  1. Count the trainable parameters as a function of rr.
  2. Compare with full fine-tuning of those matrices, and with the full model at 77B parameters.
  3. Compute the checkpoint size for 100100 tasks at r=8r = 8 in fp16.

Compute the requested quantities and say what they mean. A number without an interpretation is not an answer.

Solution

Opening this before you have a real attempt on paper is the fastest way to feel like you understand something you cannot reproduce.

Related problems

All problems
SolvedProblemFieldTypeDifficultyTime
Adapter parameter countsFine-TuningNumericalFoundation15 min
The 6ND FLOP estimateLLMsNumericalBeginner15 min
Will this fine-tune fit?Fine-TuningNumericalBeginner30 min
Derive the compute-optimal allocationLLMsProofIntermediate30 min
Mixture-of-experts sparsity accountingLLMsNumericalIntermediate30 min