Looped-Qwen3.8-27B & Altum: Weight-Rewriting Looped Transformers

Looped-Qwen3.8-27B (v3.1.2) retrofits frozen Qwen3.8-27B with a 62.8M-parameter (240 MB) gated workspace adapter across layers 24–39, enabling runtime-switchable T=1/2/3 latent depth and cutting <think> tokens by 53%–69%. Paired with Altum weight-rewriting insights (arXiv:2611.38273), engineers scale looped depth without hesitation collapse.
Looped-Qwen3.8-27B & Altum: Weight-Rewriting Looped Transformers: Looped-Qwen3.8-27B (v3.1.2) retrofits frozen Qwen3.8-27B with a 62.8M-parameter (240 MB) gated workspace adapter across layers 24–39, enabling runtime-switchable T=1/2/3 latent depth and cutting <think> tokens by 53%–69%. Paired with Altum weight-rewriting insights (arXiv:2611.38273), engineers scale looped depth without hesitation collapse. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.
- 0.23% Parameter Overlay: Wraps frozen layers 24..39 in a 62.8M-param (240 MB) WorkspaceEntry, CrossPassMixer, and pass-gated rank-16 LoRA.
- 53%–69% Fewer Think Tokens: LiveCodeBench v6 climbs from 72.6% (31,566 tok) to 78.9% (15,117 tok, T=3) and 85.0% (v3.1 T=2 @ 64k).
- Zero-Fork MTP Speculative Speed: Calibrated 810 MB BF16 MTP head averages 3.57 accepted tokens/round (36.7 tok/s on M5 Max, 3.7x faster H200 eval).
- Altum Weight-Rewriting Fix: Rewriting gain scaling plus 5 hesitation-token readout rows eliminates Wait/Hmm loops beyond trained depth (+72% at T=16).
import { createAgent } from '@smoke-monkey/harness';// Connect to local mlx-serve (port 11234) or vLLM (port 8000) running Looped-Qwen3.8-27Bconst loopedCoder = createAgent({agentId: 'looped-qwen38-t3-coder',provider: 'openai-compatible',model: 'Looped-Qwen3.8-27B',baseUrl: process.env.LOOPED_QWEN_URL ?? 'http://127.0.0.1:8000/v1',workspacePath: process.cwd(),permissions: {read_file: 'allow',write_file: 'allow',run_command: 'ask',},});async function solveWithLatentDepth() {const result = await loopedCoder.run('Refactor the async retry queue to prevent race conditions, write unit tests, and keep reasoning concise.');console.log('Looped T=3 output:', result.summary);}solveWithLatentDepth().catch(console.error);
Watch: Related Video Guides
Looped Transformers explained in 12min..
This New AI Architecture Makes Local Models Smarter
What Are Weight-Rewritten & Retrofitted Looped Transformers?
Looped transformers execute a shared block of decoder layers multiple times per token, trading latent recurrent depth for verbose text Chain-of-Thought. Retrofits like Looped-Qwen3.8-27B add a 240 MB gated workspace adapter to a frozen 27B backbone, while Altum (arXiv:2611.38273) uses an agent to rewrite gain and readout weights directly so models scale cleanly beyond their trained loop depth.
Historically, looping a trained model past its training depth (T > 4 on Ouro-1.4B) triggers two failures: endless hesitation loops (Wait, Hmm) that hit token caps, and accuracy decay on finished answers. Altum diagnoses these loop by loop and writes an edit to gain scaling plus five hesitation tokens in W_U, lifting relative math accuracy from +6% at T=3 to +72% at T=16 with zero extra FLOPs per token.
Benchmark Suite (n) | Qwen3.8-27B Base (T=1) | Looped T=2/T=3 (ω=0) | Best v3.1 + LoopCD-Hidden | Token Delta |
|---|---|---|---|---|
LiveCodeBench v6 (175, 80k) | 72.6% (31,566 tok) | 78.9% (15,117 tok, T=3) | `85.0%` (v3.1 T=2, n=60 @ 64k) | `-52.1%` tok |
AIME 2024 Official (30, 80k) | 93.3% (20,184 tok) | `96.7%` (9,526 tok, T=2) | 93.3% @ 24k (9,009 tok) | `-52.8%` tok |
MMLU-Pro (500, 80k) | 82.2% (4,968 tok) | 83.2% (1,580 tok, T=3) | `89.3%` (T=3 + LoopCD, n=150) | `-68.2%` tok |
MBPP+ Think (378, greedy) | 83.6% (2,254 tok) | 83.1% (707 tok, T=3) | 83.1% (ties 24k Base) | `-68.6%` tok |
GPQA Diamond (198, 80k) | 86.9% (18,655 tok) | 82.3% (4,940 tok, T=3) | 80.8% in 3.6x fewer tok | `-73.5%` tok |
Reproducible Mac (mlx-serve) & CUDA (vLLM) Commands
Deploy Looped-Qwen3.8-27B with stock mlx-serve (v26.11.4+) on Apple Silicon or via the vllm_looped_qwen38 plugin on CUDA GPUs without maintaining any engine fork.
# Option 1: Apple Silicon Mac (reuses cached Qwen3.8-27B weights, launches UI on :11234)
curl -fsSL https://raw.githubusercontent.com/jasontitus/loopedqwen/main/install_mac.sh | bash
# Option 2: NVIDIA CUDA GPUs with stock vLLM (defaults to T=3 + LoopCD omega=0.15)
pip install "git+https://github.com/jasontitus/loopedqwen.git#subdirectory=vllm_looped_qwen38"
vllm serve Qwen/Qwen3.8-27B \
--hf-overrides '{"architectures": ["LoopedQwen3_5ForCausalLM"]}' \
--dtype bfloat16 \
--max-model-len 81920 \
--port 8000Driving Variable-Depth Agents in Smoke Monkey Harness
Inside Smoke Monkey Harness, Looped-Qwen3.8-27B eliminates the multi-minute wait time of 30K-token reasoning traces during iterative coding loops. Because T=1, T=2, and T=3 are switchable at runtime without duplicating 54 GB BF16 weights, an agent coordinator can route quick file edits at T=1 and escalate architecture or test debugging to T=3 + LoopCD over the same local server.
Frequently Asked Questions
Q:How much VRAM or disk overhead does the Looped-Qwen3.8-27B adapter add?
The core gated_workspace adapter is 240 MB (62.8M parameters, 0.23% of 27B), and the optional calibrated BF16 Multi-Token Prediction drafter (model-mtp.safetensors) is 810 MB, totaling ~1.05 GB with zero base-weight duplication.
Q:Why do looped transformers degrade beyond their trained depth without Altum?
As shown in arXiv:2611.38273, looping past the trained depth triggers excessive 'Wait' and 'Hmm' hesitation tokens that exhaust token budgets, while accuracy on completed answers drops unless gain scaling and hesitation-token readout rows are adjusted.
Q:Can Looped-Qwen3.8-27B run on a 24 GB Mac?
Yes. Attaching the adapter zero-shot to Prism's 1.76-bit Ternary Bonsai 2.5 27B checkpoint runs in 12.5 GB Unified RAM with 32K context and 71.8%–79.3% MTP acceptance on a 24 GB M4 Pro Mac mini.
Q:Does vLLM require a custom fork to serve Looped-Qwen3.8-27B?
No. Installing vllm_looped_qwen38 registers via vllm.general_plugins and auto-downloads v3.1/ckpt_200.safetensors from Hugging Face on stock vLLM v0.34+.
Related Alternatives & Comparisons
Related Architecture Guides
View all guidesBest Open Source Coding Agents in 2026: Free, Local & Fully Hackable Harnesses
MCP Server Security Best Practices: Hardening Model Context Protocol Agents in 2026
Open Source Coding Agent Harness: Build a Forkable, Local AI Engineering Runtime
Build with Smoke Monkey Harness
Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.