Loop adapter for any model: give any transformer recurrent depth by running its middle layers again — with a small trained adapter, base weights frozen.
A transformer gets one trip through its layers per token. Looping reuses the middle layers for a second (or third) pass with the same weights, so a token gets more sequential reasoning without more parameters and without writing more chain-of-thought tokens.
What it buys (shown on DeepSeek-V4.1-Flash with a 132 MB adapter): more accuracy on reasoning tasks, fewer thinking tokens, faster answers — trained on a single 96 GB GPU for under $50.
Works for reasoning: code, math, multi-step lookup, agentic tasks. Does not add knowledge — looping cannot make a model know more than its weights store. Knowledge and factual recall do not benefit.
- Pick a model, a task family, and an automatic verifier (unit tests for code, reference answers for math).
- Let the base model sample many solutions per problem.
- Keep only the ones the verifier accepts (rejection sampling); prefer shorter thinking traces.
- Train a small loop adapter on the kept traces, base frozen.
- Evaluate on held-out problems and compare against the unlooped base — same task set, same scoring.
- Thinking Machines, Inkling 2 Mini — looped transformer, middle 12 of 24 layers run 3 times.
- Z.ai, GLM-5.4 — 28 layers looped twice, converted from a pre-trained base via continued training.
- jasontitus/dsv41-loop-eval — 132 MB loop adapter on DeepSeek-V4.1-Flash, LiveCodeBench gains with 27% fewer thinking tokens.
loop_anything/— Python package:loop.py(pass scheduling),adapter.py(adapter layout),data/(sample / verify / filter),train/(adapter training),eval/(held-out eval),serve/(inference-side loop support, e.g. vLLM plugin).configs/models/— per-model loop configs (prelude/core/coda split, passes).configs/tasks/— per-task configs (problem source, verifier, eval split).data/— generated data (not committed).adapters/— trained adapter registry (configs + reports, weights on HF).benchmarks/— eval harnesses and results.docs/— design, data recipe, training, evaluation.examples/,scripts/,tests/— TBD with the first implementation.- Repo conventions in
AGENTS.md. Docs layout follows yetone/magpie (docs/guides +docs/subsystems/one doc per subsystem); issue templates and CI under.github/.
Empty skeleton. Roadmap and first target model TBD.