All models

Ouroboros-DynamicWeightRecursion

Qwen2.5-3B cut to 17 layers, with one layer looped and re-weighted per step by a small Controller hypernetwork.

Language · 2,038 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

This diagram has 2,038 operations (1.2 MB) and is drawn when you ask.

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
1.6B
Operations
2,038
Framework
PyTorch
Recurrent
Yes
Published
2026
Cited by
2 (as of 22 November 2026)
Authors
Jaber Jaber, Osama Jaber
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m2063
Graph hash
82b511fc4db66d8e9371988c701447e226c2b9211c775990f7b21b111ce5c6a3
Skeleton hash
ac7f59e239a614d89b6f48bd0c19a4cf40bf153b0e5390109cb3c5f89328ff7d
Architecture hash
7a8a070119b578d5a922b094c9e7309f38e2894c8359eaadc8dda6b45791e6b7
Diagram SHA-256
a1848eac3e10a63d3267614ae62fe9b394ee2282e77b24d778ce67c64c200306
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

Ouroboros is a recursive transformer, one that reuses a shared weight block across several depth steps, with a twist that lets each step do something different. The limitation it targets is uniformity: every step applies the same transformation, preventing the model from composing distinct operations across depth. A compact Controller hypernetwork observes the current hidden state and produces a per-step diagonal modulation vector applied to frozen SVD-initialized LoRA bases, so each recurrence step is input-dependent. Those bases come from the SVD of the removed layers' weight residuals, so the Controller only learns how much to activate each pre-computed direction.

The captured build splits Qwen2.5-3B into a frozen 8-layer Prelude, a single recurrent layer (layer 18) and a frozen 8-layer Coda, keeping 17 of 36 layers. A gated recurrence initialized to 88% retention and per-step LayerNorm keep deep iteration stable. The gate turns out to be essential: without it, recursive layer application makes the model strictly worse. The whole system adds only 9.2M trainable parameters, 0.6% of the model.

On the training distribution it cuts loss by 43.4% over the unmodified 17-layer baseline, recovering 51.3% of the gap caused by removing layers. The authors are candid that on held-out text the Controller does not yet improve over the baseline, which they attribute to frozen downstream layers. The released loader builds the model with the recurrent layer at index 18 and then sets phase 2, the fixed-depth mode.

Key idea. A Controller hypernetwork that generates input-conditioned diagonal LoRA modulation for a recursive transformer block, so that each recurrence step applies a different transformation.

  • Ouroboros
  • dynamic weight recursion
  • recursive transformer
  • looped transformer
  • Controller hypernetwork
  • input-conditioned LoRA
  • SVD LoRA
  • Qwen2.5-3B
  • RightNow AI
  • language model

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{jaber2026ouroborosdynamicweightgeneration,
      title={Ouroboros: Dynamic Weight Generation for Recursive Transformers via Input-Conditioned LoRA Modulation}, 
      author={Jaber Jaber and Osama Jaber},
      year={2026},
      eprint={2604.02051},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2604.02051}, 
}