google/gemma-2-2b-it
Original2.6Bparameters
Fixture16.5Mparameters
Layer stacks1compared
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.layers
Original · 26
Fixture · 2
| Kind | Original | Fixture | |
|---|---|---|---|
| sliding_attention | 13 | 1 | ✓ kept |
| full_attention | 13 | 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.layers | 2.0B | 77.4% | 74.2K | 0.5% |
| model.embed_tokens | 589.8M | 22.6% | 16.4M | 99.5% |
| model.norm | 2.3K | 0.0% | 64 | 0.0% |
Preserved properties
| Config | Property | Original | Fixture | |
|---|---|---|---|---|
| model | attention style | GQA (8 heads, 4 KV) | GQA (4 heads, 2 KV) | ✓ kept |
| model | RoPE type | default | default | ✓ kept |
| model | model_type | gemma2 | gemma2 | ✓ kept |
| model | vocab_size | 256000 | 256000 | ✓ kept |
| model | tie_word_embeddings | True | True | ✓ kept |
| model | hidden_act | gelu_pytorch_tanh | gelu_pytorch_tanh | ✓ kept |
| model | max_position_embeddings | 8192 | 8192 | ✓ kept |
Module classes
Instances of each class in the built model (prefix Gemma2 omitted).
| Class | Original | Fixture |
|---|---|---|
| Linear | 183 | 15 |
| RMSNorm | 105 | 9 |
| GELUTanh | 26 | 2 |
| Attention | 26 | 2 |
| DecoderLayer | 26 | 2 |
| MLP | 26 | 2 |
| ForCausalLM | 1 | 1 |
| Model | 1 | 1 |
| RotaryEmbedding | 1 | 1 |
| TextScaledWordEmbedding | 1 | 1 |
| ModuleList | 1 | 1 |
Config changes
7 fields changed, 29 unchanged.
| Field | Original | Fixture |
|---|---|---|
| head_dim | 256 | 16 |
| hidden_size | 2304 | 64 |
| intermediate_size | 9216 | 128 |
| layer_types | 26 entries: 13× sliding_attention, 13× full_attention | ["sliding_attention", "full_attention"] |
| num_attention_heads | 8 | 4 |
| num_hidden_layers | 26 | 2 |
| num_key_value_heads | 4 | 2 |