Weights are an unmodified copy of google/diffusiongemma-26B-A4B-it.
The only difference is chat_template.jinja: thinking is on by default, without the
caller having to ask for it in the system prompt.
The stock template gates reasoning behind an enable_thinking kwarg that injects a
<|think|> marker into the system turn. This template emits that marker
unconditionally. Measured on 14 held-out prompts, 384 new tokens each:
| template | non-empty thought blocks |
|---|---|
| stock (no `< | think |
| this one (`< | think |
The model emits <|channel>thought on its own either way; the marker decides whether it
fills the channel or closes it immediately and answers. Pre-filling <|channel>thought
into the generation prompt is not a substitute — the model emits its own opener on
top of the prefilled one and duplicates the token.
DiffusionGemmaForBlockDiffusion.forward takes no labels and returns no loss, so the
training objective has to be written by hand. Following NVIDIA NeMo Automodel's
DiffusionGemma recipe,
it has two terms:
total = diffusion_CE + encoder_loss_weight * encoder_AR_CE
t ~ U(eps, 1) (there is no [MASK] token), score with CE.The AR term is not optional. A LoRA run with the diffusion term alone produced no
style transfer at all over 30 and 100 steps. Adding it (plus a fix for double-applying
the logit softcap — forward already softcaps, don't do it again) transferred cleanly:
LoRA r=16, alpha=32, lr=1.5e-4, 800 steps, attention + dense MLP on the text backbone,
MoE experts and router frozen. Trained on
sriq-ai/sriq-sft-v1.5
(compressed Simplified Chinese reasoning). Measured on 14 held-out prompts:
| base | diffusion-only, 100 steps | + AR term, 800 steps | |
|---|---|---|---|
| mean CJK of generation | 0.0% | 3.3% | 26.6% |
| rows with any CJK | 0 / 14 | 2 / 14 | 14 / 14 |
The adapter is not published. Reasoning quality under the adapter was not benchmarked — only the language shift was measured.
merge_and_unload() a LoRA adapter here. Gemma4ClippableLinear wraps the
nn.Linear; merging corrupts it. Load unmerged and generate through the PeftModel.decoder_attention_mask or it reads the block it is meant to denoise.transformers 5.11 does not expose encoder_last_hidden_state from the top-level
forward, so the AR term needs model.encoder / model.decoder called directly. 5.17
added the field.transformers build that ships the DiffusionGemma classes.model-00005-of-00011.safetensors 4.9 GBmodel-00007-of-00011.safetensors 4.9 GBmodel-00009-of-00011.safetensors 4.9 GBmodel-00003-of-00011.safetensors 4.9 GBmodel-00006-of-00011.safetensors 4.9 GBmodel-00008-of-00011.safetensors 4.9 GBmodel-00010-of-00011.safetensors 4.9 GBmodel-00004-of-00011.safetensors 4.9 GBmodel-00002-of-00011.safetensors 4.9 GBmodel-00001-of-00011.safetensors 4.7 GBmodel-00011-of-00011.safetensors 2.8 GBgoogle/diffusiongemma-26B-A4B-itHave the files? Submit a torrent.
Have the complete files and permission to share them? Replace the example folder path. The script checks the files, makes a torrent and submits its magnet and checksums. Keep your torrent client seeding. Get your community key from , and read the script before running it.
curl -fsSL https://pirateface.co/package.sh | bash -s -- --repo kaivoss/diffusiongemma-26B-A4B-it-ALWAYS-THINK ./model-folder