Efficiency: Quantization, LoRA & Distillation

A 70-billion-parameter language model stored in 16-bit precision needs roughly 140 gigabytes just to hold its weights. Fine-tuning it with standard full-parameter gradient descent needs several times more memory. This covers optimizer states, activations, and gradients. It often pushes past a terabyte across multiple GPUs. Yet millions of developers run capable language models on a single consumer GPU. Companies also fine-tune giant models on a handful of machines. The gap between these two facts is closed by three complementary efficiency techniques. These are quantization, low-rank adaptation, and knowledge distillation. Each technique attacks a different axis of cost. Quantization shrinks the numerical representation of weights and activations. It trades a controlled amount of precision for large memory and bandwidth savings. Low-Rank Adaptation (LoRA) shrinks the number of trainable parameters during fine-tuning. It exploits the empirical observation that task-specific updates to a pretrained model live in a low-dimensional subspace. Distillation shrinks the model itself, training a smaller "student" network to mimic a larger "teacher." This transfers capability rather than compressing a fixed architecture. These are not competing ideas — production systems stack them. A model might be distilled into a smaller architecture, then quantized to 4-bit weights for deployment. It can be further adapted to new tasks with LoRA on top of the quantized backbone, as in the QLoRA recipe. Understanding why each method works is essential. So is knowing precisely what it costs in accuracy, storage, and compute. This matters for anyone building or evaluating real systems, not only training models with unlimited hardware. This article develops the mathematics and algorithms behind all three techniques. It gives working pseudocode and derives their complexity. It also works through numerical examples that show the savings and the failure modes. Much of the ecosystem of fine-tuned, community-hosted models is built this way. These models sit on top of instruction-tuned base models using efficient adaptation. So these ideas connect directly to questions about model safety, provenance, and misuse. Such questions arise once adaptation becomes cheap and widespread.

Key takeaways
  • Quantization reduces the bit-width of weights/activations (e.g., FP16 → INT4), cutting memory and increasing throughput at a small, controllable accuracy cost.
  • LoRA freezes pretrained weights and learns a low-rank update `ΔW = BA`, cutting trainable parameters by orders of magnitude while matching full fine-tuning performance on many tasks.
  • QLoRA combines 4-bit quantized frozen weights with LoRA adapters, enabling fine-tuning of 65B-parameter models on a single 48GB GPU.
  • Knowledge distillation trains a small student to match a large teacher's output distribution (soft labels), transferring "dark knowledge" beyond hard labels.
  • All three techniques trade a small, measurable performance cost for large gains in memory, latency, or training cost — the art is choosing where on that curve to sit.
  • These techniques are the backbone of the open-weights ecosystem, making adaptation and misuse-mitigation questions (addressed under Safety & Red-Teaming) practically urgent.
The core insight

Efficiency techniques for LLMs work by compressing where the cost lives — numerical precision (quantization), trainable parameters (LoRA), or model size (distillation) — while preserving the function the model computes, each justified by a different piece of mathematics: rounding-error bounds, low-rank structure of task adaptation, and distributional matching.

The idea

Quantization maps a high-precision numeric representation (typically 16- or 32-bit floating point) to a lower-precision representation (typically 8-bit or 4-bit integers, or specialized float formats) for weights, and sometimes activations. Formally, a real-valued tensor WW is mapped to a quantized tensor W^\hat{W} via a scale ss and zero-point zz:

W^=round(Ws)+z,W≈s⋅(W^−z)\hat{W} = \text{round}\left(\frac{W}{s}\right) + z, \qquad W \approx s \cdot (\hat{W} - z)

The scale ss is chosen per-tensor, per-channel, or per-block to minimize quantization error given the dynamic range of the values. Post-training quantization (PTQ) quantizes an already-trained model, sometimes using a small calibration set to choose scales well. Quantization-aware training (QAT) simulates quantization during training so the model adapts to the rounding noise.

Low-Rank Adaptation (LoRA) is a parameter-efficient fine-tuning (PEFT) method. Instead of updating a pretrained weight matrix W0∈Rd×kW_0 \in \mathbb{R}^{d\times k} directly, LoRA freezes W0W_0 and learns a low-rank correction:

