Gemma 3 270M
Google · Gemma 3 · open weights
- MQA
- Sliding window
- RoPE
- Sandwich norm
- QK-norm
Facts and where they come from
| Released | 2025-08 | config.jsonconfig.jsonHugging Face repository creation date (api.createdAt) |
|---|---|---|
| Licence | gemma | config.jsonconfig.jsonREADME metadata: license |
| Total parameters | 270M | labmodel cardmodel name gemma-3-270m |
| Active parameters | not disclosed | not disclosed |
| Context length | 32K tokens | labgoogle-deepmind/gemma _gemma.py (pinned)model card (README): 32K context for the 270M and 1B sizes |
| Norm placement | sandwich | codemodelling codegoogle-deepmind/gemma _gemma.py: use_post_attn_norm and use_post_ffw_norm |
| Norm type | RMSNorm | codemodelling codegoogle-deepmind/gemma _gemma.py: use_post_attn_norm and use_post_ffw_norm |
| QK-norm | yes | config.jsonconfig.jsonuse_qk_norm |
| Positional encoding | RoPE | codemodelling coderotary on the full head (default) |
| Parallel attention and MLP | no | codemodelling codegoogle-deepmind/gemma _gemma.py: use_post_attn_norm and use_post_ffw_norm |
Architecture, drawn from the data
15× MQA 4q/1kv, window 512 + 3× MQA 4q/1kv. Each column is one layer: its token mixer above, its feed-forward block below. Paler columns reuse another layer’s keys and values.
Modelled costs
From the cost model, batch size 1. Totals the lab states are in the table above; differences come from rounding, from what a lab counts, or from parts the model does not describe (listed on the about page).
| Parameters (modelled) | 268M |
|---|---|
| Active per token (modelled) | 268M |
| Without embeddings and output head | 100M total, 100M active |
| Published weights (Hugging Face count) | 268M |
| KV cache per token, BF16 (layers that grow with context) | 3 KiB |
| KV cache + state at 32K tokens, BF16 | 104 MiB |
| Decode FLOPs per token at 4K context | 618 MFLOP |
| Prefill FLOPs for a 4K prompt | 1.05 TFLOP |
KV cache against context
Every architecture field
| Field | Value | Source |
|---|---|---|
| d_model | 640 | labgoogle-deepmind/gemma _gemma.py (pinned)_gemma.py Gemma3_270M: embed_dim |
| vocab | 262,144 | labgoogle-deepmind/gemma _gemma.py (pinned)_gemma.py Gemma3_270M: num_embed |
| tied_embeddings | true | labgoogle-deepmind/gemma _gemma.py (pinned)_gemma.py Gemma3_270M: embedder shared with the output layer |
| mixers.full.type | attn | codemodelling codeattention block |
| mixers.full.heads | 4 | labgoogle-deepmind/gemma _gemma.py (pinned)_gemma.py Gemma3_270M: num_heads |
| mixers.full.kv_heads | 1 | labgoogle-deepmind/gemma _gemma.py (pinned)_gemma.py Gemma3_270M: num_kv_heads |
| mixers.full.head_dim | 256 | labgoogle-deepmind/gemma _gemma.py (pinned)_gemma.py Gemma3_270M: head_dim |
| mixers.full.qk_norm | true | labgoogle-deepmind/gemma _gemma.py (pinned)_gemma.py Gemma3_270M: use_qk_norm |
| mixers.sliding.type | attn | codemodelling codeattention block |
| mixers.sliding.heads | 4 | labgoogle-deepmind/gemma _gemma.py (pinned)_gemma.py Gemma3_270M: num_heads |
| mixers.sliding.kv_heads | 1 | labgoogle-deepmind/gemma _gemma.py (pinned)_gemma.py Gemma3_270M: num_kv_heads |
| mixers.sliding.head_dim | 256 | labgoogle-deepmind/gemma _gemma.py (pinned)_gemma.py Gemma3_270M: head_dim |
| mixers.sliding.window | 512 | labgoogle-deepmind/gemma _gemma.py (pinned)_gemma.py Gemma3_270M: sliding_window_size |
| mixers.sliding.qk_norm | true | labgoogle-deepmind/gemma _gemma.py (pinned)_gemma.py Gemma3_270M: use_qk_norm |
| ffns.dense.type | dense | codemodelling codeMLP block |
| ffns.dense.d_ff | 2,048 | labgoogle-deepmind/gemma _gemma.py (pinned)_gemma.py Gemma3_270M: hidden_dim |
| ffns.dense.gated | true | codemodelling codeMLP: gated (SwiGLU/GeGLU) |
| layout | 5× sliding/dense · 1× full/dense · 5× sliding/dense · 1× full/dense · 5× sliding/dense · 1× full/dense | labgoogle-deepmind/gemma _gemma.py (pinned)_gemma.py Gemma3_270M: attention_types (local sliding / global pattern) |
| norms_per_layer | 4 | codemodelling codeGemma 2/3: sandwich norms (pre and post around attention and MLP) |
Sources
- config.json @ 9b0cfec
- model card
- arXiv 2503.19786
- google-deepmind/gemma _gemma.py (pinned) · google-deepmind/gemma _gemma.py (pinned)
- modelling code · transformers 5.18.0 modelling code, or the model repository's own modelling file at the pinned revision
Listed in the LLM Architecture Gallery checklist as “Gemma 3 (270M)” (name only; see about).