google/recurrentgemma-2b
Original2.7Bparameters
Fixture24.0Mparameters
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 · 3
| Kind | Original | Fixture | |
|---|---|---|---|
| Conv1d, RecurrentBlock, Rglru | 18 | 2 | ✓ kept |
| is_causal=True, Attention, RotaryEmbedding | 8 | 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 | 75.6% | 7.6M | 31.8% |
| model.embed_tokens | 655.4M | 24.4% | 16.4M | 68.2% |
| model.final_norm | 2.6K | 0.0% | 64 | 0.0% |
Preserved properties
| Config | Property | Original | Fixture | |
|---|---|---|---|---|
| model | attention style | MQA (10 heads, 1 KV) | MQA (4 heads, 1 KV) | ✓ kept |
| model | RoPE type | default | default | ✓ kept |
| model | model_type | recurrent_gemma | recurrent_gemma | ✓ kept |
| model | vocab_size | 256000 | 256000 | ✓ kept |
| model | tie_word_embeddings | True | True | ✓ kept |
Module classes
Instances of each class in the built model (prefix RecurrentGemma omitted).
| Class | Original | Fixture |
|---|---|---|
| Linear | 165 | 20 |
| RMSNorm | 53 | 7 |
| GELUTanh | 44 | 5 |
| DecoderLayer | 26 | 3 |
| Mlp | 26 | 3 |
| Conv1d | 18 | 2 |
| RecurrentBlock | 18 | 2 |
| Rglru | 18 | 2 |
| Attention | 8 | 1 |
| RotaryEmbedding | 8 | 1 |
| Embedding | 1 | 1 |
| ModuleList | 1 | 1 |
| ForCausalLM | 1 | 1 |
| Model | 1 | 1 |
Config changes
5 fields changed, 30 unchanged.
| Field | Original | Fixture |
|---|---|---|
| head_dim | 256 | 16 |
| hidden_size | 2560 | 64 |
| intermediate_size | 15360 | 128 |
| num_attention_heads | 10 | 4 |
| num_hidden_layers | 26 | 3 |