LocalLLM Forum — Run it locally. Own your models.

Best LoRA rank for an 8B fine-tune on a single 4090?

M posted by MateusKeller #fine-tuning#lora 4 posts 289 views
M

Finally getting around to fine-tuning instead of just hoarding checkpoints. Constraints:

  • Base: Llama 3.1 8B Instruct
  • GPU: single RTX 4090 (24GB)
  • Dataset: ~5,000 curated instruction pairs (Portuguese support-ticket replies)
  • Tooling: unsloth or axolotl — open to either

What rank are you all landing on for this kind of domain-adaptation job? I've seen everything from r=8 to r=256 and I'd rather not burn a weekend finding out the hard way.

Ryzen 7950X + RTX 4090 · São Paulo
I

For domain adaptation on 5k pairs, r=16 with alpha=32 is where I'd start — it captures style and vocabulary shifts without memorising your dataset. Config that works well on a 4090:

rank: 16
alpha: 32
dropout: 0.05
target_modules: q_proj,k_proj,v_proj,o_proj,gate_proj,up_proj,down_proj
learning_rate: 2e-4
scheduler: cosine
epochs: 2-3
batch: 2 (x8 gradient accumulation)

That fits comfortably in ~14GB with QLoRA (4-bit base), leaving room to push batch size. Going to r=64 on a dataset this size mostly buys you overfitting, not capability. Monitor eval loss, stop when it plateaus — usually epoch 2.

"Pushing 24GB to its limits since 2023." — Ingrid Marchetti, Bergen
K
I IngridMarchetti replied
…r=16 with alpha=32 is where I would start…

Agreed on r=16 — I trained a Finnish customer-service tune with almost exactly this recipe and it was indistinguishable from a friends r=64 run, at half the disk.

One addition: rank matters more when you're teaching knowledge than style. If you later need the model to actually learn new facts, consider a small full fine-tune of a few layers on top rather than cranking the rank.

2× RTX 3090 · Fedora · llama.cpp nightly
T

Chiming in with the boring truth: dataset quality beats every hyperparameter here. Dedupe aggressively, check your templates for tokenisation surprises, and hand-review 100 random samples before the first run. Most "the LoRA didn't learn" stories I've seen were dataset bugs.

"If it fits in VRAM, it ships." — Tomás Beaumont, Porto
Want to join the discussion? Register or log in to reply. Register Log in
Reply
Ctrl+Enter to submit
post 1 of 4