AI & Automation6 min readNetray Engineering Team

LoRA vs QLoRA: Choosing the Right Fine-Tuning Method

LoRA and QLoRA are the two fine-tuning methods that make customizing large language models practical for enterprises without a dedicated GPU cluster, but they solve different constraints and picking the wrong one wastes budget or stalls a project outright. LoRA (Low-Rank Adaptation) freezes the base model and trains small low-rank matrices injected into attention and MLP layers, cutting trainable parameters to roughly 0.1 to 1 percent of the full model while keeping the base weights in fp16 or bf16. QLoRA adds 4-bit quantization (NF4) of the frozen base model on top of the same low-rank adapters, trading a small quality hit for a dramatic memory reduction that lets a 70B model fine-tune on a single 48GB GPU instead of a multi-GPU node. The right choice comes down to VRAM budget, target model size, and how much quality headroom you can spend. This guide covers the actual rank and alpha math, memory numbers by model size, and where each method breaks down in production.

How LoRA Actually Works: Rank, Alpha, and Target Modules

LoRA decomposes the weight update for a target layer into two small matrices, A and B, whose product approximates the full-rank update a traditional fine-tune would compute. The rank (r) sets the inner dimension of that decomposition: r=8 or r=16 is enough for narrow behavior shaping like tone or format compliance, r=32 to r=64 suits most task-specific enterprise fine-tunes, and r=128 or higher rarely helps unless you are trying to inject substantial new knowledge, which is a job better suited to continued pretraining. Alpha scales the magnitude of the LoRA update relative to the frozen base weights, and the practical starting heuristic most teams use is alpha equal to two times rank, then tune from there based on eval results. Target module selection matters as much as rank: applying LoRA only to attention projections (q_proj, k_proj, v_proj, o_proj) is cheaper but applying it to the MLP projections too (gate_proj, up_proj, down_proj) consistently improves task performance on instruction-following and domain-specific fine-tunes.

  • Rank 8 to 16: narrow behavior shaping, tone, output format compliance
  • Rank 32 to 64: most enterprise task-specific fine-tunes, the practical sweet spot
  • Rank 128 plus: rarely worth it, diminishing returns and higher overfitting risk
  • Alpha equal to two times rank as a starting heuristic, then tune against eval results

QLoRA's 4-bit Quantization: What You Trade for VRAM Savings

QLoRA quantizes the frozen base model weights to 4-bit NF4 (NormalFloat4), a data type tuned for the roughly normal distribution of trained neural network weights, then dequantizes on the fly during the forward and backward pass while keeping the LoRA adapter computations in bf16 for training stability. The result is a base model footprint roughly one-quarter the size of fp16, with the adapter parameters and their optimizer states adding only a small fraction on top since only the adapters are trainable. The quality cost is real but usually small for task-specific fine-tunes, typically a fraction of a percentage point on held-out task metrics versus full-precision LoRA, though it grows on tasks requiring precise numerical reasoning or long-context retrieval where quantization noise compounds. Double quantization (quantizing the quantization constants themselves) shaves further memory at negligible additional quality cost and is standard practice in current QLoRA implementations.

VRAM Math by Model Size: 7B, 13B, 70B

The numbers below assume a single fine-tuning run with a modest batch size and standard sequence lengths; add 15 to 30 percent headroom for activation memory and gradient checkpointing overhead at longer context lengths. LoRA fine-tuning loads the base model at full precision, so its floor is set by that footprint, while QLoRA's floor is set by the 4-bit quantized footprint plus adapter overhead, which is why QLoRA opens up single-GPU fine-tuning for model sizes that would otherwise require a multi-GPU node.

  • 7B model, LoRA: base weights ~14GB in fp16, fits on a single RTX 4090 or A100 40GB with rank 16 to 64
  • 7B model, QLoRA: base weights ~4GB in NF4, fits comfortably on a single 24GB consumer GPU with room for larger batches
  • 70B model, LoRA: base weights ~140GB in fp16, requires multiple 80GB GPUs (2x H100 or better) just to hold the frozen weights
  • 70B model, QLoRA: base weights ~35 to 40GB in NF4, fits on a single 48GB A6000 or H100, the primary reason QLoRA exists

When LoRA Beats QLoRA (and Vice Versa)

