Downloads · 30 days
23
6% of all-time downloads
artivus-ai/DistMoE-Qwen3.5-35B-A3B
DistMoE-Qwen3.5-35B-A3B is a text generation model from artivus-ai. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
Qwen3.5-35B-A3B with the router removed. Every MoE layer's learned linear router is replaced by a key-addressed AoE gate (PEER-style): a query projection + per-expert key vectors, expert selection by dot-product simil…
Downloads · 30 days
23
6% of all-time downloads
All-time downloads
401
Public
Parameters
36B
144 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors71.9 GB · 100%
How the weights are stored.
BF1636B · 100%
From the Hugging Face model README
Qwen3.5-35B-A3B with the router removed. Every MoE layer's learned linear router is replaced by a key-addressed AoE gate (PEER-style): a query projection + per-expert key vectors, expert selection by dot-product similarity in a 128-d key space.
This revision (v0.2, "KL-repaired") ships gates plus KL-distillation-repaired weights:
the experts, attention projections, and norms have been finetuned to match the base router
model's output distribution under the new gating. The earlier gates-only conversion (base
weights byte-identical, ~45MB delta) is preserved at revision
v0-gates-only.
A router is a private lookup table: expert i only means anything inside this one checkpoint. A key-addressed gate makes every expert an addressable artifact — its address is a vector in key space, independent of the checkpoint it shipped in. That unlocks the distmoe runtime:
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
repo = "artivus-ai/DistMoE-Qwen3.5-35B-A3B"
tok = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
repo, dtype=torch.bfloat16, device_map="auto", trust_remote_code=True)
msgs = [{"role": "user", "content": "Explain mixture-of-experts in two sentences."}]
ids = tok(tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True),
return_tensors="pt").input_ids.to(model.device)
print(tok.decode(model.generate(ids, max_new_tokens=200)[0][ids.shape[1]:],
skip_special_tokens=True))
For distributed serving (backbone + streamed expert pool), see the dist-moe repo.
v0-gates-only revision (generic held-out ppl 10.68).Conversion is not free, but output-matching repair recovers most of it:
| model | generic held-out ppl |
|---|---|
| base Qwen (router) | 7.45 |
gates-only conversion (v0-gates-only) | 10.68 (+43% rel) |
| this revision (KL-repaired) | 8.46 (+13.5% rel) |
Repair progression: 10.68 → 9.97 (KL, experts) → 9.01 (wider corpus) → 8.94 (+attn/norms) → 8.46 (+creative-prose corpus coverage). The held-out criterion is creative prose — deliberately far from the original repair mixture. Generation is coherent and factual in our spot checks (greedy, chat template). Treat this as a research artifact demonstrating router-free addressability, not a drop-in replacement for base Qwen.
The config default is top_k=8, matching the base checkpoint contract. But the PPL-vs-k
curve on this conversion is U-shaped with its optimum at k=16-24 — raising k at serve
time is a free quality knob if you can afford the extra expert compute
(measured on the gates-only revision; the diffuse routing distribution that produces this
curve is unchanged by repair):
| serving k | held-out ppl (vs k=8) |
|---|---|
| 4 | +30-45% (catastrophic) |
| 8 (default) | baseline |
| 16-24 | -3 to -5% (optimum) |
| 32 | ~baseline |
| 64 | slightly worse |
model = AutoModelForCausalLM.from_pretrained(repo, trust_remote_code=True, ...)
model.config.num_experts_per_tok = 16 # or pass top_k in config overrides
Two things NOT to do (measured, they hurt):
The pool is published as individually-addressable artifacts (per-expert int4 CBOR + key vectors), split across two repos to stay under HF's per-repo file limits:
artivus-ai/DistMoE-Qwen3.5-35B-A3B-expert-pool
— base set (256/layer) + spawned creative set (4/layer)artivus-ai/DistMoE-Qwen3.5-35B-A3B-expert-pool-donors
— coder donor set (256/layer)Note: the pool currently contains the original (pre-repair) base experts — it composes
with the v0-gates-only revision. A repaired-expert pool update will follow.
model.safetensors-*.safetensors — base shards with KL-repaired experts and
attention/norm weights patched in (no longer byte-identical to base Qwen — see
v0-gates-only for that)model-aoe-gates.safetensors — the 40 repaired AoE gatesmodeling_dist_moe.py / configuration_dist_moe.py — trust_remote_code implementationv0-gates-only or the base Qwen repo.Base model: Qwen/Qwen3.5-35B-A3B (Apache-2.0). Conversion, gates, repair, and modeling code: Nous Research / Artivus (Apache-2.0).