Skip to content
Osaurus
Blog

LoopCD: A Smarter Model Without Training It

Researchers at Apple found a way to make looped models decode better with no retraining. It ships in Osaurus 1.0.15 for Inkling 2 Mini. Here is how it works, with live demos and every run we measured.

Same model. Same prompt. Same seed. One switch.

Below are two runs of Inkling 2 Mini on a Mac, each asked to build a 3D crystal world as a single HTML file. The only difference between them is a decoding technique called LoopCD. Press run: these are the model's actual outputs, running in your browser.

Same prompt · same seed · one switch

Low-poly floating crystal world

LoopCD off11,458 tokens · 129 tok/s

Crashes on load. The controls draw, the world never does.

LoopCD on10,430 tokens · 122 tok/s

Runs clean: a spinning faceted island with orbiting moonlets, in 1,028 fewer tokens.

The prompt and settings

Build a single self-contained HTML file (inline CSS/JS, no external libraries or CDNs, filling 100vw x 100vh) rendering a true 3D perspective-projected low-poly faceted floating crystal world on Canvas2D with back-face culling, painter's depth sorting, directional Lambert + specular triangle shading, faceted oceans/mountains/snow peaks/pine cones, an orbiting ring of faceted glowing moonlets, starfield parallax, gentle auto-orbit plus mouse drag, and Lighting / Wireframe controls.

Model
Inkling 2 Mini (JANGHT4.2) + DFlash2 drafter
Seed
777
Reasoning effort
low
Max tokens
32,768
Sampling
Bundle defaults, temperature 1.0
Machine
M5 Ultra, Osaurus 1.0.15

Nothing about the model changed between those runs. Same weights, same prompt, same sampling settings. What changed is how Osaurus reads the model's answer while it is still working on it.

That is the point of this post: a harness can make a model smarter without training it. We think this is where local AI gets interesting. When the model runs on your Mac, the software around it can reach inside the inference loop and do things a hosted API never lets you do.

One caveat up front. That pair is one of the best we saw. Further down we show all 40 pairs we ran, including the ones where LoopCD made things worse.

What a looped model is

Most language models are a tall stack of distinct layers. A token's representation passes up through each layer once and comes out the top as a prediction.

A looped transformer reuses one block several times. A short prelude reads the input, a shared block runs over the representation again and again, and a short coda turns the result into a next-token prediction. More loops means more computation per token without more weights. Inkling 2 Mini is built this way.

Because every loop uses the same block in the same representation space, you can read a prediction out after any loop, not only the last. Step through an example:

Illustrative · one token, four loops
ctx.arc(x, y, r, 0, Math.PI * 2
  1. InPrelude
  2. Shared blockLoop 4 of 4
  3. OutCoda + head
  • )34%closes the call
  • ;37%ends the line early: SyntaxError
  • ,20%adds another argument
  • *9%keeps multiplying

Strong: hRAfter the last loop ) has nearly caught up, but ; still edges it out. Sample from this and the code breaks about a third of the time.

Illustrative numbers, not real model output. Each loop sharpens the guess. The last loop is close to right, but not quite there.

Normal decoding throws every intermediate guess away and keeps only the last one.

The trick: ask which way the loops were heading

LoopCD comes from Decoding Looped Transformers Better for (Almost) Free by Weihao Liu, Huangjie Zheng, Tianrong Chen, Rohit Dilip, Richard He Bai, Yizhu Jiao, Yuyang Wang, and Ruixiang Zhang, from work done at Apple.

The observation is simple. The first loop gives a weak prediction. The last loop gives a strong prediction of the same token, from the same model, in the same space. The difference between them points in the direction the model was refining toward. So push a little further in that direction:

z' = z_R + ω · (z_R − z_1)

Here z_1 is the prediction after the first loop, z_R is the prediction after the last, and ω (omega) is how hard to push. At ω = 0 you get normal decoding.