W=W0+ΔW=W0+BA,B∈Rd×r, A∈Rr×k, r≪min⁡(d,k)W = W_0 + \Delta W = W_0 + BA, \qquad B \in \mathbb{R}^{d\times r},\ A \in \mathbb{R}^{r\times k},\ r \ll \min(d,k)

Only AA and BB are trained; W0W_0 never receives gradients. This is a direct descendant of the instruction-tuning setup, where a pretrained base model is adapted to follow instructions — LoRA asks whether that adaptation needs to touch every parameter, and answers no.

Knowledge distillation trains a smaller student network SS to approximate a larger teacher network TT, typically by matching the teacher's output probability distribution (soft labels) rather than only the ground-truth hard labels. The intuition: a teacher's full softmax output over incorrect classes encodes relative similarities ("dark knowledge") that a one-hot label discards, and this richer signal is easier for a small model to learn from.

How it works

Quantization mechanics

The central operation is affine (or symmetric) mapping between float and integer ranges. For a tensor with values in [α,β][\alpha, \beta] and a target bb-bit signed integer range [−2b−1,2b−1−1][-2^{b-1}, 2^{b-1}-1]:

s=β−α2b−1,z=−2b−1−round(α/s)s = \frac{\beta - \alpha}{2^{b}-1}, \qquad z = -2^{b-1} - \text{round}(\alpha / s)

Symmetric quantization (common for weights, since weight distributions are roughly zero-centered) sets z=0z=0 and s=max⁡(∣α∣,∣β∣)/(2b−1−1)s = \max(|\alpha|,|\beta|) / (2^{b-1}-1). Because a single scale for an entire weight matrix wastes precision when a few outlier values dominate the range, practical schemes use block-wise / group-wise quantization: partition each row (or a fixed number of consecutive weights) into blocks and store one scale per block. This is the key idea behind formats like NF4 (NormalFloat4, used in QLoRA), which additionally chooses quantization levels matched to the empirical (roughly Gaussian) distribution of pretrained weights rather than uniform spacing. ``` function QUANTIZE_TENSOR(W, bits, block_size):

# W: real-valued tensor, flattened n = length(W) num_blocks = ceil(n / block_size) scales = array of size num_blocks W_q = integer array of size n for i in 0 .. num_blocks - 1: block = W[iblock_size : min((i+1)block_size, n)] s = max(abs(block)) / (2^(bits-1) - 1) # symmetric scale scales[i] = s for each element w at position j in block: W_q[j] = round(w / s) # clamp to representable range W_q[j] = clamp(W_q[j], -2^(bits-1), 2^(bits-1) - 1) return W_q, scales function DEQUANTIZE_TENSOR(W_q, scales, block_size): W_hat = array of size length(W_q) for i in 0 .. num_blocks - 1: s = scales[i] for each element index j in block i: W_hat[j] = W_q[j] * s return W_hat ``` At inference, a quantized matmul either dequantizes weights on the fly (memory-bandwidth bound: read INT4, expand to FP16, multiply) or uses native low-precision matrix multiply units. The dominant real-world win is memory bandwidth, not FLOPs: LLM inference is largely bandwidth-bound because generation is memory-bound (one token at a time streams the whole weight matrix through the compute units), so shrinking bytes-per-weight directly shrinks latency.

LoRA mechanics

For each targeted linear layer (commonly the query/key/value/output projections in attention, sometimes the MLP projections), replace the forward pass:

h=W0x⟶h=W0x+αrBAxh = W_0 x \quad \longrightarrow \quad h = W_0 x + \frac{\alpha}{r} B A x

