MODULE 3B · CONTAINERS FOR GENAI & AGENTIC AI
The flags you didn't touch
The flags mlx_lm.lora ran — and what each one controls.
Gourav Shah · School of DevOps & AI · Deep Dive (Part 2)
M3B-DD·01
`r` is how wide the correction notepad is
Rank is the notepad's width — more lines, more correction capacity.
M3B-DD·02
Two thin matrices instead of one fat one
Two thin matrices replace one fat update — params scale with r.
M3B-DD·03
`alpha/r` is a ratio, not two knobs
alpha/r is the real dial — not alpha or r alone.
M3B-DD·04
Not every layer gets a notepad
target_modules decides which layers get a notepad clipped on.
M3B-DD·05
Dropout stops the notepad memorizing example order
Dropout zeroes a random adapter path each step.
M3B-DD·06
16 buckets, placed where the weights actually live
NF4 places its 16 buckets where the weight distribution is dense.
M3B-DD·07
Double quantization: quantizing the quantizer's own numbers
Double quantization compresses NF4's own scaling constants too.
M3B-DD·08
Storage in 4-bit, math in 16-bit
4-bit at rest, bf16 for the math — the adapter stays fp16 throughout.
M3B-DD·09
The learning rate is the optimizer's step size
Learning rate is the optimizer's step size toward the loss floor.
M3B-DD·10
Falling train loss can still mean the adapter is memorizing
Val loss stalling while train falls is the memorization signature.
M3B-DD·11
Bigger batch costs memory; more accumulation steps don't
Gradient accumulation buys a bigger effective batch at flat memory.
M3B-DD·12
Same JSON shape, wrong token boundaries — and it still trains
A chat-template mismatch trains silently — no error, no warning.
M3B-DD·13
One fixed prompt set, reused every time you change a knob
Compare variants on the same fixed held-out prompts, every time.
M3B-DD·14
Missing knowledge or missing behavior — the fork before you fine-tune
Knowledge gap leads to RAG. Behaviour gap leads to prompt, then fine-tune.
M3B-DD·15
Same lab, three adapters, one comparison table
One shared dataset, three adapters — only rank or lr changes.
M3B-DD·16
Cutting rank in half measurably raises the floor
Rank 4 lands at loss 0.449 vs rank 8's 0.200 — same data, same lr.
M3B-DD·17
10x the learning rate, and no instability shows up
10x lr converged faster and lower — 0.054 vs baseline's 0.200.
M3B-DD·18
MODULE 3B DEEP DIVE · TAKEAWAYS
What to carry into a real adapter
Next: apply these knobs to your own corporate-docs adapter. · Gourav Shah · School of DevOps & AI
M3B-DD·19