RandLoRA
4 memberslucid.peft.tuners.randloralucid.peft.tuners.randlora — RandLoRA: a full-rank update from frozen random bases.
RandLoRA (Albert et al., 2025, arXiv:2502.00987) sums frozen random rank- pairs , shared by every adapted
layer, and trains only a diagonal scale on each side of each pair. The update is full rank, yet the
trained parameters are scales; lowering r raises their number. Pick it when LoRA's rank is the
limit and the adapter must stay small.
Where the reference library keeps them, so isinstance(m, RandLoraLayer) and from lucid.peft.tuners.randlora import RandLoraConfig, Linear read as they do there. One layer type
for the one module the method adapts, nn.Linear. RandLoraConfig and RandLoraModel
(which holds the shared bases) are here and exported from lucid.peft. Importing the package
registers the method (its config under PeftType.RANDLORA, its tuner and layer), which is what
makes get_peft_model and PeftModel.from_pretrained know it.
Albert, Paul, et al. "RandLoRA: Full-rank Parameter-Efficient Fine-Tuning of Large Models." [arXiv:2502.00987](https://arxiv.org/abs/2502.00987), 2025.
RandLoRA (Albert et al., 2025, arXiv:2502.00987) reaches a full-rank update with few parameters: instead of one trainable low-rank pair it sums frozen random rank- pairs , drawn once and shared by every targeted layer, and trains only a diagonal scale on each side,
Classes
RandLoraConfig9 methodsHow lucid.peft.get_peft_model adapts a model with RandLoRA.
LinearAn nn.Linear with a RandLoRA update: .
RandLoraLayer22 methodsAdapter bookkeeping and the basis-to-update map shared by the RandLoRA layers.
RandLoraModel17 methodsA model with RandLoRA layers put into it, the random bases they share, and the tools to take them out.