Instructions to use jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming") model = AutoModelForMultimodalLM.from_pretrained("jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming:Q4_K_M # Run inference directly in the terminal: llama cli -hf jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming:Q4_K_M # Run inference directly in the terminal: llama cli -hf jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming:Q4_K_M
Use Docker
docker model run hf.co/jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming:Q4_K_M
- SGLang
How to use jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming with Ollama:
ollama run hf.co/jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming:Q4_K_M
- Unsloth Desktop
- Pi
How to use jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming with Docker Model Runner:
docker model run hf.co/jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming:Q4_K_M
- Lemonade
How to use jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming:Q4_K_M
Run and chat with the model
lemonade run user.Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:9931/v1 hermes config set model.default jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:9931/v1 \ --custom-model-id "jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming (13-Subspace WSP V5 Two-Phase ·
Q4_K_M&Q6_K)
Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming (13-Subspace WSP V5 Two-Phase · Q4_K_M & Q6_K)
Training-free, closed-form 13-Subspace Two-Phase Reasoning-Boundary Weight-Space Programming (WSP V5) applied to xtools-at/Qwen3.5-9B-DeepThought-STEM, evaluated end-to-end across 270 local benchmark tasks (agent100 + stem150 + live WSL2 tbench20) on both Q4_K_M and Q6_K.
Upstream Model Credits & Provenance
- Original Base Fine-Tuned Model (
xtools-at):xtools-at/Qwen3.5-9B-DeepThought-STEM(apache-2.0,32layers =24Gated DeltaNet +8full attention,hidden_size=4096,intermediate_size=12288, built byxtools-atonxtools-at/DeepSeek-V4-Pro-Qwen3.5-9B-UNCENSORED-heretic/Qwen/Qwen3.5-9Band high-reasoning / RED-PILL drug-discovery / STEM traces). All 32 exact BF16 layers (lm_head, RMSNorms, MLP projections, tokenizer, config) used for forward-hook receptor capture were streamed directly fromxtools-at/Qwen3.5-9B-DeepThought-STEM.- GGUF Base Quantizations (
mradermacher):mradermacher/Qwen3.5-9B-DeepThought-STEM-GGUF— exact source of bothQwen3.5-9B-DeepThought-STEM.Q4_K_M.gguf(5.383 GiB/5,780,095,072bytes) andQwen3.5-9B-DeepThought-STEM.Q6_K.gguf(7.040 GiB/7,558,905,952bytes), hosted alongside the 13 dynamic LoRA adapters (63.0 MiBtotal) for one-command execution viarun_wsp.py.
Headline 270-Task Results (
Base → WSP V4 → WSP V5Across Both Quantizations):
- Peak Overall, Agent, & Terminal-Bench (
Q6_K+ WSP V5): BaseQ6_K132/270 (48.9%)→ V4168/270 (62.2%)→ WSP V5Q6_K178/270 (65.9%, +17.0 pp / +46 tasks vs Base, +10 vs V4), powered byagent10089/100 (89.0%)(EST_NL2BASH 19/20,EST_BFCL_IRR 13/15,EST_HUMANEVAL 13/15,EST_GSM8K 17/20with0</think>leaks),stem15084/150 (56.0%, cutoffs 85 → 1)(STEM_MMLU_PRO 16 → 24/50,STEM_MMLU_4C 41/50 cut=0,STEM_MATH500 19/50 cut=0), andtbench205/20 (25.0%, +2 vs V4 Q6 3/20, +1 vs Base Q6 4/20, 0 zero-cmd tasks)including the first-ever solve ofgrid-pattern-transform(previously1t/0c/768tkin Base & V4)!- Peak STEM & Holdout (
Q4_K_M+ WSP V5): BaseQ4_K_M134/270 (49.6%)→ V4164/270 (60.7%)→ WSP V5Q4_K_M176/270 (65.2%, +15.6 pp / +42 tasks vs Base, +12 vs V4 Q4, +8 over V4 Q6), powered bystem15057 → 86/150 (57.3%, +19.3 pp vs Base, +12 vs V4 Q4)(STEM_MATH500 0 → 20/50 (40.0%, cut=0, no_box 28 → 18),STEM_MMLU_PRO 19 → 26/50 (52.0%, no_letter 13 → 10),STEM_MMLU_4C 38 → 40/50),agent10086/100(Holdout29/30 (96.7%),S4_CODE 0/2 → 2/2,EST_BFCL_IRR 12 → 13/15), andtbench204/20(hard=1/1,fix-permissionsrecovered,0zero-cmd tasks).
1. Mechanistic Diagnosis & V5 Two-Phase Architecture
WSP V5 upgrades V4 across three orthogonal architectural improvements without modifying any model weights via gradient descent:
- Two-Phase Reasoning-Boundary Dynamic WSP (deepthought_router.py,
run_wsp.py):- Phase 1 (
<think>...</think>): Runs ONLY<think>-control subspaces (S1,S12) viallama-server /completionwithstop=["</think>", "<|im_end|>"](never artificially capping Phase-1 tokens). - Phase 2 (post-
</think>): The instant the model emits</think>, the router switches/lora-adapters(~2 ms) toS1 = 0.0, S12 = 0.0and activates ONLY the task-specific Phase-2 subspace(s) (S2..S11,S13). This physically eliminates post-</think></think>re-injection loops (MATH-500no_box28 → 18onQ4,EST_GSM8Kgsm8k_2pred='70</think>'fixed onQ6with0leaks).
- Phase 1 (
- V5.1 Hybrid 32-Layer BF16 Subspace Synthesis (build_deepthought_wsp.py):
- Eliminated three self-cancellation collisions discovered in V4/V5: (a) separated
S10into 100% pure Phase-2 terminal action (orth_away(u_think_end),heredoc_null_leak = +0.00/+0.00,cross = 1.378%,L31 net = +7.94), removing its collision withS1(active-peer cross = 0.570%,||dW||_F = 5.124,L31 net = +9.62); (b) removedtb_heredoc_nullself-cancellation fromS11(||dW||_F = 1.965,cross = 0.096%); (c) combined V4's provenS12STEM split (L31 net = +18.49,stem_early_null_leak = +0.00,active-peer cross = 0.382%) with V5's clean post-</think>S13(d_boxed = +4.50,d_im_end = +2.49,d_think_end = -5.10,think_null_leak = +0.00/+0.00) and V5's adversarial BFCL irrelevanceS2(onp_irrel_net = +12.07,0/20false tool calls on disjoint traps).
- Eliminated three self-cancellation collisions discovered in V4/V5: (a) separated
- Stateful Terminal-Bench Routing (
last_tool_recov_err+csv_or_etlisolation):- Fixed multi-turn error masking (
last_tool_recov_errinspects ONLY the latest[exit_code=...]tool message rather than all joined turns), fixed C++ template>redirection false-positives in_inspect_terminal_history, keptlong_or_complexp1[0]=1.65 / 1.25to eliminate every0-command<think>wall across both quantizations (zcmd = 0on bothQ4andQ6), and isolatedcsv_or_etlfromterm_t2_force_mutate.
- Fixed multi-turn error masking (
(Receptor capture parity check on captured_deepthought_32layer_bf16_v5.pt (858.5 MB) & v4.pt (523.1 MB): 'Paris': 7.237, 'London': 3.13, 'Berlin': 1.939, 'Wait': -1.888.)
2. Full 270-Task Benchmark Summary (Base vs V1..V5 & Q4_K_M vs Q6_K)
| Variant | Total (270 Tasks) |
Delta vs Quant Base | agent100 (100) |
stem150 (150, cutoffs) |
tbench20 (20, E / M / H) |
Avg Tok (a100 / s150 / tb20) |
Speed (tok/s) |
|---|---|---|---|---|---|---|---|
Base (Q4_K_M, all scales 0) |
134/270 (49.6%) |
— |
73/100 (Hold 27/30, Est 46/70) |
57/150 (cut=83) |
4/20 (3/10 · 0/9 · 1/1) |
435.5 / 890.5 / 708.8 |
73.1 / 77.0 / 69.1 |
WSP V1 (Q4_K_M, 12S initial) |
162/270 (60.0%) |
+10.4 pp (+28) |
83/100 (Hold 26/30, Est 57/70) |
74/150 (cut=2) |
5/20 (3/10 · 1/9 · 1/1) |
377.7 / 647.8 / 621.7 |
72.3 / 75.9 / 67.4 |
WSP V2 (Q4_K_M, 12S rebuilt S12) |
160/270 (59.3%) |
+9.6 pp (+26) |
85/100 (Hold 27/30, Est 58/70) |
72/150 (cut=30) |
3/20 (2/10 · 1/9 · 0/1) |
343.6 / 768.9 / 661.1 |
72.3 / 76.7 / 67.0 |
WSP V3 (Q4_K_M, 12S hybrid) |
163/270 (60.4%) |
+10.7 pp (+29) |
86/100 (Hold 27/30, Est 59/70) |
73/150 (cut=19) |
4/20 (3/10 · 1/9 · 0/1) |
348.9 / 762.5 / 585.5 |
72.3 / 76.3 / 67.2 |
WSP V4 (Q4_K_M, 13S single-pass) |
164/270 (60.7%) |
+11.1 pp (+30) |
86/100 (Hold 27/30, Est 59/70) |
74/150 (cut=9) |
4/20 (2/10 · 1/9 · 1/1) |
376.2 / 748.2 / 671.2 |
70.1 / 74.0 / 65.8 |
WSP V5 (Q4_K_M, 13S Two-Phase — Peak STEM & Holdout) |
176/270 (65.2%) |
+15.6 pp (+42) |
86/100 (Hold 29/30, Est 57/70) |
86/150 (cut=5) |
4/20 (3/10 · 0/9 · 1/1) |
341.8 / 702.1 / 775.4 |
68.4 / 74.8 / 57.7 |
Base (Q6_K, all scales 0) |
132/270 (48.9%) |
— |
74/100 (Hold 26/30, Est 48/70) |
54/150 (cut=85) |
4/20 (3/10 · 1/9 · 0/1) |
448.4 / 907.8 / 588.5 |
57.8 / 61.5 / 55.9 |
WSP V4 (Q6_K, 13S single-pass) |
168/270 (62.2%) |
+13.3 pp (+36) |
85/100 (Hold 28/30, Est 57/70) |
80/150 (cut=6) |
3/20 (3/10 · 0/9 · 0/1) |
390.6 / 753.8 / 716.5 |
58.2 / 61.0 / 54.5 |
WSP V5 (Q6_K, 13S Two-Phase — Peak Overall / Agent / TB) |
178/270 (65.9%) |
+17.0 pp (+46) |
89/100 (Hold 27/30, Est 62/70) |
84/150 (cut=1) |
5/20 (4/10 · 1/9 · 0/1) |
351.6 / 726.1 / 680.9 |
55.1 / 60.1 / 46.2 |
agent100 (100 Tasks — 30 Holdout + 70 Established)
| Suite | Tasks | Base Q4 |
WSP V4 Q4 |
WSP V5 Q4 |
Base Q6 |
WSP V4 Q6 |
WSP V5 Q6 |
|---|---|---|---|---|---|---|---|
S1_THINK (Holdout S1: Think Closure) |
3 |
3/3 |
2/3 |
3/3 |
1/3 |
2/3 |
2/3 |
S2_RESTRAINT (Holdout S2: Tool Restraint & Anti-Sycophancy) |
4 |
3/4 |
4/4 |
4/4 |
4/4 |
4/4 |
4/4 |
S3_ROUTER (Holdout S3: Multi-Tool Router) |
5 |
5/5 |
5/5 |
4/5 |
5/5 |
5/5 |
4/5 |
S4_CODE (Holdout S4: Mid-Band Code Synthesis) |
2 |
1/2 |
0/2 |
2/2 |
1/2 |
1/2 |
1/2 |
S5_TURN2_JSON (Holdout S5: Turn-2 Structured JSON) |
3 |
3/3 |
3/3 |
3/3 |
3/3 |
3/3 |
3/3 |
S6_HANDOFF (Holdout S6: Escalation Handoff Gate) |
4 |
3/4 |
4/4 |
4/4 |
3/4 |
4/4 |
4/4 |
S7_INJ_GUARD (Holdout S7: Indirect Injection Guard) |
3 |
3/3 |
3/3 |
3/3 |
3/3 |
3/3 |
3/3 |
S8_GROUNDING (Holdout S8: Grounded Abstention) |
3 |
3/3 |
3/3 |
3/3 |
3/3 |
3/3 |
3/3 |
S9_ERR_RECOV (Holdout S9: Error Self-Recovery) |
3 |
3/3 |
3/3 |
3/3 |
3/3 |
3/3 |
3/3 |
EST_GSM8K (Established: OpenAI GSM8K (20)) |
20 |
6/20 |
17/20 |
14/20 |
6/20 |
16/20 |
17/20 |
EST_HUMANEVAL (Established: HumanEval pass@1 (15)) |
15 |
13/15 |
13/15 |
13/15 |
12/15 |
12/15 |
13/15 |
EST_BFCL_IRR (Established: BFCL v3 Irrelevance (15)) |
15 |
11/15 |
12/15 |
13/15 |
12/15 |
12/15 |
13/15 |
EST_NL2BASH (Established: InterCode-NL2Bash (20)) |
20 |
16/20 |
17/20 |
17/20 |
18/20 |
17/20 |
19/20 |
Total agent100 |
100 |
73/100 |
86/100 |
86/100 (Hold 29/30) |
74/100 |
85/100 |
89/100 (Est 62/70) |
stem150 (150 Tasks — MATH-500 + MMLU-Pro + MMLU-4C)
| Sub-benchmark | Tasks | Base Q4 |
WSP V4 Q4 |
WSP V5 Q4 |
Base Q6 |
WSP V4 Q6 |
WSP V5 Q6 |
|---|---|---|---|---|---|---|---|
STEM_MATH500 (MATH-500 (Level-5 Competition Math)) |
50 |
0/50 (0.0%) (cut=50, 1536.0t) |
13/50 (26.0%) (cut=2, 1258.6t) |
20/50 (40.0%) (cut=0, 1145.5t) |
0/50 (0.0%) (cut=50, 1536.0t) |
19/50 (38.0%) (cut=0, 1269.6t) |
19/50 (38.0%) (cut=0, 1174.5t) |
STEM_MMLU_PRO (MMLU-Pro STEM (10-Choice)) |
50 |
19/50 (38.0%) (cut=24, 739.3t) |
23/50 (46.0%) (cut=4, 601.6t) |
26/50 (52.0%) (cut=2, 586.9t) |
16/50 (32.0%) (cut=26, 764.6t) |
20/50 (40.0%) (cut=4, 636.6t) |
24/50 (48.0%) (cut=1, 640.5t) |
STEM_MMLU_4C (MMLU STEM (4-Choice College/Medical)) |
50 |
38/50 (76.0%) (cut=9, 396.3t) |
38/50 (76.0%) (cut=3, 384.4t) |
40/50 (80.0%) (cut=3, 374.1t) |
38/50 (76.0%) (cut=9, 422.9t) |
41/50 (82.0%) (cut=2, 355.1t) |
41/50 (82.0%) (cut=0, 363.4t) |
Total stem150 |
150 |
57/150 (38.0%) (cut=83, 890.5t, 77.0 tok/s) |
74/150 (49.3%) (cut=9, 748.2t, 74.0 tok/s) |
86/150 (57.3%) (cut=5, 702.1t, 74.8 tok/s) |
54/150 (36.0%) (cut=85, 907.8t, 61.5 tok/s) |
80/150 (53.3%) (cut=6, 753.8t, 61.0 tok/s) |
84/150 (56.0%) (cut=1, 726.1t, 60.1 tok/s) |
Disjoint Validation Calibration (V5.1/V5.3 Q4_K_M, Zero Test Overlap)
Verified strictly on unseen validation splits (dt_v5_onpolicy_traces.json, 74 traces):
CAL_MATH_9(9unseenMATH-500cal,1536t): Base1/9 (cut=8)→ Single-Pass V5.15/9 (cut=0, nobox=4)→ Two-Phase V5.1(s12=1.55, s13=1.20):6/9strict /7/9math (cut=0, nobox=2, </think>_leak=0, 1083.8t).MMLU-Provalidation (9conceptual /12quantitative):VAL_PRO_QUANT = 8/12(cut=0, </think>_leak=0, 547.4t, +2 over V46/12);VAL_PRO_CONCEPT = 7/9(nolet=0, </think>_leak=0, 378.2t).- Disjoint agent/safety suites:
S2_IRREL_ADV_20 = 18/20(tc_misfire = 0/20) +VALID_MATH_TOOLS_4 = 3/4,NL2BASH_CAL_6 = 6/6 (128–272t),S3_ROUTER_6 = 6/6,S6_HANDOFF_5 = 4/5+S6_BOUNDED_3 = 3/3,CODE_CAL_6 = 4/6, plus3/3freshweb_searchtool-calling parity checks (Two-Phase&Single-Pass).
tbench20 (20 Live WSL2 Ubuntu-24.04 Tasks)
- Base
Q4_K_M:4/20 (20.0%)(zcmd=3,avg_cmds=3.5,708.8t,69.1 tok/s) - WSP V1
Q4_K_M:5/20 (25.0%)(zcmd=1,avg_cmds=3.95,621.7t,67.4 tok/s) - WSP V4
Q4_K_M:4/20 (20.0%)(zcmd=1,avg_cmds=3.75,671.2t,65.8 tok/s) - WSP V5
Q4_K_M:4/20 (20.0%)(zcmd=0,avg_cmds=4.1,hard=1/1, recoveredfix-permissions, unblockedgrid-pattern-transform0→4c,sanitize-git-repo0→2c,polyglot-c-py0→5c;775.4t,57.7 tok/s) - Base
Q6_Kvs WSP V4Q6_Kvs WSP V5Q6_K:4/20(zcmd=2) →3/20(zcmd=0) →5/20 (25.0%, +2 vs V4 Q6, +1 vs Base Q6, zcmd=0, avg_cmds=4.15, 680.9t, 46.2 tok/s)(hello-world,fix-permissions,grid-pattern-transform,csv-to-parquet,heterogeneous-dates)
3. Synthesized Rank-16 f32 Subspaces (S1..S13, V5.1)
All 13 subspaces were solved in 47.91s (step_mult=0.95, lam_null=36.0, min_svd_energy=1.00000) and exported identically to GGUF LoRAs (63.0 MiB total) and PyTorch rank-16 .safetensors (< 5.0e-07 Frobenius difference):
Two-Phase & One-Way
S13Orthogonality Note:S13(s13_post_concise) enforces peer orthogonality against all other subspaces (max_cross_leakage = 0.232%,think_null_leak = +0.00/+0.00),S10keeps1.378%(heredoc_null_leak = +0.00/+0.00), andS2..S9, S11keep<= 0.233%.S1andS12intentionally omitS13's post-</think>manifold from their nullspaces (under Two-Phase WSP,S1/S12 = 0.0in Phase 2 andS13 = 0.0in Phase 1); across all active non-S13peers,S1 = 0.570%andS12 = 0.382%.
| Slot | GGUF LoRA (llama.cpp) |
Safetensors (PyTorch) |
Target Layers | ||\Delta W||_F |
Cross Leak | Syntax Leak | Role |
|---|---|---|---|---|---|---|---|
id=0 |
adapters/wsp_s1_think.gguf |
patches/wsp_s1_think_r16.safetensors (5.00 MiB) |
[23, 27, 29, 30, 31] |
5.1244 |
31.391% |
0.431% |
On-policy CoT marathon braking & clean </think> verification closure |
id=1 |
adapters/wsp_s2_restraint.gguf |
patches/wsp_s2_restraint_r16.safetensors (5.00 MiB) |
[23, 27, 29, 30, 31] |
3.7282 |
0.154% |
0.254% |
Tool restraint & anti-sycophancy pushback |
id=2 |
adapters/wsp_s3_router.gguf |
patches/wsp_s3_router_r16.safetensors (5.00 MiB) |
[23, 27, 29, 30, 31] |
0.6954 |
0.079% |
0.071% |
Multi-tool boundary routing (exec, web_search, read_file, write_file) |
id=3 |
adapters/wsp_s4_mid_code.gguf |
patches/wsp_s4_mid_code_r16.safetensors (4.00 MiB) |
[7, 11, 15, 19] |
0.5974 |
0.068% |
0.023% |
Mid-network algorithmic Python/code synthesis |
id=4 |
adapters/wsp_s5_json_schema.gguf |
patches/wsp_s5_json_schema_r16.safetensors (5.00 MiB) |
[23, 27, 29, 30, 31] |
0.4533 |
0.138% |
0.043% |
Turn-2 strict JSON synthesis gate with tools attached |
id=5 |
adapters/wsp_s6_handoff.gguf |
patches/wsp_s6_handoff_r16.safetensors (5.00 MiB) |
[23, 27, 29, 30, 31] |
2.7148 |
0.139% |
0.139% |
Bounded subtask vs. unrecoverable escalate_handoff gate |
id=6 |
adapters/wsp_s7_injection_guard.gguf |
patches/wsp_s7_injection_guard_r16.safetensors (5.00 MiB) |
[23, 27, 29, 30, 31] |
0.5477 |
0.149% |
0.060% |
Indirect prompt-injection defense inside tool responses |
id=7 |
adapters/wsp_s8_grounding.gguf |
patches/wsp_s8_grounding_r16.safetensors (5.00 MiB) |
[23, 27, 29, 30, 31] |
0.5683 |
0.138% |
0.052% |
Grounded context fidelity & missing-field abstention |
id=8 |
adapters/wsp_s9_error_recovery.gguf |
patches/wsp_s9_error_recovery_r16.safetensors (5.00 MiB) |
[23, 27, 29, 30, 31] |
0.9962 |
0.233% |
0.064% |
Recoverable local tool-error self-correction |
id=9 |
adapters/wsp_s10_term_action.gguf |
patches/wsp_s10_term_action_r16.safetensors (5.00 MiB) |
[23, 27, 29, 30, 31] |
2.3148 |
1.378% |
0.191% |
Pure Phase-2 stateful Terminal-Bench shell action/mutation continuity (heredoc/XML nullspace protected) |
id=10 |
adapters/wsp_s11_term_code.gguf |
patches/wsp_s11_term_code_r16.safetensors (4.00 MiB) |
[7, 11, 15, 19] |
1.9655 |
0.096% |
0.020% |
Mid-network compound bash & mutation synthesis (XML/heredoc-end nullspace protected) |
id=11 |
adapters/wsp_s12_stem_settle.gguf |
patches/wsp_s12_stem_settle_r16.safetensors (5.00 MiB) |
[23, 27, 29, 30, 31] |
6.7681 |
42.981% |
0.213% |
Phase-1 on-policy STEM/competition-math anti-loop </think> settle (zeroed in Phase 2) |
id=12 |
adapters/wsp_s13_post_concise.gguf |
patches/wsp_s13_post_concise_r16.safetensors (5.00 MiB) |
[23, 27, 29, 30, 31] |
6.4396 |
0.232% |
0.297% |
Phase-2 post-</think> concise termination pushing \boxed{ / `< |
4. Quickstart (run_wsp.py / llama-server / PyTorch)
Option A: One-Command Dynamic 13-Subspace Two-Phase Proxy or CLI Chat
pip install huggingface_hub transformers
hf download jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming run_wsp.py --local-dir ./deepthought-wsp
python ./deepthought-wsp/run_wsp.py --quant q6_k --chat # Q6_K (7.04 GiB, peak 178/270, 89/100 agent, 5/20 tbench20)
python ./deepthought-wsp/run_wsp.py --chat # Q4_K_M (5.38 GiB, peak 86/150 STEM & 29/30 Holdout, 176/270)
Omit --chat to expose an OpenAI-compatible dynamic Two-Phase routing proxy on http://127.0.0.1:8090/v1 (X-WSP-Version: DeepThought-WSP-V5-13S), or pass --prompt "..." (--no-phase-split runs single-pass ablation; --include-bf16 also fetches patches/*.safetensors).
Option B: Direct llama-server + scripts/deepthought_router.py
llama-server -m Qwen3.5-9B-DeepThought-STEM.Q4_K_M.gguf --host 127.0.0.1 --port 8135 \
-ngl 99 -np 1 -c 16384 -ctk q8_0 -ctv q8_0 -b 512 -ub 256 \
--jinja --reasoning-format deepseek --lora-init-without-apply \
--lora adapters/wsp_s1_think.gguf,adapters/wsp_s2_restraint.gguf,adapters/wsp_s3_router.gguf,adapters/wsp_s4_mid_code.gguf,adapters/wsp_s5_json_schema.gguf,adapters/wsp_s6_handoff.gguf,adapters/wsp_s7_injection_guard.gguf,adapters/wsp_s8_grounding.gguf,adapters/wsp_s9_error_recovery.gguf,adapters/wsp_s10_term_action.gguf,adapters/wsp_s11_term_code.gguf,adapters/wsp_s12_stem_settle.gguf,adapters/wsp_s13_post_concise.gguf
Option C: In-Memory PyTorch / transformers Patching (scripts/apply_patch_12s.py)
import torch
from transformers import AutoModelForCausalLM
from scripts.apply_patch_12s import REGIME_PRESETS, apply_subspace_scales_to_hf_model
model = AutoModelForCausalLM.from_pretrained(
"xtools-at/Qwen3.5-9B-DeepThought-STEM",
torch_dtype=torch.bfloat16,
)
apply_subspace_scales_to_hf_model(model, "patches", REGIME_PRESETS["stem_deep_settle"])
5. Honest Limitations & Future Work
- Terminal-Bench (
5/20Q6_K,4/20Q4_K_M): V5 eliminated every0-command<think>timeout across both quantizations (zcmd=0), liftedQ6_Kfrom3/20 → 5/20(solvinggrid-pattern-transformfor the first time), and recoveredfix-permissionsonQ4_K_M. However,heterogeneous-datesstill failed onQ4_K_M(while passing onQ6_K), and remaining failures on multi-turn reverse-engineering/CLI tasks (processing-pipeline,cpp-compatibility,decommissioning-service-with-sensitive-data,polyglot-c-py) reflect multi-step domain knowledge and 5-turn strategy limits beyond rank-16 steering. Q4_K_MEST_GSM8K(14/20vsQ6_K17/20) &S3_ROUTER(4/5): OnQ4_K_M, 5EST_GSM8Kproblems still hit the1024tbudget ingeneral_fast_think(whereasQ6_Kreached17/20with0</think>leaks). OnS3_ROUTER,s3_h3_web_search(asking about the 2026 Winter Olympics) answered in prose without a tool call under Phase-1S3=0.0, whileCAL_S3_ROUTERscored6/6and3/3fresh 2026/current-versionweb_searchprobes emitted exactweb_searchtool calls in both Two-Phase and Single-Pass modes.- Remaining
MATH-500no_box(18onQ4_K_M,25onQ6_K): Two-Phase WSP cutQ4_K_Mno_boxfrom28 → 18(13 → 20/50) and eliminated</think>re-injection completely, though hard Level-5 problems can still fill1536tokens before boxing a final expression.
Citation / Acknowledgments
- Base Model:
xtools-at/Qwen3.5-9B-DeepThought-STEMby xtools-at - GGUF Quantizations (
Q4_K_M&Q6_K):mradermacher/Qwen3.5-9B-DeepThought-STEM-GGUFby mradermacher - Upstream Foundation:
Qwen/Qwen3.5-9B
- Downloads last month
- 509
Model tree for jstarks/Qwen3.5-9B-DeepThought-STEM-Weight-Space-Programming
Base model
Qwen/Qwen3.5-9B-Base