Google Builds a Single Gemma 4 Fine-Tuning Hub With 17 Guides
Google published a 17-guide fine-tuning hub for Gemma 4, spanning QLoRA, MoE adaptation, audio tuning, and GRPO on single or multi-GPU setups.
Takeaways
- Google launched a Gemma 4 fine-tuning hub with 17 guides covering the full training pipeline
- Covers continued pre-training, (Q)LoRA, full fine-tuning, MoE adaptation, DPO and GRPO
- Includes vision and audio fine-tuning recipes plus unused-token tricks for custom routing tags
- VRAM tables show QLoRA fits 31B on ~22GB, versus ~200GB for full fine-tuning
- MoE guide adapts all 128 experts on 26B A4B while keeping the router frozen
- New gemma-trainer skill lets coding agents configure and run jobs locally
Google has launched a Gemma 4 tuning hub with 17 guides and more than 40 diagrams. It covers the training pipeline from continued pre-training on raw domain text through supervised fine-tuning and reinforcement learning with verifiable rewards.
The hub consolidates material usually scattered across notebooks, framework documentation, research papers, and blog posts. Developers can navigate by outcome, including domain adaptation, multimodal training, output formatting, tool use, and reasoning.
Four stages, one training map
Google’s four-stage framework separates the main training objectives:
- Pre-training teaches a base model to predict the next token across a broad corpus.
- Continued pre-training exposes that model to raw domain material such as medical literature, legal documents, or an internal codebase.
- Supervised fine-tuning trains on input-and-response examples to shape tasks, formats, tool calls, and conversational behavior.
- Reinforcement learning optimizes outputs against a reward signal, such as code tests, SQL execution results, or mathematical checks.
Most application teams can begin with an instruction-tuned checkpoint, which already supports conversational prompts and common instruction formats. Supervised fine-tuning or reinforcement learning can then target the required behavior. Continued pre-training fits projects that need the model to absorb a substantial body of domain language before behavioral tuning.
Pick the objective before the optimizer
Training objectives and parameter-update methods solve different problems. Retrieval-augmented generation, or RAG, supplies information at inference time. Continued pre-training, supervised fine-tuning, and reinforcement learning define what the model learns. LoRA, QLoRA, and full fine-tuning determine how many parameters change during training.
| Goal | Method | Reason |
|---|---|---|
| Use frequently changing facts | RAG | Documents can be reindexed without retraining model weights. |
| Absorb domain language or a large raw corpus | Continued pre-training | The model learns statistical patterns directly from unlabelled text. |
| Change format, persona, tool schema, or task behavior | Supervised fine-tuning | Examples define the desired input-and-output pattern. |
| Optimize automatically verifiable outputs | Reinforcement learning | A reward function can score code, mathematics, or SQL during training. |
Once the objective is set, the available hardware helps determine the update strategy:
- LoRA freezes the base model and trains small low-rank adapter matrices, typically updating about 1% to 2% of its parameters.
- QLoRA applies the same adapter approach while storing the frozen base model in 4-bit form, reducing memory use further.
- Full fine-tuning updates every model weight and requires substantially more accelerator memory, storage, and distributed-training capacity.
What fits on one GPU
The hub publishes estimated training memory for each Gemma 4 variant at a 2,048-token sequence length. Its figures show the difference between QLoRA and updating every weight:
| Model | Parameters | QLoRA | Full fine-tuning |
|---|---|---|---|
| Gemma 4 E2B | 2B effective | ~7 GB | ~32 GB |
| Gemma 4 E4B | 4B effective | ~9 GB | ~42 GB |
| Gemma 4 12B | 12B | ~11 GB | ~80 GB |
| Gemma 4 26B A4B | 26B total, 4B active | ~21 GB | ~160 GB |
| Gemma 4 31B | 31B | ~22 GB | ~200 GB |
The 31B QLoRA estimate falls within a 24 GB consumer GPU’s capacity, although the roughly 2 GB margin leaves little room for framework overhead or larger batches. Actual use varies with batch size, optimizer, precision, gradient checkpointing, sequence packing, and framework implementation. Full fine-tuning the same checkpoint requires a distributed, multi-GPU setup.
Recipes beyond text-only LoRA
Several guides address specialized workflows that often require combining framework documentation with research implementations:
- Mixture-of-experts tuning adapts all 128 routed experts in the 26B A4B model while keeping its router frozen.
- Audio fine-tuning uses bfloat16 LoRA with the E2B, E4B, and 12B checkpoints.
- Vision fine-tuning explains soft-token budgets, which control how much sequence capacity images such as receipts and documents consume.
- Reserved-token mapping assigns routing or source tags to unused single-token slots, preventing those tags from being split by the tokenizer.
- Distributed and low-precision training covers FSDP2 sharding across GPUs and quantization-aware training designed to preserve accuracy after 4-bit deployment.
Coding agents can run the recipe
Google also released the gemma-skills repository with two coding-agent skills. gemma-dev covers application development and general Gemma questions. gemma-trainer targets supervised fine-tuning, direct preference optimization, reinforcement learning from human feedback, and reward-model training on local hardware.
The Skills CLI can install the training skill with one command:
npx skills add google-gemma/gemma-skills --skill gemma-trainer --global
The --global flag makes the skill available across supported coding-agent projects on the machine. Installation requires Node.js, npm, and a compatible agent environment.
A compatible agent can use the skill to prepare datasets, select settings for the available GPU, generate configuration files, and launch training commands. The repository supplies workflow instructions; developers still need model access, a supported training framework, suitable hardware, and permission to read the dataset. Generated shell commands, file paths, credentials, and training settings should be reviewed before execution.
One reference, fewer hidden decisions
A shared reference for checkpoint selection, memory estimates, dataset formatting, multimodal tuning, and reward design reduces the setup work around open-weight models. It also gives teams a consistent vocabulary for comparing Gemma workflows with Llama, Qwen, and other model families, making hardware and training choices easier to evaluate before committing compute.