VB-LoRA
4 memberslucid.peft.tuners.vbloralucid.peft.tuners.vblora — VB-LoRA: low-rank factors mixed from one shared vector bank.
VB-LoRA (Li et al., 2024, arXiv:2405.15179 — Vector Bank LoRA) cuts the LoRA factors of every layer into sub-vectors and builds each as a softmax-weighted mix of the top- vectors of a single bank shared by the whole model; the learned logits that pick and weight them, and the bank, are the trained parameters. The adapter stores logits and a bank, not per-layer factors, so it holds far fewer numbers than LoRA's. Unlike LoRA it does not start as the base. Pick it when storage per adapter is the constraint.
Where the reference library keeps them, so isinstance(m, VBLoRALayer) and from lucid.peft.tuners.vblora import VBLoRAConfig, Linear read as they do there. One layer type for
the one module the method adapts, nn.Linear. VBLoRAConfig and VBLoRAModel (which holds
the bank) are here and exported from lucid.peft. Importing the package registers the method
(its config under PeftType.VBLORA, its tuner and layer), which is what makes get_peft_model
and PeftModel.from_pretrained know it.
Li, Yang, et al. "VB-LoRA: Extreme Parameter Efficient Fine-Tuning with Vector Banks." [arXiv:2405.15179](https://arxiv.org/abs/2405.15179), 2024.
VB-LoRA (Li et al., 2024, arXiv:2405.15179 — Vector Bank LoRA) builds every low-rank factor of every layer out of one shared vector bank of vectors of length . The factors and are cut into sub-vectors of length ; each sub-vector is a softmax-weighted mix of the top- bank vectors picked by learned logits,
Classes
VBLoRAConfig9 methodsHow lucid.peft.get_peft_model adapts a model with VB-LoRA.
LinearAn nn.Linear with a VB-LoRA update: .
VBLoRALayer22 methodsAdapter bookkeeping and the bank-to-factors map shared by the VB-LoRA layers.
VBLoRAModel18 methodsA model with VB-LoRA layers put into it, the vector bank they share, and the tools to take them out.