Architecture
~9 min readUpdated: December 2026

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

Looped Qwen3.8-27B and Altum Weight-Rewriting Looped Transformer Architecture

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.

Technical Review: Smoke Monkey Core Architecture Team
Tested on Node.js 18+ & BunTypeScript 5.x
Quick Answer & Executive Definition

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.

Key Architectural Takeaways
Quick Implementation Examplelooped-qwen-agent.ts
looped-qwen-agent.tstypescript
import { createAgent } from '@smoke-monkey/harness';
// Connect to local mlx-serve (port 11234) or vLLM (port 8000) running Looped-Qwen3.8-27B
const 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);
Video Guides

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-HiddenToken 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

Zero-Shot 1.76-Bit Ternary Bonsai & LoopCD-Hidden Scaling

Because the 62.8M-parameter v3.1 workspace adapter leaves all base weights untouched, it attaches zero-shot to 8-bit, 4-bit, and Prism's 1.76-bit Ternary Bonsai 2.5 27B (Had.1024) via liblooped_qwen38.dylib. On a 24 GB M4 Pro Mac mini, Looped Bonsai loads in 12.5 GB Unified RAM with 32K context, achieves 71.8%–79.3% MTP acceptance (+41% faster decode), and runs 6 concurrent 16K streams at 18.35 tok/s aggregate.

Pairing T=3 with LoopCD-Hidden (ω=0.15, ref='prev') adds zero extra FLOPs and zero KV cache overhead while lifting v3.1 by +3.2 pp across 314 thinking items (+15 / -5), and lowers KL divergence vs. 8-bit by -26% (0.217 -> 0.160).

Choose v3.1 Stop-Guard Checkpoint for GPQA & Long-CoT Tasks

When serving under vLLM or mlx-serve, load `v3.1/ckpt_200.safetensors` (`--lam-stop 0.50` stop-guard + token effort buckets) rather than the unguarded `v3` adapter to prevent premature termination on hard science benchmarks.

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.

bash
# 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 8000

Driving 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.

Google Search Questions & Answers

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 guides

Build with Smoke Monkey Harness

Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.

npm install smoke-monkey-harness