where α\alpha is a fixed scaling hyperparameter and rr is the rank. AA is typically initialized with small random Gaussian values and BB initialized to zero, so that at the start of training ΔW=BA=0\Delta W = BA = 0 and the adapted model exactly reproduces the pretrained model — training begins from a known-good point. ``` function LORA_FORWARD(x, W0, A, B, alpha, r):

# W0 is frozen; A, B are the only trainable parameters for this layer base_output = W0 @ x adapter_output = (alpha / r) * (B @ (A @ x)) return base_output + adapter_output function LORA_TRAIN_STEP(batch, model, optimizer): for each linear layer L in model.targeted_layers: freeze(L.W0) # no gradient computed or stored loss = compute_loss(model.forward(batch), batch.labels) loss.backward() # gradients flow only into A, B matrices optimizer.step() # update only A, B optimizer.zero_grad() ``` At the end of training, the adapter can either stay separate (multiple LoRA adapters can be swapped in and out of the same frozen base model, enabling multi-tenant serving) or be merged: W=W0+αrBAW = W_0 + \frac{\alpha}{r}BA, producing a single dense matrix with zero extra inference cost.

QLoRA combines the two: the frozen backbone W0W_0 is stored in 4-bit NF4 quantized form (dequantized on the fly during the forward/backward pass), while the trainable A,BA,B matrices remain in a higher-precision format (e.g., bfloat16), and gradients are computed through the quantized weights using straight-through estimation for the rounding operation combined with paged optimizers that offload optimizer state to CPU memory during activation spikes.

Distillation mechanics

Given a trained teacher TT producing logits zTz_T and a student SS producing logits zSz_S over the same output vocabulary, define a temperature-softened softmax:

pi(z,τ)=exp⁡(zi/τ)∑jexp⁡(zj/τ)p_i(z, \tau) = \frac{\exp(z_i / \tau)}{\sum_j \exp(z_j/\tau)}

Higher temperature τ>1\tau > 1 flattens the distribution, exposing relative probabilities among non-target classes that would otherwise be near-zero. The distillation loss combines a soft-label term and (optionally) a hard-label term:

L=λ⋅τ2⋅KL(p(zT,τ) ∥ p(zS,τ))+(1−λ)⋅CE(ytrue,p(zS,1))\mathcal{L} = \lambda \cdot \tau^2 \cdot \text{KL}\big(p(z_T,\tau) \,\|\, p(z_S,\tau)\big) + (1-\lambda)\cdot \text{CE}(y_{\text{true}}, p(z_S, 1))

The τ2\tau^2 factor rescales gradients so their magnitude is comparable across temperature settings (the gradient of the soft cross-entropy term with respect to logits scales as 1/τ21/\tau^2, which this factor cancels). For sequence models, distillation can be applied at the token level (matching next-token distributions at every position — the standard recipe), at the sequence level (training the student to maximize the probability of teacher-generated outputs), or via on-policy distillation, where the student generates its own rollouts and is corrected using teacher feedback on those very rollouts, reducing the mismatch between training and deployment-time input distributions. ``` function DISTILLATION_TRAIN_STEP(batch, teacher, student, tau, lambda): with no_gradient: teacher_logits = teacher.forward(batch.inputs) p_teacher = softmax(teacher_logits / tau) student_logits = student.forward(batch.inputs) p_student_soft = softmax(student_logits / tau) p_student_hard = softmax(student_logits / 1.0) loss_soft = KL_divergence(p_teacher, p_student_soft) (tau tau) loss_hard = cross_entropy(batch.labels, p_student_hard) loss = lambda loss_soft + (1 - lambda) loss_hard loss.backward() # gradients flow only through student optimizer.step() ```

Figure
Three efficiency axes acting on the same pretrained model
Pretrained Model W₀ (FP16) Quantization round(W/s) → INT4/INT8 per-block scales ↓ memory + bandwidth LoRA Adaptation W₀ frozen + B·A rank r ≪ d,k ↓ trainable params Distillation Student mimics Teacher soft-label KL loss ↓ model size QLoRA 4-bit frozen W₀ + FP16 adapters A,B Deployed model: fewer bytes, few trainable params, fewer FLOPs Same interface — same tokenizer, same generation loop

Complexity & correctness

