- knowledge distillation to a smaller model
- running at higher temperatures
- increasing batch size
- extending the context window

- Parameter reduction: The student model has significantly fewer parameters, lowering RAM/VRAM requirements and enabling inference on less powerful hardware.
- Knowledge transfer: Training on the teacher’s soft targets (logits or softened probabilities) conveys nuanced behaviors that hard labels miss.
- Deployment benefits: Smaller models yield lower latency, reduced memory footprint, and easier horizontal scaling for serving many concurrent requests.
Clarifications and trade-offs
- The inference-time sampling
temperaturedoes not change model size or memory usage. In distillation training, a distillation temperature (e.g.,T > 1) is used to soften teacher logits — that is a training-time technique to improve knowledge transfer, not a memory optimization for inference. - Increasing batch size or extending the context window increases memory usage rather than reducing it.
- Distillation usually introduces some performance loss compared to the original teacher. Selecting the student model’s capacity is a trade-off between resource savings and task accuracy.
- Quantization (e.g., 8-bit, 4-bit): reduce parameter precision to lower memory and speed up inference.
- Pruning: remove low-importance weights or neurons to shrink the model.
- Parameter-efficient fine-tuning (e.g., LoRA): add a small number of trainable parameters instead of fine-tuning the entire model.
- Model offloading / sharding: split model weights across devices or offload parts to CPU to run very large models with limited GPU memory.
- Combine distillation with quantization and pruning to maximize memory savings while maintaining acceptable performance.
- Validate distilled models on your target benchmarks and real-world inputs to detect degraded behavior early.
- Measure latency and throughput under realistic load (concurrency and batch size) to determine the best student size and precision level.
- Use progressive distillation or multi-stage compression when migrating from a very large teacher to a highly compact student.
Knowledge distillation is usually the most effective single technique for substantially reducing memory usage while keeping reasonable model performance—especially when combined with quantization or pruning.
Be aware of the trade-offs: aggressive compression can harm accuracy. Evaluate distilled models on your target tasks to ensure acceptable performance.
- Distilling the Knowledge in a Neural Network (Hinton et al.)
- Quantization techniques overview
- LoRA: Low-Rank Adaptation of Large Language Models
- Pruning neural networks: a survey of methods and results