LoRA computes h=W0x+αrBAx, where B∈Rd×r is initialised to zero and A∈Rr×k is random. How do you show that at initialisation the model equals the pre-trained one, what are the gradients ∂L/∂A and ∂L/∂B at the start, and what is the α/r factor for?

Sequence models and transformers, Parameter-efficient fine-tuning
Level L3 Intermediate. Length Long. Nature Mat Mathematical.

What's being asked

Whether you can derive the gradients of a factorised update and explain why one factor must start at zero while the other must not.

Key idea

With g=∂L/∂h: ∂L/∂B=αr g (Ax)⊤ and ∂L/∂A=αr B⊤g x⊤. At B=0 the second is zero, but the first is not, so training can start.

Steps

  1. At initialisation B=0, so BAx=0 and h=W0x. Fine-tuning starts exactly from the pre-trained function.
  2. Let L be the loss and g=∂L/∂h∈Rd. Write h=W0x+s B(Ax) with s=α/r.
  3. Gradient for B: ∂L/∂B=s g (Ax)⊤, an outer product of size d×r. It is non-zero when A≠0.
  4. Gradient for A: ∂L/∂A=s B⊤g x⊤. At B=0 it is 0, so A does not move at step one. After B becomes non-zero, A starts to learn.
  5. Why not both zero: then ∂L/∂B=0 too and nothing would ever move. So A is random (for example Gaussian) and B is zero.
  6. Scaling: with random A, the size of BAx grows with rank r. Dividing by r is the original LoRA heuristic for keeping the update size similar when r changes, so α can stay fixed. Kalajdzievski (2023) shows that α/r actually shrinks the updates at large ranks, and that α/r keeps them stable.

Common mistakes

How long your answer should be

Half a page; 5–6 minutes.

Last checked on 4 December 2026.

Read this

Previous in Sequence models and transformers: A corpus has the words low (×5), lower (×2), newest (×6) and widest (×3), each split into characters. BPE merges the most frequent adjacent pair. WordPiece merges the pair with the highest score c(ab)c(a) c(b). Which pair does each choose first, and why do they differ?
Next in Sequence models and transformers: For a vanilla RNN with ht=tanh⁡(Wht−1+Uxt), show that ∥∂hT/∂h0∥≤(σmax⁡(W))T, where σmax⁡ is the largest singular value. What does this say for σmax⁡=0.9 and 1.1 over T=50 steps? How does gradient-norm clipping help, for example when the gradient norm is 25 and the threshold is 5?