Skip to content
module

HRA

5 members
lucid.peft.tuners.hra

lucid.peft.tuners.hra — HRA: a chain of learned Householder reflections.

HRA (Yuan et al., 2024, arXiv:2405.17484 — Householder Reflection Adaptation) multiplies a weight from the right by rr Householder reflections, W′=W∏i(I−2u^iu^i⊤)W' = W\prod_i (I - 2\hat u_i \hat u_i^\top), an orthogonal transform of the input space whose only parameters are the rr vectors uiu_i. With an even r it starts as the identity, and it folds into the weight. The paper presents it as a bridge between low-rank and orthogonal adaptation: pick it for an orthogonal method that costs r dinr\,d_{in} parameters per layer.

Where the reference library keeps them, so isinstance(m, HRALayer) and from lucid.peft.tuners.hra import HRAConfig, Linear read as they do there. One layer type per module the method adapts: Linear and Conv2d. HRAConfig and HRAModel are here and exported from lucid.peft. Importing the package registers the method (its config under PeftType.HRA, its tuner and layers), which is what makes get_peft_model and PeftModel.from_pretrained know it.

Paper

Yuan, Shen, et al. "Bridging the Gap between Low-rank and Orthogonal Adaptation via Householder Reflection Adaptation." [arXiv:2405.17484](https://arxiv.org/abs/2405.17484), 2024.

Overview

HRA (Yuan et al., 2024, arXiv:2405.17484 — Householder Reflection Adaptation) multiplies each targeted weight from the right by a chain of rr Householder reflections,

u^i=ui/∥ui∥,\qquad \hat u_i = u_i / \lVert u_i \rVert,

Classes