LN Tuning
3 memberslucid.peft.tuners.ln_tuninglucid.peft.tuners.ln_tuning — LN tuning: train a copy of each chosen normalisation layer.
LN tuning (Zhao et al., 2023, arXiv:2312.11420 — Tuning LayerNorm in Attention) trains the normalisation layers of a model and nothing else. Each chosen layer gets a copy of itself that trains while the original stays frozen; the method adds no tensor of its own, so an adapter is a few parameters per layer, and merging makes the trained copy the layer. Pick it for a tiny adapter that needs no new tensors. It applies one adapter at a time.
Where the reference library keeps them, so isinstance(m, LNTuningLayer) and from lucid.peft.tuners.ln_tuning import LNTuningConfig, LNTuningLayer read as they do there. One layer
type, which wraps whichever module target_modules names. LNTuningConfig and
LNTuningModel are here and exported from lucid.peft. Importing the package registers the
method (its config under PeftType.LN_TUNING, its tuner and layer), which is what makes
get_peft_model and PeftModel.from_pretrained know it.
Zhao, Bingchen, et al. "Tuning LayerNorm in Attention: Towards Efficient Multi-Modal LLM Finetuning." [arXiv:2312.11420](https://arxiv.org/abs/2312.11420), 2023.
LN tuning (Zhao et al., 2023, arXiv:2312.11420 — "Tuning LayerNorm in Attention") trains the normalisation layers of a model and nothing else: each targeted layer gets a copy of itself that trains while the original stays frozen. The method adds no tensor of its own, so it is a few parameters per layer; "merging" makes the trained copy the layer.
Classes
LNTuningConfig9 methodsHow lucid.peft.get_peft_model adapts a model with LN tuning.
LNTuningLayer18 methodsA module beside a trainable copy of itself, one copy per adapter.
LNTuningModel15 methodsA model whose chosen normalisation layers train as copies, and the tools to take them out again.