Skip to content
AI.info

Generative AI

Parameter-Efficient Adaptation: LoRA, QLoRA, and Adapters

Understand low-rank and adapter-based fine-tuning, quantized-base training, merging choices, and multi-adapter operations.

By the end you can

Fewer trainable parameters do not mean fewer behavioral consequences

Parameter-efficient methods keep most base weights frozen and train a smaller set of parameters or modules. This can reduce memory, storage, and iteration cost.

The resulting adapter can still alter safety, style, domain behavior, and tool use across many prompts. That is a measurement, not a caution invented for this lesson. In 2023 a quantized LoRA run stripped the safety training out of released chat models. Lermen and two colleagues state it plainly in their abstract: “With a budget of less than $200 and using only one GPU, we successfully undo the safety training of Llama 2-Chat models of sizes 7B, 13B, and 70B and on the Mixtral instruct model.” For the 70B model they report refusal rates of about 1% on two refusal benchmarks. Performance on two general benchmarks was retained. The model kept its capabilities and lost its refusals.

The training run that did this was the cheapest kind in this lesson. Data and release controls therefore remain as important as in full fine-tuning.

Under $200 on a single GPU took a 70B chat model to about 1% refusal: efficiency changes the update mechanism, not the standard of evidence required for the adapted behavior.

Visual

LoRA represents a weight update through low-rank factors

The base matrix remains frozen while a trainable update is applied during the forward pass. How much capacity that update needs was measured in the LoRA paper itself, in Table 6 on GPT-3 175B. Adapting both the query and value projections, WikiSQL validation accuracy was 73.4 at r = 1 and 73.5 at r = 64. MultiNLI was 91.3 at r = 1 and 91.4 at r = 64. A rank of one matched a rank of sixty-four. Adapting the query projection alone did not behave the same way: 68.8 at r = 1 on WikiSQL, rising to 70.5 at r = 4.

The authors draw the conclusion themselves, in the section asking what the optimal rank is: “We argue that increasing r does not cover a more meaningful subspace, which suggests that a low-rank adaptation matrix is sufficient.” Read the two halves of Table 6 together and the ordering is clear. Which modules you adapt carried the result. The rank was the cheaper of the two decisions.

FigureProcess · 5 steps
  1. 1

    Select target matrices

    Choose attention or feed-forward projections to adapt.

  2. 2

    Initialize low-rank factors

    Train two smaller matrices whose product forms the update.

  3. 3

    Scale the contribution

    A rank and scaling rule control update capacity and magnitude.

  4. 4

    Optimize adapter parameters

    Gradients update the factors while base weights remain fixed.

  5. 5

    Serve merged or separate

    Combine with the base or load adapters dynamically under policy.

Comparison

Adaptation methods move cost to different parts of the lifecycle

The best option depends on hardware, variant count, serving, and governance. Each row here has a published measurement behind it rather than a reputation.

The adapter row is the oldest. In 2019 adapter modules were tested by transferring BERT to 26 text classification tasks. Houlsby and seven co-authors give the trade in one sentence: “On GLUE, we attain within 0.8% of the performance of full fine-tuning, adding only 3.6% parameters per task. By contrast, fine-tuning trains 100% of the parameters per task.” One caution for anyone citing it: the arXiv abstract of the same paper states 0.4% where the proceedings state 0.8%. The discrepancy is visible on the two pages.

Prompt tuning sits further along the same axis. A 2021 paper on prompt tuning put the number in a figure caption: “With a T5 “XXL” model, each copy of the tuned model requires 11 billion parameters. By contrast, our tuned prompts would only require 20,480 parameters per task—a reduction of over five orders of magnitude—assuming a prompt length of 5 tokens.” Its Table 4 gives 20,480 trainable against 11,135,352,832 total, or 0.00018%. Figure 4 keeps task-specific parameters under 0.01% for models over a billion parameters, against 0.1-1% for prefix tuning at inference. That is what "very small trainable state" is worth as a figure. And in the same paper, it is at that scale that the method becomes competitive at all.

FigureComparison · 4 columns

Full fine-tuning

