GuidesUnderstanding AI
LoRA: adapting an AI model without retraining all of it
The principle
- 1Freeze the modelIts billions of weights do not move.
- 2Add two small matricesNext to some of the layers.
- 3Train only thoseA fraction of the parameters.
Full or LoRA
Full retraining
LoRA
Good uses
| Case | Why LoRA |
|---|---|
| A brand’s tone and style | Behavior changes, not knowledge |
| A very precise output format | Fewer instructions to repeat |
| Classification into your categories | A narrow, well-defined task |
| Several clients, one model | One adapter loaded per client |
Before you start
You need quality examples, often a few hundred to a few thousand, and a test set to check the gain. A good prompt with examples is often enough: try that first.
The choice: RAG or fine-tuning. The models: open source model or API and quantization.
Frequently asked questions
- Does LoRA teach the model new knowledge?
- Not much. It mainly adapts a style, a format or a specific task. For knowledge that changes (catalog, documentation), RAG remains the better fit.
- What is QLoRA?
- LoRA applied to a model loaded in quantized form (4 bits). It lets you adapt a fairly large model on a single graphics card.
- Can LoRA be used on any model?
- On open-weight models, yes. For models available only through an API, the provider decides whether it offers adaptation, and in what form.