I finished upcycling of gemma4-12B
Summary
Solon-MoE-22B-A17B is a sparse Mixture-of-Experts model upcycled from Gemma4-12B-IT, with 22B total parameters and 17B active, preserving the original dense model for flexible inference and training.
View Cached Full Text
Cached at: 09/01/26, 01:07 PM
TOTORONG/Solon_MOE_22B_A17B · Hugging Face
Source: https://huggingface.co/TOTORONG/Solon_MOE_22B_A17B
https://huggingface.co/TOTORONG/Solon_MOE_22B_A17B#solon-moe-22b-a17bSolon-MoE-22B-A17B
A sparse Mixture-of-Experts upcycled from Gemma4-12B-IT— 22B total / ~17B active parameters, with the original dense model fully preserved as a shared path.
Solon-MoE converts 15 of Gemma4’s 48 decoder layers (L18–L34, excluding 23 & 29) into MoE layers using thenative transformers Gemma4 MoE block, applied selectively per layer. Each MoE layer adds 4 experts (initialized from the layer’s dense FFN) with top-2 routing, runningin parallelwith the preserved dense FFN. A learnable per-layer scale λ (post\_feedforward\_layernorm\_2) gates the routed contribution — setting λ=0 exactly recovers the original dense model, which makes λ both a safety knob and a diagnostic tool.
Base modelgoogle/gemma4-12b-itArchitectureSolonMoEForCausalLM(57-line shim over native Gemma4)MoE layers15 of 48 (L18–22, 24–28, 30–34)Experts / top-k4 / 2 (softmax → top-k → renormalize → per-expert scale)Expert weightspacked 3D:gate\_up\_proj \[4, 30720, 3840\],down\_proj \[4, 3840, 15360\]λ conventiontrained at 0.15,served at 0.10Reasoningthought-channel chat template (`<EOT token`<turn
https://huggingface.co/TOTORONG/Solon_MOE_22B_A17B#quickstart-transformersQuickstart (transformers)
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
m = "your-org/solon-moe-22b-a17b"
tok = AutoTokenizer.from_pretrained(m, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
m, dtype=torch.bfloat16, trust_remote_code=True, device_map="auto").eval()
text = tok.apply_chat_template(
[{"role": "user", "content": "If a train covers 240 km, ..."}],
add_generation_prompt=True, tokenize=False)
ids = tok(text, return_tensors="pt", add_special_tokens=False).input_ids.to(model.device)
out = model.generate(ids, max_new_tokens=2048, do_sample=False,
eos_token_id=tok.convert_tokens_to_ids("<turn|>"))
print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=False))
Always pass the EOT token (
<turn\|\>, id 106) as EOS— viaeos\_token\_idhere, viageneration\_config\.jsonfor servers, or viastop\_token\_ids: \[106\]in vLLM requests. Without it the model’s turn-end signal is ignored and generation degenerates into repetition.
https://huggingface.co/TOTORONG/Solon_MOE_22B_A17B#serving-vllmServing (vLLM)
vLLM ships a native Gemma4 implementation including the MoE block; Solon-MoE only needs a thin plugin that makes the MoE flag per-layer. Seevllm/in this repo:
pip install -e vllm/ # registers SolonMoEForCausalLM via entry point
SOLON_LAMBDA=0.10 vllm serve your-org/solon-moe-22b-a17b \
--trust-remote-code --max-model-len 8192 \
--max-num-seqs 32 --attention-backend TRITON_ATTN
SOLON\_LAMBDA=0\.10applies the inference-time λ at load (no checkpoint copy needed). On Blackwell (sm120) use\-\-attention\-backend TRITON\_ATTN; the FlashInfer decode kernel does not support this head configuration.
https://huggingface.co/TOTORONG/Solon_MOE_22B_A17B#training-your-ownTraining your own
axolotl/contains a ready-to-adapt QLoRA config with a reasoning (thought-channel) chat template, plus documentation for opening/closing the router and experts independently.scripts/contains the Gemma4 → Solon-MoE structure converter and the LoRA merge tool. SeeUSAGE.mdfor the full pipeline: convert → train → merge → serve.
https://huggingface.co/TOTORONG/Solon_MOE_22B_A17B#results-internal-evaluation-n50-per-subjectResults (internal evaluation, n=50 per subject)
After CoT training (260k Korean/English reasoning samples, experts + router, dense frozen), Solon-MoEexceeds the original dense modelon three Korean legal-reasoning benchmarks while remaining statistically indistinguishable on GPQA-diamond (paired McNemar):
Benchmark (KMMLU-Hard, CoT)Solon-MoEGemma4-12B-ITlaw0.380.32patent0.360.32criminal law0.320.30GPQA-diamond (English)0.560.64 (p=0.45, n.s.) Notable training-dynamics findings: adaptation concentrates in deep MoE layers (norm, effective rank, and orthogonality all increase with depth); per-expert learned updates are near-orthogonal (mean pairwise cos ≈ 0.01–0.09), evidence of parameter-space expert differentiation; router rewiring localizes to deep layers while mid-band routing is preserved.
https://huggingface.co/TOTORONG/Solon_MOE_22B_A17B#limitationsLimitations
- Korean taxation prompts can occasionally produce runaway generations (~12% at n=50); a stability-replay fine-tune is the known mitigation.
- λ > 0.10 at inference degrades quality; keep the 0.10 convention.
- Requires
trust\_remote\_code=True(57-line architecture shim).
https://huggingface.co/TOTORONG/Solon_MOE_22B_A17B#licenseLicense
Inherits the Gemma license and usage terms from the base model. The conversion and training code in this repository is released under Apache-2.0.
Similar Articles
Mutating Gemma 4 31B Dense in to a native Gemma 4 additive-MoE model
A proof-of-concept training script enables converting Gemma 4 31B dense model into an additive-MoE architecture, inspired by a Korean-specific finetune from JDONE-Research.
Rebuilding Gemma 4 31b... better... As 26b...
A developer is rebuilding Gemma 4 31b into a smaller 26b model by removing weak SWA layers, adding attention-based residual networks (from Moonshot), and using topK logit targets for retraining, aiming for better long context and performance.
unsloth/gemma-4-26B-A4B-it-GGUF
Unsloth releases GGUF-quantized versions of Google DeepMind's Gemma 4 26B A4B instruction-tuned model, enabling efficient local inference with support for tool-calling and fine-tuning via Unsloth Studio. Gemma 4 is a multimodal MoE model with a 256K context window, supporting text, image, video, and audio inputs.
I ran an experiment on the 30b class of gemma4 and qwen3.5 models to try to learn about energy cost and performance tradeoffs. In other words, which models use more energy to give the same answer quality?
Empirical study on four 30B-class dense and MoE models showing Gemma-4 26B MoE delivers equal accuracy at 1.9–15 Wh while dense and larger MoE variants consume up to 34 Wh for the same reasoning tasks.
Gemma 2B multimodal model matches larger models without encoder
Google's Gemma 4 12B introduces an encoder-free multimodal architecture that competes with larger models, though benchmark comparisons show it trailing Qwen 2.5 9B on most tasks. The article also covers related developments including open-weight model security risks, Uber's Claude Code spending caps, and NeurIPS's misuse of an uncalibrated AI detector.