tonytautai home/local-ai/run-local-ai/running/training/method/lora

./train --lora

Training a Fraction of the Weights.

This lora fine tuning guide is written for office document tasks: one base model on the appliance, several small adapters, one per task, swapped at load time.

Tony Tautai

lora fine tuning guide

The Idea in a Paragraph

lora fine tuning guide

Low-rank adaptation freezes the base model and trains a small pair of matrices alongside each chosen layer. The base weights never change. The adapter is tiny compared with the model, trains on modest hardware, and can be swapped in and out at load time. For office document work that last property is the one that matters: one base model, several adapters, one per task. The wider set of methods is reached by going more on local model training methods.

Steps We Follow

Knobs Worth Understanding

lora fine tuning guide

The rank sets how much the adapter can learn; small ranks suit format and style, larger ranks suit new reading behaviour. Which layers get adapters matters more than most guides admit, and the attention layers are the usual first choice. Learning rate and epochs interact with dataset size: a few hundred examples for many epochs can overfit into a model that recites training labels. Watch the frozen score, not the training loss.

Where LoRA Falls Short

It cannot teach what the base model has no capacity for. If the base cannot read skewed scans at all, an adapter will not make it. Then you need a different base, or a stronger teacher, which is the subject of what we wrote about model distillation explained. If the knowledge you want changes monthly, no adapter will keep up, and a closer look at fine tuning vs rag explains the retrieval route.

Data Volume and the Decision to Train

Adapter training is forgiving of small datasets, which is why we reach for it first; the page that answers how much data to fine tune llm gives the ranges. Whether to train at all is the earlier question, and what we wrote about local ai training vs rag when to use which is where we answer it.

An adapter is the cheapest experiment in this section. Run it before you argue about anything bigger.

ssh [email protected]

Prove it on your documents.

Every engagement starts the same way: we run the system on a sample of your own files, under NDA/DPA, and hand you a written report with the scores, misses included. No commitment.

Test it on my documents Request a diagnostic