Choose full-precision LoRA when you already have the VRAM headroom, need maximum quality on tasks sensitive to numerical precision, or are training with long context windows where quantization dequantization overhead adds meaningful latency to every training step. Choose QLoRA when GPU budget is the binding constraint, when you are fine-tuning a 30B-plus model on hardware you already own rather than provisioning new multi-GPU nodes, or when you need to run many parallel experiments across different hyperparameter configurations and single-GPU QLoRA jobs let you run more of them concurrently than multi-GPU LoRA jobs would allow. In practice most enterprise fine-tuning teams default to QLoRA for anything above 13B parameters and reserve full LoRA for smaller models where the VRAM savings do not materially change what hardware you need.

  • Full LoRA: sufficient VRAM already available, precision-sensitive tasks, models under roughly 13B parameters
  • QLoRA: GPU budget constrained, models 30B and above, need to run many parallel experiments on limited hardware
  • Both: merge adapters back into base weights post-training for simpler serving, no adapter-swap logic needed at inference

Merging Adapters and Production Serving Considerations

After training, LoRA and QLoRA adapters can be merged directly into the base model weights to produce a single dense checkpoint with no runtime overhead, which is the right default for a single-purpose production deployment. Keep adapters unmerged when you need to serve multiple fine-tuned variants from one base model deployment, since vLLM and other modern serving frameworks support hot-swapping LoRA adapters per request against a shared base model, cutting GPU footprint dramatically versus deploying separate merged models for each variant. One caveat that catches teams off guard: a model fine-tuned with QLoRA and then merged should be re-evaluated at the target serving precision (fp16, FP8, or further quantized for edge deployment), since the merge step recombines a 4-bit-adapted delta into full-precision weights and downstream quantization for serving is a separate decision with its own accuracy tradeoffs.

Frequently Asked Questions

What is the difference between LoRA and QLoRA?

LoRA freezes the base model in full precision (fp16 or bf16) and trains small low-rank adapter matrices on top of it. QLoRA does the same low-rank adaptation but first quantizes the frozen base model to 4-bit NF4, cutting the base model's memory footprint roughly four times. QLoRA trades a small, usually negligible, quality cost for the ability to fine-tune much larger models on a single GPU that would otherwise require a multi-GPU node under full LoRA.

What LoRA rank should I use for enterprise fine-tuning?

Rank 32 to 64 is the practical sweet spot for most task-specific enterprise fine-tunes, with rank 8 to 16 sufficient for narrow behavior shaping like tone or output format. Set alpha to roughly two times the rank as a starting point, then tune based on held-out evaluation results. Ranks above 128 rarely help for task-specific work and mainly increase overfitting risk and VRAM overhead.

Can QLoRA fine-tune a 70B model on a single GPU?

Yes. A 70B model's frozen weights occupy roughly 35 to 40GB in 4-bit NF4 quantization, which fits on a single 48GB GPU such as an A6000 or H100 with room left for adapter training and a modest batch size. The same model under full-precision LoRA needs roughly 140GB just for the frozen weights, requiring at least two 80GB GPUs.

Does QLoRA hurt fine-tuning quality compared to LoRA?

For most task-specific enterprise fine-tunes the gap is small, often a fraction of a percentage point on held-out task metrics. The gap widens on tasks requiring precise numerical reasoning or very long context, where quantization noise compounds across the forward pass. Test both on your actual golden evaluation set before committing to production, since the gap is task-dependent and not reliably predictable from general benchmarks.

Key Takeaways

  • 1How LoRA Actually Works: Rank, Alpha, and Target Modules: LoRA decomposes the weight update for a target layer into two small matrices, A and B, whose product approximates the full-rank update a traditional fine-tune would compute. The rank (r) sets the inner dimension of that decomposition: r=8 or r=16 is enough for narrow behavior shaping like tone or format compliance, r=32 to r=64 suits most task-specific enterprise fine-tunes, and r=128 or higher rarely helps unless you are trying to inject substantial new knowledge, which is a job better suited to continued pretraining.
  • 2QLoRA's 4-bit Quantization: What You Trade for VRAM Savings: QLoRA quantizes the frozen base model weights to 4-bit NF4 (NormalFloat4), a data type tuned for the roughly normal distribution of trained neural network weights, then dequantizes on the fly during the forward and backward pass while keeping the LoRA adapter computations in bf16 for training stability. The result is a base model footprint roughly one-quarter the size of fp16, with the adapter parameters and their optimizer states adding only a small fraction on top since only the adapters are trainable.
  • 3VRAM Math by Model Size: 7B, 13B, 70B: The numbers below assume a single fine-tuning run with a modest batch size and standard sequence lengths; add 15 to 30 percent headroom for activation memory and gradient checkpointing overhead at longer context lengths. LoRA fine-tuning loads the base model at full precision, so its floor is set by that footprint, while QLoRA's floor is set by the 4-bit quantized footprint plus adapter overhead, which is why QLoRA opens up single-GPU fine-tuning for model sizes that would otherwise require a multi-GPU node..

Deciding between LoRA and QLoRA for a real workload on your own GPUs? Netray runs fine-tuning engagements entirely on customer infrastructure for regulated industries and will size the right method and hardware before you spend on compute.