You can now fine-tune Gemma 4 locally 8GB VRAM + Bug Fixes

Posted by danielhanchen@reddit | LocalLLaMA | View on Reddit | 107 comments

You can now fine-tune Gemma 4 locally 8GB VRAM + Bug Fixes

Hey guys, you can now fine-tune Gemma 4 E2B and E4B in our free Unsloth notebooks! You need 8GB VRAM to train Gemma-4-E2B locally. Unsloth trains Gemma 4 \~1.5x faster with \~50% less VRAM than FA2 setups: https://github.com/unslothai/unsloth

We also found and did bug fixes for Gemma 4 training:

  1. Grad accumulation no longer causes losses to explode - before you might see losses of 300 to 400 - it should be 10 to 15 - Unsloth has this fixed.
  2. Index Error for 26B and 31B for inference - this will fail inference for 26B and 31B when using transformers - we fixed it.
  3. use_cache=False had gibberish for E2B, E4B - see https://github.com/huggingface/transformers/issues/45242
  4. float16 audio -1e9 overflows on float16

You can also train 26B-A4B and 31B or train via a UI with Unsloth Studio. Studio and the notebooks work for Vision, Text, Audio and inference.

For Bug Fix details and tips and tricks, read our blog/guide: https://unsloth.ai/docs/models/gemma-4/train

Free Colab Notebooks:

E4B + E2B (Studio web UI) E4B (Vision + Text) E4B (Audio) E2B (Run + Text)

Thanks guys!