Quantization. Storage drops from 3232 or 1616 bits per weight to bb bits plus a small per-block overhead: for block size gg and scale stored in 16 bits, effective bits-per-weight is b+16/gb + 16/g. With g=64g=64, INT4 quantization costs about 4+0.25=4.254 + 0.25 = 4.25 bits/weight — roughly a 3.5×3.5\times to 7.5×7.5\times reduction versus FP16/FP32. Since LLM autoregressive decoding is memory-bandwidth bound (each generated token requires streaming the entire parameter set through compute, at O(P)O(P) bytes moved per token for a PP-parameter model), and wall-clock decode time is dominated by bytes moved/bandwidth\text{bytes moved} / \text{bandwidth}, quantization yields close to a linear speedup in the compression ratio for the memory-bound regime, though a floor is imposed by compute-bound operations (attention over long contexts) that don't shrink with weight quantization. Correctness argument: quantization error per weight is bounded by half the quantization step, ∣w−w^⋅s∣≤s/2|w - \hat w \cdot s| \le s/2. Because block-wise scaling adapts ss to the local dynamic range, the relative error per block is controlled independent of extreme values elsewhere in the tensor — this is why per-tensor quantization (one scale for the whole matrix) can catastrophically hurt accuracy when even one outlier channel exists, while per-block or per-channel quantization keeps error bounded near 2−b2^{-b} relative to the local range. Empirically, transformer activations contain systematic outlier features in specific channels; algorithms such as LLM.int8() isolate these into a separate high-precision matmul, proving (empirically, not by a closed-form bound) that mixed precision recovers near-lossless accuracy at a small compute overhead.

LoRA. For a weight matrix of shape d×kd \times k, full fine-tuning has O(dk)O(dk) trainable parameters and needs optimizer state (e.g., two Adam moment buffers) of the same size, giving total trainable memory O(dk)O(dk) per matrix (times a constant of 2–3 for Adam). LoRA has r(d+k)r(d+k) trainable parameters. The reduction factor is:

dkr(d+k)≈d2rwhen d≈k\frac{dk}{r(d+k)} \approx \frac{d}{2r} \quad \text{when } d \approx k

For a typical d=k=4096d=k=4096 and r=8r=8, this is a ∼256×\sim256\times reduction in trainable parameters for that layer, which directly translates into a proportional reduction in optimizer-state memory — the dominant memory cost during training. Forward/backward FLOPs increase only slightly (an extra O(dr+rk)O(dr + rk) per token instead of O(dk)O(dk), which is smaller since r≪d,kr \ll d,k), so LoRA does not meaningfully slow training and adds no inference-time cost after merging. Correctness argument: LoRA's validity rests on the empirical claim, supported by measurements across many fine-tuning tasks, that the difference between a pretrained weight matrix and its task-adapted counterpart has low intrinsic rank — the singular value spectrum of ΔW=Wfinetuned−W0\Delta W = W_{\text{finetuned}} - W_0 decays quickly, so a rank-rr approximation captures most of the useful update for moderate rr (often r∈{4,…,64}r \in \{4,\dots,64\} suffices). This is not a universal theorem — some tasks genuinely need higher rank or updates outside the low-rank subspace spanned from a given initialization — but it holds well enough across benchmarks that LoRA typically matches full fine-tuning accuracy within a percentage point or two, while occasionally underperforming on tasks requiring large representational shifts (e.g., learning genuinely new factual knowledge at scale, versus adapting style or task format).

Distillation. Training cost is dominated by two forward passes (teacher and student) plus one backward pass (student only) per batch, so distillation training costs O(FT+FS+BS)O(F_T + F_S + B_S) per step where FF, BB denote forward/backward FLOPs — cheaper than training the student from scratch on hard labels only requires, in wall-clock terms, if the teacher's forward pass is precomputed offline (logits cached). Inference cost after distillation is simply the student's own cost, O(FS)O(F_S) — often 10×10\times to 100×100\times smaller than the teacher's, since students are typically chosen with far fewer parameters and/or layers. Correctness argument: the soft-label KL objective provides more bits of supervision per example than a one-hot label, because it specifies an entire probability vector rather than a single class index. Under a bias–variance view of learning, matching a smoothed teacher distribution acts as a regularizer that reduces the effective hypothesis-space search the student must perform, and the temperature parameter τ\tau trades off how much of the teacher's fine-grained (but possibly noisy) ranking information is transferred versus how close the loss stays to the ordinary cross-entropy the student would use to fit hard labels alone. Distillation cannot exceed the teacher's own competence — it is fundamentally a compression of what the teacher already knows, and its correctness is empirical: student accuracy approaches teacher accuracy asymptotically as student capacity and training data grow, but a strictly smaller student generally retains a measurable capability gap, especially on tasks requiring capabilities near the frontier of the teacher's own competence.

