inspector / ir /artifacts /gemma3.json
lysandre's picture
lysandre HF Staff
Deploy architecture inspector
ed5700a verified
Raw
History Blame Contribute Delete
33.5 kB
{
"architecture": {
"attention_variant": "GQA",
"family": "image_text_to_text",
"is_moe": false,
"mixer": "attention",
"positional": "rope",
"sliding_window": 4096,
"tie_word_embeddings": true,
"towers": [
{
"attention_variant": "GQA",
"config_class": "Gemma3TextConfig",
"hidden_size": 2304,
"name": "text",
"num_attention_heads": 8,
"num_hidden_layers": 26,
"positional": "rope"
},
{
"attention_variant": "MHA",
"config_class": "SiglipVisionConfig",
"hidden_size": 768,
"name": "vision",
"num_attention_heads": 12,
"num_hidden_layers": 12
}
],
"view": "multimodal"
},
"capabilities": {
"attention_backends": [
"eager",
"sdpa",
"flash_attention",
"flex_attention"
],
"attention_patterns": [
"sliding",
"causal"
],
"attention_schedule": [
"sliding_attention",
"sliding_attention",
"sliding_attention",
"sliding_attention",
"sliding_attention",
"full_attention",
"sliding_attention",
"sliding_attention",
"sliding_attention",
"sliding_attention",
"sliding_attention",
"full_attention",
"sliding_attention",
"sliding_attention",
"sliding_attention",
"sliding_attention",
"sliding_attention",
"full_attention",
"sliding_attention",
"sliding_attention",
"sliding_attention",
"sliding_attention",
"sliding_attention",
"full_attention",
"sliding_attention",
"sliding_attention"
],
"task_heads": [
"causal_lm",
"image_text_to_text",
"multimodal_lm",
"pretraining",
"sequence_classification"
],
"tensor_parallel": true
},
"components": [
{
"children": [
"vision_tower",
"multi_modal_projector",
"language_model"
],
"class_name": "Gemma3Model",
"id": "model",
"kind": "model",
"path_pattern": "model"
},
{
"children": [
"vision_tower.embeddings",
"vision_tower.encoder",
"vision_tower.post_layernorm",
"vision_tower.head"
],
"class_name": "SiglipVisionModel",
"id": "vision_tower",
"kind": "model",
"path_pattern": "model.vision_tower"
},
{
"attributes": {
"embedding_dim": "config.hidden_size"
},
"children": [
"vision_tower.embeddings.patch_embedding",
"vision_tower.embeddings.position_embedding"
],
"class_name": "SiglipVisionEmbeddings",
"id": "vision_tower.embeddings",
"kind": "embedding",
"path_pattern": "model.vision_tower.embeddings"
},
{
"class_name": "Conv2d",
"id": "vision_tower.embeddings.patch_embedding",
"kind": "convolution",
"path_pattern": "model.vision_tower.embeddings.patch_embedding"
},
{
"attributes": {},
"class_name": "Embedding",
"id": "vision_tower.embeddings.position_embedding",
"kind": "position",
"path_pattern": "model.vision_tower.embeddings.position_embedding"
},
{
"children": [
"encoder_layers"
],
"class_name": "SiglipEncoder",
"id": "vision_tower.encoder",
"kind": "encoder",
"path_pattern": "model.vision_tower.encoder"
},
{
"attributes": {
"norm_type": "layer"
},
"class_name": "LayerNorm",
"id": "vision_tower.post_layernorm",
"kind": "normalization",
"path_pattern": "model.vision_tower.post_layernorm"
},
{
"attributes": {
"head_dim": 64,
"n_heads": 12,
"n_kv_heads": 12,
"rope": false,
"variant": "MHA"
},
"children": [
"vision_tower.head.attention",
"vision_tower.head.layernorm",
"vision_tower.head.mlp"
],
"class_name": "SiglipMultiheadAttentionPoolingHead",
"id": "vision_tower.head",
"kind": "attention",
"path_pattern": "model.vision_tower.head"
},
{
"attributes": {
"head_dim": 64,
"n_heads": 12,
"n_kv_heads": 12,
"rope": false,
"variant": "MHA"
},
"children": [
"vision_tower.head.attention.out_proj"
],
"class_name": "MultiheadAttention",
"id": "vision_tower.head.attention",
"kind": "attention",
"path_pattern": "model.vision_tower.head.attention"
},
{
"class_name": "NonDynamicallyQuantizableLinear",
"id": "vision_tower.head.attention.out_proj",
"kind": "projection",
"path_pattern": "model.vision_tower.head.attention.out_proj"
},
{
"attributes": {
"norm_type": "layer"
},
"class_name": "LayerNorm",
"id": "vision_tower.head.layernorm",
"kind": "normalization",
"path_pattern": "model.vision_tower.head.layernorm"
},
{
"attributes": {
"activation": "gelu_pytorch_tanh",
"hidden_size": 768,
"intermediate_size": 3072
},
"children": [
"vision_tower.head.mlp.activation_fn",
"vision_tower.head.mlp.fc1",
"vision_tower.head.mlp.fc2"
],
"class_name": "SiglipMLP",
"id": "vision_tower.head.mlp",
"kind": "feed_forward",
"path_pattern": "model.vision_tower.head.mlp"
},
{
"attributes": {
"activation": "gelu_pytorch_tanh",
"hidden_size": 768,
"intermediate_size": 3072
},
"class_name": "GELUTanh",
"id": "vision_tower.head.mlp.activation_fn",
"kind": "feed_forward",
"path_pattern": "model.vision_tower.head.mlp.activation_fn"
},
{
"attributes": {
"in_features": "config.hidden_size",
"out_features": "config.intermediate_size"
},
"class_name": "Linear",
"id": "vision_tower.head.mlp.fc1",
"kind": "projection",
"path_pattern": "model.vision_tower.head.mlp.fc1"
},
{
"attributes": {
"in_features": "config.intermediate_size",
"out_features": "config.hidden_size"
},
"class_name": "Linear",
"id": "vision_tower.head.mlp.fc2",
"kind": "projection",
"path_pattern": "model.vision_tower.head.mlp.fc2"
},
{
"children": [
"multi_modal_projector.mm_soft_emb_norm"
],
"class_name": "Gemma3MultiModalProjector",
"id": "multi_modal_projector",
"kind": "module",
"path_pattern": "model.multi_modal_projector"
},
{
"attributes": {
"norm_type": "rms"
},
"class_name": "Gemma3RMSNorm",
"id": "multi_modal_projector.mm_soft_emb_norm",
"kind": "normalization",
"path_pattern": "model.multi_modal_projector.mm_soft_emb_norm"
},
{
"children": [
"language_model.embed_tokens",
"decoder_layers",
"language_model.norm",
"language_model.rotary_emb"
],
"class_name": "Gemma3TextModel",
"id": "language_model",
"kind": "model",
"path_pattern": "model.language_model"
},
{
"attributes": {
"embedding_dim": "config.hidden_size",
"num_embeddings": "config.vocab_size",
"tied_lm_head": true
},
"class_name": "Gemma3TextScaledWordEmbedding",
"id": "language_model.embed_tokens",
"kind": "embedding",
"path_pattern": "model.language_model.embed_tokens"
},
{
"attributes": {
"norm_type": "rms"
},
"class_name": "Gemma3RMSNorm",
"id": "language_model.norm",
"kind": "normalization",
"path_pattern": "model.language_model.norm"
},
{
"attributes": {
"head_dim": "config.head_dim",
"scheme": "rope"
},
"class_name": "Gemma3RotaryEmbedding",
"id": "language_model.rotary_emb",
"kind": "position",
"path_pattern": "model.language_model.rotary_emb"
}
],
"config": {
"class_name": "Gemma3Config",
"model_type": "gemma3",
"module": "transformers.models.gemma3.configuration_gemma3",
"referenced_fields": {},
"salient_fields": {
"is_encoder_decoder": false,
"tie_word_embeddings": true
}
},
"dataflow": {
"input": {
"name": "input_ids",
"shape": [
"B",
"S"
]
},
"output": {
"shape": [
"B",
"S",
2304
]
},
"shapes": {
"decoder_layer.input_layernorm": {
"in": [
"B",
"S",
2304
],
"out": [
"B",
"S",
2304
]
},
"decoder_layer.mlp": {
"in": [
"B",
"S",
2304
],
"out": [
"B",
"S",
2304
]
},
"decoder_layer.post_attention_layernorm": {
"in": [
"B",
"S",
2304
],
"out": [
"B",
"S",
2304
]
},
"decoder_layer.post_feedforward_layernorm": {
"in": [
"B",
"S",
2304
],
"out": [
"B",
"S",
2304
]
},
"decoder_layer.pre_feedforward_layernorm": {
"in": [
"B",
"S",
2304
],
"out": [
"B",
"S",
2304
]
},
"decoder_layer.self_attn": {
"in": null,
"out": [
"B",
"S",
2304
]
},
"language_model": {
"in": null,
"out": [
"B",
"S",
2304
]
}
},
"source": "observed_forward_meta"
},
"edges": [
{
"kind": "data",
"source": "vision_tower.embeddings",
"target": "vision_tower.encoder"
},
{
"kind": "data",
"source": "vision_tower.encoder",
"target": "vision_tower.post_layernorm"
},
{
"kind": "data",
"source": "vision_tower.post_layernorm",
"target": "vision_tower.head"
},
{
"kind": "data",
"source": "encoder_layer.layer_norm1",
"target": "encoder_layer.self_attn"
},
{
"kind": "data",
"source": "encoder_layer.self_attn",
"target": "encoder_layer.layer_norm2"
},
{
"kind": "data",
"source": "encoder_layer.layer_norm2",
"target": "encoder_layer.mlp"
},
{
"kind": "data",
"source": "vision_tower.head.attention",
"target": "vision_tower.head.layernorm"
},
{
"kind": "data",
"source": "vision_tower.head.layernorm",
"target": "vision_tower.head.mlp"
},
{
"kind": "data",
"source": "language_model.embed_tokens",
"target": "decoder_layers"
},
{
"kind": "data",
"source": "decoder_layers",
"target": "language_model.norm"
},
{
"kind": "mask",
"source": "input:attention_mask",
"target": "encoder_layer.self_attn"
},
{
"kind": "mask",
"source": "input:attention_mask",
"target": "vision_tower.head"
},
{
"kind": "mask",
"source": "input:attention_mask",
"target": "vision_tower.head.attention"
},
{
"kind": "mask",
"source": "input:attention_mask",
"target": "decoder_layer.self_attn"
},
{
"kind": "residual",
"source": "encoder_layer",
"target": "encoder_layer.self_attn"
},
{
"kind": "residual",
"source": "encoder_layer",
"target": "encoder_layer.mlp"
},
{
"kind": "residual",
"source": "decoder_layer",
"target": "decoder_layer.self_attn"
},
{
"kind": "residual",
"source": "decoder_layer",
"target": "decoder_layer.mlp"
},
{
"kind": "position",
"source": "vision_tower.embeddings.position_embedding",
"target": "vision_tower.embeddings"
},
{
"kind": "position",
"source": "language_model.rotary_emb",
"target": "decoder_layer.self_attn"
},
{
"kind": "data",
"provenance": "intra_module",
"source": "vision_tower.head.attention",
"target": "vision_tower.head.attention.out_proj"
},
{
"kind": "data",
"provenance": "intra_module",
"source": "vision_tower.head.mlp",
"target": "vision_tower.head.mlp.fc1"
},
{
"kind": "data",
"provenance": "intra_module",
"source": "vision_tower.head.mlp.fc1",
"target": "vision_tower.head.mlp.fc2"
},
{
"kind": "data",
"provenance": "intra_module",
"source": "encoder_layer.self_attn",
"target": "encoder_layer.self_attn.k_proj"
},
{
"kind": "data",
"provenance": "intra_module",
"source": "encoder_layer.self_attn",
"target": "encoder_layer.self_attn.v_proj"
},
{
"kind": "data",
"provenance": "intra_module",
"source": "encoder_layer.self_attn",
"target": "encoder_layer.self_attn.q_proj"
},
{
"kind": "data",
"provenance": "intra_module",
"source": "encoder_layer.self_attn.k_proj",
"target": "encoder_layer.self_attn.out_proj"
},
{
"kind": "data",
"provenance": "intra_module",
"source": "encoder_layer.self_attn.v_proj",
"target": "encoder_layer.self_attn.out_proj"
},
{
"kind": "data",
"provenance": "intra_module",
"source": "encoder_layer.self_attn.q_proj",
"target": "encoder_layer.self_attn.out_proj"
},
{
"kind": "data",
"provenance": "intra_module",
"source": "encoder_layer.mlp",
"target": "encoder_layer.mlp.fc1"
},
{
"kind": "data",
"provenance": "intra_module",
"source": "encoder_layer.mlp.fc1",
"target": "encoder_layer.mlp.fc2"
},
{
"kind": "data",
"provenance": "intra_module",
"source": "decoder_layer.self_attn",
"target": "decoder_layer.self_attn.q_proj"
},
{
"kind": "data",
"provenance": "intra_module",
"source": "decoder_layer.self_attn",
"target": "decoder_layer.self_attn.k_proj"
},
{
"kind": "data",
"provenance": "intra_module",
"source": "decoder_layer.self_attn",
"target": "decoder_layer.self_attn.v_proj"
},
{
"kind": "data",
"provenance": "intra_module",
"source": "decoder_layer.self_attn.q_proj",
"target": "decoder_layer.self_attn.q_norm"
},
{
"kind": "data",
"provenance": "intra_module",
"source": "decoder_layer.self_attn.k_proj",
"target": "decoder_layer.self_attn.k_norm"
},
{
"kind": "data",
"provenance": "intra_module",
"source": "decoder_layer.self_attn.q_norm",
"target": "decoder_layer.self_attn.o_proj"
},
{
"kind": "data",
"provenance": "intra_module",
"source": "decoder_layer.self_attn.k_norm",
"target": "decoder_layer.self_attn.o_proj"
},
{
"kind": "data",
"provenance": "intra_module",
"source": "decoder_layer.self_attn.v_proj",
"target": "decoder_layer.self_attn.o_proj"
},
{
"kind": "data",
"provenance": "intra_module",
"source": "decoder_layer.mlp",
"target": "decoder_layer.mlp.gate_proj"
},
{
"kind": "data",
"provenance": "intra_module",
"source": "decoder_layer.mlp",
"target": "decoder_layer.mlp.up_proj"
},
{
"kind": "data",
"provenance": "intra_module",
"source": "decoder_layer.mlp.gate_proj",
"target": "decoder_layer.mlp.down_proj"
},
{
"kind": "data",
"provenance": "intra_module",
"source": "decoder_layer.mlp.up_proj",
"target": "decoder_layer.mlp.down_proj"
},
{
"kind": "data",
"provenance": "observed_forward",
"source": "decoder_layer.input_layernorm",
"target": "decoder_layer.self_attn"
},
{
"kind": "data",
"provenance": "observed_forward",
"source": "decoder_layer.self_attn",
"target": "decoder_layer.post_attention_layernorm"
},
{
"kind": "data",
"provenance": "observed_forward",
"source": "decoder_layer.post_attention_layernorm",
"target": "decoder_layer.pre_feedforward_layernorm"
},
{
"kind": "data",
"provenance": "observed_forward",
"source": "decoder_layer.pre_feedforward_layernorm",
"target": "decoder_layer.mlp"
},
{
"kind": "data",
"provenance": "observed_forward",
"source": "decoder_layer.mlp",
"target": "decoder_layer.post_feedforward_layernorm"
}
],
"extends": "gemma2",
"model_type": "gemma3",
"patches": [
{
"added": {
"attrs": [
"attn_logit_softcapping",
"base_model_tp_plan",
"default_theta",
"final_logit_softcapping",
"layer_types",
"max_position_embeddings",
"model_type",
"rope_parameters",
"use_bidirectional_attention",
"vocab_size"
],
"methods": [
"__post_init__",
"convert_rope_params_to_dict"
]
},
"component_kind": "config",
"parent_class": "Gemma2Config",
"relation": "new",
"target_class": "Gemma3TextConfig"
},
{
"added": {
"attrs": [
"attribute_map",
"boi_token_index",
"eoi_token_index",
"image_token_index",
"initializer_range",
"mm_tokens_per_image",
"model_type",
"sub_configs",
"text_config",
"tie_word_embeddings",
"vision_config"
],
"methods": [
"__post_init__"
]
},
"component_kind": "config",
"parent_class": "PreTrainedConfig",
"relation": "new",
"target_class": "Gemma3Config"
},
{
"added": {
"methods": [
"__init__",
"forward"
]
},
"component_kind": "embedding",
"parent_class": "Embedding",
"relation": "new",
"target_class": "Gemma3TextScaledWordEmbedding"
},
{
"component_kind": "feed_forward",
"overridden": {
"methods": [
"__init__"
]
},
"parent_class": "Gemma2MLP",
"relation": "inherits",
"target_class": "Gemma3MLP"
},
{
"component_kind": "normalization",
"overridden": {
"methods": [
"__init__"
]
},
"parent_class": "Gemma2RMSNorm",
"relation": "inherits",
"target_class": "Gemma3RMSNorm"
},
{
"component_kind": "position",
"overridden": {
"methods": [
"__init__",
"compute_default_rope_parameters",
"forward"
]
},
"parent_class": "Gemma2RotaryEmbedding",
"relation": "inherits",
"target_class": "Gemma3RotaryEmbedding"
},
{
"component_kind": "attention",
"overridden": {
"methods": [
"__init__",
"forward"
]
},
"parent_class": "Gemma2Attention",
"relation": "inherits",
"target_class": "Gemma3Attention"
},
{
"added": {
"methods": [
"__init__",
"forward"
]
},
"component_kind": "transformer_block",
"parent_class": "GradientCheckpointingLayer",
"relation": "new",
"target_class": "Gemma3DecoderLayer"
},
{
"added": {
"attrs": [
"input_modalities"
]
},
"component_kind": "model",
"overridden": {
"attrs": [
"_no_split_modules",
"base_model_prefix"
],
"methods": [
"_init_weights"
]
},
"parent_class": "Gemma2PreTrainedModel",
"relation": "inherits",
"target_class": "Gemma3PreTrainedModel"
},
{
"added": {
"attrs": [
"config",
"input_modalities"
]
},
"component_kind": "model",
"overridden": {
"methods": [
"__init__",
"forward"
]
},
"parent_class": "Gemma2Model",
"relation": "inherits",
"target_class": "Gemma3TextModel"
},
{
"added": {
"attrs": [
"config"
]
},
"component_kind": "lm_head",
"overridden": {
"methods": [
"__init__"
]
},
"parent_class": "Gemma2ForCausalLM",
"relation": "inherits",
"target_class": "Gemma3ForCausalLM"
},
{
"added": {
"methods": [
"__init__",
"forward"
]
},
"component_kind": null,
"parent_class": "Module",
"relation": "new",
"target_class": "Gemma3MultiModalProjector"
},
{
"component_kind": "model",
"overridden": {
"attrs": [
"accepts_loss_kwargs"
],
"methods": [
"__init__",
"forward",
"get_image_features"
]
},
"parent_class": "PaliGemmaModel",
"parent_model": "paligemma",
"relation": "inherits",
"target_class": "Gemma3Model"
},
{
"added": {
"attrs": [
"accepts_loss_kwargs"
]
},
"component_kind": "lm_head",
"overridden": {
"methods": [
"create_masks_for_generate",
"forward",
"prepare_inputs_for_generation"
]
},
"parent_class": "PaliGemmaForConditionalGeneration",
"parent_model": "paligemma",
"relation": "inherits",
"target_class": "Gemma3ForConditionalGeneration"
},
{
"added": {
"attrs": [
"config",
"input_modalities"
]
},
"component_kind": "head",
"parent_class": "GenericForSequenceClassification",
"relation": "new",
"target_class": "Gemma3TextForSequenceClassification"
},
{
"added": {
"methods": [
"forward"
]
},
"component_kind": "head",
"parent_class": "GenericForSequenceClassification",
"relation": "new",
"target_class": "Gemma3ForSequenceClassification"
}
],
"provenance": {
"config_class": "Gemma3Config",
"config_module": "transformers.models.gemma3.configuration_gemma3",
"model_class": "Gemma3Model",
"model_module": "transformers.models.gemma3.modeling_gemma3"
},
"repeats": [
{
"body": "encoder_layer",
"container_path_pattern": "model.vision_tower.encoder.layers",
"count": 12,
"count_expr": "12",
"count_source": "module_tree",
"id": "encoder_layers",
"index_symbol": "i",
"item_path_pattern": "model.vision_tower.encoder.layers.{i}",
"kind": "symbolic_repeat",
"provenance": {
"class_name": "SiglipEncoderLayer",
"container_path_pattern": "model.vision_tower.encoder.layers",
"item_path_pattern": "model.vision_tower.encoder.layers.{i}",
"source": "module_tree_repeat_collapse"
},
"repeated_class_name": "SiglipEncoderLayer"
},
{
"body": "decoder_layer",
"container_path_pattern": "model.language_model.layers",
"count": 26,
"count_expr": "26",
"count_source": "module_tree",
"id": "decoder_layers",
"index_symbol": "i",
"item_path_pattern": "model.language_model.layers.{i}",
"kind": "symbolic_repeat",
"provenance": {
"class_name": "Gemma3DecoderLayer",
"container_path_pattern": "model.language_model.layers",
"item_path_pattern": "model.language_model.layers.{i}",
"source": "module_tree_repeat_collapse"
},
"repeated_class_name": "Gemma3DecoderLayer"
}
],
"schema_version": "architecture-template-v0",
"templates": [
{
"children": [
"encoder_layer.layer_norm1",
"encoder_layer.self_attn",
"encoder_layer.layer_norm2",
"encoder_layer.mlp"
],
"class_name": "SiglipEncoderLayer",
"id": "encoder_layer",
"kind": "transformer_block",
"path_pattern": "model.vision_tower.encoder.layers.{i}"
},
{
"attributes": {
"norm_type": "layer"
},
"class_name": "LayerNorm",
"id": "encoder_layer.layer_norm1",
"kind": "normalization",
"path_pattern": "model.vision_tower.encoder.layers.{i}.layer_norm1"
},
{
"attributes": {
"head_dim": 64,
"n_heads": 12,
"n_kv_heads": 12,
"rope": false,
"variant": "MHA"
},
"children": [
"encoder_layer.self_attn.k_proj",
"encoder_layer.self_attn.v_proj",
"encoder_layer.self_attn.q_proj",
"encoder_layer.self_attn.out_proj"
],
"class_name": "SiglipAttention",
"id": "encoder_layer.self_attn",
"kind": "attention",
"path_pattern": "model.vision_tower.encoder.layers.{i}.self_attn"
},
{
"attributes": {
"in_features": "config.hidden_size",
"out_features": "config.hidden_size"
},
"class_name": "Linear",
"id": "encoder_layer.self_attn.k_proj",
"kind": "projection",
"path_pattern": "model.vision_tower.encoder.layers.{i}.self_attn.k_proj"
},
{
"attributes": {
"in_features": "config.hidden_size",
"out_features": "config.hidden_size"
},
"class_name": "Linear",
"id": "encoder_layer.self_attn.v_proj",
"kind": "projection",
"path_pattern": "model.vision_tower.encoder.layers.{i}.self_attn.v_proj"
},
{
"attributes": {
"in_features": "config.hidden_size",
"out_features": "config.hidden_size"
},
"class_name": "Linear",
"id": "encoder_layer.self_attn.q_proj",
"kind": "projection",
"path_pattern": "model.vision_tower.encoder.layers.{i}.self_attn.q_proj"
},
{
"attributes": {
"in_features": "config.hidden_size",
"out_features": "config.hidden_size"
},
"class_name": "Linear",
"id": "encoder_layer.self_attn.out_proj",
"kind": "projection",
"path_pattern": "model.vision_tower.encoder.layers.{i}.self_attn.out_proj"
},
{
"attributes": {
"norm_type": "layer"
},
"class_name": "LayerNorm",
"id": "encoder_layer.layer_norm2",
"kind": "normalization",
"path_pattern": "model.vision_tower.encoder.layers.{i}.layer_norm2"
},
{
"attributes": {
"activation": "gelu_pytorch_tanh",
"hidden_size": 768,
"intermediate_size": 3072
},
"children": [
"encoder_layer.mlp.activation_fn",
"encoder_layer.mlp.fc1",
"encoder_layer.mlp.fc2"
],
"class_name": "SiglipMLP",
"id": "encoder_layer.mlp",
"kind": "feed_forward",
"path_pattern": "model.vision_tower.encoder.layers.{i}.mlp"
},
{
"attributes": {
"activation": "gelu_pytorch_tanh",
"hidden_size": 768,
"intermediate_size": 3072
},
"class_name": "GELUTanh",
"id": "encoder_layer.mlp.activation_fn",
"kind": "feed_forward",
"path_pattern": "model.vision_tower.encoder.layers.{i}.mlp.activation_fn"
},
{
"attributes": {
"in_features": "config.hidden_size",
"out_features": "config.intermediate_size"
},
"class_name": "Linear",
"id": "encoder_layer.mlp.fc1",
"kind": "projection",
"path_pattern": "model.vision_tower.encoder.layers.{i}.mlp.fc1"
},
{
"attributes": {
"in_features": "config.intermediate_size",
"out_features": "config.hidden_size"
},
"class_name": "Linear",
"id": "encoder_layer.mlp.fc2",
"kind": "projection",
"path_pattern": "model.vision_tower.encoder.layers.{i}.mlp.fc2"
},
{
"children": [
"decoder_layer.self_attn",
"decoder_layer.mlp",
"decoder_layer.input_layernorm",
"decoder_layer.post_attention_layernorm",
"decoder_layer.pre_feedforward_layernorm",
"decoder_layer.post_feedforward_layernorm"
],
"class_name": "Gemma3DecoderLayer",
"id": "decoder_layer",
"kind": "transformer_block",
"path_pattern": "model.language_model.layers.{i}"
},
{
"attributes": {
"head_dim": 256,
"n_heads": 8,
"n_kv_heads": 4,
"qk_norm": true,
"rope": true,
"sliding_window": 4096,
"variant": "GQA"
},
"children": [
"decoder_layer.self_attn.q_proj",
"decoder_layer.self_attn.k_proj",
"decoder_layer.self_attn.v_proj",
"decoder_layer.self_attn.o_proj",
"decoder_layer.self_attn.q_norm",
"decoder_layer.self_attn.k_norm"
],
"class_name": "Gemma3Attention",
"id": "decoder_layer.self_attn",
"kind": "attention",
"path_pattern": "model.language_model.layers.{i}.self_attn"
},
{
"attributes": {
"in_features": "config.hidden_size",
"out_features": 2048
},
"class_name": "Linear",
"id": "decoder_layer.self_attn.q_proj",
"kind": "projection",
"path_pattern": "model.language_model.layers.{i}.self_attn.q_proj"
},
{
"attributes": {
"in_features": "config.hidden_size",
"out_features": 1024
},
"class_name": "Linear",
"id": "decoder_layer.self_attn.k_proj",
"kind": "projection",
"path_pattern": "model.language_model.layers.{i}.self_attn.k_proj"
},
{
"attributes": {
"in_features": "config.hidden_size",
"out_features": 1024
},
"class_name": "Linear",
"id": "decoder_layer.self_attn.v_proj",
"kind": "projection",
"path_pattern": "model.language_model.layers.{i}.self_attn.v_proj"
},
{
"attributes": {
"in_features": 2048,
"out_features": "config.hidden_size"
},
"class_name": "Linear",
"id": "decoder_layer.self_attn.o_proj",
"kind": "projection",
"path_pattern": "model.language_model.layers.{i}.self_attn.o_proj"
},
{
"attributes": {
"norm_type": "rms"
},
"class_name": "Gemma3RMSNorm",
"id": "decoder_layer.self_attn.q_norm",
"kind": "normalization",
"path_pattern": "model.language_model.layers.{i}.self_attn.q_norm"
},
{
"attributes": {
"norm_type": "rms"
},
"class_name": "Gemma3RMSNorm",
"id": "decoder_layer.self_attn.k_norm",
"kind": "normalization",
"path_pattern": "model.language_model.layers.{i}.self_attn.k_norm"
},
{
"attributes": {
"hidden_size": 2304,
"intermediate_size": 9216
},
"children": [
"decoder_layer.mlp.gate_proj",
"decoder_layer.mlp.up_proj",
"decoder_layer.mlp.down_proj"
],
"class_name": "Gemma3MLP",
"id": "decoder_layer.mlp",
"kind": "feed_forward",
"path_pattern": "model.language_model.layers.{i}.mlp"
},
{
"attributes": {
"in_features": "config.hidden_size",
"out_features": "config.intermediate_size"
},
"class_name": "Linear",
"id": "decoder_layer.mlp.gate_proj",
"kind": "projection",
"path_pattern": "model.language_model.layers.{i}.mlp.gate_proj"
},
{
"attributes": {
"in_features": "config.hidden_size",
"out_features": "config.intermediate_size"
},
"class_name": "Linear",
"id": "decoder_layer.mlp.up_proj",
"kind": "projection",
"path_pattern": "model.language_model.layers.{i}.mlp.up_proj"
},
{
"attributes": {
"in_features": "config.intermediate_size",
"out_features": "config.hidden_size"
},
"class_name": "Linear",
"id": "decoder_layer.mlp.down_proj",
"kind": "projection",
"path_pattern": "model.language_model.layers.{i}.mlp.down_proj"
},
{
"attributes": {
"norm_type": "rms"
},
"class_name": "Gemma3RMSNorm",
"id": "decoder_layer.input_layernorm",
"kind": "normalization",
"path_pattern": "model.language_model.layers.{i}.input_layernorm"
},
{
"attributes": {
"norm_type": "rms"
},
"class_name": "Gemma3RMSNorm",
"id": "decoder_layer.post_attention_layernorm",
"kind": "normalization",
"path_pattern": "model.language_model.layers.{i}.post_attention_layernorm"
},
{
"attributes": {
"norm_type": "rms"
},
"class_name": "Gemma3RMSNorm",
"id": "decoder_layer.pre_feedforward_layernorm",
"kind": "normalization",
"path_pattern": "model.language_model.layers.{i}.pre_feedforward_layernorm"
},
{
"attributes": {
"norm_type": "rms"
},
"class_name": "Gemma3RMSNorm",
"id": "decoder_layer.post_feedforward_layernorm",
"kind": "normalization",
"path_pattern": "model.language_model.layers.{i}.post_feedforward_layernorm"
}
]
}