google/embeddinggemma-2
Original744.4Mparameters
Fixture19.4Mparameters
Layer stacks3compared
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.
vision_tower.encoder.layers
Original · 16
Fixture · 2
| Kind | Original | Fixture | |
|---|---|---|---|
| Gemma4VisionEncoderLayer | 16 | 2 | ✓ kept |
language_model.layers
Original · 24
Fixture · 2
| Kind | Original | Fixture | |
|---|---|---|---|
| EncoderLayer | 24 | 2 | ✓ kept |
audio_tower.layers
Original · 12
Fixture · 2
| Kind | Original | Fixture | |
|---|---|---|---|
| Gemma4AudioLayer | 12 | 2 | ✓ 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 |
|---|---|---|---|---|
| audio_tower.layers | 302.2M | 40.6% | 198.4K | 1.0% |
| vision_tower.encoder.layers | 151.0M | 20.3% | 82.5K | 0.4% |
| language_model.embed_tokens | 134.2M | 18.0% | 16.8M | 86.7% |
| language_model.layers | 130.1M | 17.5% | 521.9K | 2.7% |
| vision_tower.patch_embedder | 16.3M | 2.2% | 1.4M | 7.0% |
| language_model.ple | 6.3M | 0.8% | 66.0K | 0.3% |
| audio_tower.output_proj | 1.6M | 0.2% | 99.8K | 0.5% |
| 5 others | 2.7M | 0.4% | 255.3K | 1.3% |
Preserved properties
| Config | Property | Original | Fixture | |
|---|---|---|---|---|
| model | model_type | embedding_gemma2 | embedding_gemma2 | ✓ kept |
| text_config | attention style | GQA (4 heads, 2 KV) | GQA (4 heads, 2 KV) | ✓ kept |
| text_config | model_type | embedding_gemma2_text | embedding_gemma2_text | ✓ kept |
| text_config | vocab_size | 262144 | 262144 | ✓ kept |
| text_config | max_position_embeddings | 262144 | 262144 | ✓ kept |
| vision_config | attention style | MHA (12 heads, 12 KV) | MHA (4 heads, 4 KV) | ✓ kept |
| vision_config | RoPE type | axial | axial | ✓ kept |
| vision_config | model_type | gemma4_vision | gemma4_vision | ✓ kept |
| vision_config | max_position_embeddings | 131072 | 131072 | ✓ kept |
| vision_config | patch_size | 16 | 16 | ✓ kept |
| audio_config | model_type | gemma4_audio | gemma4_audio | ✓ kept |
| audio_config | hidden_act | silu | silu | ✓ kept |
Module classes
Instances of each class in the built model (prefix EmbeddingGemma2 omitted).
| Class | Original | Fixture |
|---|---|---|
| Linear | 467 | 61 |
| Gemma4ClippableLinear | 232 | 34 |
| Gemma4RMSNorm | 220 | 32 |
| RMSNorm | 196 | 20 |
| GELUTanh | 64 | 6 |
| SiLUActivation | 36 | 6 |
| Attention | 24 | 2 |
| EncoderLayer | 24 | 2 |
| MLP | 24 | 2 |
| TextPLEBlock | 24 | 2 |
| Gemma4AudioFeedForward | 24 | 4 |
| Gemma4VisionAttention | 16 | 2 |
| Gemma4VisionEncoderLayer | 16 | 2 |
| Gemma4VisionMLP | 16 | 2 |
| Gemma4AudioAttention | 12 | 2 |
| Gemma4AudioCausalConv1d | 12 | 2 |
| Gemma4AudioLayer | 12 | 2 |
| Gemma4AudioLightConv1d | 12 | 2 |
| ModuleList | 3 | 3 |
| Conv2d | 2 | 2 |
| MultimodalEmbedder | 2 | 2 |
| Gemma4AudioSubSampleConvProjectionLayer | 2 | 2 |
| LayerNorm | 2 | 2 |
| ReLU | 2 | 2 |
| Model | 1 | 1 |
| RotaryEmbedding | 1 | 1 |
| TextModel | 1 | 1 |
| TextPLE | 1 | 1 |
| TextScaledWordEmbedding | 1 | 1 |
| Gemma4AudioModel | 1 | 1 |
| Gemma4AudioRelPositionalEncoding | 1 | 1 |
| Gemma4AudioSubSampleConvProjection | 1 | 1 |
| Gemma4VisionEncoder | 1 | 1 |
| Gemma4VisionModel | 1 | 1 |
| Gemma4VisionPatchEmbedder | 1 | 1 |
| Gemma4VisionPooler | 1 | 1 |
| Gemma4VisionRotaryEmbedding | 1 | 1 |
Config changes
19 fields changed, 89 unchanged.
| Field | Original | Fixture |
|---|---|---|
| audio_config.hidden_size | 1024 | 64 |
| audio_config.num_attention_heads | 8 | 4 |
| audio_config.num_hidden_layers | 12 | 2 |
| text_config.head_dim | 256 | 16 |
| text_config.hidden_size | 512 | 64 |
| text_config.intermediate_size | 2048 | 128 |
| text_config.layer_types | 24 entries: 20× sliding_attention, 4× full_attention | ["sliding_attention", "full_attention"] |
| text_config.num_hidden_layers | 24 | 2 |
| text_config.per_layer_config.05 | {"head_dim": 512, "num_key_value_heads": 1} | — |
| text_config.per_layer_config.1 | — | {"head_dim": 512, "num_key_value_heads": 1} |
| text_config.per_layer_config.11 | {"head_dim": 512, "num_key_value_heads": 1} | — |
| text_config.per_layer_config.17 | {"head_dim": 512, "num_key_value_heads": 1} | — |
| text_config.per_layer_config.23 | {"head_dim": 512, "num_key_value_heads": 1} | — |
| vision_config.head_dim | 64 | 16 |
| vision_config.hidden_size | 768 | 64 |
| vision_config.intermediate_size | 3072 | 128 |
| vision_config.num_attention_heads | 12 | 4 |
| vision_config.num_hidden_layers | 16 | 2 |
| vision_config.num_key_value_heads | 12 | 4 |