# WebBrain-RingLoop-16B-A1.4B
> **Detailed Technical Report:** Looking for the concise overview, plain-language summary, and open-weight peer model comparisons? See the **[Main Model Card](./README.md)**.
**WebBrain-RingLoop-16B-A1.4B** transforms [`inclusionAI/Ring-mini-2.0`](https://huggingface.co/inclusionAI/Ring-mini-2.0) (16.4B total / 1.4B active MoE parameters, 20 layers) into a **depth-recurrent (looped) reasoning model** developed by **WebBrain**.
By inserting lightweight **Inkling-2-Mini–inspired zero-initialized cross-pass readers & rank-64 gated bridges** (`10.53M` trainable parameters, only **+0.064%** over the frozen base weights) around Middle Core layers `5–14` and running **2 recurrent passes** (`30` logical layers, isolated `30`-slot KV cache), `WebBrain-RingLoop-16B-A1.4B` achieves **+17.90 percentage points** average accuracy gain across core low-budget reasoning benchmarks over the stock 1-pass baseline — while strictly preserving the frozen base experts and beating a parameter-matched 1-pass LoRA control on every core split.
### Model Family (WebBrain RingLoop)
| Artifact | Format | Size / VRAM | Link |
|---|---|---:|---|
| **Lossless BF16 (Main)** | Hugging Face `bfloat16` (`trust_remote_code=True`) | ~30.3 GiB | [`webbrain-one/WebBrain-RingLoop-16B-A1.4B`](https://huggingface.co/webbrain-one/WebBrain-RingLoop-16B-A1.4B) |
| **8 GB VRAM Quantized** | Packed Group-64 NF3 Experts + INT8 Emb/LM-Head (`trust_remote_code=True`) | **7.01 GiB** (`7.31 GiB` BS=1 peak) | [`webbrain-one/WebBrain-RingLoop-16B-A1.4B-INT3`](https://huggingface.co/webbrain-one/WebBrain-RingLoop-16B-A1.4B-INT3) |
| **llama.cpp GGUF** | Native GGUF (`Q2_K` / `Q3_K_S` / `Q3_K_M` / `Q4_K_M`, [`ggml-org/llama.cpp#33298`](https://github.com/ggml-org/llama.cpp/pull/33298) `bailingmoe2_loop`) | 5.8–9.2 GiB (`6.05–9.40 GiB` total) | [`webbrain-one/WebBrain-RingLoop-16B-A1.4B-GGUF`](https://huggingface.co/webbrain-one/WebBrain-RingLoop-16B-A1.4B-GGUF) |
---
## Key Highlights
- **+17.90 pp Core Reasoning Gain (20.80% → 38.70%):** Massive low-token and zero-CoT accuracy jumps on held-out `MATH-500` and `MMLU-Pro STEM` (`+8.80 pp` MATH No-CoT, `+16.40 pp` MATH Short-192, `+30.80 pp` MMLU-Pro No-CoT, `+15.60 pp` MMLU-Pro Short-192).
- **Verified Cross-Pass Computation (Control C Ablation):** Zeroing out the cross-pass message (`msg = 0`) while keeping all trained parameters and 30 logical steps intact causes an immediate **-13.70 pp** collapse across all 4 core splits, proving the gains come from iterative inter-pass hidden-state communication.
- **Outperforms Parameter-Matched LoRA (Control A):** Beats an `r=64` 1-pass LoRA baseline (`10.81M` params trained on identical data/budget) on **4 out of 4 core splits** (**+2.90 pp** average, including **+7.60 pp** on `MATH-500 No-CoT`), without epoch-2 overfitting.
- **100% Frozen Base Weights:** Exact original weights of `Ring-mini-2.0` are preserved; setting `model.num_passes = 1` reduces identically (`0.00e+00` diff at init; `<1 pp` variance after training) to standard 20-layer execution.
---
## Architecture: How `WebBrain-RingLoop-16B-A1.4B` Differs from `Ring-mini-2.0`
1. **Prelude (Layers `0–4`, 1x, KV Slots `0–4`):** Runs once to form a clean anchor representation `h_prelude`.
2. **Looped Middle Core (Layers `5–14`, 2 Passes, KV Slots `5–24`):**
- **Pass 0 (`Slots 5–14`):** Identical to stock layers `5–14`; records intermediate output states of all 10 core layers.
- **Pass 1 (`Slots 15–24`):** Restarts cleanly from `h_prelude`. Before each layer's Attention Norm (`pre-attn`) and MLP Norm (`pre-mlp`), a **FP32 `DepthAttentionReader`** computes normalized depth-attention over all Pass 0 states, and a **zero-initialized Rank-64 `CrossPassGate`** injects:
`h_in = x + (-tanh(W_forget(h)) * x + tanh(W_gain(h)) * msg)`
3. **Coda (Layers `15–19`, 1x, KV Slots `25–29`):** Finalizes token logits without modifying `lm_head` or `word_embeddings`.
---
## Benchmark Performance
### 1. Core Reasoning & Strict Causal Controls (`MATH-500` & `MMLU-Pro STEM`, `n=250` frozen splits)
| Variant | Trainable Params | Logical Layers | `MATH-500` No-CoT | `MATH-500` Short-192 | `MMLU-Pro` No-CoT | `MMLU-Pro` Short-192 | **4-Split Avg** |
|---|---:|---:|---:|---:|---:|---:|---:|
| Stock `Ring-mini-2.0` (Phase 0) | 0 | 20 | 20.00% | 28.80% | 8.80% | 25.60% | **20.80%** |
| Phase 1 ODE Loop (Zero-Training `K=2`) | 0 | 30 | 21.60% | 28.00% | 6.80% | 21.20% | **19.40%** |
| Control B (`looped` ckpt @ `num_passes=1`) | 10.53M | 20 | 19.20% | 28.00% | 8.40% | 24.80% | **20.10%** |
| Control C (`2-pass`, `msg = 0`) | 10.53M | 30 | 20.80% | 30.00% | 23.60% | 25.60% | **25.00%** |
| Control A (1-Pass LoRA `r=64`) | 10.81M | 20 | 21.20% | 44.80% | 38.40% | 38.80% | **35.80%** |
| **`WebBrain-RingLoop-16B-A1.4B` (2-Pass)** | **10.53M** | **30** | **28.80%** | **45.20%** | **39.60%** | **41.20%** | **38.70%** |
- **Long-CoT Guard (`fullcot50`, 2048-token cap on matched `n=50` subset):** `MATH-500` **52.00%** (Stock **54.00%**), `MMLU-Pro` **78.00%** (Stock **48.00%**, **+30.00 pp**).
### 2. Inkling-2-Mini Aligned Open-Source Benchmarks (`Stock Ring-mini-2.0` vs. `WebBrain-RingLoop-16B-A1.4B`)
| Benchmark | Regime | Stock 1-Pass | `WebBrain-RingLoop` (2-Pass) | Delta | RingLoop Speed |
|---|---|---:|---:|---:|---:|
| GSM8K (n=200) | No-CoT (0 tok) | 24.50% | **31.00%** | **+6.50 pp** | 45.2 tok/s |
| GSM8K (n=200) | Short-CoT (192 cap) | 50.00% | **70.00%** | **+20.00 pp** | 64.2 tok/s |
| ARC-AGI-1 Compact (n=50) | Short-CoT (192 cap) | 6.00% | **6.00%** | **+0.00 pp** | 26.6 tok/s |
| LongBench-v2 <=3.5K (n=100) | No-CoT (0 tok) | 14.00% | **34.00%** | **+20.00 pp** | 2.5 tok/s |
| LongBench-v2 <=3.5K (n=100) | Short-CoT (192 cap) | 9.00% | **29.00%** | **+20.00 pp** | 30.0 tok/s |
| AIME 2024+2025 (n=60) | Short-CoT (192 cap) | 0.00% | **1.67%** | **+1.67 pp** | 87.5 tok/s |
| AIME 2024+2025 (n=60) | Full-CoT (2048 cap) | 13.33% | **16.67%** | **+3.34 pp** | 56.7 tok/s |
> **Evaluation Scope Note:** All benchmarks above were executed identically in-house using greedy decoding (`do_sample=False`), the official `Ring` chat template, and identical token caps (`nocot=0`, `shortcot=192`, `fullcot=2048`). Other benchmarks appearing in Inkling-2 or frontier model cards that require gated datasets (`HLE`), vision encoders (`MMMU` / image benchmarks), or multi-turn sandboxed environments (`BrowseComp`, `Terminal-Bench`, `SWE-bench`) are excluded from this text-only open-source comparison.
---
## Vertical (Looped Depth) vs. Horizontal (CoT Tokens) Scaling
We also evaluated continued `{2, 3}`-pass joint training (`phase2_23pass`). At `3` passes (`40` logical layers, `+33%` compute/KV over 2-pass), peak `MATH-500 Short-192` reached **47.60%** and `MATH Full-CoT-50` reached **64.00%**, while the 4-split average stood at **38.10%** vs. **38.70%** for the dedicated `2-pass` model. Consequently, `WebBrain-RingLoop-16B-A1.4B` ships with **`loop_num_passes = 2`** by default for the strongest speed-to-intelligence frontier (users can adjust `model.num_passes = 3` at runtime if desired).
---
## Efficiency & Learned Gate Diagnostics
- **Cross-Pass Gate Activity (`checkpoints/phase2_2pass/best.pt`):** Starting from strict zero initialization (`W_forget = 0`, `W_gain = 0`), training opens structured, asymmetric cross-pass gating across Layers `5–14` with mean active gate magnitude `mean(|tanh(W_forget)|) = 0.05469` and `mean(|tanh(W_gain)|) = 0.05819`.
---
## Quickstart (`transformers`, `trust_remote_code=True`)
```python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo_id = "webbrain-one/WebBrain-RingLoop-16B-A1.4B"
tokenizer = AutoTokenizer.from_pretrained(repo_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
repo_id,
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True,
)
prompt = (
"SYSTEMYou are Ring, an assistant created by inclusionAI"
"HUMANFind the number of positive integers n <= 100 that are divisible by 3 or 5.ASSISTANT\n"
)
inputs = tokenizer(prompt, return_tensors="pt", return_token_type_ids=False).to(model.device)
with torch.no_grad():
out = model.generate(**inputs, max_new_tokens=512, do_sample=False)
print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
```
## Acknowledgments
- Built on [`inclusionAI/Ring-mini-2.0`](https://huggingface.co/inclusionAI/Ring-mini-2.0) (Apache-2.0 / MIT compatible base release).
- Cross-pass looped adapter design inspired by [`thinkingmachines/Inkling-2-Mini`](https://huggingface.co/thinkingmachines/Inkling-2-Mini).