S5-16 · 高阶S5-16 · Expert

QLoRA · 位宽管基座,秩管增量QLoRA · Base Precision and Adapter Rank Are Separate Levers

quantized frozen base + trainable LoRA delta → memory savings with two error sources

量化低秩适配(QLoRA)以量化后的冻结基座配合 LoRA 适配器进行参数高效微调。基座位宽与 LoRA 秩是两个独立控件。QLoRA combines a quantized frozen base with a trainable LoRA adapter. Base bit width and LoRA rank are independent controls with different effects.

01 · 两个省资源旋钮不能绑在一起01 · Two resource-saving dials should not be glued together

把基座从 16 位压到 4 位,为什么不会自动把 LoRA 的 r 也变小?反过来调 r,又为什么不改变基座文件精度?Why does compressing the base from 16-bit to 4-bit not automatically reduce LoRA rank—and why does changing rank not alter base precision?

02用位宽与 rank r 两个独立控件驱动显存、参数量与误差Use Independent Bit-width and Rank Controls to Drive Memory, Parameters, and Error

位宽 ⟂ 低秩precision ⟂ low rank
状态 AMetric A
状态 BMetric B
状态 CMetric C

所有概率、得分与输出均为固定种子的教学模拟,不代表真实模型。拖回主变量即可复核结论。All probabilities, scores, and outputs are fixed-seed teaching simulations, not real model output. Move the main variable back to verify the conclusion.

03把刚才的变化拆成 4 个零件Break the Change into Four Parts

QLoRA
QBASE

量化冻结基座Quantized frozen base

位宽减少冻结权重存储,不直接训练基座。Bit width reduces frozen-weight storage without training the base.

LORA

LoRA 增量LoRA delta

A、B 矩阵保持可训练。The A and B matrices remain trainable.

BITS

位宽杠杆Bit-width lever

16/8/4 位主要改变存储与量化误差。16/8/4 bits mainly affect storage and quantization error.

RANK

秩杠杆Rank lever

r 主要改变增量参数与近似容量。r mainly affects delta parameters and approximation capacity.

04最小机制:主交互能逐项验证Minimal Mechanism: Verify Each Link in the Interaction

MECHANISM
output = dequantize(Wq)x + BrArx
点击位宽只让灰色基座层变深;拖 r 只让红色适配器变宽,两个指标不会偷偷联动。Bit-width buttons change only the gray base layers; moving r changes only the red adapters. The controls never silently move each other.
压缩基座Quantize base减少冻结权重存储reduce frozen-weight storage
训练增量Train deltaLoRA A、B 保持高精度keep LoRA A and B trainable
组合推理Compose inference两类误差共同验收evaluate both error sources

05同时选择 4-bit 基座与 r = 1Combine a 4-bit Base with r = 1

主动制造失败Create a failure

边界实验Boundary experiment

位宽和秩都压到最低时资源最省,但量化误差与低秩近似误差会叠加。Minimizing both precision and rank saves the most resources, but quantization and low-rank approximation errors accumulate.

尚未执行。先在主交互中观察正常机制。Not run yet. Observe the normal mechanism in the main interaction first.
QLoRA 就是 4-bit LoRA,两个旋钮永远绑定。QLoRA is 4-bit LoRA with permanently linked dials.→ ✓ 位宽与 r 是独立设计与验收变量。Bit width and r are independent design and evaluation variables.
量化基座也会像 LoRA 一样被训练。The quantized base is trained like LoRA.→ ✓ QLoRA 路线中基座冻结,训练的是低秩增量。In QLoRA, the base stays frozen while the low-rank delta trains.
显存最低的配置就是最佳配置。The lowest-memory configuration is always best.→ ✓ 还要同时验收任务质量与两类误差。Task quality and both error sources still need evaluation.
06 · 一句话带走06 · One line to keep

QLoRA 用量化位宽压缩冻结基座,用 LoRA 秩控制可训练增量;两个杠杆独立,误差却会在最终输出中合流。QLoRA compresses the frozen base with bit width and controls the trainable delta with LoRA rank. The levers are independent, but their errors meet in the final output.