Before you move a control in the demo, say what you expect to change.
Foundation reference
Efficiency: Quantization, Distillation, LoRA & Sparse MoE
Quantization stores weights with fewer bits, and LoRA trains a low-rank update while keeping the original weights fixed. Combining 4-bit quantization with LoRA makes it possible to fine-tune a 65B-parameter model on a single 48 GB GPU (QLoRA, Dettmers et al., 2023).
Study guide
Where to start
What does a low-rank update look like geometrically, and why can a rank-r change to each weight matrix be enough to adapt a pretrained model?
How to study this pagePredict · Check · Generalize · Continue
Compare what the demo shows with the key equation and with the papers cited below.
Identify the part of the idea that survives a change of notation or model, so you can recognize it in another paper or system.
The newer notebook covers the same concept and has an interactive demo.
Why It Matters for Modern Models
- Quantization stores weights with fewer bits, and LoRA trains a low-rank update while keeping the original weights fixed. Combining 4-bit quantization with LoRA makes it possible to fine-tune a 65B-parameter model on a single 48 GB GPU (QLoRA, Dettmers et al., 2023).
- Distillation trains a smaller student to match a larger teacher; DistilBERT is 40% smaller than BERT and keeps about 97% of its language-understanding performance (Sanh et al., 2019).
- Sparse mixture-of-experts layers raise the parameter count without raising the compute per token; Switch Transformers reached 1.6 trillion parameters this way (Fedus et al., 2022).
Questions to Think About
- How does quantization error propagate through a network, and why are some layers and outlier channels more sensitive than others?
Interactive Demos
Core Math
If you prefer intuition first, try the demos above, then come back for the math.
Distillation: train a student to match a teacher , with both softmaxes computed at temperature :
The factor keeps gradient magnitudes comparable across temperatures, and the term is usually combined with the ordinary cross-entropy on the true labels (Hinton et al., 2015).
Quantization: map float weights to a grid of low-bit integers with step :
LoRA: reparameterize a weight matrix as , where ; only and are trained and stays frozen.
Sparse MoE: replace a feed-forward layer by many experts and a router with probabilities . With top-1 routing as in Switch Transformers: , where .