microsoft/Phi-4-multimodal-instruct
Original4.7Bparameters
Fixture16.6Mparameters
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.
model.layers
Original · 32
Fixture · 2
| Kind | Original | Fixture | |
|---|---|---|---|
| DecoderLayer | 32 | 2 | ✓ kept |
model.embed_tokens_extend.image_embed.img_processor.encoder.layers
Original · 27
Fixture · 2
| Kind | Original | Fixture | |
|---|---|---|---|
| VisionEncoderLayer | 27 | 2 | ✓ kept |
model.embed_tokens_extend.audio_embed.encoder.encoders
Original · 24
Fixture · 2
| Kind | Original | Fixture | |
|---|---|---|---|
| AudioConformerEncoderLayer | 24 | 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 | 3.2B | 67.9% | 74.0K | 0.4% |
| model.embed_tokens | 614.6M | 13.0% | 12.8M | 77.3% |
| model.embed_tokens_extend.audio_embed.encoder.encoders | 428.6M | 9.0% | 671.2K | 4.1% |
| model.embed_tokens_extend.image_embed.img_processor.encoder.layers | 411.5M | 8.7% | 66.9K | 0.4% |
| model.embed_tokens_extend | 67.9M | 1.4% | 3.0M | 17.8% |
| model.norm | 3.1K | 0.0% | 64 | 0.0% |
Preserved properties
| Config | Property | Original | Fixture | |
|---|---|---|---|---|
| model | attention style | GQA (24 heads, 8 KV) | GQA (4 heads, 2 KV) | ✓ kept |
| model | RoPE type | longrope | longrope | ✓ kept |
| model | model_type | phi4_multimodal | phi4_multimodal | ✓ kept |
| model | vocab_size | 200064 | 200064 | ✓ kept |
| model | tie_word_embeddings | True | True | ✓ kept |
| model | hidden_act | silu | silu | ✓ kept |
| model | max_position_embeddings | 131072 | 131072 | ✓ kept |
| vision_config | model_type | phi4_multimodal_vision | phi4_multimodal_vision | ✓ kept |
| vision_config | hidden_act | gelu_pytorch_tanh | gelu_pytorch_tanh | ✓ kept |
| vision_config | image_size | 448 | 448 | ✓ kept |
| vision_config | patch_size | 14 | 14 | ✓ kept |
| vision_config | num_channels | 3 | 3 | ✓ kept |
| audio_config | model_type | phi4_multimodal_audio | phi4_multimodal_audio | ✓ kept |
Module classes
Instances of each class in the built model (prefix Phi4Multimodal omitted).
| Class | Original | Fixture |
|---|---|---|
| Linear | 492 | 46 |
| LayerNorm | 176 | 16 |
| Dropout | 139 | 13 |
| Conv1d | 96 | 8 |
| SiLU | 96 | 8 |
| RMSNorm | 65 | 5 |
| AudioMLP | 48 | 4 |
| Attention | 32 | 2 |
| DecoderLayer | 32 | 2 |
| MLP | 32 | 2 |
| SiLUActivation | 32 | 2 |
| GELUTanh | 28 | 3 |
| VisionMLP | 28 | 3 |
| VisionAttention | 27 | 2 |
| VisionEncoderLayer | 27 | 2 |
| AudioAttention | 24 | 2 |
| AudioConformerEncoderLayer | 24 | 2 |
| AudioConvModule | 24 | 2 |
| AudioDepthWiseSeparableConv1d | 24 | 2 |
| AudioGluPointWiseConv | 24 | 2 |
| Conv2d | 6 | 6 |
| Embedding | 3 | 3 |
| ModuleList | 3 | 3 |
| AvgPool2d | 1 | 1 |
| MultiheadAttention | 1 | 1 |
| NonDynamicallyQuantizableLinear | 1 | 1 |
| AudioEmbedding | 1 | 1 |
| AudioMeanVarianceNormLayer | 1 | 1 |
| AudioModel | 1 | 1 |
| AudioNemoConvSubsampling | 1 | 1 |
| AudioRelativeAttentionBias | 1 | 1 |
| FeatureEmbedding | 1 | 1 |
| ForCausalLM | 1 | 1 |
| ImageEmbedding | 1 | 1 |
| Model | 1 | 1 |
| RotaryEmbedding | 1 | 1 |
| VisionEmbeddings | 1 | 1 |
| VisionEncoder | 1 | 1 |
| VisionModel | 1 | 1 |
| VisionMultiheadAttentionPoolingHead | 1 | 1 |
| ReLU | 1 | 1 |
| Sequential | 1 | 1 |
Config changes
15 fields changed, 78 unchanged.
| Field | Original | Fixture |
|---|---|---|
| audio_config.chunk_size | -1 | 8 |
| audio_config.hidden_size | 1024 | 64 |
| audio_config.intermediate_size | 1536 | 128 |
| audio_config.num_attention_heads | 16 | 4 |
| audio_config.num_blocks | 24 | 2 |
| hidden_size | 3072 | 64 |
| intermediate_size | 8192 | 128 |
| num_attention_heads | 24 | 4 |
| num_hidden_layers | 32 | 2 |
| num_key_value_heads | 8 | 2 |
| rope_parameters | {"long_factor": [1, 1.118320672, 1.250641126, 1.398617824, 1.564103225, 1.749… | {"long_factor": [1, 2.446418898, 5.984965424, 14.64173252, 32.1, 32.71], "ori… |
| 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 |