ðŸ§Đ LoRA Adapter Size Calculator

Calculate LoRA trainable parameters, adapter checkpoint size, training-state memory, and trainable percentage from rank and target layers.

✓ Formula shown✓ Worked example✓ Browser-only calculation✓ Updated 2026

Calculate LoRA Adapter Size

Number of layers receiving adapters.
For example q, k, v, and output projections.
Input width of each targeted linear matrix.
Output width of each targeted linear matrix.
Rank r of the low-rank update matrices.
2 for FP16/BF16 checkpoints.
Training-only memory.
Adam moments often use multiple higher-precision values.
Used only to report trainable percentage.
Useful for multi-tenant or task-specific deployments.

What this LoRA adapter size calculator calculates

Low-Rank Adaptation freezes the base model and represents each selected weight update with two smaller matrices. For a target matrix with input dimension d-in, output dimension d-out, and rank r, the adapter adds r × (d-in + d-out) trainable parameters.

Adapter size depends on which modules are targeted, rank patterns, bias settings, modules saved in full, and checkpoint format. The calculator uses an average-matrix approximation that is useful for architecture planning and storage comparisons.

LoRA Adapter Size Calculator formula

LoRA parameters = layers × target matrices per layer × rank × (input dimension + output dimension). Checkpoint bytes = parameters × weight bytes. Training-state memory adds gradients and optimizer states.

Assumptions and limitations

The result is an engineering estimate based on the values entered. Model architectures, tokenizers, frameworks, accelerators, parallel strategies, billing rules, and production traffic differ. Validate important decisions with measured data from the exact model, runtime, hardware, and workflow you intend to use.

Worked example

Targeting four 4,096-by-4,096 matrices across 32 layers with rank 16 adds about 16.8 million trainable parameters. At two bytes each, one raw adapter checkpoint is roughly 33.6 MB before file metadata or extra saved modules.

How to interpret and use the result

Compare ranks and target-module choices before training. A higher rank increases capacity and training memory linearly, but quality does not necessarily improve linearly. Use the exact model module shapes for a precise count and verify what the framework includes in the saved checkpoint.

  1. Start with measured or representative production assumptions.
  2. Run conservative, expected, and optimistic scenarios.
  3. Record model version, framework, precision, hardware, and review date.
  4. Replace estimates with observed p50 and p95 values after testing.

Common mistakes to avoid

  • Multiplying rank by the original full matrix size instead of the two low-rank matrix sizes.
  • Forgetting that QLoRA may target all linear layers rather than only attention projections.
  • Treating raw parameter bytes as complete training VRAM.

Methodology references

These sources describe the underlying technology. The calculator remains an approximation because implementations and workloads differ.

Frequently asked questions

Why are LoRA adapters much smaller than full checkpoints?

Only low-rank update matrices and selected additional modules are stored; the frozen base weights are referenced separately.

Does LoRA add inference latency?

Merged adapters can avoid additional matrix operations, while unmerged or dynamically selected adapters may have runtime overhead depending on the serving system.

How should I choose rank?

Tune rank on representative validation data. Start modestly and increase only when the task needs additional adaptation capacity.

Related AI calculators

Methodology and privacy

This educational tool uses the formula and assumptions displayed on the page. Calculations run locally in your browser, and the page does not transmit the values you enter. Results are estimates rather than provider quotes, benchmark guarantees, financial advice, or capacity guarantees. Last methodology review: August 2, 2026.

Formula Explorer connections

Interpretation: This formula connects model architecture and numeric precision to compute, storage or accelerator-memory demand. Assumption: Architecture details, optimizer states, activations, framework buffers, sharding and quantization metadata can change measured requirements.

ðŸŠķ QLoRA Training VRAM Calculator →ðŸ’ū Model Parameter Memory Calculator →⚙ïļ Neural Network FLOPs Calculator →CS & AI Formula Explorer →