It is the same idea as contrastive decoding in language models and classifier-free guidance in image models: steer away from a weaker version of yourself. Usually you need something to play the weak model, like a second, smaller model or a deliberately degraded prompt. A looped model already has one built in.

Try it on the same token:

Illustrative · the same token as above

z′ = zR + 0.25 × (zR − z1)

  • )34% becomes 48%
  • ;37% becomes 30%
  • ,20% becomes 16%
  • *9% becomes 6%
Top choice; → )
Chance of sampling the broken ;37% → 30%

In this one-token toy, more strength always looks better. Over a long output it is not: each nudged token changes everything after it, and the paper finds generation quality falls steeply past about 0.6. Osaurus uses 0.25, inside the paper's 0.2 to 0.3 band for generation.

Illustrative. Drag ω to see guidance re-rank a close call. Osaurus uses 0.25.

Two details matter in practice.

  • Where to apply it. The paper offers two versions. LoopCD-Logits contrasts the two predictions after the output head, which costs one extra pass through the final layers. LoopCD-Hidden mixes the two hidden states before the output head, so the head still runs once and there is no extra compute. Osaurus uses LoopCD-Hidden.
  • How hard to push. For scoring multiple-choice answers, the paper finds a wide sweet spot around ω = 0.5. For long generation the window is narrower, 0.2 to 0.3, because every nudged token changes all the tokens after it. Osaurus uses 0.25.

The paper also shows why it helps. Guidance mostly leaves confident tokens alone and changes the close calls, where the top two candidates are nearly tied. On ARC-Challenge, the least confident fifth of questions gained 6.4 to 13.3 points across four models, while the most confident fifth gained at most 0.4.

What the paper found

Across four families of looped models, LoopCD improved results at the same number of loops, with no training:

Pass@1 scores from Liu et al. Ouro rows use LoopCD-Logits with adaptive strength; the Huginn row uses LoopCD-Hidden.
Model and benchmarkWithout LoopCDWith LoopCD
Ouro-2.6B-Thinking, AIME 202461.8873.33
Ouro-2.6B-Thinking, AIME 202549.5856.88
Ouro-1.4B-Thinking, AIME 202450.8359.17
Ouro-2.6B, HumanEval75.6179.88
Huginn-0125, HumanEval22.5631.71

The second result may matter more on a laptop. Because guided decoding is better at the same depth, you can run fewer loops. At half the loops, LoopCD matched or beat the unguided full-depth model on the seven-benchmark average in all six settings the paper tested, using 22.5% to 48.2% less forward compute. On a Mac, compute is battery, heat, and speed.

What we saw on Inkling 2 Mini

We built LoopCD-Hidden into the Osaurus inference engine for Inkling 2 Mini, then ran the same creative-coding prompts with it off and on. Each prompt asks for one self-contained HTML file with no libraries. Here are five pairs. Every pane is the model's untouched output, running in a sandbox.

Same prompt · same seed · one switch

Low-poly floating crystal world

LoopCD off11,458 tokens · 129 tok/s

Crashes on load. The controls draw, the world never does.

LoopCD on10,430 tokens · 122 tok/s

Runs clean: a spinning faceted island with orbiting moonlets, in 1,028 fewer tokens.

The prompt and settings

Build a single self-contained HTML file (inline CSS/JS, no external libraries or CDNs, filling 100vw x 100vh) rendering a true 3D perspective-projected low-poly faceted floating crystal world on Canvas2D with back-face culling, painter's depth sorting, directional Lambert + specular triangle shading, faceted oceans/mountains/snow peaks/pine cones, an orbiting ring of faceted glowing moonlets, starfield parallax, gentle auto-orbit plus mouse drag, and Lighting / Wireframe controls.

Model
Inkling 2 Mini (JANGHT4.2) + DFlash2 drafter
Seed
777
Reasoning effort
low
Max tokens
32,768
Sampling
Bundle defaults, temperature 1.0
Machine
M5 Ultra, Osaurus 1.0.15