Worked example

Consider fine-tuning a 4096×4096 attention projection matrix (d=k=4096d=k=4096) with LoRA rank r=8r=8, comparing to full fine-tuning, and then quantizing the resulting deployed model to 4-bit.

QuantityFull fine-tuningLoRA (r=8)
Trainable params (this matrix)4096×4096=16,777,2164096 \times 4096 = 16{,}777{,}2168×(4096+4096)=65,5368\times(4096+4096) = 65{,}536
Reduction factor—≈256×\approx 256\times
Adam optimizer state (2 moments, FP32, 4 bytes each)16,777,216×2×4=134.216{,}777{,}216 \times 2 \times 4 = 134.2 MB65,536×2×4=0.5265{,}536 \times 2 \times 4 = 0.52 MB
Gradient memory16,777,216×4=67.116{,}777{,}216 \times 4 = 67.1 MB65,536×4=0.2665{,}536 \times 4 = 0.26 MB
Extra forward FLOPs per token (vs. base matmul dkdk)included in base cost+ r(d+k)=65,536+\,r(d+k) = 65{,}536 (negligible next to 16.816.8M)

Scaling this across a model with, say, 200 such matrices (a rough count for attention + MLP projections across many layers of a 7B-parameter model), full fine-tuning needs roughly 200×134200 \times 134 MB ≈26.8\approx 26.8 GB of optimizer state for just these matrices alone, on top of the 14 GB (FP16) or 28 GB (FP32) of weights and additional buffers for the rest of the network — easily exceeding a single 24–48 GB GPU. LoRA needs only 200×0.52200 \times 0.52 MB ≈104\approx 104 MB of optimizer state, making fine-tuning feasible on much smaller hardware, with the frozen 14 GB of FP16 weights as the dominant remaining memory cost. Now apply 4-bit NF4 quantization (block size 64) to the frozen base weights, as QLoRA does:

bits per weight=4+1664=4.25 bits  ⟹  bytes per weight≈0.53\text{bits per weight} = 4 + \frac{16}{64} = 4.25 \text{ bits} \implies \text{bytes per weight} \approx 0.53

The 7B-parameter frozen backbone now needs 7×109×0.53≈3.77\times10^9 \times 0.53 \approx 3.7 GB instead of 14 GB — roughly a 3.8×3.8\times reduction — while the LoRA adapters (kept in bfloat16) add only tens of megabytes. This is precisely the regime that lets a 65B-parameter model be fine-tuned on a single 48 GB GPU: the frozen quantized backbone occupies roughly 65×109×0.53≈3465\times10^9 \times 0.53 \approx 34 GB, leaving headroom for activations, the small adapter parameters, and the paged optimizer state.

Distillation trace. Suppose the teacher assigns to the next token after "The capital of France is" the distribution (restricted to the top four tokens): Paris =0.82=0.82, Lyon =0.06=0.06, a =0.05=0.05, London =0.03=0.03. A hard-label cross-entropy loss only ever tells the student "the answer is Paris, everything else is wrong equally." At temperature τ=2\tau=2, the softened teacher distribution (recomputed by dividing logits by τ\tau before softmax) becomes approximately Paris =0.55=0.55, Lyon =0.18=0.18, a =0.15=0.15, London =0.12=0.12 — the student now learns that Lyon and London are meaningfully more plausible than "a" in this context, information entirely absent from the hard label, at the cost of a slightly less peaked target that the KL loss must still match closely for the dominant class.

Common pitfalls & traps

