↑↓ move Enter open ⌘K find from any page 256 of 256 tabs
Loading the recording…

One family, three ways to adapt a frozen weight

LoRA, QLoRA and DoRA fine-tune a model without touching its weights. Each adapted weight stays frozen, and the only weights that train are two small matrices, and , with a rank far below either dimension. They differ in what the product is added to and how the result is used:

QLoRA is LoRA on a base stored in 4-bit NormalFloat and dequantized on every forward pass. DoRA keeps LoRA's for the direction of each output row and trains its length separately. Each member tab works through one of these on its own run. This page puts the three runs side by side: their losses, the updates they learn for the same matrix, the base each one trains on, and what each costs.

One start

The three member tabs were already recorded on the same footing: SmolLM2-135M-Instruct, the same eight text-to-SQL rows as one batch and one held-out row, adapters on every layer's q_proj and v_proj with and , the same (seed 0) and , 40 AdamW steps at a constant , all in float32 on the CPU. The losses and gradient norms on this page are those tabs' own recordings.

The tabs did not keep everything a comparison needs: QLoRA's and , DoRA's merged update for every layer, or the time and memory of a step. So all three were run again, each in its own process, and every re-run reproduces its tab to the bit: the losses, the held-out losses, the gradient norms, the greedy replies, and the , and the tabs kept. These re-runs add QLoRA's matrices, every update's singular values, and the costs. No member recorded full fine-tuning, so the three updates are compared with each other, not with a fully fine-tuned weight.

Three updates, one matrix

The What each one adds to W₀ panel draws layer 15's update on one colour scale. LoRA and QLoRA add . DoRA's merged weight changes in two parts. Write with :