All pairs used Osaurus 1.0.15, Inkling 2 Mini (JANGHT4.2) with the DFlash2 speculative drafter, the model's own sampling defaults (temperature 1.0), and low reasoning effort, on M5 Max and M5 Ultra Macs. "Off" means VMLX_LOOPCD=0, an engine flag we used for this comparison. "On" is the default.

Speed is in the same range either way, as you would expect from a method that adds no extra pass.

Every run we measured

The five pairs above are the best of 40. Here are all of them.

LoopCD off31/40loaded without errors
LoopCD on26/40loaded without errors
TaskLoopCD offLoopCD on
Bioluminescent Deep-Sea Jellyfish & Boid ReefM5 Max · low effort · seed 42RunsRuns
3D Brass Clockwork Mechanical Solar OrreryM5 Max · low effort · seed 42RunsCrashes
Isometric Floating Voxel Pagoda IslandM5 Max · low effort · seed 42RunsCrashes
12 Numbered Balls Inside a Rotating HeptagonM5 Max · low effort · seed 42RunsCrashes
Pseudo-3D Synthwave Sunset Highway RacerM5 Max · low effort · seed 42RunsCrashes
Diverging Chaos: Triple Double-Pendulum LabM5 Max · low effort · seed 42RunsRuns
Rainy Neon Cyberpunk Isometric City BlockM5 Max · low effort · seed 42RunsRuns
Procedural Four-Season Animated Bonsai DioramaM5 Max · low effort · seed 42RunsCrashes
Skeleton Mechanical Tourbillon Wristwatch MovementM5 Max · low effort · seed 42RunsRuns
Playable Neon Cyber-Arcade Pinball TableM5 Max · low effort · seed 42CrashesCrashes
Interactive Verlet Silk Cloth & Wrecking BallM5 Max · low effort · seed 42RunsRuns
WebGL2 Raymarched Infinite Crystal CathedralM5 Max · low effort · seed 42RunsCrashes
Animated Stained-Glass Gothic Rose WindowM5 Ultra · low effort · seed 42RunsRuns
Miniature Isometric Alpine Steam Railway DioramaM5 Ultra · low effort · seed 42CrashesHit token limit
Real-Time Navier-Stokes Colorful Fluid & Ink SimM5 Ultra · low effort · seed 42RunsRuns
Orbital Polyrhythmic Galaxy Music SequencerM5 Ultra · low effort · seed 42CrashesRuns
Playable Vector-Glow Lunar Lander ArcadeM5 Ultra · low effort · seed 42RunsRuns
First-Person 3D Vector Canyon Flight SimulatorM5 Ultra · low effort · seed 42RunsCrashes
Playable 3D Textured Raycasting Torchlight DungeonM5 Ultra · low effort · seed 42RunsRuns
4D Rotating Hypercube (Tesseract) VisualizerM5 Ultra · low effort · seed 42RunsRuns, with errors
Colliding Spiral Galaxies N-Body Gravity SimM5 Ultra · low effort · seed 42RunsRuns
3D Isometric Voxel Lighthouse ArchipelagoM5 Ultra · low effort · seed 42RunsRuns
WebGL2 Relativistic Black Hole & Gravitational LensingM5 Ultra · low effort · seed 42RunsRuns
Animated Japanese Zen Koi Pond & Water RipplesM5 Ultra · low effort · seed 42RunsRuns
Procedural Four-Season Animated Bonsai DioramaM5 Max · medium effort · seed 42RunsRuns
Isometric Floating Voxel Pagoda IslandM5 Max · medium effort · seed 42Hit token limitHit token limit
12 Numbered Balls Inside a Rotating HeptagonM5 Max · medium effort · seed 42RunsRuns
WebGL2 Raymarched Infinite Crystal CathedralM5 Max · medium effort · seed 42RunsHit token limit
Fractal Lightning Storm Over Reflective City SkylineM5 Max · low effort · seed 101RunsCrashes
Fourier Epicycle Rotating Gears Drawing StudioM5 Max · low effort · seed 101RunsRuns
3D Animated Self-Solving Rubik's CubeM5 Max · low effort · seed 101RunsRuns, with errors
Cozy Isometric Lofi Night Corner Cafe DioramaM5 Max · low effort · seed 101RunsRuns
Live Maze Generator & A* vs Dijkstra Pathfinding RaceM5 Max · low effort · seed 101CrashesRuns
Twilight Starling Murmuration & Swooping FalconM5 Max · low effort · seed 101RunsRuns
Real-Time Falling-Sand Elemental Physics DioramaM5 Ultra · low effort · seed 777RunsRuns
Harbor Fireworks Spectacular with Dynamic Water ReflectionsM5 Ultra · low effort · seed 777RunsRuns
3D Flat-Shaded Low-Poly Floating Crystal PlanetM5 Ultra · low effort · seed 777Hit token limitRuns
Hyper-Juicy Neon Cyber-Breakout ArcadeM5 Ultra · low effort · seed 777Runs, with errorsRuns
Neon Physics Plinko & Live Gaussian Distribution BoardM5 Ultra · low effort · seed 777CrashesRuns
3D Flat-Shaded Low-Poly Floating Crystal Planet (32K tokens)M5 Ultra · low effort · seed 777CrashesRuns

