Self-distillation with an EMA teacher at scale: ZeRO-3 + PEFT [P]

Reddit r/MachineLearning Tools

Summary

A plug-and-play repo implementing self-distillation with an EMA teacher that scales to large models by combining LoRA adapters with DeepSpeed ZeRO-3, avoiding the memory and latency overhead of holding separate full teacher and student models. Tested on Qwen3.5 and ToolAlpaca, it includes adapter switching, EMA checkpointing, and memory-optimized DeepSpeed configs.

Self-distillation methods usually rely on an Exponential Moving Average (EMA) teachers to get synced and stable critics. However, this doesn't scale well for large models since holding both teacher and student (trained) on GPU increases latency, zero3 communication, etc. We can mitigate this with LoRA finetuning: the backbone is shared & frozen, and we need to maintain two light adapters: one for the student (trained) and one for the teacher (EMA of the student adapter). Getting this to work cleanly under TRL and ZeRO-3 took some fixes, so I packaged it as a plug-and-play repo. It supports: -> robust SDFT implementation that runs under ZeRO-3 -> ZeRO-3 + LoRA integration with adapter switching for teacher/student passes -> Saving and resuming EMA teacher checkpoint -> working deepspeed configs that fix memory spikes when GPU memory is tight I tested on Qwen3.5 and ToolAlpaca. Repo: https://github.com/ifiaposto/sdft_zero3 Feedback/ more examples/ issues welcome!
Original Article

Similar Articles

Post-Trained MoE Can Skip Half Experts via Self-Distillation

Hugging Face Daily Papers

ZEDA is a low-cost framework that converts post-trained static MoE models into dynamic ones by injecting zero-output experts and using self-distillation, achieving over 50% expert FLOP reduction with marginal accuracy loss on benchmarks.

[Paper] EdgeRazor: A Lightweight Framework for Large Language Models via Mixed-Precision Quantization-Aware Distillation

Reddit r/LocalLLaMA

EdgeRazor is a lightweight framework for compressing large language models using entropy-guided mixed-precision quantization-aware distillation, achieving 1.88 bits per parameter while preserving teacher model competence and requiring no changes to inference implementations like llama.cpp. The method is demonstrated on small models such as MobileLLM and Qwen variants.