Qwen3-Looped-CSA2-Engram
Collection
R=3 Depth-V2 looping, CSA2 FP4 KV, and Engram upcycling of Qwen3-0.6B-Base โ Safetensors & imatrix GGUFs for llama.cpp. โข 2 items โข Updated
amuhak/Qwen3-Looped-CSA2-Engramllama.cpp Port: amuhak/llama.cpp-qwen3-looped (branch qwen3-looped)A hybrid small language model upcycled from Qwen/Qwen3-0.6B-Base over 20B scrubbed tokens, combining:
R=3): Partitions the 28 pretrained layers into 4L Prelude + 20L Shared Core ร 3 + 4L Coda (68 effective layers, ~`1.2B effective active params) with unshared per-loop RMSNorms, per-loop residual scalars, rank-16 per-loop LoRAs (11.88M` params), input-preserving anchor mixing, and Ouro Stage II adaptive early-exit calibration (up to 2.55ร real wall-clock speedup on H200).10.67ร core KV compression): Loop 0 runs in Full mode writing packed E2M1/E4M3 group-16 FP4 KV + lightweight indexer keys (K_idx, d=64); Loops 1..2 run in Reindex mode writing 0 bytes of new global KV while issuing fresh Top-K (K=1024) sparse queries per loop.2/3-gram hash table over NFKC-canonicalized Qwen3 tokens, fetched once per token before Loop 0 and re-gated via RMSNorm dot-product + causal ShortConv inside every loop pass.Looking for ready-to-run
llama.cppGGUFs? Seeamuhak/Qwen3-Looped-CSA2-Engram-0.6B-GGUF(1.37 GBQ8_0 with0.0015mean KL /98.2%top-1 parity).
sparse_fp4 Mode, 10.67ร Core KV Compression)
Compare 6B Looped (Iso) vs. 6B Dense R=1 for pure architecture isolation at identical tokens and SFT recipe, and 20B columns for the full 20B scale-up + unified multi-turn SFT + Dr. GRPO recipe:
| Benchmark | 6B Dense R=1 | 6B Looped (Iso) | 20B Pre-RL SFT | 20B Post-RL + Ouro (this repo) |
|---|---|---|---|---|
| 8K Pretrain Val PPL (โ) | 3.5965 | 3.2126 (-10.7%) |
2.9639 | 2.9827 (-17.1%) |
HumanEval (pass@1) |
39.02% | 38.41% | 42.07% | 47.56% (+8.54%) |
MBPP (pass@1) |
41.25% | 38.52% | 48.64% | 43.97% |
BFCL v3 AST (n=400) |
25.00% | 25.00% | 61.25% | 58.50% |
| MATH-500 (No-Think, cap=1024) | 33.60% | 31.80% | โ | 34.80% (R1 33.0 โ R3 34.8%) |
| GPQA-Diamond (4-Perm Mean) | 27.53% | 30.30% | 27.65% | 29.17% (1-perm: 29.80%) |
| 8K / 16K FP4 NIAH | โ | 100% / 100% | 100% / 100% | 100% / 100% |
8K RULER (Reindex / Reuse) |
โ | 71.9% / 75.0% | 53.1% / 50.0% | 68.75% / 65.62% (+3.13%) |
R=3 (68 eff. layers, BF16): 278.5 GB / 1Msparse_fp4 Core + BF16 Prelude/Coda + K_idx: 58.4 GB / 1M (23.0 GB core KV)llama.cpp (K q8_0 + V q4_0, all 28 layers + K_idx): 49.2 GB / 1M (~`805 MB` at 16K context)This model uses a custom architecture (Qwen3LoopedCSAEngram) implemented in the companion repository (amuhak/Qwen3-Looped-CSA2-Engram):
git clone https://github.com/amuhak/Qwen3-Looped-CSA2-Engram.git
cd Qwen3-Looped-CSA2-Engram
pip install -e .
pip install fastapi uvicorn
# Download weights from Hugging Face
huggingface-cli download amuhak/Qwen3-Looped-CSA2-Engram-0.6B --local-dir ./weights
# Launch local OpenAI-compatible API + streaming Web UI
python scripts/serve_openai.py --ckpt ./weights --port 8001
L=8192. Single-needle NIAH generalizes cleanly to 16K (100%), while multi-key RULER drops at 16K/32K (15.6% / 0.0%).+5.5%), 4-perm GPQA (+1.5%), and 8K RULER (+15.6%), but lengthened <think> traces (52% hitting a 2,048-token cap on MATH-500 Think mode vs. 34.8% in matched No-Think mode).Qwen/Qwen3-0.6B-Base (Apache-2.0).Nemotron-ClimbMix, Nemotron-CC-Math-v1, Nemotron-CC-Code-v1, Nemotron-Pretraining-SFT-v1, Nemotron-Post-Training-Dataset-v2).