Gemma 3 / Gemma 3n

View as Markdown

Gemma 3 includes text-only and multimodal checkpoints. Gemma 3n is a next-generation efficiency-focused variant. This is the single coverage page for the Gemma 3 generation.

TaskText Generation, Image-Text-to-Text
ArchitectureGemma3ForCausalLM, Gemma3ForConditionalGeneration
Parameters270M – 27B
HF Orggoogle

Available Models

  • Gemma 3 270M (text-only)
  • Gemma 3 27B IT (VL)
  • Gemma 3 4B IT (VL)
  • Gemma 3n 4B (VL)

Architecture

  • Gemma3ForCausalLM — text-only models
  • Gemma3ForConditionalGeneration — multimodal models

Example HF Models

ModelHF ID
Gemma 3 270Mgoogle/gemma-3-270m
Gemma 3 4B ITgoogle/gemma-3-4b-it
Gemma 3 27B ITgoogle/gemma-3-27b-it

Example Recipes

RecipeDatasetDescription
gemma_3_270m_squad.yamlSQuADSFT — Gemma 3 270M
gemma_3_270m_squad_peft.yamlSQuADLoRA — Gemma 3 270M
gemma3_vl_4b_cord_v2.yamlcord-v2SFT — Gemma 3 4B VL on CORD-v2
gemma3_vl_4b_cord_v2_peft.yamlcord-v2LoRA — Gemma 3 4B VL on CORD-v2
gemma3_vl_4b_cord_v2_megatron_fsdp.yamlcord-v2SFT — Gemma 3 4B VL with MegatronFSDP
gemma3_vl_4b_medpix.yamlMedPix-VQASFT — Gemma 3 4B VL on MedPix
gemma3n_vl_4b_medpix.yamlMedPix-VQASFT — Gemma 3n 4B VL on MedPix
gemma3n_vl_4b_medpix_peft.yamlMedPix-VQALoRA — Gemma 3n 4B VL on MedPix

Try with NeMo AutoModel

1. Clone and install from source (full instructions):

$git clone https://github.com/NVIDIA-NeMo/Automodel.git
$cd Automodel
$uv sync --locked --all-groups --all-extras

2. Run the recipe from inside the repo:

$uv run automodel --nproc-per-node=8 examples/vlm_finetune/gemma3/gemma3_vl_4b_cord_v2.yaml

1. Pull the container and mount a checkpoint directory:

$docker run --gpus all -it --rm \
> --shm-size=8g \
> -v $(pwd)/checkpoints:/opt/Automodel/checkpoints \
> nvcr.io/nvidia/nemo-automodel:26.06.00

2. Navigate to the AutoModel directory (where the recipes are):

$cd /opt/Automodel

3. Run the recipe:

$automodel --nproc-per-node=8 examples/vlm_finetune/gemma3/gemma3_vl_4b_cord_v2.yaml

See the Installation Guide and VLM Fine-Tuning Guide.

Fine-Tuning

See the Gemma 3 & Gemma 3n Fine-Tuning Guide for detailed instructions on dataset preparation, configuration, and multi-GPU training.

Hugging Face Model Cards