# Quicktour PEFT offers parameter-efficient methods for finetuning large pretrained models. The traditional paradigm is to finetune all of a model's parameters for each downstream task, but this is becoming exceedingly costly and impractical because of the enormous number of parameters in models today. Instead, it is more efficient to train a smaller number of prompt parameters or use a reparametrization method like low-rank adaptation (LoRA) to reduce the number of trainable parameters.

Wrapping means that PEFT replaces the targeted layers (here: all q_proj layers) with the adapter-specific layer for the target layer's type. Since we're dealing with linear layers, it will be, in this case, a lora.Linear layer. Note that these changes are done in-place to save memory, so your base model is now modified.
Note that we've only specified q_proj but in actuality we are targeting all model.layers[:].self_attn.q_proj layers. This is because PEFT searches for matching suffixes by default. Pass a string with a regular expression if you want to target more complex layer patterns.


The base model's layer will be wrapped, retained and not trained while new, trainable weights are added and are combined. How these new weights are structured and combined with the weights of the base model is a good portion of what sets the different PEFT methods apart.
This works because the wrapped layer actually has a unique set of trainable weights for each adapter name. Not every adapter is active and trainable by default. You have to explicitly enable adapters by name before they are active. This allows you to quickly swap between adapters where task-specific knowledge is needed or serve different use-cases on top of one model.
