Guide to fine-tuning Gemma 4: when to use RAG, LoRA or full fine-tuning
The guide covers fine-tuning Gemma 4, a model that can reason, call tools, and understand images and audio. It goes through the stages from continued pre-training and supervised fine-tuning to reinforcement learning and multi-GPU training, and most teams start from the instruction-tuned (-it) checkpoint[1], which already follows instructions.
The guide first asks whether the weights need to change at all. RAG[2] leaves the weights untouched and injects retrieved documents into the prompt. LoRA[3] freezes the base model and trains small matrices, updating about 1% to 2% of the parameters. QLoRA[4] uses the same adapter method but stores the frozen base weights in 4-bit precision. Full fine-tuning updates 100% of the weights.
Training needs much more GPU memory than inference. For each trained parameter, the GPU stores the weight (2 bytes in bfloat16), its gradient (another 2 bytes), and optimizer states (2 bytes with an 8-bit optimizer or 8 bytes in 32-bit precision), plus the intermediate activations from the forward pass. The guide gives peak VRAM for all five Gemma 4 models at a sequence length of 2,048 tokens.
Product Gemma 4 deepmind.google
Google DeepMind's fourth-generation open model family that handles reasoning, tool calling, and image and audio input.
Read the original gemma.aiDiscussion
Discussion
Commenters mostly question the memory figures for full fine-tuning. One calculates that they match about 6 bytes per parameter with an 8-bit optimizer and gradient checkpointing, and says standard 32-bit Adam needs closer to 16 bytes, while another notes that the MoE model does not get cheaper for full fine-tuning. Others praise the guides and ask for the gemma-skills GitHub repository.
Links from the post and discussion
- gemma-skills repository, linked in a comment github.com
Sources
-
Gemma Docs
Fine-tune Gemma 4 models



