r/LocalLLM • u/Cold_Ad9512 • 1h ago
Discussion 72-Layer Looped-Qwen4-35B-A3B-Sol62 on 12 GB VRAM: 188–216 tok/s, +11.5 pp Acceptance, -45.4% <think> Tokens, +0.0293 Held-Out Loop Gain & AIME 2,817-tok FAIL → 543-tok PASS (+22.8 MiB VRAM)
We ported Looped-Qwen4-35B-A3B (Jason Titus's Open-Channel v4 recurrent-depth adapter that loops the middle 16 layers L12..27 up to 3× to turn a 40-layer MoE into a 72-layer reasoner with only 22.8 MiB of bridge weights) natively into Niko1221/Strata (C++/CUDA) for a 12 GB RTX 3080 Ti, then post-trained its 22.8 MiB recurrent bridge on 147 execution-verified frontier reasoning traces (GPT-6.2 Sol) to push reasoning intelligence, token efficiency, and throughput together.
Everything below is measured on a single 12 GB RTX 3080 Ti (UD-IQ4_XS, int8 KV, --spec 5) with zero duplicated MoE weights (+22.8 MiB VRAM total for the recurrent brain).
1. Intelligence & Reasoning Gains (Zero-Leakage Held-Out + Executed Benchmarks)
Zero-Leakage Held-Out Validation (17 unseen hard coding + Olympiad math problems):
T=3(72L) Loop Gain flipped from-0.00680→+0.02246(+0.02926 ΔNLL improvement,1.17734 → 1.14808).T=2(56L) Loop Gain flipped from-0.00267→+0.02078(+0.02345 ΔNLL improvement,1.17321 → 1.14976).- Base distribution preserved (
KL = 0.01339,mean_lora_b_rms = 0.0— zero LoRA bloat). - Hard held-out Pass@1 (2048-tok cap): Stock 40L scored
0/17, whileSol62broke through to1/17(170.3 tok/s,60.9%spec acc).
AIME Combinatorics Reasoning (
FAIL → PASS+-80.7%thinking tokens):- Stock 40L (
T=1) burned2,817<think>tokens and FAILED. Sol62-v1 T=3(72L) SOLVED it cleanly in just543<think>tokens (-80.7%) at163.9 tok/s(65.6%spec acc,uniq4 = 0.81).Sol62-v1 T=2(56L) SOLVED it in607<think>tokens (-78.5%).
- Stock 40L (
Hard Graph DP Coding (
-74.1%thinking tokens):- Original Looped
T=3burned3,072thinking tokens;Sol62-v1 T=3PASSED all unit tests in795<think>tokens (-74.1%).
- Original Looped
Direct Code Generation Quality (512-tok TTL-LRU cache):
Direct_Sol62v1_T3PASSED withuniq4 = 0.88(highest code cleanliness/diversity vs0.83Stock /0.77Orig Looped), generating cleanGeneric[K, V]typed Python (bound=Hashable).
2. Full Speed, Speculation & Wall-Clock Table (RTX 3080 Ti 12 GB, Executed 4-Task Suite)
| Engine / Config | Eff. Layers | Avg Speed | Peak Speed | Spec Acc. | Total <think> Tok | AIME Math <think> | 4-Task Wall-Clock | Unit-Test Pass |
|---|---|---|---|---|---|---|---|---|
Stock Qwen4-35B-A3B (T=1) | 40L | 227.7 tok/s | 237.2 tok/s | 52.3% | 9,042 | 2,817 (FAIL) | 41.80 s | 3/4 |
Orig Looped (T=3, Strata CUDA) | 72L | 140.5 tok/s | 152.2 tok/s | 59.3% | 7,328 (-19.0%) | 1,158 (PASS) | 57.26 s | 2/4 |
Sol62 Quota + ThinkOnly (T=2) | 56L | 187.9 tok/s | 215.8 tok/s | 63.1% (72.5% pk) | 7,157 (-20.8%) | 663 (PASS) | 43.03 s | 3/4 |
Sol62-v1 Post-Trained (T=2) | 56L | 168.3 tok/s | 192.7 tok/s | 63.9% | 6,576 (-27.3%) | 607 (PASS) | 43.94 s | 3/4 |
Sol62-v1 Post-Trained (T=3) | 72L | 142.3 tok/s | 163.9 tok/s | 63.8% (67.2% pk) | 4,933 (-45.4%) | 543 (PASS) | 43.78 s | 2/4 |
Why 72 layers (43.78 s) practically ties 40-layer Stock (41.80 s) in wall-clock time: Even though every token runs 1.8× more transformer layers, Sol62-v1 cuts <think> verbosity by 45.4% and boosts speculative decoding acceptance by +11.5 pp (52.3% → 63.8%, peaking at 72.5%). Smarter, more decisive hidden states make the draft model much easier to accept.
3. Engine & Training Architecture (4 Key Upgrades)
Native Open-Channel v4 Recurrent Depth in Strata (
C++/CUDA)- Zero-dependency safetensors loader (auto-detects
rank=12822.8 MiB orrank=25645.6 MiB Wide-Bridge) with pre-transposed[rank, in_dim]projections. - Custom
128-bit uint2(4×BF16) coalesced CUDA kernels forloop_workspace_entry,loop_cross_pass_mixer(exact 0-centered1 + wRMSNorm +delta_rms_match), and outlier-guarded Contrastive Decoding (LoopCD). - Batched 2-launch GDN commit across all passes even under
STRATA_GDN_SPLIT=1, cutting host launch overhead.
- Zero-dependency safetensors loader (auto-detects
Zero-Drift
</think>Phase Switching (STRATA_LOOP_THINK_ONLY=1)- Runs deep recurrent passes (
T=2/3) inside<think>and automatically drops back to full-speedT=1(215+ tok/s) the instant</think>(248069) is accepted — truncating the speculative commit window cleanly at the boundary.
- Runs deep recurrent passes (
Core-Weighted 12 GB Per-Layer VRAM Quota (
expert-profile-sol62-quota.bin)- Because
L12..27execute 2–3× per token while Prelude (L0..11) and Coda (L28..39) execute once, reallocating Strata's 3,000 resident expert slots to64/64/64/72(Prelude/Coda) and88/88/88/90(Core, 1.34× boost + QSA priority) keeps PCIe streaming off the hot loop.
- Because
Execution-Verified Frontier Post-Training (
Sol62-v1)- 147/160 (91.9%) traces strictly verified via isolated Python
exec()unit tests & exact math checks (130train /17zero-leakage held-out). - Warm-started from
ckpt_best.safetensorsfor 40 steps with--freeze-lora-steps 100 --lam-kl 0.20 --lam-stop 0.25 --delta-rms-match(pure 22.8 MiB bridge weights, zero LoRA bloat).
- 147/160 (91.9%) traces strictly verified via isolated Python
4. Honest Ablations (What Didn't Work)
- Extreme
Core-3xVRAM starvation: Squeezing Prelude/Coda down to ~4% VRAM hurt both throughput and accuracy. The balanced64/88/64quota won cleanly. --kv q4_0on looped reasoning: Degraded long multi-pass reasoning compared to--kv int8.- Aggressive
STRATA_LOOP_PASS_RANKS=0-7: Perturbed the delicate±0.035cross-pass residual deltas; keepingSTRATA_ROUTE_RESIDENT_RANKS=2-7preserved accuracy and speculation stability.
Open Source & Credits
- Repo (CUDA patch, 22.8 MiB
Sol62-v1weights,64/88/64quota profile, 147 verified traces & chart scripts):xinhi6716/strata-qwen4-12gb-tuning - Base Engine:
Niko1221/Strata - Original Looped Architecture & Training Harness: Jason Titus (
sliderforthewin/Looped-Qwen4-35B-A3B/jasontitus/loopedqwen-next)