DRV-Qwen3-1.7B-ablation-loop3-chained
Ablation. 3 passes with a different way of connecting passes: each pass reads the previous pass's output instead of returning to the block's original input.
Each pass computes h <- h + g * (block(h) - h). The loss gets steadily worse beyond 3 passes.
What this is
Qwen3-1.7B-Base, continued-pretrained for about 20B tokens (one pass over a web / PDF / code / agent-trajectory mix, 16K-token sequences, AdamW, peak LR 3e-4 with cosine decay). In the looped models, layers 8-19 (12 of the 28 layers, counting from 0) form a block that runs several times in a row with the same weights, so the model gets more computation per token without more parameters. Layers 0-7 run once before the block, layers 20-27 once after it.
How passes are connected: the first pass reads the output e of layer 7. Every later pass
reads e + g * (previous pass output - e), where g is one learned number per hidden
channel (model.loop_gate). With g = 0 the model is exactly the original Qwen3. The
ablation-loop3-chained* models connect passes differently (see their description).
Unless the description says otherwise, training also put a small loss (weight 0.0555) on the prediction made after each intermediate pass, so stopping early still gives sensible output.
Part of the Depth Recurrent Vector collection; the reference model without looping
is CharlesDDDD/DRV-Qwen3-1.7B-midtrain-noloop.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
name = "CharlesDDDD/DRV-Qwen3-1.7B-ablation-loop3-chained"
tok = AutoTokenizer.from_pretrained(name)
model = AutoModelForCausalLM.from_pretrained(name, dtype="bfloat16", trust_remote_code=True).cuda()
ids = tok("The capital of France is", return_tensors="pt").input_ids.cuda()
out = model.generate(ids, max_new_tokens=20) # trained number of passes
out = model.generate(ids, max_new_tokens=20, num_loops=4) # any other number of passes
- Requires
trust_remote_code=True(tested with transformers 5.14). Each pass keeps its own KV cache, so with 3 passes the cache is about 1.9x that of a standard Qwen3-1.7B. - vLLM and other serving engines do not support this architecture yet.
- These are base models (no instruction tuning). The HF implementation matches our training code to within 0.003 nats of loss at every number of passes.
Test loss by number of passes (trained with 3)
| passes | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|
| loss | 1.2014 | 1.1438 | 1.1236 | 1.1280 | 1.1389 | 1.1535 | 1.1709 | 1.1904 |
Held-out test set from the training data mix; lower is better. The control without looping gets 1.1460.