CoolFace
Modelpublic

XpressAI/Qwen3.5-9B-RYS-UD-Q4_K_XL-GGUF

sourceHugging Faceapache-2.0updated 6mo agoView on Hugging Face
3likes199downloads
Model Card

Qwen3.5-9B — RYS Layer Surgery (GGUF)

Two modified versions of Qwen3.5-9B-Instruct produced by RYS layer duplication — no training, no weight changes, just routing hidden states through a specific circuit twice.

Based on David Ng's RYS method.


Files

FileLayersSize
Qwen3.5-9B-UD-Q4_K_XL.gguf325.6 GiB
Qwen3.5-9B-rys_22-25-UD-Q4_K_XL.gguf36~6.3 GiB
Qwen3.5-9B-rys_6-9_eq-UD-Q4_K_XL.gguf36~6.3 GiB

Probe scores

Scores from an internal sweep benchmark run during circuit search. Sample sizes are small — treat these as directional indicators, not definitive benchmarks.

ModelMathEQReasoning
Base (32 layers)0.5635.50.235
rys_22-25 (36 layers)0.1880.00.529
rys6-9eq (36 layers)0.36924.00.353
  • —Math: Ng's partial-credit scoring on a small GSM8K sample
  • —EQ: EQ-Bench-style emotional intelligence score (0–100)
  • —Reasoning: fraction correct across causal, date, logic, navigation, and GSM8K probes

rys22-25 more than doubles baseline reasoning (0.529 vs 0.235), with GSM8K rising from 0.2 to 0.8. rys6-9_eq raises EQ from 5.5 to 24.0 and also improves reasoning above baseline, at some cost to math.


What is RYS?

Transformers self-organise during training into functional circuits — contiguous blocks of layers that act together. The RYS technique duplicates a specific block in the forward pass using the same weights, with no extra copies on disk beyond the GGUF file overhead:

Normal:    0 → … → 21 → 22 → 23 → 24 → 25 → 26 → … → 31
rys_22-25: 0 → … → 21 → 22 → 23 → 24 → 25
                         → 22 → 23 → 24 → 25 → 26 → … → 31

The model processes the circuit twice, without any weight changes or fine-tuning.


Hybrid Mamba/attention architecture constraint

Qwen3.5-9B is a hybrid SSM/attention model (full_attention_interval = 4): full attention every 4th layer, Gated DeltaNet SSM everywhere else. The architecture repeats 8 times:

3 × (DeltaNet → FFN) → 1 × (Attention → FFN)

This creates a hard constraint on layer surgery: the total layer count must remain divisible by 4.

  • —Block size 4 → 32 + 4 = 36 layers (36 ÷ 4 = 9 ✓)
  • —Block size 8 → 32 + 8 = 40 layers (40 ÷ 4 = 10 ✓)
  • —Block size 3 → 32 + 3 = 35 layers (35 ÷ 4 = 8.75 ✗ → crash)

How the circuit was found

A two-pass sweep over the 32-layer model:

Pass 1 — 8-layer blocks, stride 4, layers 0–28:

  • —(8, 16) identified as hot zone: reasoning=0.412

Pass 2 — 4-layer blocks, stride 1, layers 4–28:

  • —(22, 26) best reasoning: reasoning=0.529, GSM8K=0.80
  • —(6, 10) best EQ: EQ=24.0, reasoning=0.353

Each configuration was tested by patching the GGUF layer path, loading with llama-server, and scoring with the probe suite.


Usage

llama.cpp / llama-server

bash
# Best reasoning
llama-server -m Qwen3.5-9B-rys_22-25-UD-Q4_K_XL.gguf -ngl 99 --port 8080

# Best EQ
llama-server -m Qwen3.5-9B-rys_6-9_eq-UD-Q4_K_XL.gguf -ngl 99 --port 8080

Thinking mode

Qwen3.5 defaults to thinking mode (<think>…</think>). Add /no_think to the system prompt for fast, direct answers:

python
messages = [
    {"role": "system", "content": "/no_think"},
    {"role": "user",   "content": "Your question here"}
]

VRAM requirements

Model weights are ~6.3 GiB (Q4KXL, 36 layers). Runs on any modern GPU or CPU.


Credits

License

Apache 2.0 (inherited from base model)