The recipe, knob by knob.
The exact Unsloth QLoRA configuration behind every ui-agent adapter: one RTX 5090,
32 GB of VRAM, trainer in WSL. What each setting does, in plain words.
- load_in_4bit true
- The frozen base is held in 4-bit NF4 while training. This is the “Q” in
QLoRA, and it’s what lets a 27B model train inside 32 GB.
- r 32
- The width of the detour: the correction is built from 32 independent directions. More
rank buys capacity — and overfitting room. 32 carries fifteen behaviors here.
- lora_alpha 64
- How loudly the detour speaks: the update is scaled by alpha ÷ rank,
here 2×. Twice-rank is the locally proven setting.
- lora_dropout 0.05
- 5% of detour activations are randomly silenced during training so the adapter
can’t lean on memorized shortcuts.
- target_modules all-linear
- Attach a detour to every linear projection. Non-negotiable on this base:
Qwen’s DeltaNet linear-attention layers are invisible to the stock
q/k/v/o list, so the trainer asserts they actually got adapters.
- learning_rate 1e-4
- How far each gradient step moves the detour. Brisker than generic fine-tuning
defaults, and proven stable on this base across eleven adapters.
- epochs 3
- The dataset is seen three times: enough to learn the behaviors, short of the
memorization that long runs show.
- max_seq_length 1024
- Rows are capped at 1,024 tokens; the corpus is length-audited so no target loses its
ending to the cut.
- batch 1 × 4 accum
- One row at a time on the GPU, gradients pooled over four before each update: an
effective batch of 4 that fits beside the 4-bit base.
- optim adamw_8bit
- The optimizer’s own bookkeeping is stored in 8-bit, roughly quartering its
memory bill.
- loss responses only
- Loss is computed on the assistant’s answer tokens only, so the model learns to
write answers, not to parrot requests.
<think> traces are
masked too, so scratch-work never becomes learned output.
- export F16 GGUF
- The adapter ships as one 467 MB llama.cpp file, NaN-scanned tensor by tensor,
loaded next to the base at startup, and removable just as easily.