The first part stretches or shrinks each row of . The strip beside DoRA's matrix shows that row by row as . The second part is LoRA's update, rescaled. Averaged over the 30 layers' q_proj, DoRA changed the row lengths by 0.0117 at step 40 against LoRA's 0.0024, five times as much, while the mean change of direction ( between old and new rows, the DoRA paper's ) was the same, .

Singular values

A product of rank 8 has eight nonzero singular values. They come from the core of and , so the matrix is never decomposed. LoRA's and QLoRA's spectra in the Singular values panel stop there. At layer 15's q_proj after 40 steps, the largest value holds 72% of LoRA's and 77% of QLoRA's.

DoRA's is rank 8 too, but its merged update adds , a full-rank matrix, so the spectrum continues past 8. At step 40 that tail held 1.9–6.5% of the merged update's across the q_proj layers (median 3.2%) and 1.4–6.0% across v_proj. So a merged DoRA weight is not a rank-8 change of , even though only , and were trained. The grey line is QLoRA's base error , which is close to flat, like noise.

The base matters more than the method

From the same on the same rows, LoRA's and DoRA's updates ended almost the same: cosine 0.981 on average over the layers for both q_proj and v_proj, and their top-8 output subspaces overlap 0.98–0.99. LoRA's and QLoRA's did not: cosine 0.48 for q_proj and 0.60 for v_proj, and an overlap of 0.25–0.29, where two random 8-dimensional subspaces of 576 would give 0.014. Yet the training losses almost coincide: 0.00215, 0.00223 and 0.00209 after step 40. Many different low-rank updates fit eight rows.

The gap opens at the first step. AdamW divides the first moment by the square root of the second, and on step 1 both are built from one gradient, so every entry of moves by , the sign of its gradient, however small that gradient is. The 4-bit base changes the activations and gradients a little, enough to flip the sign of about 24% of layer 15's entries. DoRA's base is itself, and it keeps every sign. After step 1 the LoRA–QLoRA cosine is already 0.47 (q_proj), and it never recovers. The Same start, how alike they end panel shows it layer by layer and over the steps.

The weight QLoRA trains on

NF4 with blocks of 64 and double quantization changes every q_proj and v_proj of SmolLM2-135M by 9.3–10.1% of its norm. The updates are much smaller: at step 40 and the median layer, LoRA's is 1.3% of for q_proj and 1.5% for v_proj, QLoRA's 1.2% and 1.5%. So QLoRA's base error is 7.3 times its update for q_proj and 6.4 times for v_proj at the median layer. The adapters do not undo it. The best rank-8 matrix could cancel only 7.5% (q_proj) or 10.4% (v_proj) of the error's on average, and QLoRA's update has with at every layer and step. It learns the task on top of the error. LoftQ (Li et al.) starts the adapters from a low-rank approximation of that error instead.

Before training, the 4-bit base raises the held-out row's loss from 2.411 to 2.430 nats. During training QLoRA's held-out loss dipped less: its best was 1.59 at step 6, against LoRA's 1.11 and DoRA's 1.10 at step 8. With one held-out row and one seed this is an anecdote, not a measurement of QLoRA's quality.

What each one costs

LoRA and QLoRA train the same 460,800 weights; DoRA adds one magnitude per output row, 23,040 more (5%). The adapters, their gradients and AdamW's two moments take 7.0 MiB (7.4 MiB for DoRA). The base takes 513 MiB in float32 and 161 MiB in NF4 with double quantization (the embedding stays in float32).

The largest item is neither. A training step keeps 918 MiB of activations for its backward pass, for eight rows padded to 95 tokens through 30 layers and the logits over a 49,152-token vocabulary. QLoRA keeps exactly as much: bitsandbytes dequantizes each weight inside its matrix product and does not keep the result. DoRA keeps 1,052 MiB, 134 MiB more, for the graph of its rescaling by . So QLoRA's whole saving here is its smaller base, 352 MiB of about 1.4 GiB. On a 7-billion-parameter model the base is most of the memory, and NF4 is what makes it fit on one GPU.

Timing on this Mac was hard: its swap was full, shared with other sessions' jobs. For the table all three trained once more in one process, one step of each in turn, so that interference hit all three alike. Their fastest steps took 0.76 s for LoRA, 0.89 s for QLoRA and 0.81 s for DoRA. QLoRA dequantizes every 4-bit weight on every pass, and DoRA recomputes for each adapted matrix. But the medians, 1.39, 1.45 and 1.30 s, and each method's runs alone in their own processes changed order from one run to the next. On this CPU the three cost within about 20% of each other, and the timing does not separate them further. On a GPU, where dequantization is a fused kernel, the ratios differ.

What this comparison cannot say

Forty steps on eight rows, one held-out row and one seed show how the three methods change the same weights, not which one fine-tunes better. The CPU step times measure this Mac, shared with other jobs, not a GPU. And without a full fine-tuning run there is no reference direction: the LoRA paper and its successors compare adapters with full fine-tuning on much larger tasks.

Papers

  1. LoRA: Low-Rank Adaptation of Large Language Models Edward J. Hu et al. · ICLR 2022 2021 LoRA: frozen weights plus a trained low-rank product (α/r)·B·A, B starting at zero; its §7 compares the update's subspaces across ranks and with W.
  2. QLoRA: Efficient Finetuning of Quantized LLMs Tim Dettmers et al. · NeurIPS 2023 QLoRA: LoRA on a base stored in 4-bit NormalFloat with double-quantized constants, dequantized for every matrix product.
  3. DoRA: Weight-Decomposed Low-Rank Adaptation Shih-Yang Liu et al. · ICML 2024 DoRA: each row's length m trained directly, LoRA for its direction; the ΔM / ΔD analysis of how methods move the weights.
  4. LoftQ: LoRA-Fine-Tuning-Aware Quantization for Large Language Models Yixiao Li et al. · ICLR 2024 2023 Initialises the adapters from a low-rank approximation of the quantization error, which plain QLoRA's adapters do not learn to cancel.
  5. LoRA vs Full Fine-tuning: An Illusion of Equivalence Reece Shuttleworth et al. · arXiv 2024 Compares the singular vectors of LoRA's and full fine-tuning's weights; the comparison this page cannot make without a full fine-tuning run.
  6. Intrinsic Dimensionality Explains the Effectiveness of Language Model Fine-Tuning Armen Aghajanyan, Luke Zettlemoyer, Sonal Gupta · ACL 2021 2020 Fine-tuning can succeed in a tiny random subspace of the weights: one reason many different low-rank updates fit the same data.
  7. Adam: A Method for Stochastic Optimization Diederik P. Kingma, Jimmy Ba · ICLR 2015 2014 Adam's bias-corrected moments: on the first step the update is lr times the sign of each gradient entry.
  8. SmolLM2: When Smol Goes Big -- Data-Centric Training of a Small Language Model Loubna Ben Allal et al. · arXiv 2025 SmolLM2-135M-Instruct, the base all three methods adapt.

See also