“Runs” means the page loaded with no JavaScript errors. It says nothing about whether the result is good: the rose window and koi pond both “run” with LoopCD off.

On the bluntest measure, whether the page loads without JavaScript errors, LoopCD did not come out ahead in this sample. It fixed 6 pairs and broke 11. With it off, 31 of 40 pages loaded cleanly; with it on, 26 did.

We don't read that as LoopCD hurting, and we don't read the showcases as proof that it helps. This test can't tell either way:

  • One sample per side. Each pair is a single generation at temperature 1.0. Each run generates 5,000 to 24,000 tokens of reasoning and code, and one stray character in the code crashes the page.
  • Same seed is not the same draw. A fixed seed fixes the random numbers, not the outcome. As soon as LoopCD shifts one probability, every later token is drawn from a different place, and the two runs become independent attempts.
  • "Runs" is not "good". The rose window, koi pond, and galaxies all load cleanly with LoopCD off. The difference is in what they draw, which an error count does not capture.

A fair test needs many samples per prompt and per setting, scored on quality, which is how the paper's benchmarks work. That is the evidence we rely on for the claim that LoopCD makes looped models better. Settling it for Inkling specifically would take an evaluation of that kind.

Why this belongs in a local harness

Better models usually come from training: more data, more compute, a new release. LoopCD is a different kind of gain. It comes from how the model is read while it decodes, and it needs three things:

  • access to the model's intermediate states, which hosted APIs do not expose;
  • control over decoding, one token at a time;
  • a way to ship the change to everyone without retraining or new weights.

A local harness has all three. Osaurus runs the model on your Mac, owns the inference engine, and can ship a decoding improvement in an app update. That is how LoopCD shipped: the same Inkling 2 Mini weights you already had, read differently.

We expect there is a lot more of this to find. Research like this keeps showing that how you run a model matters, not just which model you run, and a local harness is the place where those ideas can reach people quickly.

Try it

LoopCD is on by default in Osaurus 1.0.15 with Inkling 2 Mini. There is nothing to configure. Download Osaurus and load Inkling 2 Mini, or find the weights on Hugging Face.

Thanks to Weihao Liu, Ruixiang Zhang, and their coauthors for the paper. If you build on LoopCD, cite their work: Liu et al., "Decoding Looped Transformers Better for (Almost) Free," arXiv:2610.02185.

Download Osaurus

The newsletter

Release notes, new skills, and product news. No spam.

No spam. Unsubscribe anytime.