179 questions
No questions match those filters.
You're implementing LoRA from scratch. How should you i...
This is one of the questions in the full AI/ML interview bank. Pro unlocks all 1789 questions; Premium includes the same bank plus the highest daily Practice limit.
See plansLoRA isn’t a new layer bolted onto the network — it’s a residual correction to an existing weight matrix: W_new = W_frozen + B·A. That framing is the whole reason the naive answer (Xavier or Kaiming init for both A and B, because that’s the standard practice for any new weight matrix) is wrong here. If both A and B start as random noise, their product B·A is also just noise, and you’re adding that noise directly onto carefully pretrained weights before a single gradient step happens — the model has to spend its first updates undoing damage you introduced, rather than actually adapting.
The fix is asymmetric initialization: draw A from a random Gaussian (it needs some randomness so different output dimensions of B can receive distinct gradient signals and don’t all move in lockstep), and set B to exact zeros. Since the product of anything times a zero matrix is zero, B·A = 0 at step zero, which means W_new = W_frozen exactly — the adapter starts as a true identity function and the pretrained model’s behavior is fully preserved on the first forward pass. As training proceeds, B moves away from zero and the adaptation is introduced gradually rather than as a shock. This is a small implementation detail with an outsized effect on how much of the base model’s capability survives the first few hundred steps of fine-tuning.