← Conhecimento
Artigos Texto

LoopREAP: Loop-Aware Expert Pruning, the 512→32 Scaling Cliff, and Shared-PLE Multi-Tier MoE Deployment

Why standard T=1 REAP misses Pass-2 recurrent specialists, empirical 512→256→128→64→32 zero-shot pruning benchmarks on T=2 looped Qwen4-exp MoEs, a 2.5× zero-shot lift from T=2 REAP on 35B, and a shared-PLE architecture for consumer GPUs.

Available in English · this article has not been translated yet.

Following our Broot-65B-A6B Loop-Aware Dynamic Quantization release, we investigated a natural next question: how far can we structurally prune a T=2 recurrent-depth looped MoE (512 → 256 → 128 → 64 → 32 experts/layer) on a single 16 GB consumer GPU, and what changes when pruning is aware of the recurrent loop?


1. Motivation: Why T=1 REAP Misses Recurrent Specialists

Standard REAP (Router-weighted Expert Activation Pruning) scores each expert (l, e) during a single forward pass (T=1) by how much it moves the residual stream:

$$S^{\text{REAP}}{l,e} = \sum{t} w_{l,e}(x_t) \cdot |f_{l,e}(x_t)|_2$$

In a recurrent-depth looped MoE (T=2), however, the 16-layer recurrent core (L16–L31) executes twice per token — Pass 1 on raw early representations, and Pass 2 on already-refined hidden states modulated by the gated_workspace and router LoRA overlays (core_steps.0..15.layer.mlp.gate.lora_b).

Because Pass 2 sees a shifted activation distribution and modified router logits, Pass 2 activates a different subset of core experts than Pass 1. Pruning a 512-expert base model with T=1 statistics (as in Groot-65B) risks discarding specialists that only fire during the second reasoning pass.

LoopREAP addresses this directly:

  1. Recurrent Trace Collection (T=2 active): Collect routing dispatches with the T=2 loop adapter enabled so every L16–L31 expert accumulates saliency across both Pass 1 and Pass 2.
  2. Norm-Weighted Saliency: Multiply each expert’s T=2 routing weight by its output projection magnitude (||W_down||_F as a fast zero-rebuild proxy, or exact ||f_{l,e}(x_t)||_2).
  3. Co-Slicing All Three Artifacts: Slice the .basalt expert blobs + BF16 router gates (blk.L.ffn_gate_inp.weight), all 24 core_steps + coda router LoRA heads (ckpt_final_groot{ne}.safetensors), and the VRAM hotness profile (qwen4exp-48x{ne}.prof) with identical per-layer index maps.

2. Empirical 512 → 256 → 128 → 64 → 32 Zero-Shot Scaling Cliff

Using our 26-task programmatic evaluation suite (10 Olympiad Math, 8 Unit-Tested Python Coding, 8 BoB/Hermes Tool-Calling Harness) on a single RTX 4070 Ti SUPER (16 GB VRAM) + Ryzen 9 9950X + 64 GB DDR5 running Adamant (nixcat-dev’s fork of Basalt) with our T=2 loop-adapter patches:

StageModelExperts / LayerExperts SizeT=2 TotalMathCodeHarnessDecode tok/sStatus
Stage 0Qwen3.8-FN UD-IQ2_XS (ref)51238.8 GiB26/2610/108/88/874.3Production
Stage 0BeQwause_no_qwen4 (LoopUD-IQ2_XL)51238.8 GiB24/269/108/87/870.9Production
Stage 1Broot-65B (LoopUD-IQ4_XS)256 (1/2)29.0 GiB25/2610/108/87/858.4Production
Stage 2aBroot-NE128 (~35B-A6B, freq-only)128 (1/4)15.1 GiB2/260/100/82/883.5Open Preview
Stage 2a+Broot-NE128-REAP (T=2 REAP)128 (1/4)15.1 GiB5/261/100/84/871.6Open Preview (2.5× zero-shot lift)
Stage 2bBroot-NE64 (~20B-A6B, 100% VRAM)64 (1/8)7.5 GiB1/260/100/81/8134.1Open Preview
Stage 2cBroot-NE32 (~12B-A6B, 100% VRAM)32 (1/16)3.8 GiB0/260/100/80/8129.0Open Preview

Three Key Findings

  1. The Zero-Shot Cliff Sits Between 256 and 128: Direct weight inspection confirmed Groot-65B did zero router healing (min_cos = 0.999998, norm_ratio = 1.000000 ± 0.000005 vs. QFN-125B). At 50% pruning (512 → 256), redundancy absorbs the cut (25/26). Past 50% (256 → 128), top_k = 10 routing pulls in low-rank experts whose normalized softmax weights inject residual noise, collapsing zero-shot coding and arithmetic.
  2. T=2 REAP Delivers a 2.5× Zero-Shot Jump Over Frequency Pruning: Across 179,584 T=2 routing dispatches, expert ||W_down||_F norms varied by 10.38×. Weighting T=2 routing by ||W_down||_F swapped 39.2% (2,409 / 6,144) of the kept experts — immediately lifting NE=128 from 2/26 → 5/26 (4/8 Harness, 1/10 Olympiad Math) with zero gradient updates and only WikiText-2 calibration text.
  3. 100% VRAM Residency Unlocks 130+ tok/s Looped Inference: At NE=64 (7.5 GiB experts) and NE=32 (3.8 GiB experts), the entire MoE fits statically inside a 16 GB GPU (and even 8–12 GB GPUs for NE=32), hitting 129–134 tok/s even under T=2 recurrent looping.

3. Shared-PLE Multi-Tier Architecture (--ple-gguf)

A major practical discovery for deploying a multi-size family locally: all 5 tiers (125B, 65B, 35B, 20B, 12B) share the exact same ~27 GiB PLE n-gram lookup table (per_layer_token_embd.weight).

Because Adamant natively supports --ple-gguf FILE, a local deployment can mount one shared PLE file instead of duplicating 27 GiB per tier. The marginal footprint to add each smaller tier drops dramatically:

TierExperts (LoopUD-IQ4_XS)Experts (LoopUD-IQ3_XXS)Marginal Disk Footprint w/ Shared PLE (IQ3_XXS + Dense)
12B-A6B (NE=32)3.8 GiB2.9 GiB~4.5 GiB
20B-A6B (NE=64)7.5 GiB5.8 GiB~7.5 GiB
35B-A6B (NE=128)15.1 GiB11.7 GiB~13.5 GiB
65B-A6B (NE=256)29.0 GiB23.3 GiB~25.0 GiB

4. Next Up: Stage 3 Router Healing & Non-Uniform LoopREAP

  1. Consumer-GPU Router + Loop-LoRA Healing (Stage 3): Keep all quantized base experts frozen and mmap the PLE table (< 2.5 GB RAM); train only the 48 router gates (3.9–15.7M params) and the existing r=16 Loop-LoRA (~133M params) against rejection-sampled T=2 teacher traces from Broot-65B / BeQwause_no_qwen4. Fits comfortably on a 2-PC consumer setup (RTX 4070 Ti SUPER 16 GB healing NE=64 in parallel with RTX 5070 12 GB healing NE=32).
  2. Direct 512 → NE(layer) Non-Uniform LoopREAP: Instead of uniform pruning, retain 256 experts inside the L16–L31 loop core (where T=2 executes twice) while pruning insensitive non-loop layers (L00–L15, L32–L46) down to 64–128 experts — concentrating parameter capacity directly inside the recurrent thinking core.

License