google/gemma-3-4b-it
Original4.3Bparameters
Fixture17.2Mparameters
Layer stacks2compared
Findings0to review
✓ Same architecture, smaller
Every module class, layer kind and checked property of the original is in the fixture.
Layer stacks
One square per layer, colored by kind: the layer's module classes and type attributes. Hover a square for its index and kind.
model.vision_tower.encoder.layers
Original · 27
Fixture · 2
| Kind | Original | Fixture | |
|---|---|---|---|
| SiglipEncoderLayer | 27 | 2 | ✓ kept |
model.language_model.layers
Original · 34
Fixture · 2
| Kind | Original | Fixture | |
|---|---|---|---|
| sliding_attention | 29 | 1 | ✓ kept |
| full_attention | 5 | 1 | ✓ kept |
Where the parameters are
Share of each model's parameters per component. Vocabulary and patch sizes are kept, so embeddings usually take a larger share of the fixture.
Original
Fixture
| Component | Original | Share | Fixture | Share |
|---|---|---|---|---|
| model.language_model.layers | 3.2B | 74.6% | 74.3K | 0.4% |
| model.language_model | 671.3M | 15.6% | 16.8M | 97.4% |
| model.vision_tower.encoder.layers | 411.5M | 9.6% | 66.9K | 0.4% |
| model.vision_tower | 5.4M | 0.1% | 300.0K | 1.7% |
| model.multi_modal_projector | 3.0M | 0.1% | 4.2K | 0.0% |
Preserved properties
| Config | Property | Original | Fixture | |
|---|---|---|---|---|
| model | model_type | gemma3 | gemma3 | ✓ kept |
| model | tie_word_embeddings | True | True | ✓ kept |
| text_config | attention style | GQA (8 heads, 4 KV) | GQA (4 heads, 2 KV) | ✓ kept |
| text_config | model_type | gemma3_text | gemma3_text | ✓ kept |
| text_config | vocab_size | 262208 | 262208 | ✓ kept |
| text_config | tie_word_embeddings | True | True | ✓ kept |
| text_config | max_position_embeddings | 131072 | 131072 | ✓ kept |
| vision_config | model_type | siglip_vision_model | siglip_vision_model | ✓ kept |
| vision_config | hidden_act | gelu_pytorch_tanh | gelu_pytorch_tanh | ✓ kept |
| vision_config | image_size | 896 | 896 | ✓ kept |
| vision_config | patch_size | 14 | 14 | ✓ kept |
| vision_config | num_channels | 3 | 3 | ✓ kept |
Module classes
Instances of each class in the built model (prefix Gemma3 omitted).
| Class | Original | Fixture |
|---|---|---|
| Linear | 401 | 27 |
| RMSNorm | 206 | 14 |
| GELUTanh | 61 | 4 |
| LayerNorm | 55 | 5 |
| Attention | 34 | 2 |
| DecoderLayer | 34 | 2 |
| MLP | 34 | 2 |
| SiglipAttention | 27 | 2 |
| SiglipEncoderLayer | 27 | 2 |
| SiglipMLP | 27 | 2 |
| ModuleList | 2 | 2 |
| AvgPool2d | 1 | 1 |
| Conv2d | 1 | 1 |
| Embedding | 1 | 1 |
| ForConditionalGeneration | 1 | 1 |
| Model | 1 | 1 |
| MultiModalProjector | 1 | 1 |
| RotaryEmbedding | 1 | 1 |
| TextModel | 1 | 1 |
| TextScaledWordEmbedding | 1 | 1 |
| SiglipEncoder | 1 | 1 |
| SiglipVisionEmbeddings | 1 | 1 |
| SiglipVisionModel | 1 | 1 |
Config changes
11 fields changed, 60 unchanged.
| Field | Original | Fixture |
|---|---|---|
| text_config.head_dim | 256 | 16 |
| text_config.hidden_size | 2560 | 64 |
| text_config.intermediate_size | 10240 | 128 |
| text_config.layer_types | 34 entries: 29× sliding_attention, 5× full_attention | ["sliding_attention", "full_attention"] |
| text_config.num_attention_heads | 8 | 4 |
| text_config.num_hidden_layers | 34 | 2 |
| text_config.num_key_value_heads | 4 | 2 |
| vision_config.hidden_size | 1152 | 64 |
| vision_config.intermediate_size | 4304 | 128 |
| vision_config.num_attention_heads | 16 | 4 |
| vision_config.num_hidden_layers | 27 | 2 |