Update most or all model parameters.

  • Maximum adaptation flexibility
  • High optimizer memory and storage
  • Produces a complete new checkpoint
  • Needs broad regression testing

LoRA or adapters

Train small additional parameter sets on a frozen base.

  • Lower training and storage cost
  • Supports many variants
  • Target modules and rank matter
  • Serving must manage compatibility

QLoRA-style training

Adapt a quantized frozen base with low-rank updates.

  • Reduces training memory
  • Quantization adds numerical choices
  • Serving precision can differ
  • Quality must be evaluated on the target workload

Prompt or prefix tuning

Optimize learned input-side representations.

  • Very small trainable state
  • Behavior depends strongly on base model
  • Can be awkward across interfaces
  • Useful in selected controlled settings

Example

Adapter operations create a variant-management problem

Low storage cost can let variants multiply unchecked, and the ceiling is far above most teams' inventories. A serving system called S-LoRA measured it in 2024. Sheng and eleven co-authors write in their comparison with other systems: “Remarkably, S-LoRA can serve 2,000 adapters simultaneously, maintaining minimal overhead for the added LoRA computation. In contrast, vLLM-packed needs to maintain multiple weight copies and can only serve fewer than 5 adapters due to the GPU memory constraint.” On a single A100 (80GB) they improved throughput by up to 30× over HuggingFace PEFT and up to 4× over vLLM with naive LoRA support.

Two thousand adapters on one card is an inventory, not a deployment. Every failure below is a property of inventories rather than of training.

  • Base mismatch: An adapter trained for one checkpoint is loaded on an incompatible revision.
  • Tokenizer drift: The base or prompt format changes while the adapter remains unchanged.
  • Routing error: The wrong tenant or domain adapter is selected for a request — one wrong pick out of a candidate set that can now number two thousand on a single GPU.
  • Merge ambiguity: Several adapters are combined without evidence that their updates compose safely.
  • Retirement gap: A revoked adapter remains cached on serving workers or referenced by an alias.
  • Evaluation blind spot: Each adapter passes local tests while shared base changes cause broad regressions.

Key idea

An adapter is not a live knowledge database

Low-rank adaptation can teach terminology, formats, and stable domain behavior. It can also increase recall of facts present in training data.

Those facts remain embedded in weights without source-level update or citation. Current and auditable information should usually come from retrieval or structured tools.

Use adapters for behavior that can be learned stably; use external evidence for facts that must remain current and inspectable.

Case

From 1.2TB to 350GB, and from 350GB to 35MB — two different savings

Against fine-tuning GPT-3 175B with Adam, the LoRA abstract reports ten thousand times fewer trainable parameters and a threefold cut in the GPU memory requirement. The paper was published in 2021 and appeared at ICLR the following year. Those are the two figures everyone repeats, and the two that are easiest to merge into one.

The paper separates them itself, in its paragraph on practical benefits and limitations: “On GPT-3 175B, we reduce the VRAM consumption during training from 1.2TB to 350GB. With r = 4 and only the query and value projection matrices being adapted, the checkpoint size is reduced by roughly 10,000× (from 350GB to 35MB).”

The 10,000× is the checkpoint. The memory a training run occupies went from 1.2TB to 350GB. Training also ran 25% faster than full fine-tuning — 43.1 against 32.5 tokens/s per V100 GPU. A footnote in the same paper puts the storage consequence at fleet scale: about 354GB for 100 adapted models, against about 35TB for 100 full copies.

Figure

Two reductions from the same paper, four orders of magnitude apart: trainable parameters against the GPU memory they actually save.

Case

Sixty-five billion parameters fine-tuned on a single 48GB GPU

QLoRA pushed the idea further at NeurIPS in 2023. Backpropagating gradients through a frozen four-bit model into low-rank adapters — using 4-bit NormalFloat, Double Quantization and Paged Optimizers — let four researchers fine-tune a 65-billion-parameter model on one 48GB GPU. Full 16-bit finetuning task performance was preserved.

