DiscoLoop: Looping Discrete Embeddings and Continuous Hidden States for Multi-hop Reasoning
Summary
DiscoLoop introduces a looping architecture that carries both discrete embedding and continuous hidden-state channels to improve multi-hop reasoning in transformers, achieving near-perfect accuracy on synthetic tasks and stronger performance on real-world language modeling.
View Cached Full Text
Cached at: 07/02/26, 05:36 AM
# DiscoLoop: Looping Discrete Embeddings and Continuous Hidden States for Multi-hop Reasoning
Source: [https://arxiv.org/html/2607.00341](https://arxiv.org/html/2607.00341)
Hengyu Fu1&Tianyu Guo1111University of California, Berkeley\. Email:\{hengyuf,tianyu\_guo,hanlinzhu\}@berkeley\.edu&Zixuan Wang1,2111University of California, Berkeley\. Email:\{hengyuf,tianyu\_guo,hanlinzhu\}@berkeley\.edu&Hanlin Zhu1111University of California, Berkeley\. Email:\{hengyuf,tianyu\_guo,hanlinzhu\}@berkeley\.eduJason D\. Lee1&Jiantao Jiao1&Stuart Russell1&Song Mei1
###### Abstract
Large language models achieve strong performance on many reasoning tasks when allowed to externalize intermediate steps as Chain\-of\-Thought \(CoT\)\. However, many questions require the model to internalize themulti\-step reasoningwithin a single forward pass before generating the answer\. We study this challenge throughtwo\-hop reasoning, a representative task where the model must compose multiple pieces of parametric knowledge within a single forward pass\. Standard non\-recurrent Transformers suffer from adepth\-local storageproblem: facts learned in earlier layers are unavailable where second\-hop retrieval happens\. We found that Looped Transformers mitigate this issue by reusing the same memory, but still generalize imperfectly\. We show that the remaining bottleneck isrepresentational\. In the two\-hop reasoning task, the first loop often makes the correct bridge entity nearly perfectly decodable, yet the corresponding hidden state remains poorly aligned with the bridge token embedding\. Surprisingly, an easy training\-free realignment intervention nearly closes the generalization gap\. Building upon this insight, we proposeDiscoLoop, a looping architecture whose recurrence carries both a*dis*crete embedding channel and a*co*ntinuous hidden\-state channel\. DiscoLoop achieves near\-perfect accuracy with substantially fewer training steps across symbolic and synthetic\-language multi\-hop reasoning tasks\. When applied to real\-world pretraining, DiscoLoop attains lower training loss and stronger benchmark performance than looped\-transformer baselines, suggesting that the mixed\-channel design transfers to practical language modeling\.
22footnotetext:Princeton University\. Email:zw2814@princeton\.edu## 1Introduction
Current large language models \(LLMs\) heavily rely on long traces of Chain\-of\-Thought \(CoT\)\(Wei et al\.,[2022](https://arxiv.org/html/2607.00341#bib.bib27)\)to achieve strong performance in various challenging tasks, including math\(Jaech et al\.,[2024](https://arxiv.org/html/2607.00341#bib.bib17); Guo et al\.,[2025](https://arxiv.org/html/2607.00341#bib.bib14)\)and coding\(Chen et al\.,[2021](https://arxiv.org/html/2607.00341#bib.bib8); Cao et al\.,[2026](https://arxiv.org/html/2607.00341#bib.bib7)\)\. Yet many questions implicitly require several reasoning steps before generating the answer token, which must happeninternallythrough the forward pass\(Yang et al\.,[2024](https://arxiv.org/html/2607.00341#bib.bib29)\)\. Ideally, an intelligent model should reason in a parameter and context\-efficient way bystoringatomic facts and*composing*them implicitly on demand, which reduces the need to verbalize every intermediate step in the context\. Unfortunately, many recent works show that transformer\-based LLMs struggle with suchimplicit reasoning\(Ye et al\.,[2024](https://arxiv.org/html/2607.00341#bib.bib33); Press et al\.,[2023](https://arxiv.org/html/2607.00341#bib.bib22); Yang et al\.,[2025](https://arxiv.org/html/2607.00341#bib.bib30)\)despite their excellent performance with CoT\.
Towards understanding the failure on implicit reasoning, a symbolictwo\-hop reasoningtask\(Wang et al\.,[2024](https://arxiv.org/html/2607.00341#bib.bib25); Ye et al\.,[2025b](https://arxiv.org/html/2607.00341#bib.bib32)\)was proposed as the most fundamental version of implicit reasoning\. As an example, withatomic factslike “*Alice’s son is Bob*” and “*Bob’s wife is Carol*”, thecomposite queryshould be “*Who is the wife of Alice’s son?*”\. Traditional transformer\-based LLMs surprisingly struggle to learn this seemingly simple task\(Yang et al\.,[2024](https://arxiv.org/html/2607.00341#bib.bib29); Biran et al\.,[2024](https://arxiv.org/html/2607.00341#bib.bib5); Balesni et al\.,[2024](https://arxiv.org/html/2607.00341#bib.bib3); Wang et al\.,[2024](https://arxiv.org/html/2607.00341#bib.bib25)\), and models often fail to compose two learned facts when the exact composite query was not observed during training\.
The failure was previously attributed to adepth\-local storageproblem in standard transformers\(Biran et al\.,[2024](https://arxiv.org/html/2607.00341#bib.bib5); Wang et al\.,[2024](https://arxiv.org/html/2607.00341#bib.bib25)\)\. In this view, a non\-recurrent Transformer solves two\-hop reasoning through a depth\-wise circuit by assigning different roles to layers of different depth\. In the example above, earlier layers can recover the first\-hop bridge entity, “*Bob*”, from “*Alice’s son is Bob*”, while later layers must use this bridge to retrieve the second\-hop answer “*Carol*”, from “*Bob’s wife is Carol*”\. This depth\-wise division of labor requires the second\-hop fact to be available in the later layers where the answer is retrieved\. However, if that fact is observed during training only as an atomic fact and never in a compositional second\-hop role, training provides little direct pressure to make it available at the required depth\.
This perspective motivates looped Transformers\(Wang et al\.,[2024](https://arxiv.org/html/2607.00341#bib.bib25); Zeng et al\.,[2025](https://arxiv.org/html/2607.00341#bib.bib34); Zhu et al\.,[2025c](https://arxiv.org/html/2607.00341#bib.bib39); Kohli et al\.,[2026](https://arxiv.org/html/2607.00341#bib.bib18)\)as a natural architectural fix\. By applying the same Transformer block recurrently, a looped model reuses the same learned parametric memory across reasoning steps: the first loop can recover the bridge, and the next loop can query the same memory to resolve the second hop\. However, despite substantially outperforming non\-looped Transformers, existing looped\-Transformer architectures can still suffer from low training efficiency\(Wang et al\.,[2024](https://arxiv.org/html/2607.00341#bib.bib25)\)and imperfect generalization\(Ye et al\.,[2025b](https://arxiv.org/html/2607.00341#bib.bib32)\)especially in out\-of\-distribution \(OOD\) settings, where the constituent atomic facts are observed during training only as standalone facts and never appear in any compositional two\-hop training example\(Ye et al\.,[2025b](https://arxiv.org/html/2607.00341#bib.bib32)\)\. This raises our motivating questions:
*If looping makes the same memory available across hops, why do vanilla looped transformers still fail to compose atomic facts? How do we resolve the remaining issue?*
Based on the two questions, we design a controlled symbolic two\-hop reasoning task and conduct mechanistic interpretability analyses on vanilla looped transformers \(see Section[2](https://arxiv.org/html/2607.00341#S2)and Section[3](https://arxiv.org/html/2607.00341#S3)\)\. We identify a new*representation*bottleneck: after the first loop, the bridge entity is often decodable from the continuous hidden vector, yet this vector remains noisy and geometrically misaligned with the clean discrete embedding of the same entity that the next loop would ideally consume\. We further show that a training\-free realignment intervention nearly closes the performance gap in both ID and the more challenging OOD setting, which reveals a simple design principle: the recurrence should pass not only continuous hidden states, but also discrete embedding\-aligned vectors across loops\.
Motivated by this principle, we proposeDiscoLoop, a looped Transformer architecture that keeps the memory\-reuse benefit of recurrence while adding a decoded embedding channel to reduce loop\-wise representation mismatch\. DiscoLoop achieves near\-perfect test accuracy with substantially fewer training steps across symbolic and synthetic\-language multi\-hop reasoning tasks\. Moreover, on real\-world pretraining tasks, DiscoLoop attains lower training loss and stronger performance on different benchmarks compared to looped\-transformer baselines, suggesting that our mixed\-channel design generalizes to realistic pretraining setups \(see[Section˜5](https://arxiv.org/html/2607.00341#S5)\)\.
Figure 1:Overview of our analysis and DiscoLoop\.The figure summarizes the two\-hop reasoning setup, the depth\-local storage issue of vanilla non\-looped transformers, the representation\-mismatch issue that remains in vanilla looped transformers, and our DiscoLoop architecture that injects a soft decoded embedding into the recurrent residual stream\. The rigorous two\-hop task formulation is defined in Section[2](https://arxiv.org/html/2607.00341#S2), and the DiscoLoop recurrence is formalized in Section[4](https://arxiv.org/html/2607.00341#S4)\.### 1\.1Related work
#### Out\-of\-context and multi\-hop reasoning\.
Out\-of\-context reasoning \(OCR\) refers to models’ capability to answer a question where certain key information is missing from the context but learned during training\. Previous works show that LLMs can achieve strong OCR performance in certain tasks like factual recall and implication\(Feng et al\.,[2024](https://arxiv.org/html/2607.00341#bib.bib10); Huang et al\.,[2025](https://arxiv.org/html/2607.00341#bib.bib16)\), while they struggle with other OCR tasks, such as the reversal curse\(Berglund et al\.,[2023](https://arxiv.org/html/2607.00341#bib.bib4); Allen\-Zhu and Li,[2023](https://arxiv.org/html/2607.00341#bib.bib2); Zhu et al\.,[2024](https://arxiv.org/html/2607.00341#bib.bib36)\), in\-weight multi\-hop reasoning\(Yang et al\.,[2024](https://arxiv.org/html/2607.00341#bib.bib29); Biran et al\.,[2024](https://arxiv.org/html/2607.00341#bib.bib5); Balesni et al\.,[2024](https://arxiv.org/html/2607.00341#bib.bib3)\), etc\. We focus on boosting in\-weight multi\-hop reasoning capability in this work, which is one of the most important OCR tasks\. Prior work\(Wang et al\.,[2024](https://arxiv.org/html/2607.00341#bib.bib25)\)shows that transformers can learn two\-hop reasoning through grokking \(i\.e\., an extended period of training far beyond overfitting\) when the test data is in distribution \(ID\), but totally fail for out\-of\-distribution \(OOD\) test data \(See the rigorous definition of ID and OOD in Section[2](https://arxiv.org/html/2607.00341#S2)\)\.Biran et al\. \([2024](https://arxiv.org/html/2607.00341#bib.bib5)\); Wang et al\. \([2024](https://arxiv.org/html/2607.00341#bib.bib25)\)interpreted the failure reason as a depth\-local storage issue\.Ye et al\. \([2025a](https://arxiv.org/html/2607.00341#bib.bib31)\)showed that the explicit decodability of intermediate entities is insufficient for implicit reasoning, and second\-hop generalization requires seeing the relevant atomic fact in the same compositional role during training\.
#### Latent reasoning and looped transformer\.
Unlike explicit CoT\(Wei et al\.,[2022](https://arxiv.org/html/2607.00341#bib.bib27)\), latent space reasoning moves the reasoning procedure from the textual token space to a latent space, including discrete latent space\(Goyal et al\.,[2023](https://arxiv.org/html/2607.00341#bib.bib12); Wang et al\.,[2023](https://arxiv.org/html/2607.00341#bib.bib26); Cheng and Van Durme,[2024](https://arxiv.org/html/2607.00341#bib.bib9); Pfau et al\.,[2024](https://arxiv.org/html/2607.00341#bib.bib21); Su et al\.,[2025](https://arxiv.org/html/2607.00341#bib.bib24)\), continuous latent space\(Hao et al\.,[2024](https://arxiv.org/html/2607.00341#bib.bib15); Zhu et al\.,[2025b](https://arxiv.org/html/2607.00341#bib.bib38),[a](https://arxiv.org/html/2607.00341#bib.bib37); Gozeten et al\.,[2025](https://arxiv.org/html/2607.00341#bib.bib13); Zhang et al\.,[2025](https://arxiv.org/html/2607.00341#bib.bib35); Butt et al\.,[2025](https://arxiv.org/html/2607.00341#bib.bib6)\), looped transformer\(Saunshi et al\.,[2025](https://arxiv.org/html/2607.00341#bib.bib23); Zeng et al\.,[2025](https://arxiv.org/html/2607.00341#bib.bib34); Zhu et al\.,[2025c](https://arxiv.org/html/2607.00341#bib.bib39); Kohli et al\.,[2026](https://arxiv.org/html/2607.00341#bib.bib18)\), etc\. In particular, the looping architecture naturally resolves the storage issue of multi\-hop reasoning, and the OOD test accuracy increases from 0 to a non\-trivial number\(Zeng et al\.,[2025](https://arxiv.org/html/2607.00341#bib.bib34); Zhu et al\.,[2025c](https://arxiv.org/html/2607.00341#bib.bib39); Kohli et al\.,[2026](https://arxiv.org/html/2607.00341#bib.bib18)\)compared to vanilla transformers\. However, the OOD test accuracy is still far from perfect\. Concurrent to our work,Kohli et al\. \([2026](https://arxiv.org/html/2607.00341#bib.bib18)\)studies implicit in\-weight multi\-hop reasoning with vanilla looped transformers\. Their test split holds out 5% of atomic facts from training compositions within a single knowledge graph\. In contrast, our OOD split uses a separate entity\-disjoint graph of comparable size to the training graph and withholds all of its compositions from training, making the two\-hop generalization more challenging in both scale and separation\.
## 2Task Formulation: Multi\-hop Reasoning
#### Two\-hop reasoning\.
We formalize a symbolic abstraction of the two\-hop reasoning example in Section[1](https://arxiv.org/html/2607.00341#S1)\. Given a knowledge graph𝒢=\(ℰ,ℛ,ℱ\)\\mathcal\{G\}=\(\\mathcal\{E\},\\mathcal\{R\},\\mathcal\{F\}\)with entity setℰ\\mathcal\{E\}, relation setℛ\\mathcal\{R\}, and edge setℱ⊆ℰ×ℛ×ℰ\\mathcal\{F\}\\subseteq\\mathcal\{E\}\\times\\mathcal\{R\}\\times\\mathcal\{E\}, an*atomic fact*is a triple\(a,r1,b\)∈ℱ\(a,r\_\{1\},b\)\\in\\mathcal\{F\}, i\.e\., an edge of𝒢\\mathcal\{G\}\(e\.g\.,a=a=Alice,r1=r\_\{1\}=spouse,b=b=Bob\)\. A*two\-hop question*is a chain\(a,r1,r2\)\(a,r\_\{1\},r\_\{2\}\)\(e\.g\.,r2=r\_\{2\}=workplace\) whose answercc\(e\.g\., San Francisco\) is determined by composing two atomic facts: there exists a uniqueb∈ℰb\\in\\mathcal\{E\}such that\(a,r1,b\)∈ℱ\(a,r\_\{1\},b\)\\in\\mathcal\{F\}and\(b,r2,c\)∈ℱ\(b,r\_\{2\},c\)\\in\\mathcal\{F\}\. We refer tobbas the*bridge entity*\. Equivalently, two\-hop questions are generated by the inference rule
∀a,b,c∈ℰ,∀r1,r2∈ℛ,\(a,r1,b\)∈ℱ∧\(b,r2,c\)∈ℱ⟹\(a,r1,r2,c\)\.\\forall a,b,c\\in\\mathcal\{E\},\\ \\forall r\_\{1\},r\_\{2\}\\in\\mathcal\{R\},\\quad\(a,r\_\{1\},b\)\\in\\mathcal\{F\}\\ \\wedge\\ \(b,r\_\{2\},c\)\\in\\mathcal\{F\}\\ \\Longrightarrow\\ \(a,r\_\{1\},r\_\{2\},c\)\.\(1\)The construction extends tokk\-hop questions\(a,r1,…,rk\)\(a,r\_\{1\},\\dots,r\_\{k\}\)for anyk\>1k\>1, butk=2k=2is the most canonical case and thus our main focus throughout the paper\. Atomic facts and two\-hop questions are presented as separate training examples, and the model is trained to predict the answerccdirectly from\(a,r1,r2\)\(a,r\_\{1\},r\_\{2\}\)without generating the bridge entitybb\. The model is therefore required to store the atomic facts*in weights*and to perform the composition*implicitly*within a single forward pass\.
#### Two\-graph design for ID/OOD splits\.
Beyond memorization, we expect that the trained models are able to generalize to compose facts, not only in in\-distribution \(ID\) but also in out\-of\-distribution \(OOD\) test sets\. We consider two*entity\-disjoint*knowledge graphs𝒢A\\mathcal\{G\}\_\{A\}and𝒢B\\mathcal\{G\}\_\{B\}that*share the same relation vocabulary*\. We designate𝒢A\\mathcal\{G\}\_\{A\}as the*in\-distribution*graph: all atomic facts and a subset of two\-hop questions on𝒢A\\mathcal\{G\}\_\{A\}are used for training, while the remaining two\-hop questions on𝒢A\\mathcal\{G\}\_\{A\}form the ID test settest\_id\. In contrast,𝒢B\\mathcal\{G\}\_\{B\}serves as the*out\-of\-distribution*graph, on which we train*only*its atomic facts; all two\-hop questions on𝒢B\\mathcal\{G\}\_\{B\}are reserved as the OOD test settest\_ood\. The crucial asymmetry is that although the model has observed*every*atomic edge of𝒢B\\mathcal\{G\}\_\{B\}during training, it has*never*seen a two\-hop composition over𝒢B\\mathcal\{G\}\_\{B\}\. Together, the two splits probe whether the composition rule learned on𝒢A\\mathcal\{G\}\_\{A\}transfers to held\-out questions on the same graph \(test\_id\) and, more stringently, to a disjoint entity set whose atomic facts the model has only seen in isolation \(test\_ood\)\. This two\-graph separation follows the protocol ofWang et al\. \([2024](https://arxiv.org/html/2607.00341#bib.bib25)\)and makestest\_ooda stricter test of systematic generalization: unlike held\-out compositions on𝒢A\\mathcal\{G\}\_\{A\}, no fact in𝒢B\\mathcal\{G\}\_\{B\}has ever appeared as part of a compositional training example, so success requires applying the learned composition rule to facts seen only as standalone facts\.
## 3Looping Fixes Storage, but Not Representation
In this section, we train a vanilla looped transformer on the two\-hop reasoning task of Section[2](https://arxiv.org/html/2607.00341#S2)\. We observe that while looping unlocks implicit two\-hop generalization, the test accuracy remains far from perfect, especially out\-of\-distribution\. We then conduct a mechanistic analysis to localize the failure as representational, and find that a simple training\-free intervention on the hidden states at the bridge position is enough to nearly close the OOD gap\.
### 3\.1Training setup
#### Dataset design\.
We instantiate the two\-graph construction of Section[2](https://arxiv.org/html/2607.00341#S2)with\|ℰA\|=\|ℰB\|=500\|\\mathcal\{E\}\_\{A\}\|=\|\\mathcal\{E\}\_\{B\}\|=500entities per graph and a shared relation vocabulary of size\|ℛ\|=50\|\\mathcal\{R\}\|=50\. Every entity has exactly1010outgoing edges, each labeled by a distinct relation, so each graph contains5,0005\{,\}000atomic facts and50,00050\{,\}000two\-hop chains\. During training, each entity and each relation is assigned its own dedicated symbolic token \(e\.g\.<a\>,<r\_1\>\), so an atomic fact is rendered as a three\-token sequence<a\> <r\_1\> <b\>, and a two\-hop question as a four\-token sequence<a\> <r\_1\> <r\_2\> <c\>\. In both cases, the model is trained to predict the final token\. The training set comprises*all*10,00010\{,\}000atomic facts from both graphs \(train\_atom\), together with10,00010\{,\}000two\-hop questions \(train\_id\) drawn uniformly from𝒢A\\mathcal\{G\}\_\{A\}\. We hold out a further2,0002\{,\}000𝒢A\\mathcal\{G\}\_\{A\}chains as the ID test settest\_id, and sample2,0002\{,\}000two\-hop questions from𝒢B\\mathcal\{G\}\_\{B\}as the OOD test settest\_ood\.
#### Looped Transformer\.
As a starting point, we train a decoder\-only Transformer from scratch in a*looping*pipeline\. Letfθf\_\{\\theta\}denote the stack of transformer blocks, and let𝐖∈ℝV×d\\mathbf\{W\}\\in\\mathbb\{R\}^\{V\\times d\}be the \(tied\) embedding matrix, whereVVis the vocabulary size andddthe hidden dimension\. Given an input token sequencex=\(x0,…,xT−1\)x=\(x\_\{0\},\\dots,x\_\{T\-1\}\), we form the initial hidden states𝐇\(0\)=𝐖\[x\]∈ℝT×d\\mathbf\{H\}^\{\(0\)\}=\\mathbf\{W\}\[x\]\\in\\mathbb\{R\}^\{T\\times d\}, and then applyfθf\_\{\\theta\}recurrently by feeding each iterate’s output back in as its own input:
𝐇\(k\+1\)=fθ\(𝐇\(k\)\),k=0,1,…,K−1,\\mathbf\{H\}^\{\(k\+1\)\}\\;=\\;f\_\{\\theta\}\\\!\\big\(\\mathbf\{H\}^\{\(k\)\}\\big\),\\qquad k=0,1,\\dots,K\-1,\(2\)The next\-token logits are read off the final iterate through the same embedding matrix,ℓ=𝐇\(K\)𝐖⊤\\ell=\\mathbf\{H\}^\{\(K\)\}\\mathbf\{W\}^\{\\top\}\. We setK=2K=2to match the maximum reasoning depth in the data, giving the model exactly two passes to compose two atomic facts\. Intuitively, on a two\-hop input\(a,r1,r2\)\(a,r\_\{1\},r\_\{2\}\), we expectfθf\_\{\\theta\}to retrieve the first\-hop fact\(a,r1,b\)\(a,r\_\{1\},b\)in the first loop and reveal the bridge entitybbin the residual stream, and then to usebbtogether withr2r\_\{2\}in the second loop to retrieve\(b,r2,c\)\(b,r\_\{2\},c\), obtaining the final answercc\.
### 3\.2Results and mechanistic analysis
We now train the vanilla looped transformer described in Section[3\.1](https://arxiv.org/html/2607.00341#S3.SS1)on the symbolic dataset and evaluate it across the four splits introduced there\. We report accuracy as the fraction of inputs on which the model’s argmax\-decoded next token at the answer position matches the ground\-truth target\.
#### Looped transformers do compose, but imperfectly\.
After3,0003\{,\}000epochs of training, the looped transformer fits the training set perfectly on both atomic facts and two\-hop chains \(Table[1\(a\)](https://arxiv.org/html/2607.00341#S3.T1.st1)\)\. The key diagnostic is the intermediate*Stage\-1*accuracy, obtained by reading the next\-token prediction off the post\-first\-loop hidden states𝐇\(1\)\\mathbf\{H\}^\{\(1\)\}via the LM head𝐖\\mathbf\{W\}, i\.e\., applyingfθf\_\{\\theta\}only once \(K=1K=1\) at inference time\. Stage\-1 atomic accuracy is100%100\\%, confirming that atomic facts are perfectly recalled from the weights within a single loop\. In contrast, Stage\-1 two\-hop accuracy ontrain\_idis only8\.8%8\.8\\%, far below its perfect Stage\-2 \(final\) score\. The model therefore does*not*memorize two\-hop answers as shortcuts insidefθf\_\{\\theta\}; instead, the second loop is what performs the composition, exactly as theK=2K=2design intends\. Despite this correctly decoupled behavior, the final accuracy is still imperfect: ID test accuracy plateaus at71\.1%71\.1\\%, and OOD test accuracy at only8\.3%8\.3\\%\. In conclusion, the vanilla looped transformer does the right thing structurally, but its compositional reasoning capability is still far from perfect, particularly outside the training distribution\.
#### A training\-free intervention closes the ID/OOD gap\.
A looped transformer can in principle resolve the depth\-local storage issue: the first loop may retrieve the bridge entity before the second\-hop fact is needed\. However, the second loop must still consume the first\-loop representation of this bridge\. We therefore test whether making this intermediate representation more embedding\-like improves two\-hop generalization\.
We apply a targeted, training\-free intervention illustrated in the left panel of Figure[2](https://arxiv.org/html/2607.00341#S3.F2)\. Between the first and second loops, at position11only, we replace the hidden state with a convex combination of itself and the normalized embedding of the highest\-probability decoded token,
𝐇1\(1\)←\(1−α\)𝐇1\(1\)\+αNorm\(𝐖\[bmax\]\),α∈\[0,1\],\\mathbf\{H\}^\{\(1\)\}\_\{1\}\\;\\leftarrow\\;\(1\-\\alpha\)\\,\{\\mathbf\{H\}\}^\{\(1\)\}\_\{1\}\\;\+\\;\\alpha\\,\\mathrm\{Norm\}\(\\mathbf\{W\}\[b\_\{\\rm max\}\]\),\\qquad\\alpha\\in\[0,1\],\(3\)wherebmax=argmax\(𝐖𝐇1\(1\)\)b\_\{\\rm max\}=\\arg\\max\(\\mathbf\{W\}\\mathbf\{H\}^\{\(1\)\}\_\{1\}\)is the top decoded token\. Sweepingα\\alphaproduces the right panel: a small intervention \(α=0\.1\\alpha=0\.1\) already lifts OOD accuracy from8\.3%8\.3\\%to25\.9%25\.9\\%, and atα≈0\.5\\alpha\\approx 0\.5both ID and OOD accuracy approach100%100\\%, achieving more than a*ten\-fold*gain on OOD accuracy\.
Figure 2:Left:the intervention procedure\. Atα=0\\alpha=0the position\-11representation is unchanged; atα=1\\alpha=1it is replaced entirely by the decoded bridge embeddingNorm\(𝐖\[bmax\]\)\\mathrm\{Norm\}\(\\mathbf\{W\}\[b\_\{\\rm max\}\]\)\. The substitution is applied only at position11and only between the two loops; the rest of the forward pass is untouched\.Right:ID and OOD two\-hop accuracy as a function of the intervention strengthα\\alphain Eq\. \([3](https://arxiv.org/html/2607.00341#S3.E3)\)\.
#### Decodable bridge, misaligned representation\.
To understand why this intervention helps, we apply a logit lens analysis to the position where the bridge entitybbis expected to appear\. For every two\-hop test input\(a,r1,r2\)\(a,r\_\{1\},r\_\{2\}\), we look up the ground\-truth bridgebband examine the intermediate hidden state𝐇1\(1\)\\mathbf\{H\}^\{\(1\)\}\_\{1\}at position11\(the position ofr1r\_\{1\}\)\. We report the intermediate Stage\-1 LM\-head probabilityP\(b∣𝐇1\(1\)\)=softmax\(𝐖𝐇1\(1\)\)bP\(b\\mid\\mathbf\{H\}^\{\(1\)\}\_\{1\}\)=\\mathrm\{softmax\}\(\\mathbf\{W\}\\mathbf\{H\}^\{\(1\)\}\_\{1\}\)\_\{b\}assigned to the ground\-truth bridge token, and the cosine similarity between𝐇1\(1\)\\mathbf\{H\}^\{\(1\)\}\_\{1\}and the bridge embedding𝐖\[b\]\\mathbf\{W\}\[b\]\.
Table 1:Results of a vanilla looped transformer on the symbolic dataset\.*Stage 1*reads the next\-token prediction off the post\-first\-loop hidden states𝐇\(1\)\\mathbf\{H\}^\{\(1\)\};*Stage 2*is the model’s actual prediction after both loops\.\(a\)Training and test accuracy on the four splits\.train\_atomtrain\_idtest\_idtest\_oodStage 1100\.0%100\.0\\%8\.8%\\phantom\{0\}8\.8\\%0\.9%\\phantom\{0\}0\.9\\%0\.0%\\phantom\{0\}0\.0\\%Stage 2100\.0%100\.0\\%100\.0%100\.0\\%71\.1%71\.1\\%8\.3%\\phantom\{0\}8\.3\\%
\(b\)Logit lens at position11, post\-first\-loop\.P\(b∣𝐇1\(1\)\)P\(b\\mid\\mathbf\{H\}^\{\(1\)\}\_\{1\}\)cos\(𝐇1\(1\),𝐖\[b\]\)\\cos\(\\mathbf\{H\}^\{\(1\)\}\_\{1\},\\,\\mathbf\{W\}\[b\]\)test\_id1\.0001\.0000\.3270\.327test\_ood1\.0001\.0000\.2660\.266
As shown in Table[1\(b\)](https://arxiv.org/html/2607.00341#S3.T1.st2), the model assigns probability essentially11to the correct bridge on both the ID and OOD splits, which indicates that the shared loop block has both pieces needed for composition: the first loop recovers the bridge, and the same block contains the parametric memory to answer\(b,r2\)\(b,r\_\{2\}\)queries in the second loop\. This suggests that the remaining failure cannot be simply explained by the depth\-local storage issue that limits non\-looped Transformers: the bridge is already available before the second loop, and the second\-hop fact is ideally retrievable in the second loop since the same block has learned to recall all atomic facts within a single loop\.
However, the hidden vector itself is not fully aligned with the bridge embedding direction\. The cosine similarity stays around0\.30\.3, and the OOD cosine is noticeably lower than the ID one\. Thus, the second loop receives a noisy continuous mixture rather than a clean copy of the discrete embedding𝐖\[b\]\\mathbf\{W\}\[b\]\. Equivalently, the base modelfθf\_\{\\theta\}is asked to consume two qualitatively different input distributions across the two loops: clean token embeddings𝐖\[x\]\\mathbf\{W\}\[x\]in the first loop, but noisy hidden states𝐇\(1\)\\mathbf\{H\}^\{\(1\)\}in the second\.
This suggests that the representation mismatch between the noisy continuous hidden state and the clean discrete embedding is a dominant cause of the generalization gap\. The larger gap in the OOD case is consistent with this view: OOD entities appear only as endpoints of atomic facts during training and never as intermediate bridges, sofθf\_\{\\theta\}is never directly pressured to align their post\-first\-loop hidden states with their embeddings\. Therefore, Looping resolves the depth\-local storage issue but leaves a representation bottleneck, and mixing in the clean embedding direction at the bridge position is enough to recover near\-perfect accuracy\. This motivates the architectural change we develop in the next section\.
## 4Architecture Design
The intervention in Section[3\.2](https://arxiv.org/html/2607.00341#S3.SS2)suggests a simple design principle: between loops, the residual stream should carry not just the continuous hidden state computed byfθf\_\{\\theta\}, but also a clean discrete embedding read off through the LM head\. The targeted intervention realizes this idea fixed at one position and via a non\-differentiableargmax\\arg\\max\. We now lift it into a learned, fully differentiable architecture that applies the same principle jointly at every position and every loop\.
We proposeDiscoLoop, a looping architecture that augments the residual stream with both*dis*crete embeddings and*co*ntinuous hidden states across the*loop*recurrence\. Given a base modelfθf\_\{\\theta\}, we replace the vanilla recurrence \([2](https://arxiv.org/html/2607.00341#S3.E2)\) by
𝐇\(k\+1\)=fθ\(𝐇~\(k\)\),𝐇~\(k\+1\)=𝐇\(k\+1\)\+α\(k\)⊙RMSNorm\(Φ\(𝐇\(k\+1\)\)\),\\mathbf\{H\}^\{\(k\+1\)\}\\;=\\;f\_\{\\theta\}\\\!\\left\(\\widetilde\{\\mathbf\{H\}\}^\{\(k\)\}\\right\),\\qquad\\widetilde\{\\mathbf\{H\}\}^\{\(k\+1\)\}\\;=\\;\\mathbf\{H\}^\{\(k\+1\)\}\+\\alpha^\{\(k\)\}\\odot\{\\rm RMSNorm\}\\\!\\left\(\\Phi\\\!\\left\(\\mathbf\{H\}^\{\(k\+1\)\}\\right\)\\right\),\(4\)fork=0,…,K−1k=0,\\dots,K\-1, with𝐇~\(0\)=𝐖\[x\]∈ℝT×d\\widetilde\{\\mathbf\{H\}\}^\{\(0\)\}=\\mathbf\{W\}\[x\]\\in\\mathbb\{R\}^\{T\\times d\}\. Here⊙\\odotdenotes row\-wise multiplication, soα\(k\)=\[α1\(k\),…,αT\(k\)\]\\alpha^\{\(k\)\}=\[\\alpha^\{\(k\)\}\_\{1\},\\dots,\\alpha^\{\(k\)\}\_\{T\}\]is a token\-wise gate along the sequence\.Φ\\Phiis a soft*decode\-then\-encode*operator applied independently at each position:
Φ\(h\)=∑v=1Vpv\(h\)𝐖\[v\],pv\(h\)=exp\(\(𝐖h\)v/τ\)∑v′=1\|V\|exp\(\(𝐖h\)v′/τ\),\\Phi\(h\)\\;=\\;\\sum\_\{v=1\}^\{V\}\\,p\_\{v\}\(h\)\\,\\mathbf\{W\}\[v\],\\qquad p\_\{v\}\(h\)\\;=\\;\\frac\{\\exp\\big\(\(\\mathbf\{W\}h\)\_\{v\}/\\tau\\big\)\}\{\\sum\_\{v^\{\\prime\}=1\}^\{\|V\|\}\\exp\\big\(\(\\mathbf\{W\}h\)\_\{v^\{\\prime\}\}/\\tau\\big\)\},\(5\)with temperatureτ\>0\\tau\>0\. Intuitively,Φ\(h\)\\Phi\(h\)is a weighted sum of token embeddings whose weights are the tempered next\-token probabilities obtained by reading the LM head offhh, which is the differentiable analogue of the hard substitution𝐖\[vmax\]\\mathbf\{W\}\[v\_\{\\rm max\}\]used in Section[3\.2](https://arxiv.org/html/2607.00341#S3.SS2)\. Addingα\(k\)⊙RMSNorm\(Φ\(𝐇\(k\+1\)\)\)\\alpha^\{\(k\)\}\\odot\\mathrm\{RMSNorm\}\(\\Phi\(\\mathbf\{H\}^\{\(k\+1\)\}\)\)to the residual stream therefore injects a*discrete embedding channel*alongside the continuous hidden states, with a gateα\(k\)\\alpha^\{\(k\)\}controlling the injection strength\.
#### Gate parametrization\.
We setα\(K−1\)≡𝟎T\\alpha^\{\(K\-1\)\}\\equiv\\mathbf\{0\}\_\{T\}, so the final prediction is still read directly from𝐇\(K\)\\mathbf\{H\}^\{\(K\)\}by the LM head\. Fork=0,…,K−2k=0,\\dots,K\-2, we consider two parametrizations ofα\(k\)\\alpha^\{\(k\)\}\. We can either set a*fixed*α\(k\)≡α⋆𝟏T\\alpha^\{\(k\)\}\\equiv\\alpha^\{\\star\}\\mathbf\{1\}\_\{T\}withα⋆\>0\\alpha^\{\\star\}\>0for allkk, or design a*learnable*α\(k\)\\alpha^\{\(k\)\}by introducing a token\-wise gate through a sigmoid activationσ\\sigma:
αt\(k\)=σ\(⟨𝐰α,Φ\(𝐇t\(k\+1\)\)⟩\+bα\),𝐰α∈ℝd,bα∈ℝ\.\\alpha^\{\(k\)\}\_\{t\}\\;=\\;\\sigma\\Big\(\\big\\langle\\mathbf\{w\}\_\{\\alpha\},\\,\\Phi\\big\(\\mathbf\{H\}^\{\(k\+1\)\}\_\{t\}\\big\)\\big\\rangle\+b\_\{\\alpha\}\\Big\),\\qquad\\mathbf\{w\}\_\{\\alpha\}\\in\\mathbb\{R\}^\{d\},\\ b\_\{\\alpha\}\\in\\mathbb\{R\}\.\(6\)The gate is conditioned on the decoded contentΦ\(𝐇t\(k\+1\)\)\\Phi\(\\mathbf\{H\}^\{\(k\+1\)\}\_\{t\}\)at each token, so the model can inject the discrete embedding more strongly at positions where the decoded distribution is informative and turn the injection off elsewhere\. The learnable variant introduces onlyd\+1d\+1extra parameters in total \(a single vector𝐰α\\mathbf\{w\}\_\{\\alpha\}and biasbαb\_\{\\alpha\}shared across loops and positions\), which is negligible relative to the size offθf\_\{\\theta\}\.
## 5Experiments
We evaluate DiscoLoop in three settings of increasing realism\. Section[5\.1](https://arxiv.org/html/2607.00341#S5.SS1)first revisits the symbolic two\-graph task from Section[3\.1](https://arxiv.org/html/2607.00341#S3.SS1)\. Section[5\.2](https://arxiv.org/html/2607.00341#S5.SS2)then studies a synthetic natural\-language version of the same task in two question formats, testing whether the same effect persists beyond pure symbolic tokenization\. Section[5\.3](https://arxiv.org/html/2607.00341#S5.SS3)evaluates practical language modeling, asking whether the DiscoLoop also improves standard pretraining beyond the controlled multi\-hop datasets\.
### 5\.1Symbolic two\-graph dataset
We re\-use the symbolic dataset and training setup of Section[3\.1](https://arxiv.org/html/2607.00341#S3.SS1)\. We compare DiscoLoop with two baselines: \(i\) a*vanilla looped transformer*of Eq\. \([2](https://arxiv.org/html/2607.00341#S3.E2)\), which shares the same base modelfθf\_\{\\theta\}as DiscoLoop and differs only in whether the discrete embedding channel is added, and \(ii\) a*non\-looped transformer*obtained by stackingKKcopies offθf\_\{\\theta\}as untied layers\. This non\-looped baseline matches the FLOPs of the looped models while strictly upper\-bounding their parameter count\. For DiscoLoop, we use a fixed gateα⋆=1\\alpha^\{\\star\}=1and temperatureτ=1\\tau=1\. All other training hyperparameters are kept identical across the three models\.
Figure 3:Two\-hop accuracy along training on the symbolic dataset for the non\-looped transformer, the vanilla looped transformer, and DiscoLoop\.Left:Final two\-hop accuracy on the held\-out ID test set \(solid\) and the OOD test set \(dashed\)\.Right:Stage\-1 two\-hop training accuracy, obtained by reading the LM head after the first loop\. Since the non\-looped transformer has no recurrent stages, we report its final two\-hop training accuracy as a reference\.#### DiscoLoop dominates both baselines\.
According to the left panel of Figure[3](https://arxiv.org/html/2607.00341#S5.F3), DiscoLoop reaches near\-perfect accuracy on both the ID and OOD test sets by the end of training, while the vanilla looped transformer plateaus at roughly70%70\\%ID and below10%10\\%OOD\. The non\-looped baseline performs the worst despite usingK×K\\\!\\timesparameters: only below20%20\\%ID accuracy essentially0%0\\%OOD\. DiscoLoop also demonstrates substantially better training efficiency: we observe asharp phase transitionaround epoch500500, after which both ID and OOD test accuracy already exceed80%80\\%\.
#### Stronger inductive bias towards compositional reasoning\.
The right panel of Figure[3](https://arxiv.org/html/2607.00341#S5.F3)plots the Stage\-1 two\-hop*training*accuracy, obtained by reading the LM head off the post\-first\-loop hidden states𝐇\(1\)\\mathbf\{H\}^\{\(1\)\}as described in Section[3\.2](https://arxiv.org/html/2607.00341#S3.SS2)\. Early in training, both looped models behave like the non\-looped baseline: Stage\-1 training accuracy quickly hits100%100\\%while ID and OOD test accuracy stay near zero, indicating that two\-hop answers are being memorized directly in the weights offθf\_\{\\theta\}\. During the phase transition, the Stage\-1 training accuracy*collapses toward zero*just as the test accuracies*jump up*\. Once the model can no longer answer two\-hop training questions from a single loop, it is forced to offload composition to the second loop\. This is the looping architecture’s inductive bias against single\-loop memorization shortcuts, leading to a more generalizable solution\.
Crucially, the Stage\-1 collapse is*earlier and sharper*for DiscoLoop than for the vanilla looped baseline, and its test accuracy rises earlier and converges higher\. By injecting a cleaner signal via the discrete embedding channelΦ\\Phi, DiscoLoop strengthens this inductive bias, pushing the model toward looping\-based composition more aggressively, thus accelerating the phase transition and improving final generalization\.
#### Beyond two\-hop\.
The benefits of DiscoLoop are not limited to two\-hop reasoning\. We additionally evaluate it on a*three\-hop*extension of the symbolic dataset and find that it again converges to near\-perfect ID accuracy and substantial OOD generalization, while the vanilla looped transformer and the non\-looped baseline both fail completely on the three\-hop OOD split\. Due to space constraints, we defer the full setup and results to Appendix[A\.2](https://arxiv.org/html/2607.00341#A1.SS2)\.
### 5\.2Synthetic natural\-language dataset
To check that the architectural finding is not an artifact of symbolic tokenization, we re\-run the same task on a synthetic natural\-language version where atomic facts and two\-hop questions are verbalized in English\. We again generate a two\-graph dataset as described in Section[2](https://arxiv.org/html/2607.00341#S2)\. Instead of a pure symbolic sequence, each atomic fact is rendered as “Finley’s teacher is Anya”, and we consider two natural verbalizations of the two\-hop query that differ in the order of the relation chain:
- •*Direct*: “Finley’s teacher’s wife isCharlie”\.
- •*Reverse*: “Who is the wife of the teacher of Finley?\\nAnswer:Charlie”\.
The two formats share the same atomic facts and the same answer for every two\-hop chain; only the surface form of the question differs\. The reverse format is closer to natural\-language QA but requires the model to compose relations in the opposite order to that in which they appear in the input\.
We again useK=2K=2loops for both DiscoLoop and the vanilla looped transformer, and the corresponding non\-looped baseline stacks two copies offθf\_\{\\theta\}as untied layers\. We train all models for50005000epochs, with the remaining training setup identical to the symbolic experiments\. We use a learnable gateα\\alphafor DiscoLoop on both synthetic\-language datasets\.
Figure 4:Two\-hop accuracy on the two synthetic\-language datasets \(*direct*and*reverse*formats\), comparing the non\-looped transformer, the vanilla looped transformer, and DiscoLoop on the ID test set \(solid\) and the OOD test set \(dashed\)\. All models are trained under the same optimization recipe used in the symbolic setting, except that the total number of training epochs is50005000rather than30003000\.Figure[4](https://arxiv.org/html/2607.00341#S5.F4)shows that the language\-setting curves mirror the symbolic case\. For both formats, DiscoLoop outperforms both baselines in accuracy and training efficiency\. DiscoLoop reaches near100%100\\%ID accuracy and around95%95\\%OOD accuracy, while the vanilla looped transformer reaches around90%90\\%ID accuracy but fails OOD, especially in the reverse format\. The non\-looped baseline reaches only around40%40\\%ID accuracy on the direct format and20%20\\%on the reverse format, and essentially0%0\\%OOD accuracy on both\. DiscoLoop also generalizes perfectly on the ID test set well before the end of training, also around epoch500500, making it substantially more training\-efficient than the baselines\. We observe the same inductive\-bias phenomenon as in the symbolic case, which we visualize in Appendix[A\.3](https://arxiv.org/html/2607.00341#A1.SS3)\.
### 5\.3Language modeling
We next test whether the benefits of DiscoLoop extend beyond controlled synthetic tasks to practical language modeling\. Besides the vanilla loop baseline, we compare with PonderLM\(Zeng et al\.,[2025](https://arxiv.org/html/2607.00341#bib.bib34)\), a related recurrent architecture that also maps intermediate predictions back into embedding space\. The key difference is how the recurrent signal is carried: PonderLM maintains the recurrence only in embedding space, while DiscoLoop preserves the continuous hidden state and injects the decoded embedding as an additional discrete channel\. Thus this comparison tests whether keeping both channels improves over both hidden\-state\-only looping and embedding\-only looping\.
We pretrain three440440M models on2020B tokens using a6:46\{:\}4mixture of FineWeb\-Edu and FineMath\(Niklaus and Kydlíček,[2026](https://arxiv.org/html/2607.00341#bib.bib19); Allal et al\.,[2025](https://arxiv.org/html/2607.00341#bib.bib1)\)\. The FineMath component makes the corpus more math\- and reasoning\-heavy than pure web text\. All models share the same model backbone asZhu et al\. \([2025c](https://arxiv.org/html/2607.00341#bib.bib39)\)with hidden dimensiond=1024d=1024,2424layers, loop step44, and tied input\-output embeddings\. We keep the training recipe fixed and vary only the recurrent computation mechanism\. For a controlled comparison, all recurrent models use four total applications of the backbone\. Additional training details are provided in Appendix[B](https://arxiv.org/html/2607.00341#A2)\.
Table 2:Zero\-shot evaluation scores for the440440M pretraining runs using the backbone architecture ofZhu et al\. \([2025c](https://arxiv.org/html/2607.00341#bib.bib39)\), with 24 layers, loop step44, and tied input\-output embeddings\. For multiple\-choice tasks, we report length\-normalized accuracy to reduce length bias\. Thus ARC\-C, ARC\-E, HellaSwag, PIQA, and SciQ use normalized accuracy; LAMBADA and RACE use accuracy\. Bold indicates the best score for each benchmark\. DiscoLoop is best or tied on six of the seven benchmarks\.SettingARC\-CARC\-EHellaSwagLAMBADAPIQARACESciQAvg\.Vanilla loop30\.557\.244\.235\.167\.431\.079\.549\.3PonderLM31\.755\.643\.938\.067\.731\.280\.549\.8DiscoLoop\(Ours\)32\.657\.644\.237\.668\.431\.381\.550\.5#### DiscoLoop improves the language modeling\.
Table[2](https://arxiv.org/html/2607.00341#S5.T2)reports zero\-shot evaluation on seven standard language\-modeling benchmarks\. DiscoLoop obtains the best average score, improving over the vanilla Loop baseline from49\.349\.3to50\.550\.5, and also outperforming PonderLM’s average score of49\.849\.8\. DiscoLoop is best or tied on six of the seven benchmarks, with the largest numerical improvements over Loop on ARC\-C, LAMBADA, and SciQ\. PonderLM remains strongest on LAMBADA\. When aggregating across benchmarks, DiscoLoop achieves the highest average score, suggesting that the looped reasoning mechanism yields broad gains rather than improvements confined to a small subset of tasks\. This indicates that the mechanism does not merely solve the synthetic compositional task, but also transfers to standard language model pretraining\. We also present the training loss curves in Appendix[B](https://arxiv.org/html/2607.00341#A2)\. DiscoLoop surpasses the vanilla loop after training on roughly 13B tokens and maintains this advantage through the end of training\.
## 6Conclusion and Discussion
We have studied implicit in\-weight multi\-hop reasoning through the lens of looped transformers\. Our contribution has been two\-fold\. First, we have provided a mechanistic explanation for why vanilla looped transformers do not fully solve the task\. Although the bridge entity is often already decodable after the first loop, the hidden state carrying it is not well aligned with the clean token embedding that the next loop would naturally consume\. A simple training\-free intervention that injects the decoded bridge embedding has nearly closed the ID/OOD gap, showing that representation mismatch is a central bottleneck\. Second, motivated by this finding, we have proposed DiscoLoop, which augments the loop recurrence with both a continuous hidden\-state channel and a decoded discrete\-embedding channel\. DiscoLoop has achieved strong performance on symbolic and synthetic\-language two\-hop reasoning tasks, improving both training efficiency and OOD generalization, and has also shown gains in our open\-domain pretraining experiments\.
Looking forward, it would be interesting to test whether DiscoLoop length\-generalizes: trained on questions with at mostkkhops, can it extrapolate to questions with more thankkhops? This would be a stronger test of whether the architecture learns a more generalizable compositional procedure rather than a depth\-specific strategy\. Moreover, our pretraining experiments have been limited to moderate\-scale models because of compute constraints, so larger\-scale verification remains important\. Beyond training looped models from scratch, an important next step is to study whether the same looping recipe can be introduced through continual pretraining of larger pretrained models\. This would test whether existing pretrained non\-looped models can acquire the discrete\-continuous recurrence without full retraining, and whether the benefits of DiscoLoop persist at more realistic model scales\.
## References
- Allal et al\. \(2025\)Loubna Ben Allal, Anton Lozhkov, Elie Bakouch, Gabriel Martín Blázquez, Guilherme Penedo, Lewis Tunstall, Andrés Marafioti, Hynek Kydlíček, Agustín Piqueres Lajarín, Vaibhav Srivastav, Joshua Lochner, Caleb Fahlgren, Xuan\-Son Nguyen, Clémentine Fourrier, Ben Burtenshaw, Hugo Larcher, Haojun Zhao, Cyril Zakka, Mathieu Morlon, Colin Raffel, Leandro von Werra, and Thomas Wolf\.Smollm2: When smol goes big – data\-centric training of a small language model, 2025\.URL[https://arxiv\.org/abs/2502\.02737](https://arxiv.org/abs/2502.02737)\.
- Allen\-Zhu and Li \(2023\)Zeyuan Allen\-Zhu and Yuanzhi Li\.Physics of language models: Part 3\.2, knowledge manipulation\.*arXiv preprint arXiv:2309\.14402*, 2023\.
- Balesni et al\. \(2024\)Mikita Balesni, Tomasz Korbak, and Owain Evans\.The two\-hop curse: Llms trained on a→ b, b→ c fail to learn a→ c\.2024\.
- Berglund et al\. \(2023\)Lukas Berglund, Meg Tong, Max Kaufmann, Mikita Balesni, Asa Cooper Stickland, Tomasz Korbak, and Owain Evans\.The reversal curse: Llms trained on" a is b" fail to learn" b is a"\.*arXiv preprint arXiv:2309\.12288*, 2023\.
- Biran et al\. \(2024\)Eden Biran, Daniela Gottesman, Sohee Yang, Mor Geva, and Amir Globerson\.Hopping too late: Exploring the limitations of large language models on multi\-hop queries\.*arXiv preprint arXiv:2406\.12775*, 2024\.
- Butt et al\. \(2025\)Natasha Butt, Ariel Kwiatkowski, Ismail Labiad, Julia Kempe, and Yann Ollivier\.Soft tokens, hard truths\.*arXiv preprint arXiv:2509\.19170*, 2025\.
- Cao et al\. \(2026\)Ruisheng Cao, Mouxiang Chen, Jiawei Chen, Zeyu Cui, Yunlong Feng, Binyuan Hui, Yuheng Jing, Kaixin Li, Mingze Li, Junyang Lin, et al\.Qwen3\-coder\-next technical report\.*arXiv preprint arXiv:2603\.00729*, 2026\.
- Chen et al\. \(2021\)Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde De Oliveira Pinto, Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, et al\.Evaluating large language models trained on code\.*arXiv preprint arXiv:2107\.03374*, 2021\.
- Cheng and Van Durme \(2024\)Jeffrey Cheng and Benjamin Van Durme\.Compressed chain of thought: Efficient reasoning through dense representations\.*arXiv preprint arXiv:2412\.13171*, 2024\.
- Feng et al\. \(2024\)Jiahai Feng, Stuart Russell, and Jacob Steinhardt\.Extractive structures learned in pretraining enable generalization on finetuned facts\.*arXiv preprint arXiv:2412\.04614*, 2024\.
- Gao et al\. \(2024\)Leo Gao, Jonathan Tow, Baber Abbasi, Stella Biderman, Sid Black, Anthony DiPofi, Charles Foster, Laurence Golding, Jeffrey Hsu, Alain Le Noac’h, Haonan Li, Kyle McDonell, Niklas Muennighoff, Chris Ociepa, Jason Phang, Laria Reynolds, Hailey Schoelkopf, Aviya Skowron, Lintang Sutawika, Eric Tang, Anish Thite, Ben Wang, Kevin Wang, and Andy Zou\.The language model evaluation harness, 07 2024\.URL[https://zenodo\.org/records/12608602](https://zenodo.org/records/12608602)\.
- Goyal et al\. \(2023\)Sachin Goyal, Ziwei Ji, Ankit Singh Rawat, Aditya Krishna Menon, Sanjiv Kumar, and Vaishnavh Nagarajan\.Think before you speak: Training language models with pause tokens\.*arXiv preprint arXiv:2310\.02226*, 2023\.
- Gozeten et al\. \(2025\)Halil Alperen Gozeten, M Emrullah Ildiz, Xuechen Zhang, Hrayr Harutyunyan, Ankit Singh Rawat, and Samet Oymak\.Continuous chain of thought enables parallel exploration and reasoning\.*arXiv preprint arXiv:2505\.23648*, 2025\.
- Guo et al\. \(2025\)Daya Guo, Dejian Yang, Haowei Zhang, Junxiao Song, Peiyi Wang, Qihao Zhu, Runxin Xu, Ruoyu Zhang, Shirong Ma, Xiao Bi, et al\.Deepseek\-r1: Incentivizing reasoning capability in llms via reinforcement learning\.*arXiv preprint arXiv:2501\.12948*, 2025\.
- Hao et al\. \(2024\)Shibo Hao, Sainbayar Sukhbaatar, DiJia Su, Xian Li, Zhiting Hu, Jason Weston, and Yuandong Tian\.Training large language models to reason in a continuous latent space\.*arXiv preprint arXiv:2412\.06769*, 2024\.
- Huang et al\. \(2025\)Yixiao Huang, Hanlin Zhu, Tianyu Guo, Jiantao Jiao, Somayeh Sojoudi, Michael I Jordan, Stuart Russell, and Song Mei\.Generalization or hallucination? understanding out\-of\-context reasoning in transformers\.*arXiv preprint arXiv:2506\.10887*, 2025\.
- Jaech et al\. \(2024\)Aaron Jaech, Adam Kalai, Adam Lerer, Adam Richardson, Ahmed El\-Kishky, Aiden Low, Alec Helyar, Aleksander Madry, Alex Beutel, Alex Carney, et al\.Openai o1 system card\.*arXiv preprint arXiv:2412\.16720*, 2024\.
- Kohli et al\. \(2026\)Harsh Kohli, Srinivasan Parthasarathy, Huan Sun, and Yuekun Yao\.Loop, think, & generalize: Implicit reasoning in recurrent\-depth transformers\.*arXiv preprint arXiv:2604\.07822*, 2026\.
- Niklaus and Kydlíček \(2026\)Joel Niklaus and Hynek Kydlíček\.Smoldata\.[https://huggingface\.co/collections/HuggingFaceFW/smol\-data](https://huggingface.co/collections/HuggingFaceFW/smol-data), 2026\.
- Paszke et al\. \(2019\)Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al\.Pytorch: An imperative style, high\-performance deep learning library\.*Advances in neural information processing systems*, 32, 2019\.
- Pfau et al\. \(2024\)Jacob Pfau, William Merrill, and Samuel R Bowman\.Let’s think dot by dot: Hidden computation in transformer language models\.*arXiv preprint arXiv:2404\.15758*, 2024\.
- Press et al\. \(2023\)Ofir Press, Muru Zhang, Sewon Min, Ludwig Schmidt, Noah A Smith, and Mike Lewis\.Measuring and narrowing the compositionality gap in language models\.In*Findings of the Association for Computational Linguistics: EMNLP 2023*, pages 5687–5711, 2023\.
- Saunshi et al\. \(2025\)Nikunj Saunshi, Nishanth Dikkala, Zhiyuan Li, Sanjiv Kumar, and Sashank J Reddi\.Reasoning with latent thoughts: On the power of looped transformers\.*arXiv preprint arXiv:2502\.17416*, 2025\.
- Su et al\. \(2025\)Dijia Su, Hanlin Zhu, Yingchen Xu, Jiantao Jiao, Yuandong Tian, and Qinqing Zheng\.Token assorted: Mixing latent and text tokens for improved language model reasoning\.In*International Conference on Machine Learning*, pages 57144–57163\. PMLR, 2025\.
- Wang et al\. \(2024\)Boshi Wang, Xiang Yue, Yu Su, and Huan Sun\.Grokked transformers are implicit reasoners: A mechanistic journey to the edge of generalization\.*arXiv preprint arXiv:2405\.15071*, 2024\.
- Wang et al\. \(2023\)Xinyi Wang, Lucas Caccia, Oleksiy Ostapenko, Xingdi Yuan, William Yang Wang, and Alessandro Sordoni\.Guiding language model reasoning with planning tokens\.*arXiv preprint arXiv:2310\.05707*, 2023\.
- Wei et al\. \(2022\)Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Fei Xia, Ed Chi, Quoc V Le, and Denny Zhou\.Chain\-of\-thought prompting elicits reasoning in large language models\.In*Advances in Neural Information Processing Systems*, volume 35, 2022\.
- Wolf et al\. \(2019\)Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Rémi Louf, Morgan Funtowicz, et al\.Huggingface’s transformers: State\-of\-the\-art natural language processing\.*arXiv preprint arXiv:1910\.03771*, 2019\.
- Yang et al\. \(2024\)Sohee Yang, Elena Gribovskaya, Nora Kassner, Mor Geva, and Sebastian Riedel\.Do large language models latently perform multi\-hop reasoning?*arXiv preprint arXiv:2402\.16837*, 2024\.
- Yang et al\. \(2025\)Sohee Yang, Nora Kassner, Elena Gribovskaya, Sebastian Riedel, and Mor Geva\.Do large language models perform latent multi\-hop reasoning without exploiting shortcuts?In*Findings of the Association for Computational Linguistics: ACL 2025*, pages 3971–3992, 2025\.
- Ye et al\. \(2025a\)Jiaran Ye, Zijun Yao, Zhidian Huang, Liangming Pan, Jinxin Liu, Yushi Bai, Amy Xin, Weichuan Liu, Xiaoyin Che, Lei Hou, et al\.How do transformers learn implicit reasoning?*arXiv preprint arXiv:2505\.23653*, 2025a\.
- Ye et al\. \(2025b\)Jiaran Ye, Zijun Yao, Zhidian Huang, Liangming Pan, Jinxin Liu, Yushi Bai, Amy Xin, Liu Weichuan, Xiaoyin Che, Lei Hou, et al\.How does transformer learn implicit reasoning?*arXiv preprint arXiv:2505\.23653*, 2025b\.
- Ye et al\. \(2024\)Tian Ye, Zicheng Xu, Yuanzhi Li, and Zeyuan Allen\-Zhu\.Physics of language models: Part 2\.1, grade\-school math and the hidden reasoning process\.*arXiv preprint arXiv:2407\.20311*, 2024\.
- Zeng et al\. \(2025\)Boyi Zeng, Shixiang Song, Siyuan Huang, Yixuan Wang, He Li, Ziwei He, Xinbing Wang, Zhiyu Li, and Zhouhan Lin\.Pretraining language models to ponder in continuous space\.*arXiv preprint arXiv:2505\.20674*, 2025\.
- Zhang et al\. \(2025\)Zhen Zhang, Xuehai He, Weixiang Yan, Ao Shen, Chenyang Zhao, Shuohang Wang, Yelong Shen, and Xin Eric Wang\.Soft thinking: Unlocking the reasoning potential of llms in continuous concept space\.*arXiv preprint arXiv:2505\.15778*, 2025\.
- Zhu et al\. \(2024\)Hanlin Zhu, Baihe Huang, Shaolun Zhang, Michael Jordan, Jiantao Jiao, Yuandong Tian, and Stuart Russell\.Towards a theoretical understanding of the’reversal curse’via training dynamics\.*Advances in neural information processing systems*, 37:90473–90513, 2024\.
- Zhu et al\. \(2025a\)Hanlin Zhu, Shibo Hao, Zhiting Hu, Jiantao Jiao, Stuart Russell, and Yuandong Tian\.Emergence of superposition: Unveiling the training dynamics of chain of continuous thought\.*arXiv preprint arXiv:2509\.23365*, 2025a\.
- Zhu et al\. \(2025b\)Hanlin Zhu, Shibo Hao, Zhiting Hu, Jiantao Jiao, Stuart Russell, and Yuandong Tian\.Reasoning by superposition: A theoretical perspective on chain of continuous thought\.*arXiv preprint arXiv:2505\.12514*, 2025b\.
- Zhu et al\. \(2025c\)Rui\-Jie Zhu, Zixuan Wang, Kai Hua, Tianyu Zhang, Ziniu Li, Haoran Que, Boyi Wei, Zixin Wen, Fan Yin, He Xing, et al\.Scaling latent reasoning via looped language models\.*arXiv preprint arXiv:2510\.25741*, 2025c\.
## Appendix AAdditional experiments and training details on synthetic datasets
### A\.1Training details
We implement the vanilla non\-looped transformers, looped\-transformers and DiscoLoop all through PyTorch and Huggingface Transformers\[Paszke et al\.,[2019](https://arxiv.org/html/2607.00341#bib.bib20), Wolf et al\.,[2019](https://arxiv.org/html/2607.00341#bib.bib28)\]\. All the synthetic experiments are done on 8 NVIDIA H200 GPUs within 168 hours at maximum\.
### A\.2Three\-hop reasoning experiment
To check that the architectural advantage of DiscoLoop is not specific to two\-hop composition, we run the same comparison on a three\-hop extension of the symbolic two\-graph task\.
#### Three\-hop questions\.
Following the symbolic abstraction in Section[2](https://arxiv.org/html/2607.00341#S2), a*three\-hop question*is a chain\(a,r1,r2,r3\)\(a,r\_\{1\},r\_\{2\},r\_\{3\}\)whose answerddis determined by composing three atomic facts: there exist uniqueb,c∈ℰb,c\\in\\mathcal\{E\}such that\(a,r1,b\),\(b,r2,c\),\(c,r3,d\)∈ℱ\(a,r\_\{1\},b\),\\,\(b,r\_\{2\},c\),\\,\(c,r\_\{3\},d\)\\in\\mathcal\{F\}\. We refer tobbandccas the two bridge entities, and the three\-hop input is rendered as a five\-token sequence<a\> <r\_1\> <r\_2\> <r\_3\> <d\>, with the model trained to predict the final answer token\.
#### Dataset\.
We re\-use the two\-graph construction of Section[3\.1](https://arxiv.org/html/2607.00341#S3.SS1):\|ℰA\|=\|ℰB\|=500\|\\mathcal\{E\}\_\{A\}\|=\|\\mathcal\{E\}\_\{B\}\|=500entities per graph, a shared relation vocabulary of size\|ℛ\|=50\|\\mathcal\{R\}\|=50, and out\-degree1010, so each graph contains5,0005\{,\}000atomic facts\. The training set is composed of*all*10,00010\{,\}000atomic facts from both graphs,5,0005\{,\}000two\-hop questions, and5,0005\{,\}000three\-hop questions, both sampled from𝒢A\\mathcal\{G\}\_\{A\}\. We evaluate on four held\-out test splits of1,0001\{,\}000chains each: two\-hop ID and three\-hop ID, sampled from𝒢A\\mathcal\{G\}\_\{A\}disjoint from training; and two\-hop OOD and three\-hop OOD, sampled from𝒢B\\mathcal\{G\}\_\{B\}\. Since no compositional question over𝒢B\\mathcal\{G\}\_\{B\}is ever seen in training, both OOD splits cleanly probe systematic compositional generalization at the corresponding reasoning depth\.
#### Models and training\.
We setK=3K=3loops for both the vanilla looped transformer and DiscoLoop, matching the maximum reasoning depth in the data\. The non\-looped baseline correspondingly stacks three copies offθf\_\{\\theta\}as untied layers\. We use a fixed gatingα=1\\alpha=1for DiscoLoop\. All other hyperparameters \(base model, optimizer, learning rate, batch size, schedule\) follow Section[3\.1](https://arxiv.org/html/2607.00341#S3.SS1)\.
Figure 5:Test accuracy on the three\-hop symbolic dataset for the non\-looped transformer, the vanilla looped transformer, and DiscoLoop\. Solid lines: ID test set\. Dashed lines: OOD test set\.Left:two\-hop test accuracy\.Right:three\-hop test accuracy\.
#### Results\.
Figure[5](https://arxiv.org/html/2607.00341#A1.F5)shows test accuracy on the four splits over training\. The curves resemble the two\-hop case but with a more pronounced separation\. On the two\-hop splits \(left panel\), DiscoLoop reaches near\-perfect ID accuracy and around90%90\\%OOD, while the vanilla looped transformer plateaus near40%40\\%ID and5%5\\%OOD, and the non\-looped baseline fails on both\. On the three\-hop splits \(right panel\), DiscoLoop again converges to near\-perfect ID accuracy and reaches roughly65%65\\%OOD\. Strikingly, both the vanilla looped transformer and the non\-looped baseline remain near zero on the three\-hop OOD split throughout training\.
In conclusion, DiscoLoop’s advantage is not specific to two\-hop composition: the same mechanism continues to accelerate training and improve generalization at deeper reasoning depths\. Moreover, the gap between DiscoLoop and the baselines*widens*with depth\. The vanilla looped transformer can still partially solve two\-hop ID, but almost fails on three\-hop, where each additional hop requires another clean handoff between loops\. This is consistent with the mechanistic story in Section[3\.2](https://arxiv.org/html/2607.00341#S3.SS2): representational misalignment at the bridge position compounds across hops in the vanilla model, while DiscoLoop’s discrete channel suppresses it at every hop, unlocking compositional generalization that is otherwise unreachable\.
### A\.3Stage\-1 inductive bias on the natural\-language datasets
Figure 6:Stage\-1 two\-hop training accuracy on the two synthetic natural\-language datasets \(*direct*and*reverse*formats\), for the non\-looped transformer, the vanilla looped transformer, and DiscoLoop\. As in the symbolic case, both looped models suppress their Stage\-1 training accuracy as composition is offloaded fromfθf\_\{\\theta\}to the looping recurrence; the suppression is markedly sharper for DiscoLoop than for the vanilla looped transformer\. The non\-looped baseline retains∼100%\\sim\\\!100\\%throughout, having no second loop to offload composition to\.Figure[6](https://arxiv.org/html/2607.00341#A1.F6)plots the Stage\-1 two\-hop training accuracy on the two natural\-language datasets, computed exactly as in the symbolic case \(Section[5\.1](https://arxiv.org/html/2607.00341#S5.SS1)\)\. The pattern mirrors that case: both looped models initially fit the two\-hop training set within a single loop and then sharply suppress this single\-loop accuracy once composition is offloaded to the looping recurrence\. The collapse is remarkably sharper for DiscoLoop than for the vanilla looped transformer—DiscoLoop drops to near\-zero Stage\-1 accuracy within roughly400400epochs, while the vanilla baseline takes more than2,0002\{,\}000epochs to do the same\. The non\-looped baseline retains∼100%\\sim\\\!100\\%Stage\-1 accuracy throughout, since it has no second loop to offload composition to\. The natural\-language results therefore reproduce the same inductive\-bias phenomenon observed in the symbolic setting, with DiscoLoop again strengthening it\.
## Appendix BLanguage modeling pretraining details
This section gives the full training and evaluation details for the open\-domain language\-modeling experiments in Section[5\.3](https://arxiv.org/html/2607.00341#S5.SS3)\. We adopt the Ouro architecture fromZhu et al\. \[[2025c](https://arxiv.org/html/2607.00341#bib.bib39)\]because it provides a strong and established design for loop transformers\. The recorded launcher configuration corresponds to the vanilla loop baseline\. DiscoLoop and PonderLM use the same architecture scale, data mixture, tokenizer, optimizer, sequence length, and distributed training setup, changing only the recurrent computation mechanism\. All recurrent models apply the backbone four times, i\.e\.,K=4K=4\.
For DiscoLoop, we use a top\-kkapproximation to the decode\-then\-encode operatorΦ\\Phiin Eq\. \([5](https://arxiv.org/html/2607.00341#S4.E5)\)\. For a hidden statehh, let
𝒯k\(h\)=TopK\(\{pv\(h\)\}v=1V\)⊆\[V\]\\mathcal\{T\}\_\{k\}\(h\)=\\operatorname\{TopK\}\\big\(\\\{p\_\{v\}\(h\)\\\}\_\{v=1\}^\{V\}\\big\)\\subseteq\[V\]denote the set ofkktokens with the largest probabilities under the LM\-head distributionp\(h\)p\(h\)\. We then replaceΦ\\Phiby
Φk\(h\)=∑v∈𝒯k\(h\)pv\(h\)𝐖\[v\],\\Phi\_\{k\}\(h\)=\\sum\_\{v\\in\\mathcal\{T\}\_\{k\}\(h\)\}p\_\{v\}\(h\)\\mathbf\{W\}\[v\],where we mask all logits outside the top\-kkset and then computing the embedding average on this truncated support\. This reduces compute and memory overhead, since most probabilitiespv\(h\)p\_\{v\}\(h\)are negligible in practice\. We find thatk=128k=128is sufficient to retain essentially all nontrivial probability mass in our pretraining runs\.
For PonderLM, four backbone applications correspond to three ponder steps under the convention of the original PonderLM formulation, where the final backbone application is treated as the standard final forward pass rather than a ponder step\.
#### Architecture\.
We use a looped transformer backboneZhu et al\. \[[2025c](https://arxiv.org/html/2607.00341#bib.bib39)\]with hidden size10241024,2424layers, and1616attention heads\. The recurrent computation uses four total applications of the backbone\. The context length is81928192, with maximum position embeddings set to1638416384and RoPE baseθ=106\\theta=10^\{6\}\. The model uses SwiGLU activations, tied input/output embeddings, no QKV bias, and vocabulary size129,280129\{,\}280\.
#### Training data\.
Unless otherwise specified, all runs use the same two\-source pretraining mixture:60%60\\%FineWeb\-Edu sample data and40%40\\%FineMath\-4plus\. Both sources are loaded as streaming parquet datasets\. We use the DeepSeek\-V3\-0324 tokenizer\.
#### Optimization\.
Models are trained with AdamW and Muon enabled\. We use learning rate3×10−33\\times 10^\{\-3\}, AdamWϵ=10−15\\epsilon=10^\{\-15\}, Muon momentum0\.950\.95, gradient clipping at norm1\.01\.0, and a linear learning\-rate schedule with10001000warmup steps and final absolute learning rate10−510^\{\-5\}\. The effective batch size is128128, the sequence length is81928192\.
#### Token budget and distributed setup\.
The Loop baseline is trained with a target budget of2020B tokens\. With22nodes,88GPUs per node, batch size88, sequence length81928192, and gradient accumulation11, each step processes1,048,5761\{,\}048\{,\}576tokens\. This gives19,07419\{,\}074optimization steps, corresponding to20,000,538,62420\{,\}000\{,\}538\{,\}624total training tokens\.
#### Evaluation\.
We evaluate checkpoints usinglm\-evaluation\-harnessin the zero\-shot setting\. The reported benchmarks are ARC\-C, ARC\-E, HellaSwag, LAMBADA, PIQA, RACE, and SciQ\. For multiple\-choice tasks wherelm\-evaluation\-harness\[Gao et al\.,[2024](https://arxiv.org/html/2607.00341#bib.bib11)\]providesacc\_norm, we reportacc\_norm; otherwise we reportacc\.
#### Training loss curves\.
Figure[7](https://arxiv.org/html/2607.00341#A2.F7)shows the pretraining global average loss for the three settings: DiscoLoop, Vanilla loop, and PonderLM\. Early in training, Vanilla loop has the lowest loss, while DiscoLoop and PonderLM start slightly higher\. In the second half of training, however, DiscoLoop undergoes a clear transition and overtakes Vanilla loop, becoming the best\-performing run in the late stage\. In the zoomed region, this advantage is sustained and reaches roughly10−210^\{\-2\}in global average loss at its largest, while PonderLM remains above DiscoLoop throughout this phase\.
Figure 7:Pretraining loss curves for the language modeling\.Global average loss versus training tokens for DiscoLoop, Vanilla loop, and PonderLM over the full2020B\-token training budget \(19,07419\{,\}074optimization steps\)\. For readability, curves are smoothed with an exponential moving average\. The upper panel shows the full training trajectory, while the lower panel zooms into the late\-training regime from roughly1010B to1717B tokens; the dashed box and connector lines in the upper panel indicate the zoomed interval\. Vanilla loop leads early in training, but DiscoLoop overtakes it in the second half of training and attains the lowest loss in the zoomed region, with a peak separation from Vanilla loop on the order of10−210^\{\-2\}\. PonderLM also starts above Vanilla loop and, although it steadily improves, remains above DiscoLoop throughout the zoomed window\.Similar Articles
Decoding Looped Transformers Better for (Almost) Free
The paper introduces LoopCD, a training-free contrastive decoding framework for looped transformers that uses intermediate recurrent states as weak/strong prediction pairs, delivering substantial gains (e.g., Ouro-2.6B-Thinking's AIME 2024 pass@1 rising from 61.88% to 73.33%) while enabling halving of recurrent loops and 22.5%-48.2% reductions in forward FLOPs.
@ZhihuFrontier: Half a year ago, a Zhihu contributor predicted that the next Transformer would absorb loops, recurrent state, sparse ro…
A Zhihu contributor's half-year-old prediction that the next Transformer would absorb loops, recurrent state, sparse routing, and latent reasoning is gaining relevance as Loop Engineering advances. The article explores how future Transformer architectures may evolve into hybrid models blending linear-complexity layers for background context with attention for precise reasoning, plus finer-grained sparsity and native System 2 reasoning.
Looped State-Space Language Models with Adaptive Exit-State Selection
This paper explores looped (recurrent) state-space language models using Mamba and hybrid Mamba-Transformer backbones, showing they outperform non-looped baselines on reasoning tasks and remain competitive under iso-parameter and iso-FLOPs pretraining, with adaptive exit-state selection improving intermediate-depth performance.
@DorothyDDU: LoopCoder-v2 is out Loop Transformers reuse the same block for recurrent hidden-state refinement — letting models “thin…
This paper introduces LoopCoder-v2, a family of 7B parameter parallel loop transformers for code generation, and studies the optimal number of loops, finding that two loops yield significant gains while more loops cause degradation.
Looped World Models
Looped World Models introduce iterative latent state refinement through shared transformer blocks, achieving 100x parameter efficiency while adapting computational depth to prediction complexity.