PitfallWhy it happensConsequence
Per-tensor (not per-block) quantization on outlier-heavy layersA few large-magnitude activations or weight channels dominate the chosen scaleMost values get crushed into a handful of integer levels; large accuracy loss
Choosing LoRA rank rr without checking task complexityAssuming low rank always sufficesUnderfits tasks that need large representational shifts (e.g., new factual domains)
Forgetting to also adapt MLP layers, only touching attention projectionsOriginal LoRA paper targeted attention matrices onlyMisses capacity needed for tasks that rely heavily on MLP-stored knowledge
Distilling with τ=1\tau=1 (no softening)Treating distillation as ordinary label copyingLoses the "dark knowledge" signal that makes distillation work better than training on hard labels alone
Merging LoRA weights into a matrix that will later be quantized without re-checking scale/outlier structureAssuming merge + quantize commutes cleanlyThe merged W0+BAW_0 + BA can have a different dynamic range than W0W_0 alone, breaking previously-tuned quantization calibration
Comparing quantized-model benchmarks without matching decoding settings (temperature, sampling) to the FP16 baselineOverlooking that quantization interacts with sampling noiseMisattributes sampling variance to quantization-induced quality loss, or vice versa

Pioneers & history

Origins · 1 minGeoffrey Hinton and how this was discovered
GH
Geoffrey Hinton
1947–present · Toronto, co-developer of knowledge distillation and a central figure in deep learning

Hinton, together with Oriol Vinyals and Jeff Dean, formalized knowledge distillation in 2015, building on earlier "model compression" ideas from Caruana and colleagues (2006) that trained small models to match large ensemble outputs. Hinton's framing — using temperature-softened softmax outputs as a richer training signal — became the standard recipe used across vision and language model compression for the following decade, and directly informs how today's smaller open-weight language models are trained from larger proprietary or open teachers.

History
2006
— Caruana et al. show ensembles can be compressed into single small models matching ensemble accuracy.
2015
— Hinton, Vinyals, Dean formalize knowledge distillation with temperature-scaled soft targets.
2018
— Integer quantization (INT8) becomes standard in production inference frameworks for convolutional and early transformer models.
2021
— Hu et al. introduce LoRA, demonstrating low intrinsic-rank task adaptation for large pretrained language models.
2023
— Dettmers et al. introduce QLoRA and NF4 quantization, enabling fine-tuning of 65B-parameter models on a single consumer-class 48GB GPU.

Where this matters

Quantized inference runtimes (e.g., 4-bit and 8-bit weight formats supported by widely used inference libraries) are how large open-weight models run on consumer GPUs and even laptops, making local and offline deployment of capable language models practical for individual developers and privacy-sensitive applications. LoRA and its variants underpin the enormous ecosystem of community-shared "adapters" — small files, often tens of megabytes, that reconfigure a shared base model for a new domain, style, or language without redistributing the full weights, and are the standard technique behind rapid, low-cost customization offered by many model-hosting platforms. Distillation is how smaller, cheaper, faster model variants are produced from larger flagship models for latency-sensitive applications such as real-time chat assistants, on-device summarization, and search-result reranking, where the cost or latency of the largest model would be prohibitive at scale. Because these techniques make adaptation and deployment dramatically cheaper, they also lower the barrier to modifying a model's behavior after its original safety training — a LoRA adapter can, in principle, be trained to undo alignment properties introduced during Instruction Tuning just as easily as it can add a helpful new skill. This tension between efficient customization and controllable safety is exactly the terrain explored under Safety & Red-Teaming, where questions of how easily fine-tuning can strip away guardrails, and how to detect or prevent that, become central.

Ask the tutor: How would you decide, for a specific deployment budget, whether to prioritize quantization, LoRA, or distillation first?

Does quantization always hurt model accuracy?

Quantization introduces rounding error, so in principle it always changes the model's computed function, but the practical accuracy impact varies enormously with technique and bit-width. Well-implemented 8-bit quantization with per-channel scales is often near-lossless on standard benchmarks, showing accuracy drops of a fraction of a percentage point. Aggressive 4-bit or lower quantization, especially with naive per-tensor scaling, can cause noticeable degradation, particularly on tasks requiring precise numerical reasoning or rare, low-frequency knowledge. Modern techniques like NF4 (matching quantization levels to the actual weight distribution) and mixed-precision handling of outlier channels substantially narrow this gap, making 4-bit quantization usable in production for many applications, though careful evaluation on task-relevant benchmarks remains essential rather than trusting bit-width alone as a quality proxy.

