Skip to content
module

DEFT

4 members
lucid.peft.tuners.deft

lucid.peft.tuners.deft — DEFT: knowledge injected after removing a learned subspace of the weight.

DEFT (Kumar et al., 2025, arXiv:2509.22793 — Decompositional Efficient Fine-Tuning) removes a learned subspace from the weight and injects new knowledge into it through a residual projection, W′=(I−Pproj) W+QPRW' = (I - P_{proj})\,W + Q_P R. The projector comes from a learned direction matrix by a ReLU or a QR decomposition; para=True keeps the removal alone (PaRa). 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 editing what a layer already encodes, rather than only adding to it, or for long fine-tunes that must keep the base model's instruction following.

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

Paper

Kumar, Komal, et al. "DEFT: Decompositional Efficient Fine-Tuning for Text-to-Image Models." [arXiv:2509.22793](https://arxiv.org/abs/2509.22793), 2025.

Overview

DEFT (Kumar et al., 2025, arXiv:2509.22793 — Decompositional Efficient Fine-Tuning) injects knowledge through a residual projection. For a frozen weight WW it learns a direction matrix P∈Rdout×rP \in \mathbb{R}^{d_{out} \times r} and an injection matrix R∈Rr×dinR \in \mathbb{R}^{r \times d_{in}} and uses

Classes