HiRA
8 memberslucid.peft.tuners.hiralucid.peft.tuners.hira — HiRA: a low-rank matrix that modulates the weight elementwise.
HiRA (Huang et al., 2025, ICLR — Hadamard High-Rank Adaptation) multiplies the frozen weight
elementwise by a low-rank matrix, , so the update can have a rank
far above the r it is built from while costing parameters. The
update reads the weight, so a merge keeps the weight it was folded into and an unmerge gives it back
exactly. Pick it for more expressive updates than LoRA at the same parameter count.
Where the reference library keeps them, so isinstance(m, HiraLayer) and from lucid.peft.tuners.hira import HiraConfig, Linear read as they do there. One layer type per module
the method adapts: Linear, Embedding, Conv1d, Conv2d and Conv3d. HiraConfig
and HiraModel are here and exported from lucid.peft. Importing the package registers the
method (its config under PeftType.HIRA, its tuner and layers), which is what makes
get_peft_model and PeftModel.from_pretrained know it.
Huang, Qiushi, et al. "HiRA: Parameter-Efficient Hadamard High-Rank Adaptation for Large Language Models." ICLR, 2025.
HiRA (Huang et al., 2025, ICLR — Hadamard High-Rank Adaptation) multiplies the frozen weight elementwise by a low-rank matrix,
Classes
HiraConfig9 methodsHow lucid.peft.get_peft_model adapts a model with HiRA.
Conv1d18 methodsAn nn.Conv1d with a HiRA update: the kernel is modulated by .
Conv2d18 methodsAn nn.Conv2d with a HiRA update: the kernel is modulated by .
Conv3d18 methodsAn nn.Conv3d with a HiRA update: the kernel is modulated by .
EmbeddingAn nn.Embedding with a HiRA update: the table is looked up as .
HiraLayer18 methodsAdapter bookkeeping and the modulated update shared by the HiRA layers.
LinearAn nn.Linear with a HiRA update: .
HiraModel15 methodsA model with HiRA layers in it, and the tools to take them out again.