Can LoRA and full fine-tuning be combined, or is it strictly one or the other?

They are not mutually exclusive. A common pattern trains some layers fully (often the final output layer or embedding layer, which are relatively cheap) while applying LoRA to the large attention and MLP projection matrices that dominate parameter count. Some pipelines also progressively unfreeze more of the base model after an initial LoRA-only phase, effectively using LoRA as a cheap warm-start before a more expensive full fine-tuning stage if resources allow. The right choice depends on how much the target task diverges from the pretrained distribution: modest style or domain adaptation typically works well with LoRA alone, while tasks requiring substantial new capabilities may benefit from allocating some full-fine-tuning budget to critical layers.

Why don't we just always use the smallest possible student model in distillation?

Student capacity fundamentally bounds achievable accuracy — below some size, no amount of distillation signal can make a student match a much larger teacher's competence on tasks near the frontier of that teacher's ability. Practically, distillation curves show diminishing returns: making a student modestly smaller than the teacher preserves most performance, but going far smaller yields sharply worse accuracy, especially on reasoning-heavy or knowledge-intensive tasks compared to more surface-level tasks like sentiment or formatting. There is also a training-data tradeoff: smaller students often need more diverse distillation data (more teacher rollouts, more on-policy correction) to reach comparable performance to what a larger student achieves with less data, so the "smallest possible" choice trades inference savings against increased distillation-training cost and engineering complexity.

Is LoRA a form of regularization, or purely a computational efficiency trick?

It functions as both, though its motivation is primarily computational efficiency. By restricting updates to a low-rank subspace, LoRA implicitly limits how far the fine-tuned model's weights can move from the pretrained initialization, which can reduce catastrophic forgetting of pretrained capabilities compared to unconstrained full fine-tuning. This is a double-edged property: it can help preserve broad general knowledge while adapting to a narrow task, but it can also prevent the model from making genuinely necessary large changes if the task truly requires them. In practice, the rank rr and which layers are targeted act as tunable knobs controlling how much this implicit regularization effect dominates versus how much adaptation capacity is available.

How does QLoRA avoid losing accuracy from having both quantized weights and low-rank adapters?

QLoRA keeps the frozen base weights in 4-bit NF4 format but performs the actual forward and backward computation by dequantizing them to a higher-precision format (typically bfloat16) on the fly, so matrix multiplications happen in full precision even though storage stays compressed. The trainable LoRA matrices are stored and updated entirely in bfloat16, so the parameters actually receiving gradient updates never suffer quantization error. Because the frozen backbone is fixed throughout training, any quantization error it introduces is a constant systematic distortion the adapters can partially learn to compensate for, rather than a source of noisy or shifting error during optimization. Empirically, this combination reaches accuracy close to full 16-bit fine-tuning on many benchmarks, validating the approach.

What happens to LoRA adapters if the base model is later updated or replaced?

A LoRA adapter's parameters AA and BB are tied to the specific weight matrices of the base model they were trained against; the low-rank update was learned relative to a particular W0W_0. If the base model is retrained, fine-tuned further, or replaced with a different checkpoint, the adapter generally cannot be transplanted without retraining, since the "correction direction" it learned assumes the original weight values as a reference point. This creates a practical dependency: adapter ecosystems must track which base model version an adapter was built for, and organizations that frequently update their base models need a plan for either retraining adapters or maintaining compatibility across checkpoint versions, which is a meaningful operational cost in adapter-heavy deployment pipelines.

Does distillation transfer a teacher's safety behavior along with its capabilities?

Distillation transfers whatever distribution the teacher actually produces at training time, so if the teacher reliably refuses unsafe requests or follows its alignment training, a student trained to match those output distributions on relevant examples will tend to inherit similar refusal behavior on similar inputs. However, this transfer is imperfect and distributionally narrow: the student only learns to imitate patterns present in its training data, so behaviors outside that distribution, or safety properties the teacher exhibits only through more complex reasoning, may not transfer reliably. This gap between capability transfer and robust safety transfer is one reason distilled or adapted models require their own dedicated safety evaluation rather than inheriting a guarantee from the teacher, a theme developed further under Safety & Red-Teaming.

Before this

Where this leads