Beyond LoRA: Can you beat the most popular fine-tuning technique?
LoRA accounts for roughly 95–98% of PEFT usage across Hugging Face Hub model cards and image-generation checkpoints, but controlled benchmarks in the PEFT library show it is often not the best tradeoff. On a MetaMathQA/GSM8K fine-tune of Llama-3.2-3B, rs-LoRA (53.2%, 22.6 GB) sits on the accuracy–memory Pareto frontier alongside BEFT (32.9%, 20.2 GB) and Lily (54.9%, 25.6 GB), while vanilla LoRA (48.1%, 22.5 GB) is dominated. On a FLUX.2-klein-base-4B image concept-learning benchmark, OFT strictly beats LoRA on both DINO similarity and VRAM. To work around downstream tools like vLLM that only load LoRA, PEFT can now convert some other adapters to LoRA with near-identical scores, so switching techniques is mostly a matter of changing one config.
Related posts
- What is LLM fine-tuning?
Modal mediumAdept
Fine-tuning adjusts a pretrained LLM's weights for a specific task or domain, often matching larger models' quality at lower cost and latency. One cited example puts a fine-tuned Llama 7B at roughly 50x cheaper per token than GPT-3.5. The guide compares where to fine-tune (OpenAI, Predibase, Modal, Colab, SageMaker) and which frameworks to use (HuggingFace transformers, TRL, Axolotl). It then walks through choosing a base model, formatting and tokenizing an instruction dataset with optional custom special tokens, training, and efficiency techniques such as LoRA-based PEFT and quantization.
- Parameter-Efficient Fine-Tuning using 🤗 PEFT
Hugging Face mediumAdeptHugging Face's PEFT library brings parameter-efficient fine-tuning methods (LoRA, Prefix Tuning, Prompt Tuning, P-Tuning) to Transformers and Accelerate. Most pretrained weights stay frozen and only a small set of extra parameters is trained, which gives performance comparable to full fine-tuning at a fraction of the compute and storage cost. A LoRA config on mt0-large trains about 0.19% of the parameters, and the saved adapters are only a few MB (19MB for T0_3B) instead of 40GB per-task checkpoints. Example use cases include tuning T0_3B on 11GB consumer GPUs with DeepSpeed offload, INT8 tuning of OPT-6.7b in Colab with bitsandbytes, and Stable Diffusion Dreambooth, plus code for training, saving and loading adapters.
- Fine-tuning 20B LLMs with RLHF on a 24GB consumer GPU
Hugging Face hardMasterCombining trl with peft and bitsandbytes makes RLHF fine-tuning of a 20B-parameter LLM feasible on a single 24GB consumer GPU. The approach loads the active model in 8-bit using LLM.int8(), trains only small LoRA adapters to shrink optimizer state, and obtains reference logits for PPO from the same model by disabling the adapters, so no second model copy is needed. Memory rules of thumb are 4/2/1 GB per billion parameters in fp32/fp16/int8, plus 8 bytes per parameter for AdamW. A gpt-neox-20b model was fine-tuned on IMDB, its adapters were merged, and it was then RL-tuned to generate positive reviews. The main cost is speed, since adapters make forward and backward passes roughly twice as slow.
- 🤗 PEFT welcomes new merging methods
Hugging Face hardMasterPEFT adds on-the-fly merging methods for LoRA adapters through add_weighted_adapter(): concatenation (cat), linear/task arithmetic, SVD, TIES, DARE variants and magnitude pruning. Each method's math is laid out along with its tradeoffs. cat gives exact weighted merging and supports differing ranks. linear requires equal ranks. svd lets you choose the output rank but needs a lot of GPU memory. TIES and DARE use pruning, rescaling and majority-sign masks to reduce interference. Worked examples merge LLM adapters, such as Hinglish plus mental-health to combine both capabilities, and SDXL style LoRAs in Diffusers by wrapping them as PeftModels.
- LoRA Explained: Faster, More Efficient Fine-Tuning with Docker
Docker mediumAdeptGemma 3 270M can be specialized into a compact PII-masking assistant using LoRA, which freezes the base weights and trains only small low-rank adapters, cutting compute and memory needs while avoiding catastrophic forgetting. The walkthrough covers formatting supervised examples with the model's chat template so training data matches inference input, configuring PEFT adapters (r=16, alpha=32 on q_proj/v_proj), training with TRL's SFTConfig via Unsloth, and merging adapters into a standalone 16-bit checkpoint. The merged model can then be packaged and shared through Docker Model Runner and Docker Hub.