﻿# DoRA: separating magnitude from low-rank direction updates

How DoRA differs from ordinary LoRA, what its magnitude state adds to an artifact, and why caching, offloading and merging need separate measurements.

Author: Retrivium editorial team
Updated: 2026-11-03
Canonical URL: https://retrivium.ai/journal/guide-dora-magnitude-direction/
Language: en

DoRA changes how a pretrained weight is adapted by separating magnitude and direction. A LoRA-style path updates direction, while an additional learned component controls magnitude. This parameterization aims to give compact adaptation a different learning behavior; it does not make every DoRA run equivalent to full fine-tuning.

## Understand the extra learned state

Ordinary LoRA factors alone do not fully describe a DoRA adaptation. The magnitude parameters participate in the effective weight, so an export that preserves only familiar low-rank matrices is incomplete. Inspect the saved tensors and configuration together. A loader accepting their shapes does not establish that it reconstructed normalization, magnitude and directional scaling correctly.

## Compare a task under fixed conditions

For an illustrative instruction-formatting task, retain the same demonstrations, chat template, target masking and held-out documents when comparing LoRA and DoRA. Report format validity separately from answer correctness. The DoRA paper evaluates particular language and vision-language setups; its improvement is evidence for those experiments. A new domain may prefer another adaptation budget or learn an unwanted style despite a lower training loss.

## Measure the chosen runtime path

Current PEFT documentation describes evaluation-time reuse, an optional caching helper and ephemeral GPU offloading. These are distinct execution choices with memory trade-offs. An option that avoids repeated work may retain additional state; offloading can introduce transfers and temporary device allocations. Measure the intended workload rather than copying a vendor example's timing. Separate first-use preparation, steady-state execution and peak memory in the experiment record.

## Validate support at the module level

The documented implementation supports selected module types and qualifies some quantized-training combinations. Examine the actual model modules, quantization library and distributed setup together. General support for DoRA does not prove that every quantized wrapper or parallel-training combination is supported. Preserve the precise environment and confirm a small forward, backward and reload cycle before committing a larger training budget.

## Test the serving artifact separately

If a supported merge is selected, compare the merged model with unmerged DoRA in evaluation mode at the target precision. Retain the untouched base and complete adapter so the export can be reproduced. Sampled text can amplify small numerical differences; fixed-continuation scores provide a useful additional comparison where available. Choose DoRA from observed task behavior and serving cost, not solely from the size of its trainable state.

## Primary references

[PEFT: DoRA](https://huggingface.co/docs/peft/package_reference/lora_variant_dora).

[DoRA original research](https://arxiv.org/abs/2402.09353).

[NVIDIA DoRA reference implementation](https://github.com/NVlabs/DoRA).

Related explanations: [adapter merge arithmetic](/journal/lora-adapter-merge-linear-layer/); [evaluation-mode behavior](/journal/train-eval-dropout-model-behavior/).
