Skip to content
module

PSOFT

5 members
lucid.peft.tuners.psoft

lucid.peft.tuners.psoft — PSOFT: orthogonal fine-tuning inside the weight's principal subspace.

PSOFT (Wu et al., 2025, arXiv:2505.11235 — Efficient Orthogonal Fine-Tuning with Principal Subspace Adaptation) rotates a weight inside its principal subspace only: the top-rr singular directions are frozen as two factors, and an r×rr \times r matrix between them, kept orthogonal by a Cayley parameterisation and relaxed by two diagonal scalings, is all that trains (about r2/2+2rr^2/2 + 2r numbers per layer, whatever the layer's width). The update starts at zero and folds into the weight. Pick it for orthogonal fine-tuning that costs one small matrix per layer instead of a block-diagonal one.

Where the reference library keeps them, so isinstance(m, PsoftLayer) and from lucid.peft.tuners.psoft import PsoftConfig, Linear read as they do there. One layer type for the one module the method adapts, nn.Linear; OrthLayer is the trained matrix. PsoftConfig and PsoftModel are here and exported from lucid.peft. Importing the package registers the method (its config under PeftType.PSOFT, its tuner and layer), which is what makes get_peft_model and PeftModel.from_pretrained know it.

Paper

Wu, Fei, et al. "Efficient Orthogonal Fine-Tuning with Principal Subspace Adaptation." [arXiv:2505.11235](https://arxiv.org/abs/2505.11235), 2025.

Overview

PSOFT (Wu et al., 2025, arXiv:2505.11235 — Efficient Orthogonal Fine-Tuning with Principal Subspace Adaptation, section 4) rotates a weight inside its principal subspace only. An SVD of the weight gives its top-r directions as frozen factors AA and BB, and only an r×rr \times r matrix RR between them is trained:

Classes