LLM Learning Hub

workspace/llm-course/home

Trainable Adapters

Trainable adapters are the small LoRA matrices A and B (and optionally scaling) injected into specific linear layers that are the only parameters updated during fine-tuning.

What is Trainable Adapters?

Trainable adapters are the small LoRA matrices A and B (and optionally scaling) injected into specific linear layers that are the only parameters updated during fine-tuning.

Trainable adapters are the small LoRA matrices A and B (and optionally scaling) injected into specific linear layers that are the only parameters updated during fine-tuning.

Where is it used?

Adapters are attached to `q_proj`, `k_proj`, `v_proj`, and `o_proj` in Llama/Mistral via `peft`; `unsloth` fuses adapters for 2x speedup; adapters can be swapped at inference with `load_adapter`.

How to build it

Inspect `model.peft_config` and `model.adapter_model()` to list injected layers; save with `model.save_pretrained("adapter")` producing a small ~10MB `adapter_model.safetensors` file.