coding by Ryan Caldwell

Unsloth Cuts VRAM for MoE Fine-Tuning

Unsloth says its gpt-oss fine-tuning uses over 50% less VRAM, letting the 20B Mixture-of-Experts model train on under 14GB.

Unsloth Cuts VRAM for MoE Fine-Tuning

Fine-tuning a Mixture-of-Experts (MoE) model is memory-intensive because the expert layers hold the bulk of the parameters. Unsloth, a library focused on faster and more memory-efficient training, published an account of how it fine-tunes OpenAI’s gpt-oss models, which use an MoE design. According to Unsloth at https://unsloth.ai/blog/gpt-oss, its approach uses over 50% less VRAM than standard methods while supporting longer context lengths.

Memory Figures

Unsloth states that its gpt-oss fine-tuning “uses 70% less VRAM” and supports “10x longer context lengths.” It frames the comparison against other training methods that need roughly 300% more memory because they upcast weights to bf16.

The concrete numbers center on two model sizes. Unsloth reports that the 20B model fits in under 14GB of VRAM, and the 120B model works on 65GB of VRAM. By contrast, the blog says other methods need a minimum of 65GB of VRAM just to train the 20B model. In one comparison Unsloth describes its requirement as 14GB, an 80% reduction.

A performance table in the post lists both gpt-oss-20b and gpt-oss-120b training at a VRAM reduction of more than 50% and 5x longer context, with 1.5x speed, while standard methods with FlashAttention 2 run out of memory on the same setup. The testing conditions given are the Alpaca dataset, batch size of 2, gradient accumulation of 4, rank 32, and QLoRA applied to all linear layers.

Why the Experts Dominate

The memory pressure comes from the MoE structure itself. Unsloth explains that gpt-oss-20b picks the top 4 experts out of 32 total experts, while gpt-oss-120b activates 4 experts per token out of 128 total experts. For the smaller model, the expert and MLP layers account for approximately 19B of the total 20B parameters.

Because those expert layers hold almost all of the weights, quantizing them efficiently is what makes the memory savings possible. Unsloth describes converting the weights from a Parameter format to a Linear format so that BitsandBytes quantization could be applied to them.

What This Means in Practice

The headline takeaway from the post is access. Unsloth presents fine-tuning the 20B MoE model on under 14GB of VRAM as a way to bring this work onto more modest hardware, rather than requiring the 65GB that the blog attributes to standard methods for the same model. The same approach is described for the larger 120B model at 65GB.

The figures above come directly from Unsloth’s own write-up and reflect the specific test conditions it lists. Results on other datasets, model configurations, or hardware are not covered by the source and would need separate verification. For setup details and the full comparison, the blog post at https://unsloth.ai/blog/gpt-oss documents the configuration Unsloth used.

Source: unsloth.ai