DoRA · fine-tuning

Also known as: Weight-decomposed low-rank adaptation

On this page 7

DoRA, short for weight-decomposed low-rank adaptation, is a parameter-efficient fine-tuning method that splits each pretrained weight matrix into a magnitude vector and a direction matrix, trains the magnitude directly and updates the direction with a low-rank adapter in the style of LoRA. In the Training topic of artificial intelligence, it is regarded as a refinement of LoRA that narrows the accuracy gap to full fine-tuning without adding any inference cost.

The method was introduced in 2024 by researchers at NVIDIA and quickly became available in mainstream libraries such as Hugging Face PEFT. Its appeal is practical: DoRA uses almost the same number of trainable parameters as LoRA, can be merged back into the base weights after training, and tends to deliver consistently better results at low ranks. Not to be confused with the EU Digital Operational Resilience Act, which shares the same acronym.

How weight decomposition works in DoRA

DoRA rewrites every adapted weight matrix as the product of a magnitude and a unit direction. For a pretrained matrix W0, the magnitude m is the column-wise vector norm of W0, and the direction is W0 divided by that norm, so each column has length one. This follows the idea of weight normalization, a reparameterization technique known from earlier deep learning research.

During fine-tuning, the direction receives a low-rank update BA, exactly as in LoRA, and the result is normalized again column by column. The magnitude vector m is trained as an ordinary parameter. The adapted weight is therefore m multiplied by the normalized sum of W0 and BA, which lets the optimizer change the length and the orientation of each column independently.

The components of a DoRA layer and their roles are summarized below.

ComponentTrainableSizeRole
Pretrained weight W0No (frozen)d × kProvides the starting knowledge
Low-rank matrices A and BYesr × k and d × rRotate the direction of columns
Magnitude vector mYes1 × kRescales the length of each column
Column-wise normComputed1 × kKeeps the direction at unit length
Components of a DoRA-adapted layer

Why separating magnitude and direction helps

The motivation for DoRA comes from a weight decomposition analysis of how models change during training. The authors compared the magnitude changes and direction changes produced by full fine-tuning and by LoRA across layers and training steps.

Full fine-tuning showed a negative correlation between the two: large directional changes often came with small magnitude changes and vice versa. LoRA showed a positive correlation, meaning it tended to scale and rotate weights together. DoRA reproduced a pattern much closer to full fine-tuning, which the authors interpret as evidence of greater learning capacity under the same low-rank budget.

There is also an optimization argument. Because the low-rank update acts on a normalized direction, its gradient is projected away from the current weight vector and scaled by the magnitude, which tends to make training more stable and less sensitive to the chosen rank.

DoRA belongs to the family of parameter-efficient fine-tuning techniques and is easiest to understand next to its neighbors. The table compares it with the most common alternatives.

MethodWhat is trainedExtra inference costTypical trade-off
Full fine-tuningAll weightsNoneBest capacity, highest memory
LoRALow-rank matrices onlyNone after mergingCheap, slight accuracy gap
DoRALow-rank matrices plus magnitudeNone after mergingCloser to full fine-tuning, slower steps
QLoRALoRA on a 4-bit base modelDepends on deploymentLowest memory, quantization error
Adapter tuningSmall bottleneck modulesExtra layers at runtimeSimple, adds latency
Prompt tuningSoft prompt vectorsLonger inputVery few parameters, weaker on hard tasks
DoRA and related fine-tuning approaches

DoRA is orthogonal to quantization, so it can be combined with a 4-bit base model in the same way as QLoRA. Community variants often called QDoRA follow this pattern to fit large models on a single GPU.

Configuring DoRA in practice

Configuring DoRA is nearly identical to configuring LoRA, because it reuses the same hyperparameters. In Hugging Face PEFT, it is enabled with a single flag, use_dora=True, on a standard LoRA configuration. The settings below are the ones that matter most.

ParameterCommon rangeEffect
Rank r4 to 64Capacity of the directional update
Scaling alphaOften equal to r or 2rStrength of the low-rank update
Target modulesAttention and MLP projectionsWhich layers are adapted
Learning rateSimilar to LoRA, about 1e-4 to 3e-4Speed and stability of training
Dropout0 to 0.1Regularization on adapter inputs
Key DoRA hyperparameters

A frequently reported advantage is that DoRA remains strong at small ranks, so a rank half the size of a LoRA setup can reach comparable quality. After training, the magnitude and the low-rank update can be folded into a single dense matrix, so the deployed model has the same architecture and speed as the base model.

Limitations and practical cautions

DoRA improves quality per parameter but brings measurable training overhead. The most relevant limitations are listed here.

  • Slower training steps: computing column norms in every forward pass adds time and activation memory compared with LoRA.
  • Memory trick with a cost: the original implementation detaches the norm from the gradient to save memory, a simplification that slightly changes the exact gradient.
  • Modest, task-dependent gains: improvements over LoRA are typically one to a few accuracy points and can vanish on easy tasks or at high ranks.
  • Merging precision: merging into a quantized base model needs care to avoid rounding errors.
  • Same data risks: like any fine-tuning, DoRA can still cause catastrophic forgetting or overfitting on small datasets.

A plain-language summary

Large AI models are expensive to retrain. LoRA is a shortcut that trains only small add-on pieces. DoRA is a smarter version of that shortcut.

Think of each part of the model as an arrow. An arrow has a length and a direction. LoRA changes both at once. DoRA adjusts the length and the direction separately, which is closer to how full retraining behaves. The result is better quality for almost the same cost, and the final model runs just as fast.

An example from practice

A legal technology team wants an open-weight language model with 8 billion parameters to summarize contracts in a fixed house format. Full fine-tuning would require several high-memory GPUs, so the team starts with LoRA at rank 16 on the attention and MLP projections, using about 20,000 annotated contract summaries.

The LoRA model performs well but still misses some clause types. The engineers switch the same configuration to DoRA by enabling one flag and keep every other setting. Each training step takes roughly a fifth longer, yet the evaluation on a held-out set shows fewer omitted clauses and better format adherence. They then test DoRA at rank 8 and obtain similar quality. After training, they merge the adapter into the base weights and deploy the model with no change in serving latency.