# LoRA (low-rank adaptation)

> Canonical: https://skillalmanac.com/glossary/lora | Last verified: 2026-11-24 | Index status: not offered to search engines

LoRA (low-rank adaptation) is a fine-tuning method that keeps a model's original weights frozen and trains two small added matrices instead, so adapting a large model takes less memory than updating every weight.

Also called: LoRA, low-rank adaptation, lora fine tuning, LoRA adapter, LoRA adapters.

## In plain language

Fine-tuning a large model normally means adjusting all of its settings (called weights), which needs a lot of memory. LoRA leaves those settings untouched and trains a small add-on layer next to them, like clipping a thin lens onto a camera instead of rebuilding the camera. The add-on is saved as a small file called an adapter, which can be swapped or combined with the original model. The cost is the compute to train and the work of preparing good examples. Hosted fine-tuning services may use their own methods, so check what a provider offers.

## Technical definition

LoRA represents the weight update for a layer as the product of two smaller matrices (a low-rank decomposition) and trains only those, while the original weight matrix stays frozen. The LoRA paper (arXiv 2106.09685) describes injecting trainable rank decomposition matrices into the layers of a Transformer, and claims no additional inference latency compared with adapters. The Hugging Face PEFT documentation says adapter weights can be merged into the base model, for example with merge_and_unload(), giving a standalone model. The PEFT guide mentions QLoRA training in its note on LoftQ initialization.

## How it shows up when you use agents

LoRA appears when a team wants a model to follow a house style, a format or a narrow task, and prompting alone is not enough. Instead of changing all the weights, they train an adapter and load it beside a base model. If you run models yourself, the adapter is a separate small file, and the base model is the part that needs the memory. Hosted coding agents such as [Claude Code](/tools/claude-code) do not ask you to train anything, so LoRA is mostly a concern for self-hosted setups and for people who build their own models.

What breaks when it is misunderstood: people expect an adapter to teach the model new facts, then find it still gets them wrong. LoRA is a form of [fine-tuning](/glossary/fine-tuning), so it shapes behaviour from examples. For facts that change, retrieval ([RAG](/glossary/retrieval-augmented-generation)) is often the better tool. Another trap is judging success by training loss and not by a held-out test set.

Next action: write down the behaviour you want, assemble examples of it, hold some back as a test set, and compare the adapted model with the base model on that test set. Check with [local-model-sizing](/skills/skill-almanac/local-model-sizing) that the base model fits your hardware first. A base model can also be [quantized](/glossary/quantization) to save memory.

## Common confusions

- **LoRA versus full fine-tuning.** Full fine-tuning updates all weights. LoRA freezes them and trains small added matrices, as the paper's abstract states.
- **LoRA versus QLoRA.** QLoRA training applies LoRA to a base model that has been quantized, The PEFT guide mentions it in its note on LoftQ initialization.
- **LoRA versus RAG.** An adapter changes how the model behaves. RAG changes what text is put in the prompt.
- **Myth.** An adapter is a new model. It depends on its base model and is meant to be used with it, unless you merge the two.

## Worked examples in this catalogue

### [huggingface-datasets](https://skillalmanac.com/skills/huggingface/huggingface-datasets)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Metadata, rows, search and filters for a Hugging Face dataset, read through the Dataset Viewer API.

Why it exercises the concept: A LoRA run trains on a set of examples. Use it to inspect a candidate dataset's rows before training.

### [llm-eval-test-sets](https://skillalmanac.com/skills/skill-almanac/llm-eval-test-sets)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: An eval dataset for an LLM feature, with a checker for duplicates, missing graders, imbalance and leakage.

Why it exercises the concept: After training an adapter, a held-out eval set is how you compare the adapted model with the base model. The checker flags leakage.

### [local-model-sizing](https://skillalmanac.com/skills/skill-almanac/local-model-sizing)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A check of whether an open-weight language model will run on a given GPU, Mac or PC, with weight, KV-cache and overhead memory per quantization level.

Why it exercises the concept: A LoRA adapter sits on top of a base model, so the base model still has to fit in memory. This skill works out that fit before you start.

## Related terms

- [Fine-tuning](https://skillalmanac.com/glossary/fine-tuning.md)
- [Transformer](https://skillalmanac.com/glossary/transformer.md)
- [Quantization](https://skillalmanac.com/glossary/quantization.md)
- [Open-weights model](https://skillalmanac.com/glossary/open-weights-model.md)
- [Model weights](https://skillalmanac.com/glossary/model-weights.md)

## Sources

- [LoRA: Low-Rank Adaptation of Large Language Models](https://arxiv.org/abs/2106.09685), arXiv (Hu et al.) (accessed 2026-11-24)
- [LoRA (PEFT conceptual guide)](https://huggingface.co/docs/peft/main/en/conceptual_guides/lora), Hugging Face (accessed 2026-11-24)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-24. [Glossary index](https://skillalmanac.com/glossary.md).
