Home / Tools / Config generator

A config that fits your card.

Batch size and gradient accumulation come from the VRAM estimate for the GPU you pick. The learning rate and rank are defensible defaults, not magic.

Config trl
Model
GPU
Target framework
Max sequence length
—

What to change first

Learning rate. LoRA trains a small number of parameters and needs roughly 10x the rate of a full fine-tune. 2e-4 is a normal starting point. If nothing is happening after 50 steps, the rate is probably too low; if loss spikes and collapses, it is too high.

Rank. 16 is the default for a reason. Rank 8 for a narrow format task, rank 64+ only if the task genuinely needs more capacity — and check it against your evaluation, because higher rank also raises the overfitting risk on small datasets.

Target modules. All seven projection layers, not just q and v. The older q/v-only advice comes from the original LoRA paper's GLUE experiments and costs you quality on instruction tuning.

Epochs. One to three. Watch the validation loss, not the training loss.