./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.

The Idea in a Paragraph

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
- Freeze the test set first and hash it. Nothing in it goes into training.
- Write the labelling guide, label a small batch, check agreement, then label the rest.
- Pick the base model you intend to run on the appliance, not a bigger one you will have to shrink later.
- Train the adapter with the data in the exact prompt format the production pipeline uses.
- Score on the frozen set. Read every miss. Decide whether the fix is more data, cleaner data, or a different base.
- Merge or keep the adapter separate; separate is easier to version and roll back.
Knobs Worth Understanding

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.
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.