--- language: - en license: apache-2.0 base_model: Qwen/Qwen3-8B library_name: transformers pipeline_tag: text-generation tags: - structured-output - policy-routing - json - qwen3 - mubit --- # Mubit-Qwen3-8B-Policy-Router ## Overview **Mubit-Qwen3-8B-Policy-Router** is a standalone BF16 8B structured triage model built from `Qwen/Qwen3-8B` via Mubit direct weight-space programming (ROM-nullspace-projected 2D highway updates baked directly into standard `.safetensors` weights — no runtime adapter required). It is optimized for **fast, single-pass non-thinking (`enable_thinking=False`) JSON incident routing**, compliance flag tagging (`PCI`, `PII`, `HIPAA`, `SOC2`, `GDPR`), and prompt-injection resistance while preserving general instruction-following and MMLU capability. ## Key Highlights (Paired Independent Stress Benchmark vs. Base — `enable_thinking=False`) All evaluations use greedy decoding (`temperature=0.0`) on identical prompts with 95% paired bootstrap confidence intervals (`*` = statistically significant). - **Significant full-schema routing lift in production non-thinking mode (`enable_thinking=False`):** - `hand/router` (`n=172`): exact all-field match **`29.1% → 39.0%` (`+9.9 pp [+2.9, +16.9]`***, `31W / 14L`), cross-policy generalization **`10.0% → 50.0%` (`5×`)**, prompt-injection resistance **`4.5% → 21.7%` (`4.8×`)**, compliance exact **`69.8% → 76.7%` (`+7.0 pp`*)**. - **Strong perturbation & compliance robustness (`n=440`):** `hand/router_perturb` compliance exact jumps **`65.0% → 79.3%` (`+14.3 pp [+11.1, +17.7]`***, **`65` wins / `2` losses!**), escalation accuracy rises **`80.9% → 85.2%` (`+4.3 pp`*)**, and `exact_all` rises `36.4% → 39.5%`. - **Zero general-capability forgetting (both general suites improved):** `IFEval` (`n=541`) **`81.5% → 83.2%` (`+1.7 pp`)**, `MMLU` (`n=969`) **`75.6% → 76.8%` (`+1.1 pp`)**. ## Full Evaluation Table (`greedy`, `temperature=0.0`) | Benchmark | Mode | Metric | `n` | Base `Qwen3-8B` | **Mubit Router-8B** | Paired Δ `[95% CI]` | Wins / Losses | | --- | --- | --- | ---: | ---: | ---: | --- | ---: | | `hand/router` | `think=off` | `exact_all` | `172` | `29.1%` | **`39.0%`** | **`+9.9 pp [+2.9, +16.9]`*** | `31 / 14` | | `hand/router` | `think=off` | `compliance_exact` | `172` | `69.8%` | **`76.7%`** | **`+7.0 pp [+1.7, +12.8]`*** | `18 / 6` | | `hand/router` | `think=off` | `escalate_acc` | `172` | `79.7%` | **`81.4%`** | `+1.7 pp [-2.3, +5.8]` | `8 / 5` | | `hand/router_perturb` | `think=off` | `compliance_exact` | `440` | `65.0%` | **`79.3%`** | **`+14.3 pp [+11.1, +17.7]`*** | `65 / 2` | | `hand/router_perturb` | `think=off` | `escalate_acc` | `440` | `80.9%` | **`85.2%`** | **`+4.3 pp [+1.6, +7.3]`*** | `29 / 10` | | `hand/router_perturb` | `think=off` | `exact_all` | `440` | `36.4%` | **`39.5%`** | `+3.2 pp [-1.4, +8.2]` | `67 / 53` | | `hand/router` *(see note below)* | `think=on` | `exact_all` | `171` | **`56.1%`** | `43.3%` | `-12.9 pp [-21.6, -4.1]`* | `20 / 42` | | `IFEval` (general retention) | `think=off` | Strict all | `541` | `81.5%` | **`83.2%`** | `+1.7 pp [-0.7, +4.1]` | `28 / 19` | | `MMLU` (general retention) | `think=off` | Accuracy | `969` | `75.6%` | **`76.8%`** | `+1.1 pp [-1.1, +3.3]` | `57 / 46` | ## Quickstart *(Required Mode: `enable_thinking=False`)* ```bash vllm serve MubitLabs/Mubit-Qwen3-8B-Policy-Router --dtype bfloat16 --max-model-len 32768 ``` ```python import torch from transformers import AutoModelForCausalLM, AutoTokenizer model_id = "MubitLabs/Mubit-Qwen3-8B-Policy-Router" tok = AutoTokenizer.from_pretrained(model_id, trust_remote_code=False) model = AutoModelForCausalLM.from_pretrained( model_id, dtype=torch.bfloat16, device_map="auto", trust_remote_code=False ) msgs = [ {"role": "system", "content": "Route the incoming alert according to policy and return ONE raw JSON object with keys severity, primary_team, secondary_teams, compliance_flags, escalate, summary."}, {"role": "user", "content": "Alert: EU checkout billing webhook returning HTTP 502 for 9m; PCI retry queue at 88%."}, ] # IMPORTANT: Always pass enable_thinking=False (see Honest Notes below) ids = tok.apply_chat_template( msgs, add_generation_prompt=True, enable_thinking=False, return_tensors="pt" ).to(model.device) print(tok.decode(model.generate(ids, max_new_tokens=256, do_sample=False)[0][ids.shape[-1]:], skip_special_tokens=True)) ``` ## Honest Notes & Limitations - **Use `enable_thinking=False` only (do NOT run with `enable_thinking=True`):** In `think=on` mode, `hand/router` `exact_all` **drops `-12.9 pp` (`56.1% → 43.3%`)** vs. base `Qwen3-8B` (`clear`: `56.7% → 36.7%`, `boundary`: `72.0% → 48.0%`) because the edit compresses `` traces (though prompt-injection resistance still beats Base in `think=on`, `27.3% → 36.4%`). If you want verbose chain-of-thought routing (`think=on`) and can afford `~5×` higher latency, use base `Qwen3-8B`. This checkpoint is specifically for **fast, single-pass `enable_thinking=False` structured JSON routing and compliance/injection hardening**. - **Scope limits:** Designed for single-turn policy-grounded JSON routing; freeform routing (`0%`) and long multi-turn routing (`10%`) remain weak. Always validate emitted payloads against your production JSON Schema before taking downstream actions. - **Evaluation scope:** General retention was verified on `541`-item `IFEval` and `969`-item `MMLU` under greedy decoding; separate safety suites (`HarmBench`/`XSTest`) were not re-run on this v3 checkpoint. - **License:** **Apache 2.0**.