Qwen3-Looped-CSA2-Engram-0.6B

A hybrid small language model upcycled from Qwen/Qwen3-0.6B-Base over 20B scrubbed tokens, combining:

  1. Depth-V2 Recurrent Looping (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).
  2. Cross-Loop CSA2 + Triton Packed FP4 Global KV (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.
  3. Engram Conditional Memory (~512M params): Deterministic multi-head SplitMix64 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.cpp GGUFs? See amuhak/Qwen3-Looped-CSA2-Engram-0.6B-GGUF (1.37 GB Q8_0 with 0.0015 mean KL / 98.2% top-1 parity).


Benchmarks (Full 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%)

KV Cache Footprint (per 1M Tokens)

  • Naive Looped R=3 (68 eff. layers, BF16): 278.5 GB / 1M
  • PyTorch sparse_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)

Quickstart (PyTorch)

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

Honest Limitations

  • Multi-key retrieval past 8K: 20B Stage 2 CSA2 trained exclusively at L=8192. Single-needle NIAH generalizes cleanly to 16K (100%), while multi-key RULER drops at 16K/32K (15.6% / 0.0%).
  • GRPO chain-of-thought verbosity: Unfrozen-core Dr. GRPO boosted HumanEval (+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).

License & Attribution

  • Weights and code are released under Apache-2.0.
  • Upcycled from Qwen/Qwen3-0.6B-Base (Apache-2.0).
  • Pretraining and post-training mixtures derived from NVIDIA Nemotron open datasets (Nemotron-ClimbMix, Nemotron-CC-Math-v1, Nemotron-CC-Code-v1, Nemotron-Pretraining-SFT-v1, Nemotron-Post-Training-Dataset-v2).
Downloads last month
104
Safetensors
Model size
1B params
Tensor type
I64
ยท
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for amuhak/Qwen3-Looped-CSA2-Engram-0.6B

Finetuned
(833)
this model
Quantizations
1 model

Collection including amuhak/Qwen3-Looped-CSA2-Engram-0.6B