LoopRes-Qwen3-1.7B
Paper (arXiv) · Code · Dataset
A looped transformer on Qwen3-1.7B-Base. LoopRes applies a block of decoder layers several loop steps per token: a prelude runs once, the core layers loop under block attention residuals whose sources carry trained static keys, read through learned loop and content keys, and a coda reads the last step out. This checkpoint runs 3 loop steps over layers 7-21 in 2 blocks of 7, each read reaching the previous step's blocks, and was trained for 12,000 steps at 16k tokens on the Qwen3-8B replies of LoopRes-Qwen3-SFT.
Use
The checkpoint loads through the LoopRes repository's loopres package (pip install -e . there), which
registers the loopres model type with transformers:
import loopres # registers LoopResForCausalLM; without it the config's model type is unknown
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("oahzxl/LoopRes-Qwen3-1.7B", dtype="auto").cuda().eval()
tokenizer = AutoTokenizer.from_pretrained("oahzxl/LoopRes-Qwen3-1.7B")
text = tokenizer.apply_chat_template(
[{"role": "user", "content": "What is the remainder when $2^{2024}$ is divided by $7$?"}],
tokenize=False, add_generation_prompt=True, enable_thinking=True,
)
inputs = tokenizer(text, add_special_tokens=False, return_tensors="pt").to(model.device)
print(tokenizer.decode(model.generate(
**inputs, do_sample=True, temperature=0.6, top_p=0.95, top_k=20, max_new_tokens=32768,
)[0, inputs.input_ids.shape[1]:]))
Scores
At 32,768 new tokens, temperature 0.6, top-p 0.95, top-k 20; math benchmarks through math_verify,
HumanEval+ / MBPP+ pass@1 through EvalPlus. SFT is Qwen3-1.7B-Base trained on the same data at one step.
| benchmark | samples | SFT | LoopRes |
|---|---|---|---|
| AIME 2025 | 16 | 13.8 | 26.9 |
| AIME 2026 | 16 | 10.8 | 21.7 |
| AMC 2023 | 16 | 46.7 | 61.3 |
| OlympiadBench | 1 | 43.6 | 53.0 |
| MATH-500 | 1 | 73.8 | 82.2 |
| HumanEval+ (base/plus) | 4 | 62.7 / 57.6 | 75.5 / 71.2 |
| MBPP+ (base/plus) | 2 | 64.4 / 55.4 | 79.4 / 67.3 |