google/gemma-2b
Original2.5Bparameters
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 · 18
Fixture · 2
| Kind | Original | Fixture | |
|---|---|---|---|
| DecoderLayer | 18 | 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 |
|---|---|---|---|---|
| model.layers | 2.0B | 79.1% | 69.9K | 0.4% |
| model.embed_tokens | 524.3M | 20.9% | 16.4M | 99.6% |
| model.norm | 2.0K | 0.0% | 64 | 0.0% |
Preserved properties
| Config | Property | Original | Fixture | |
|---|---|---|---|---|
| model | attention style | MQA (8 heads, 1 KV) | MQA (4 heads, 1 KV) | ✓ kept |
| model | RoPE type | default | default | ✓ kept |
| model | model_type | gemma | gemma | ✓ 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 Gemma omitted).
| Class | Original | Fixture |
|---|---|---|
| Linear | 127 | 15 |
| RMSNorm | 37 | 5 |
| GELUTanh | 18 | 2 |
| Attention | 18 | 2 |
| DecoderLayer | 18 | 2 |
| MLP | 18 | 2 |
| ForCausalLM | 1 | 1 |
| Model | 1 | 1 |
| RotaryEmbedding | 1 | 1 |
| TextScaledWordEmbedding | 1 | 1 |
| ModuleList | 1 | 1 |
Config changes
5 fields changed, 24 unchanged.
| Field | Original | Fixture |
|---|---|---|
| head_dim | 256 | 16 |
| hidden_size | 2048 | 64 |
| intermediate_size | 16384 | 128 |
| num_attention_heads | 8 | 4 |
| num_hidden_layers | 18 | 2 |