Regenerate tiny gemma4 from google/gemma-4-E2B-it with non-degenerate outputs
Browse filesRebuilt with wider output-side initialization (std=0.2 on embed_tokens, embed_tokens_per_layer and the vision/audio embedding projections) so the logits no longer sit near a constant vector.
Measured on an image+text prompt, previous revision -> this one:
logit std 0.113 -> 1.130
min per-position std 0.113 -> 1.126
distinct argmax positions 24/273 -> 65/273
sensitivity to the image 0.060 -> 4.66
NaN / Inf 0 / 0 -> 0 / 0
Config fixes toward the original architecture: num_key_value_heads 2->1 (the original is multi-query), text global_head_dim 8->16 (the original keeps head_dim != global_head_dim), vision global_head_dim 64->8 (was left at the full-size value while head_dim was 8), hidden_size_per_layer_input 1->4, vision default_output_length 70->280.
model_type, architectures, sub-config types, special token ids, vocab_size and the layer counts (text 3 / vision 1 / audio 1) are unchanged, so the expected INT8 node counts in tests/openvino/utils_tests.py still hold.
Validated under ONEDNN_MAX_CPU_ISA=AVX2 (the CI runners' ISA): OpenVINO export, forward and generate all pass, and 6/6 gemma4 tests in test_seq2seq.py + test_quantization.py pass.
Files changed (5)
65 unmodified lines666768696970717273737475768 unmodified lines858687888889909118 unmodified lines1101111121131131141151161 unmodified line11811912012112112212312312412512665 unmodified lines "eos_token_id": 1, "expert_intermediate_size": null, "final_logit_softcapping": 30.0, "global_head_dim": 8, "global_head_dim": 16, "head_dim": 8, "hidden_activation": "gelu_pytorch_tanh", "hidden_size": 32, "hidden_size_per_layer_input": 1, "hidden_size_per_layer_input": 4, "initializer_range": 0.02, "intermediate_size": 64, "layer_types": [8 unmodified lines "num_experts": null, "num_global_key_value_heads": null, "num_hidden_layers": 3, "num_key_value_heads": 2, "num_key_value_heads": 1, "num_kv_shared_layers": 1, "pad_token_id": 0, "rms_norm_eps": 1e-06,18 unmodified lines "vocab_size_per_layer_input": 262144 }, "tie_word_embeddings": true, "transformers_version": "5.5.0", "transformers_version": "5.5.4", "video_token_id": 258884, "vision_config": { "_name_or_path": "",1 unmodified line "attention_bias": false, "attention_dropout": 0.0, "chunk_size_feed_forward": 0, "default_output_length": 70, "default_output_length": 280, "dtype": "float32", "global_head_dim": 64, "global_head_dim": 8, "head_dim": 8, "hidden_activation": "gelu_pytorch_tanh", "hidden_size": 32,7 unmodified lines8910111112137 unmodified lines "output_attentions": false, "output_hidden_states": false, "pad_token_id": 0, "transformers_version": "5.5.0", "transformers_version": "5.5.4", "use_cache": true}12323version https://git-lfs.github.com/spec/v1oid sha256:c2645ac53c3989c11a75141407c3016e1c732a38eb306ea75fb9b53d7b64b191size 40017352oid sha256:3f9988219ad792099f3cb4350a70e107f80d5804d75d4b56208fc8f7b2d9852esize 4946794812 unmodified lines131415161617181912 unmodified lines "max_frequency": 8000.0, "mel_floor": 0.001, "min_frequency": 0.0, "padding_side": "left", "padding_side": "right", "padding_value": 0.0, "per_bin_mean": null, "per_bin_stddev": null,136 unmodified lines137138139140140141136 unmodified lines "str_token": "<|tool_response>", "think_token": "<|think|>", "tokenizer_class": "GemmaTokenizer", "truncation_side": "left", "unk_token": "<unk>"}