Skip to content
module

FourierFT

4 members
lucid.peft.tuners.fourierft

lucid.peft.tuners.fourierft — FourierFT: the weight update as a few frequency coefficients.

FourierFT (Gao et al., 2024, arXiv:2405.03003) learns n_frequency coefficients of a dout×dind_{out}\times d_{in} spectrum at fixed pseudo-random locations; the inverse 2-D Fourier transform of that sparse spectrum, times scaling, is the update. The locations come from random_loc_seed alone, so an adapter holds just the coefficients. Pick it for an adapter smaller than LoRA's whose update has no low-rank structure.

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

Paper

Gao, Ziqi, et al. "Parameter-Efficient Fine-Tuning with Discrete Fourier Transform." [arXiv:2405.03003](https://arxiv.org/abs/2405.03003), 2024.

Overview

FourierFT (Gao et al., 2024, arXiv:2405.03003) learns the weight update in the frequency domain: a handful of coefficients c1…cnc_1 \dots c_n of a dout×dind_{out} \times d_{in} spectrum, at fixed pseudo-random locations, and the inverse 2-D Fourier transform of that sparse spectrum is the update,

Sℓj=cj,S_{\ell_j} = c_j,

Classes