Why This Merge? / 为什么做这个融合?
In the 2507 update, Qwen split the 4B lineup into two separate models:
Qwen3-4B-Instruct-2507: Fast direct output, strong instruction following & tool calling, native 256K context — but occasionally over-explains or stumbles mid-derivation on multi-step logic traps.
Qwen3-4B-Thinking-2507: Strong deep reasoning — but generates mandatory, very long <think> chains (frequently >1,000 tokens even on simple JSON extraction or 3-sentence summaries).
Qwen3-4B-2507-Hybrid-SLERP bridges the two:
- Keeps direct non-thinking responses (clean
Instruct-2507 chat template, zero <think> token tax).
- Injects
Thinking-2507's reasoning circuits primarily into middle-to-deep MLP layers (peaking at t = 0.65) while anchoring embeddings, input/output attention, and final norm closer to Instruct-2507 (t = 0.20–0.25) to preserve crisp formatting, JSON strictness, native <tool_call> accuracy, and clean <|im_end|> stopping.
Merge Recipe / 融合配方
Merged in streaming bfloat16 (with f64 spherical dot/norm accumulation across all 398 tensors; verified 0 NaN, 0 Inf, 0 zero-rows, 0 norm anomalies) using zlrh merge -f merge.toml:
Table with columns: Component, Layer Depth Curve (t: 0 = Instruct, 1 = Thinking), Rationale| Component | Layer Depth Curve (t: 0 = Instruct, 1 = Thinking) | Rationale |
|---|
embed_tokens & model.norm | 0.25 | Preserve Instruct token calibration, clean stopping, and tool-call tokens |
self_attn (36 layers) | [0.20, 0.35, 0.50, 0.45, 0.25] | Clean instruction parsing at entry/exit; balanced reasoning routing in middle layers |
mlp (36 layers) | [0.30, 0.50, 0.65, 0.55, 0.35] | Concentrate Thinking's math, coding, and deductive circuits in mid-deep FFN layers |
layernorm | 0.35 | Smooth transition across blocks |
The exact reproducible configuration is included in merge.toml.
Evaluation & Benchmarks / 全面实测对比
1. 16-Task Multi-Dimensional Suite (MLX bf16, temp = 0.0, Apple M4 16GB)
Tested across 8 capability dimensions: Competition Math & Bayes Probability, Deductive & Anti-Memorization Logic, Unit-Tested Python Coding, Native <tool_call> + Restraint, IFEval 4-Constraint Formatting + Strict JSON Schema, 8K Needle-in-a-Haystack Multi-Hop Retrieval, Chinese/Systems Translation, and Multi-Turn State + Stochastic Sampling Stability (temp=0.65):
Table with columns: Model, Verified Pass Rate, 15-Task Output Tokens, Total Time (M4 bf16), Highlights| Model | Verified Pass Rate | 15-Task Output Tokens | Total Time (M4 bf16) | Highlights |
|---|
Qwen3-4B-2507-Hybrid-SLERP (Ours) | 14 / 16 (87.5%) | 5,542 tok | 515.8 s | -5.5% to -14.5% fewer tokens than Instruct; finishes CRT math cleanly (622 tok vs Instruct truncated at 768 tok); 100% pass on 8K haystack, <tool_call>, IFEval, JSON, Bayes (1/6), and LRUCache unit tests |
Qwen/Qwen3-4B-Instruct-2507 | 14 / 16 (87.5%) | 5,862 tok | 558.6 s | Truncated at 768 tok during CRT verification; 42.7% more verbose with mid-step hesitation on Chinese box-label logic puzzle |
(Both 4B models hit the same two 4B-scale boundaries: an edge case *)(* on O(n) wildcard parentheses and a subtle Gaokao-style Chinese idiom distinction.)
2. Core 6-Task Conciseness & Reasoning Benchmark (MLX bf16, temp = 0.0)
Table with columns: Model, Accuracy, Total Tokens, Total Latency, Notes| Model | Accuracy | Total Tokens | Total Latency | Notes |
|---|
Qwen3-4B-2507-Hybrid-SLERP (Ours) | 6 / 6 | 1,267 tok | 112.6 s | -14.5% fewer tokens & -19.6% faster than Instruct; crisp deduction & stronger code assert coverage |
Qwen/Qwen3-4B-Instruct-2507 | 6 / 6 | 1,482 tok | 140.0 s | Mid-derivation stumble on logic puzzle; generic SLERP definition |
Qwen/Qwen3-4B-Thinking-2507 | — (capped) | 6,144+ tok | 537.3 s | Hit 1,024-token ceiling inside <think> on all 6 prompts |
Table with columns: Metric, Throughput| Metric | Throughput |
|---|
Prompt Processing (pp512) | 342.61 ± 2.21 tok/s |
Token Generation (tg128) | 33.46 ± 0.04 tok/s |
| Cold Model Load Time | ~1.45 s |
Usage / 使用方法
Note: This model is designed for direct (non-thinking) mode using its included Instruct-2507 chat template. Do not force <think>\n prefixes.
Recommended Sampling Parameters / 推荐采样参数
temperature: 0.65
top_p: 0.85
top_k: 20
from transformers import AutoModelForCausalLM, AutoTokenizer model_id = "EEU/EEU-Qwen3-4B-2507-Hybrid-SLERP"tok = AutoTokenizer.from_pretrained(model_id)model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto", device_map="auto") messages = [{"role": "user", "content": "用三句话通俗解释什么是 SLERP 模型融合。"}]text = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)inputs = tok([text], return_tensors="pt").to(model.device)out = model.generate(**inputs, max_new_tokens=512, temperature=0.65, top_p=0.85, top_k=20)print(tok.decode(out[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
Apple Silicon (MLX)
mlx_lm.generate --model EEU/EEU-Qwen3-4B-2507-Hybrid-SLERP --prompt "Explain SLERP model merging concisely."
llama.cpp / Ollama (GGUF Q4_K_M)
llama-completion -m EEU-Qwen3-4B-2507-Hybrid-SLERP-Q4_K_M.gguf -cnv --temp 0.65 --top-p 0.85 --top-k 20
License & Credits / 许可证与致谢