# LoRA (low-rank adaptation)

> LoRA, or low-rank adaptation, is a fine-tuning method that trains a small set of extra weights alongside a frozen base model, making it far cheaper and quicker to adapt a large model to a specific task.

Also called: LoRA, low-rank adaptation, LoRA adapter, QLoRA, parameter-efficient fine-tuning, PEFT. Category: Models and training. Source: https://aibuildindex.com/glossary/lora

## In the index

- LLM fine-tuning: median $3,500, middle half $420 to $13,700, 78 priced briefs (https://aibuildindex.com/cost/llm-fine-tuning)
- Hugging Face: median $2,550, middle half $1,000 to $9,450, 50 priced briefs (https://aibuildindex.com/tools/hugging-face)
- Stable Diffusion: median $3,120, middle half $1,000 to $7,500, 58 priced briefs (https://aibuildindex.com/skills/stable-diffusion)

Full [fine-tuning](https://aibuildindex.com/glossary/fine-tuning) adjusts every weight in a model, which for a large model needs a lot of memory and computing time. LoRA takes a lighter approach. It leaves the original model untouched and trains a small add-on, called an adapter, that nudges the model's behaviour towards the new task. The result is most of the benefit of fine-tuning at a fraction of the hardware cost. LoRA is widely used to adapt [open-weight models](https://aibuildindex.com/glossary/open-weight-model) for text and is also popular for teaching image models a particular style or subject.

## How it works

Inside a model, each layer contains large tables of weights. LoRA adds a pair of much smaller tables next to selected layers. During training only these small tables change; the base model stays frozen. Because the adapter has far fewer numbers to learn, training fits on smaller graphics processors and finishes faster.

A related method, QLoRA, combines LoRA with [quantization](https://aibuildindex.com/glossary/quantization) of the base model, cutting memory needs further so that sizeable models can be adapted on a single machine.

Some practical properties follow:

- **Adapters are small files.** They can be stored, versioned and swapped cheaply.
- **One base, many adapters.** A single base model can serve several tasks, loading a different adapter for each, for example one per brand or per document type.
- **Base model dependence.** An adapter only works with the exact base model it was trained on, so changing the base means retraining.

An online retailer, for example, might train separate LoRA adapters on one open-weight model for writing product descriptions in each of its brand voices.

## What it means for cost

LoRA lowers the hardware cost of fine-tuning, which can bring custom models within reach of smaller projects. It does not lower the main cost of a fine-tuning project, which is gathering, cleaning and reviewing good [training data](https://aibuildindex.com/glossary/training-data) and evaluating the result. Serving the model, keeping adapters matched to base model versions and retraining over time remain ongoing work.

Ask a builder whether LoRA quality has been checked against full fine-tuning or strong prompting for your task, which base model the adapter depends on, and what happens when that base model is updated.

## Common questions

### Is LoRA as good as full fine-tuning?

For many tasks it comes close, which is why it is so widely used. For substantial changes to a model's knowledge or behaviour, full fine-tuning can perform better. Testing on held-out examples settles the question for a specific case.

### Can LoRA be used with hosted models from major providers?

Providers that offer fine-tuning may use parameter-efficient methods behind the scenes, but builders do not usually control the method. Training and choosing LoRA adapters directly is mainly done with open-weight models.

### Why is LoRA popular for image generation?

Image model adapters can teach a specific product, person, character or art style from a modest number of pictures, and the small files are easy to share and combine. That makes them practical for brand and product imagery.

## Related terms

- [Fine-tuning](https://aibuildindex.com/glossary/fine-tuning): Fine-tuning is the process of further training an existing AI model on a smaller set of task-specific examples so that it reliably adopts a particular behaviour, format, tone or specialised skill.
- [Open-weight model](https://aibuildindex.com/glossary/open-weight-model): An open-weight model is an AI model whose trained weights are published for download, so organisations can run, inspect and fine-tune it on their own infrastructure instead of only accessing it through a provider's API.
- [Quantization](https://aibuildindex.com/glossary/quantization): Quantization is a technique that stores an AI model's numbers at lower precision, which makes the model smaller and faster to run on cheaper hardware at the cost of a usually small loss in quality.
- [Training data](https://aibuildindex.com/glossary/training-data): Training data is the set of examples a machine learning model learns from, such as labelled images, past transactions or question-and-answer pairs, and its quality, coverage and rights largely decide how well the finished model performs.
- [Small language model](https://aibuildindex.com/glossary/small-language-model): A small language model is a compact language model with far fewer parameters than leading large models, built to be cheaper and faster to run, often on modest hardware or devices, while handling focused tasks well.
