Skip to content
module

Uni-LoRA

4 members
lucid.peft.tuners.unilora

lucid.peft.tuners.unilora — Uni-LoRA: every LoRA factor of the model read out of one trainable vector.

Uni-LoRA (Li et al., 2025, arXiv:2506.00799) writes the LoRA parameters of every adapted layer as a read of one vector θd\theta_d through a fixed projection, θD=P θd\theta_D = P\,\theta_d, whose rows are one-hot at indices drawn uniformly and whose columns are normalised so that PP is an isometry. The adapter of the whole model is that vector: theta_d_length numbers however many layers it adapts. Pick it for the smallest adapter file for a given rank, shared across all layers.

Where the reference library keeps them, so isinstance(m, UniLoraLayer) and from lucid.peft.tuners.unilora import UniLoraConfig, Linear read as they do there. One layer type for the one module the method adapts, nn.Linear. UniLoraConfig and UniLoraModel (which holds the shared vector) are here and exported from lucid.peft. Importing the package registers the method (its config under PeftType.UNILORA, its tuner and layer), which is what makes get_peft_model and PeftModel.from_pretrained know it.

Paper

Li, Kaiyang, et al. "Uni-LoRA: One Vector Is All You Need." [arXiv:2506.00799](https://arxiv.org/abs/2506.00799), 2025.

Overview

Uni-LoRA (Li et al., 2025, arXiv:2506.00799 — One Vector Is All You Need) reads every LoRA factor of every adapted layer out of a single trainable vector θd\theta_d of theta_d_length entries. A fixed projection, drawn once from proj_seed, assigns each entry of the flattened factors one scaled entry of θd\theta_d, so the adapter of the whole model is theta_d_length numbers.

Classes