What that budget buys is the part worth reading twice. The paper finetuned more than 1,000 models across 8 instruction datasets, and its abstract reports: “Our best model family, which we name Guanaco, outperforms all previous openly released models on the Vicuna benchmark, reaching 99.3% of the performance level of ChatGPT while only requiring 24 hours of finetuning on a single GPU.” A day and one card now produce a variant worth deploying. Neither method makes the weights citable.

Position

The saving is in the training, not in the risk

Ten thousand times fewer trainable parameters. Three times less GPU memory. Both figures come from one abstract sentence about GPT-3 175B fine-tuned with Adam. A reader who takes the first as the size of the saving is reading a storage number as a hardware number. The paper keeps them apart. The checkpoint fell from 350GB to 35MB at r = 4 with only the query and value projections adapted. The VRAM a training run consumes fell from 1.2TB to 350GB. The frozen base is still there, and it is still run for every token. What the method made small is the part you train and the part you store, not the model you operate.

The cheapness is real, and it is what creates the governance problem. QLoRA fine-tuned a 65-billion-parameter model on one 48GB GPU. Guanaco reached 99.3% of ChatGPT's performance level on the Vicuna benchmark after 24 hours of finetuning on a single GPU. On the serving side, S-LoRA held 2,000 adapters at once on a single A100 (80GB), where vLLM-packed managed fewer than five. When a variant costs one card and a day, an organisation ends up with a shelf of them. That is why this lesson's failure list is about base mismatch, tokenizer drift, routing to the wrong tenant and a revoked adapter still sitting in a cache, rather than about training at all.

And the behavior an adapter reaches is not marginal. The safety training of Llama 2-Chat was undone at 7B, 13B and 70B, and on Mixtral instruct, for under $200 on one GPU. The 70B model then refused about 1% of the time on two refusal benchmarks while it held its scores on two general benchmarks. The evidence you owe for a behavior change does not shrink with the parameter count.

Ask how many prompts an adapter changes, not how many parameters it trained.

Steps

Operate an adapter as a versioned release

Treat base, tokenizer, adapter, prompt, and routing as one compatibility set.

Step 1 is where rank and target modules are frozen into the record, and Table 6 of the LoRA paper shows why the second matters more than the first. On GPT-3 175B, WikiSQL validation accuracy was 73.4 at r = 1 and 73.5 at r = 64 when the query and value projections were both adapted — a tenth of a point across a sixty-fourfold difference in rank. Adapting the query projection alone started at 68.8 and needed r = 4 to reach 70.5. Rank is cheap to record. The module list is the field that explains a result later.

FigureProcess · 6 steps
  1. 1. Freeze compatibility keys

    Record base checkpoint, tokenizer, modules, rank, precision, and format.

  2. 2. Curate and split data

    Apply the same provenance and leakage controls as full tuning.

  3. 3. Compare baselines

    Test prompt-only, adapter, and full-tune options where feasible.

  4. 4. Evaluate broad regressions

    Include safety, multilingual, tool, and out-of-domain behavior.

  5. 5. Test serving modes

    Merged, dynamic, multi-tenant, cache, and rollback paths.

  6. 6. Govern routing and retirement

    Use allowlists, exact versions, inventory, and cache invalidation.

Parameter efficiency is an engineering advantage, not a quality shortcut

LoRA, QLoRA, and adapters let a small team experiment and specialize under smaller hardware budgets. They also create more variants and compatibility surfaces to govern. And they are not free in quality. A 2024 head-to-head on programming and mathematics ran instruction finetuning on about 100K prompt-response pairs and continued pretraining on 20B tokens. Biderman and eleven co-authors report the outcome in their abstract: “Our results show that, in the standard low-rank settings, LoRA substantially underperforms full finetuning. Nevertheless, LoRA better maintains the base model's performance on tasks outside the target domain.” They also found full finetuning learning perturbations of rank 10-100× greater than typical LoRA configurations. The constraint that costs in-domain accuracy is the same constraint that limits the forgetting.

The next lesson studies synthetic data. Cheap example generation can accelerate adaptation. But model-generated supervision can reproduce errors and narrow the training distribution.

Key takeaways