Introduction
The decoder in this task is fixed: a mixture-of-experts (MoE) transformer whose block shapes, initialisation, data, token count, optimizer and learning-rate schedule cannot change. What can change is how its blocks are called. A block may be applied more than once, a section of the stack may be looped, later states may be fed back to earlier layers or to later positions, and the training objective may be spread over several passes. The question is which use of extra training compute, through recurrence alone, gives the lowest held-out loss within a training-FLOPs cap.
The reference methods take distinct positions on what should flow between passes. Ouro loops the whole stack with an exit gate [1]; the looped-models study re-applies a middle block between a prelude and a coda with input injection [2]; HRM-Text runs two coupled recurrences at different timescales [3]. Others carry state across positions rather than across depth: T2MLR feeds a middle-layer state to the next position [4], the Full-bandwidth Transformer feeds the top layer back to the input at the next position [5], and the Latent Recurrent Transformer injects a mid-depth state into every layer's keys, values and residual [6]. DiscoLoop loops while carrying both a continuous state and a decoded embedding of the model's own prediction [7].
Three properties make the problem hard. First, a repeated pass that sees only the previous pass's output loses access to everything before it, including the token itself, so the loop must decide what to re-inject. Second, one MoE router is shared by every pass; when it sees a later pass's input, it can collapse onto a few experts. Third, the cap is on FLOPs, and the decoder is small relative to its vocabulary, so the number of passes that fits the budget depends strongly on model size. A method has to be one algorithm whose only per-size differences are values.
Method
Our method keeps several reference ideas that were cheap in FLOPs and puts them into one whole-stack loop. The guiding principle is that each repeated pass should see, in a learnable mixture, every representation the model has already computed for this position and its predecessors, instead of only the last one.
How many passes, and the bridge passes
The stack is run times. depends on the number of layers and was chosen so that the extra passes use up the training-FLOPs budget at each size: small models with few layers can afford nine passes, deeper ones four. Two passes are designated bridges , and at some sizes a final coda re-runs the upper half of the layers once more, which gives a fractional pass count. The peak learning rate is scaled with the effective pass count, , on the reasoning that gradients summed over more passes of the same weights have lower variance.
def _schedule_for_layers(L: int):
if L <= 2:
return 9, (2, 5), False
if L == 3:
return 8, (2, 5), False
if L == 4:
return 6, (1, 3), True
if L <= 6:
return 5, (1, 3), True
if L <= 8:
return 5, (1, 3), False
return 4, (1, 2), TrueWhat each pass receives
Let be the token embedding and the residual stream after pass . After each pass we form a deep state from the top of the stack and a middle layer,
and a positional state that carries the deep state of earlier positions, as T2MLR and the Full-bandwidth Transformer do [4, 5], but with three taps and a reset at document starts:
with a low-rank correction and, from the second pass on, a slowly propagating copy of the previous pass's positional state.
def _make_state_and_shift(self, x_top, x_mid, starts, idx: int, p_unit_prev=None):
s_top = R.rms_norm_np(x_top)
s_mid = R.rms_norm_np(x_mid)
s_last = R.rms_norm_np(s_top + s_mid * R.cdt(self.mid_gain[idx]))
s_prev1 = shift_reset(s_last, starts)
s_prev2 = shift_reset(s_prev1, starts)
s_prev3 = shift_reset(s_prev2, starts)
s_mix = s_prev1 + s_prev2 * R.cdt(self.tap2_gain[idx]) + s_prev3 * R.cdt(self.tap3_gain[idx])
lat = (s_mix @ R.cdt(self.sh_a)) * R.cdt(self.sh_lat_scale[idx])
p_shift = s_mix + lat @ R.cdt(self.sh_b)
if p_unit_prev is not None:
z1 = shift_reset(p_unit_prev, starts)
z2 = shift_reset(z1, starts)
z3 = shift_reset(z2, starts)
p_shift = p_shift + p_unit_prev * R.cdt(self.p_keep_gain[idx]) + z3 * R.cdt(self.p_wave_gain[idx])
return s_last, p_shift, R.rms_norm_np(p_shift)The input of pass is then not the previous output but a softmax mixture over all candidates seen so far: the embedding , every earlier deep state, every bridge embedding (below), and the final-normed output of the previous pass. The weights come from a small query on ,
which generalises the input injection of looped models [2] into attention over depth. The second term, a signed depth velocity, was added because convex weights cannot extrapolate along the direction in which successive passes are moving.
for k in range(self.K):
if k > 0:
cands = sources + [n_prev]
qd = (s_last + e0) @ R.cdt(self.w_depth_q)
logits = (qd @ R.cdt(self.w_depth_k[k - 1])).float() + self.b_depth[k - 1].float()
w = torch.softmax(logits, dim=-1).to(e0.dtype)
x = (torch.stack(cands, dim=-1) * w.unsqueeze(-2)).sum(dim=-1) * R.cdt(self.in_gain[k - 1])
if s_prev_pass is not None:
x = x + (s_last - s_prev_pass) * R.cdt(self.vel_gain[k - 1])
if last_phi_emb is not None:
bi = last_bi
ps = R.cdt(self.phi_pass_scale[k - 1])
g_phi = torch.sigmoid((last_phi_raw @ R.cdt(self.w_phi[bi]))[..., None] + R.cdt(self.b_phi[bi]))
pr_logit = (e0 @ R.cdt(self.w_prior[bi])
+ (e0 * last_phi_prior) @ R.cdt(self.w_agree[bi]))[..., None] + R.cdt(self.b_prior[bi])
g_pr = torch.sigmoid(pr_logit)
err = not_start * (e0 - last_phi_prior)
x = (x
+ (g_phi * last_phi_emb * R.cdt(self.gain_phi[bi])) * ps[0]
+ (g_pr * last_phi_prior * R.cdt(self.gain_prior[bi])
+ err * R.cdt(self.gain_err[bi])) * ps[1])Vocabulary bridges and prediction error
At the two bridge passes, the model reads out its own prediction and feeds it back as an embedding, as DiscoLoop does [7]. We decode only the top 128 tokens of the output projection, take a softmax over them, and return the probability-weighted sum of their input embeddings, . A custom autograd function computes this in chunks without materialising the full vocabulary distribution. Because the previous position's is the model's guess for the current token, we also form a prior and a prediction error , and add both to later passes, the prior behind a gate that depends on how well it agrees with the actual token embedding and the error with a learned gain.
if k < self.K - 1:
s_prev_pass = s_last
s_last, p_shift, p_unit_prev = self._make_state_and_shift(x, x_mid, starts, k, p_unit_prev)
n_prev = R.final(bb, x)
if k in self.bridges:
last_bi = self.bridges.index(k)
q_bridge = n_prev * R.cdt(self.bridge_qscale[last_bi])
last_phi_raw = fast_decode_encode(bb, q_bridge, self.topk)
last_phi_emb = bb.embed_gated_norm(bb.embed_norm(last_phi_raw))
last_phi_prior = shift_reset(last_phi_emb, starts)
sources.append(last_phi_emb)
sources.append(s_last)Inside a repeated block
A repeated block reuses the fixed weights and adds three changes. Its keys and values mix the block's own projections with the first pass's keys and values (a value residual), the previous pass's values, and a memory projected from , carrying deep and positional state into attention much as the Latent Recurrent Transformer injects a mid-depth state into every layer's keys and values [6]. Each source has a per-token gate, and three of them pass through a selective gate that can close a source completely. The attention output then has its component along the token's own value removed,
so that attention contributes only what the token does not already hold.
m1 = self.m_kv
raw = a_q @ R.cdt(self.w_g[l]) + R.cdt(self.b_g[ri, l])
g = 2.0 * torch.sigmoid(raw[..., :4 * m1])
sel = F.relu(1.0 + 2.0 * torch.tanh(0.5 * raw[..., 4 * m1:]))
gl_k, gr_k = g[..., :m1, None], g[..., m1:2 * m1, None]
gl_v, gr_v = g[..., 2 * m1:3 * m1, None], g[..., 3 * m1:4 * m1, None]
gk0 = sel[..., :m1, None] * R.cdt(self.g0_k[ri, l])
gv0 = sel[..., m1:2 * m1, None] * R.cdt(self.g0_v[ri, l])
gvp = sel[..., 2 * m1:3 * m1, None] * R.cdt(self.gprev_v[ri, l])
kk = gl_k * kk + gk0 * k0 + gr_k * mk
vv = gl_v * vv_loc + gv0 * v0 + gvp * v_prev + gr_v * mv
qn, kn = R.qk_finish(attn, q, kk)
qn = qn * R.cdt(self.q_temp[ri, l])
y_att = R.attend(attn, qn, kn, vv, seq)
av = vv.repeat_interleave(self.n_q // self.m_kv, dim=2)
dot = (y_att * av).sum(-1, keepdim=True)
vn = (av * av).sum(-1, keepdim=True)
y_xsa = y_att - (dot / (vn + 1e-6)) * av
gate = 2.0 * torch.sigmoid(a @ R.cdt(attn.attn_gate) + R.cdt(self.b_ag[ri, l]))[..., None]
y_attn = (gate * y_xsa).reshape(B, S, self.n_q * self.hd) @ R.cdt(attn.w_o)
x = xb + y_attn * R.cdt(self.attn_res_scale[ri, l])For the MoE sublayer, the router input of a repeated pass is re-centred (a learned mean direction is subtracted), shifted by the deep and positional states and a low-rank rotation, and rescaled back to the input's RMS; each pass role, the first pass included, also gets a bounded router bias, centred before the bound. The purpose is to let later passes reach different experts than the first, while the expert weights themselves stay untouched.
Readout and objective
The readout interpolates between the final pass and the two bridge passes with token-dependent coefficients, toward the second bridge and toward the first, so that the final pass can lean back on, or extrapolate away from, an earlier pass. The loss adds a cross-entropy at the second bridge with weight , annealed over training:
if k == self.K - 1:
u_fin = R.rms_norm_np(x)
u_b1 = R.rms_norm_np(x_b1)
u_b0 = R.rms_norm_np(x_b0)
ex_logits = (u_fin @ R.cdt(self.w_ex_f)
+ (u_fin - u_b1) @ R.cdt(self.w_ex_d)
+ e0 @ R.cdt(self.w_ex_e)).float() + self.b_ex.float()
ex_sig = torch.sigmoid(ex_logits).to(x.dtype)
c1 = 0.50 * ex_sig[..., 0:1] - 0.15
c0 = 0.17 * ex_sig[..., 1:2] - 0.05
outs.append(u_fin + c1 * (u_b1 - u_fin) + c0 * (u_b0 - u_fin))
else:
outs.append(x if k == self.bridges[1] else None)The same algorithm runs at every size; only values computed from the size change: the pass schedule, the low-rank widths, the initial middle-layer gain, whether the key and value memory projections are shared across banks of layers, and a compact parameterisation at the smallest width.
Results
| Method | ① | ② |
|---|---|---|
| LM loss, Paloma ↓ | LM loss, Paloma ↓ | |
| DiscoLoop | 3.435 | 3.100 |
| Full-bandwidth Transformer | 3.527 | 3.193 |
| HRM-Text | 3.487 | 3.146 |
| Huang et al. | 3.436 | 3.083 |
| Latent Recurrent Transformer | 3.494 | 3.169 |
| Grug MoE, no recurrence | 3.574 | 3.226 |
| Ouro | 3.469 | 3.129 |
| T2MLR | 3.522 | 3.171 |
- ① Grug MoE, 747M parameters, 1.44B tokens · held-out loss under a training-FLOPs cap
- ② Grug MoE, 2.04B parameters, 4.42B tokens · held-out loss under a training-FLOPs cap
For the reader's orientation, the strongest reference on Grug MoE, 747M parameters, 1.44B tokens is DiscoLoop [7] at 3.435, and on Grug MoE, 2.04B parameters, 4.42B tokens Huginn [2] at 3.083, against 3.574 and 3.226 for the starter decoder that runs every block once. Both leading references loop the decoder and re-inject information into the loop, which is the family our method belongs to.
What we can report are our own development measurements, on a held-out split of public pretraining text that we tokenised ourselves and at the smallest model sizes only; they are not comparable to the table. At the smallest size our final design reached a development loss of 3.883, against 4.208 for DiscoLoop and 4.413 for the starter decoder on the same data. At the next size, run for half of the training schedule, the synthesis the submission is built on reached 3.479 against 3.706 for DiscoLoop. These are single development runs, and none of them is a measurement of the submitted file on this task.
How we got here
We began by reading the fixed trainer and the reference implementations, measuring their parameter and FLOP counts at every size, and fetching the reference papers. We then built our own training and held-out data from public pretraining corpora and ran all eight reference methods at the smallest size as a development baseline. From there the method grew over nine rounds of about six parallel candidates each, every one checked for causality, parameter count and FLOPs before training.
- First round: the two-bridge synthesis came first. Six candidates, among them a loop anchored to the input, an LRT-style parallel memory with pass-specific routing, and loops with one, two or three vocabulary bridges, all came in below every reference in our development runs. Two bridges were better than three, which fixed the bridge count.
- Depth attention beat orthogonal input injection. Replacing a fixed injection of the embedding with a learned softmax over all earlier states improved the development loss by 0.025. In the same round, six passes beat four by 0.056 and a 20% larger learning rate helped by 0.028, which led to the pass-count-dependent learning-rate scale.
- Per-layer key and value memories, in the largest gain of that round. Giving every layer its own memory projection into keys and values, with separate key and value gates, together with an identity-residual two-tap shift in the same version, improved the development loss by 0.074 over the version without these changes. Reusing the first pass's keys and values, on the same base, added almost no FLOPs and helped by 0.043.
- A context-conditioned router. Until then the router of a repeated pass saw only that pass's own input, with a small low-rank correction. Conditioning the router query on the deep and positional states brought the development loss to 3.913.
- Convex mixing cannot extrapolate. A middle-layer tap into the deep state and the third shift tap gave 3.906. A probe after that round showed the depth attention assigning almost no weight to the last state, because a convex combination cannot express moving further along the direction between the last two passes. The signed depth velocity term, added in the next round, is our fix.
- Equalising compute across sizes. We derived the FLOPs of one stack pass and of one vocabulary decode at every size and set the pass schedule so that each size spends a similar share of the budget, with the upper-half coda supplying fractional passes. This gave 3.892 at the smallest size.
- Not every addition helped on its own. The prediction-error and readout-interpolation component, tested alone, made the development loss worse than the version it extended (3.904 against 3.892); it is part of the final synthesis, which as a whole was better than its predecessor at the second size (3.479 against 3.489). At the third size the synthesis was level with its predecessor (3.590 against 3.588). The submitted file differs from that synthesis only in computing the attention gate from the block's own input, which gave 3.883 at the smallest size.
- Router collapse at larger width, found but not fixed in the submission. A probe of the previous version at the third size found one repeated pass routing 99.5% of its tokens to ten experts, with 233 of 256 experts unused; a trust-region bound on the router shift reduced the unused experts to 69 in that probe. The submitted file re-centres the router input but has no such bound. A pruned version and the bounded router were tried in the last development runs and were not adopted.
Limitations
- Development stopped short of the larger sizes. Our development runs covered mainly the smallest model sizes, and at the larger of them only a fraction of the training schedule. We budgeted the method in FLOPs at every size, but we did not complete a full-length development run at any larger size.
- The bridge decode is approximate. To find the top 128 tokens, the bridge first keeps the 32 blocks of 64 vocabulary entries with the largest maxima and then searches inside them. When the top 128 tokens are spread over more than 32 blocks, some are missed. Keeping as many blocks as tokens makes the search exact, which we confirmed only after the submitted version.
- The method is a synthesis, and its parts are not separately justified. It contains many gated components, several with hand-set initial values, and at least one of them was worse on its own than without it. The gains we measured came from the synthesis at small sizes, not from a single mechanism whose effect we understand.
- Router collapse is unresolved. We found an MoE routing collapse in a repeated pass of an earlier version at the largest size we probed. We did not probe the submitted router at that size, and it does not include the bound we tested against it.
References
- Rui-Jie Zhu, Zixuan Wang, Kai Hua et al. (2025). Scaling Latent Reasoning via Looped Language Models.
- Benhao Huang, Chufan Shi, Junlin Chen et al. (2026). Towards Looped Models Done Right, Part I: Topology, Input Injection, Recurrent-State Design.
- Guan Wang, Changling Liu, Chenyu Wang et al. (2026). HRM-Text: Efficient Pretraining Beyond Scaling.
- Ziyang Cai, Xingyu Zhu, Yihe Dong et al. (2026). T^2MLR: Transformer with Temporal Middle-Layer Recurrence.
- Xi Wang, Ziyang Cai, Zheng Zhan et al. (2026). Full-bandwidth transformer.
- Zeyi Huang, Xuehai He, LiLiang Ren et al. (2026). Latent Recurrent Transformer: Architecture Exploration, Training Strategies, and Scaling Behavior.
- Hengyu Fu, Tianyu Guo, Zixuan Wang et al. (2026). DiscoLoop: Looping Discrete Embeddings and Continuous Hidden States for Multi-hop Reasoning.