Looped transformers and AlphaFold recycling
· 21 min read · Updated Nov 2, 2026
Digests are written primarily by LLMs with only readability edits by me. If this one reads like slop, please shoot me an email at max.zhuang@berkeley.edu.
Saunshi and colleagues trained small transformers on a synthetic task: adding up to 32 three-digit numbers, writing only the answer. A model with a single layer got at most 0.1 percent of the test sums right. A model that ran a single layer twelve times in a row, each pass taking in what the last one produced, got 99.6 percent or more. That is within half a point of the 100 percent scored by a model with twelve separate layers. Each score is the best of three training runs. Saunshi et al.
A model that runs the same block of layers several times, like this one, is a looped transformer. AlphaFold 2 does something similar with its whole structure predictor: after predicting a protein’s structure, it runs the same network again, starting from what the previous pass produced, four passes in all in its published setup. Its authors call this recycling (each pass after the first is a recycle) and report that it “contributes markedly to accuracy with minor extra training time”. Both spend more computation on a problem without adding learned weights. Dehghani et al., Jumper et al.
The two carry different information between passes. A looped language model hands the next pass only its internal numerical states; Geiping and colleagues’ model also re-reads the same embedded input in every pass. AlphaFold 2 passes on its internal features too, and adds distances measured in the three-dimensional structure it has just predicted. AlphaFold’s input also includes many evolutionarily related sequences lined up against the protein’s own, and by default each pass reads a new random sample of them. A recycle is therefore partly a fresh look at the input, as well as a revision of the last prediction.
This digest asks what the extra passes buy, and compared with what; what they cost; and what one pass has to hand the next for a later pass to improve on it.
- Looping adds depth without adding stored weights: four layers run six times make 24 layer applications, the arithmetic of a 24-layer model, from four layers’ weights.
- A later pass can build on what an earlier pass computed, so depth can matter for problems that chain steps. Separate layers give the same depth, so only a comparison can show whether reusing one block is enough.
- Against a model of the same size run once, extra passes helped in each comparison here. Against separate layers given the same computation, looped language models have usually done no better overall in the studies so far, and they recall fewer facts; results on reasoning are mixed.
- In one model trained with varying loop counts, running more loops at test time raised its scores up to 32 loops, about its training average, with most of each gain by 16 loops. That was not measured against a fixed-depth model of equal cost, and on grade-school math problems (GSM8K) answered without written-out reasoning, accuracy rose under two points from 4 to 32 loops.
- A loop saves stored weights, not arithmetic: six passes through a block take roughly six times its computation. Training by tracing the error back through every pass takes memory that grows with the number of passes, which is why AlphaFold 2 and the model above trace it through only the end of the loop.
- AlphaFold 2 hands the next pass distances measured on its predicted structure, along with its features, and by default each pass reads a new sample of the aligned sequences. Removing recycling lowered its accuracy, but that removes several things at once, so the experiment cannot say whether the fed-back structure is why.
- AlphaFold 3 recycles only features and generates coordinates afterwards by diffusion, so its loop is closer to a looped transformer’s, though with a deep alignment its input still varies from pass to pass.
- More passes are not guaranteed to help: the useful number differs between tasks and between inputs, and in the one family of language models here run past its trained number of passes, accuracy generally fell. A rule that stops once the answer stops changing saves computation but cannot tell a settled right answer from a settled wrong one.
What a looped transformer repeats
A looped transformer applies one block of layers several times, each pass starting from the hidden states the last one produced. That adds depth, the number of layers applied one after another, without adding stored weights, but each pass costs the arithmetic of the layers it repeats.
In a conventional transformer, successive layers usually have different weights. A looped transformer reuses a layer or block of layers instead. Each run through the block is a pass, also called a loop. Each pass receives the hidden state produced by the previous one, so it can build on earlier computations. Nothing is learned during the passes: the weights stay fixed during inference, when the trained model is used to make a prediction.
Four layers run six times give 24 layer applications, as many as a conventional 24-layer model, while storing only four layers’ weights. In a language model, all the passes for a token run before the readout, the step that turns the hidden states into probabilities for the next token. The diagram below unrolls that example beside four layers run once and 24 different layers. Saunshi et al.
The same idea goes by the names recurrent depth and depth recurrence, because the model repeatedly processes states at the same input positions. A conventional recurrent neural network instead carries state from one sequence position to the next. Universal Transformers is an early example, combining depth recurrence with attention.
Why another pass can help
A later pass can combine what an earlier pass computed, so depth, the number of steps applied in sequence, can matter for problems that chain steps. Separate layers give depth as well, so whether reusing one block is enough is a question for measurement.
Suppose the input says Alice is older than Bob, and Bob is older than Carol. One step of computation could represent the two comparisons; a later step could combine them to establish that Alice is older than Carol. The second step uses the first step’s result, so the two come one after the other.
Saunshi and colleagues argue that many reasoning problems require a large depth but not necessarily many parameters. Their reason is that such problems can often be solved by an iterative algorithm, which applies the same step again and again; a loop applies the same few weights again and again. Saunshi et al.
A deeper model with separate weights for each layer could take the same two steps, so the example argues for more steps in sequence, not for reusing one block. The experiments in the next section compare the two.
The example illustrates a computation that steps in sequence allow. It does not identify the steps a trained model actually takes.
Looped and deeper models compared
What looping buys depends on what is held fixed. Against a model of the same size run once, extra passes helped in each comparison here, at the price of more computation. Against separate layers given the same computation, looped language models have usually done no better overall in the studies so far, and they recall fewer facts.
Saunshi and colleagues ran both comparisons, first on synthetic tasks trained from scratch, such as adding up to 32 three-digit numbers or solving symbolic grade-school math problems. There, looped models nearly matched or beat deeper models with the same total number of layer applications, using a fraction of the weights. The single layer run twelve times, in the opening, is one such case. Saunshi et al.
They also trained language models on 250 billion tokens of text, comparing a 24-layer model with looped models that run a block of 4 to 12 layers enough times to make 24 layer applications. The looped models therefore store between a sixth and a half of its layer weights. Each looped model was also compared with its own block run once.
The four layers looped six times, from the first section, show both
comparisons at once. The paper’s tests of tracking variable assignments
include chains like the Alice example: given a=1, b=2, c=a, d=b, the model must
answer d=?. On the paper’s four variable-tracking tests the looped model
scored above both four layers run once and 24 different layers, averaging
56.9 percent against the deeper model’s 47.5. On questions testing memorized
facts it fell between them. The chart below shows all four groups of tests.
Average accuracy over the tasks in each group, for three separately trained models; the paper calls the groups closed-book QA, open-book QA, math word problems and reasoning primitives. The shaded bar spans the 4-layer and 24-layer models; the accent line runs from the 4-layer model to the looped one. Next-token prediction, as validation perplexity (lower is better): 10.12 for 4 layers, 8.79 looped, 7.40 for 24 layers.
At every block size, the looped models beat shallow models of their own size on every measure. Against the 24-layer model they were worse at next-token prediction, at questions testing memorized facts and at reading comprehension. They closed more of the gap on reading comprehension than on memorized facts, though.
On math word problems, looped models with blocks of six or more layers came within a point of the 24-layer model or passed it; the best, 12 layers run twice, scored 34.3 percent against 29.3.
On the four variable-tracking tests, which ask for a variable’s value directly or through one assignment, every looped model scored higher than the 24-layer model. Saunshi and colleagues read this as a bias of looped models toward reasoning, since these tests must be answered from the context, where memorized facts do not help. The paper reports one training run per language model, with no error bars.
Later studies that match computation agree that separate weights recall more facts, and their results on reasoning are mixed. A 2026 scaling study of models up to about a billion parameters measured, from validation loss, how much a repeat is worth. Under the authors’ training recipe, a block run four times was worth about 1.9 blocks with their own weights, roughly half the four that separate blocks would give. Schwethelm et al., 2026
That study also retrained its compute-optimal model for each architecture it compared, at its largest compute budget, with three random seeds. Scored by the loss on the answer text, differences on math word problems and on variable look-up and string-puzzle tests stayed within the spread between those runs. The variable-tracking lead from Saunshi’s single runs did not reappear there as a difference larger than run-to-run variation, though the two studies score their tests differently.
In another 2026 study, a looped model trailed a deeper model of the same computation by about 15 points on competition math (32.8 against 47.6 percent on MATH500). The study also ran a mixture-of-experts version of the comparison, whose layers send each token through a few of many parallel sub-networks. There the looped model led on grade-school math (83.6 against 80.8 percent on GSM8K) and trailed on 7 of the 10 benchmarks. That study reports no repeated runs with different seeds. Huang et al., 2026
Running more loops at test time
A looped model trained with varying loop counts can be run with more or fewer at test time. In one such model, scores rose with the loop count up to its training average, most of each gain by 16 loops. No fixed-depth model of equal cost was compared, and on grade-school math without written reasoning the gain was under two points.
Geiping and colleagues trained a 3.5-billion-parameter looped language model on 800 billion tokens, sampling a different number of loops for each training sequence, about 32 on average. Running more loops at test time raised its scores: on all eight benchmarks in the chart below, accuracy was higher at 32 loops than at one. Most of each gain came by 16 loops, sooner on some tasks than others. SciQ, which Geiping and colleagues describe as a test of recalled science facts, had nearly all of its gain by 8 loops, while MMLU gained less than two points up to 8 loops and about six more by 16. Geiping et al.
Accuracy in percent on multiple-choice benchmarks, answered with no worked examples in the prompt, normalised where the benchmark provides it · a loop is one pass through the model's repeated block of four layers · dashed line: chance, 25% or, for PiQA and WinoGrande, 50% · the model was trained with loop counts drawn at random around 32
The chart stops at 32 loops, near the training average, and training almost never drew a single loop, so the one-loop scores show the model run far below its usual depth.
Their one controlled comparison is a twin trained for 180 billion tokens with a single pass through the repeated block. The looped model at the same point in training, run with 32 loops, beat it on all eight benchmarks; run with one loop, it scored below the twin on seven of them. That shows a model can learn to make use of its loops at this scale. The twin matches parameters and training data but not computation, though, so the comparison cannot say whether a larger fixed-depth model given the same computation would do as well.
Those eight benchmarks are scored without any written reasoning. A model can also write a chain of thought, intermediate reasoning expressed as text, and run its loops before emitting each token of it. Geiping and colleagues used this combination for their chain-of-thought results on grade-school math problems (GSM8K).
Problem-solving that stays in the hidden states, without being written out, is called latent reasoning, and Geiping and colleagues describe their model’s gains as reasoning of this kind. The chart alone does not show it: SciQ, which they describe as a recall test, gained too, so the gains are not confined to tasks that need steps of reasoning.
A 2025 study tested the model more directly. With written reasoning suppressed, its GSM8K accuracy rose only from 3.1 to 4.9 percent between 4 and 32 loops. The study also decoded the hidden states produced during each loop into the tokens they favoured, on arithmetic problems, and found little sign of step-by-step reasoning there, though its authors do not rule it out. Lu et al., 2025
What a loop costs
Every extra loop, in training or at test time, costs the arithmetic of the block it repeats, so a loop saves stored weights, not arithmetic. Sharing weights cuts the memory for weights and the traffic of moving them, which matters where those are the limit.
Each pass starts from the last one’s output, so the passes for a token run one after another, like the layers of a model of the same total depth. Total memory also includes intermediate states and cached attention data, not only the stored weights.
Geiping and colleagues report that sharing weights reduced communication between processors and let them train with simpler parallelism. They also suggest that a looped model, being smaller than one scaled up by adding parameters, may be easier to run locally on ordinary chips. Geiping et al.
What AlphaFold 2 recycles
AlphaFold 2 makes the same trade with a whole structure predictor: each recycle reruns the entire network with the same weights. Besides its internal features, it hands the next pass distances measured on the structure it has just predicted, and by default each pass reads a new sample of the aligned sequences.
AlphaFold 2 predicts a protein’s structure from its amino acid sequence, aided by related sequences and, when available, structural templates. A multiple sequence alignment, or MSA, lines up those related sequences.
The Evoformer, the network’s main stack of 48 blocks, updates two sets of features. The MSA representation is a grid with one row per aligned sequence and one column per residue; its first row holds the protein being predicted. Pair features describe relationships between pairs of amino acid residues. The structure module then predicts coordinates. Jumper et al.
Recycling feeds three things into the next pass:
- Features of the target protein, from the first row of the previous MSA representation.
- Pair features from the previous pass.
- Distances from the predicted structure, measured between one atom per residue and sorted into ranges up to about 21 ångströms; anything farther falls into the last range.
AlphaFold adds this feedback to the representations the next pass starts from, then runs the Evoformer and structure module again with the same weights: four passes in all in the original setup, the initial prediction plus three recycles. The structure module is itself a small inner loop, applying one set of weights eight times within each pass; recycling is the outer loop around both. The diagram below draws this loop beside AlphaFold 3’s, which the next section takes up. Official AlphaFold 2 implementation, supplementary methods
By default, each pass also reads a new random sample of the aligned sequences, in the published method and in the released code. The authors name processing “multiple versions of the input features” as one purpose of recycling, alongside making the network deeper.
What could the fed-back structure add that the pair features lack? Pair features describe each pair of residues, and those descriptions need not fit together. A pairwise description matches a single three-dimensional structure only if many constraints hold, such as the triangle inequality on distances. Distances measured on a predicted structure all come from one arrangement, so they satisfy them by construction.
Suppose two regions of a protein have plausible local shapes but are poorly placed relative to each other. The predicted distances describe that placement when the regions sit within about 21 ångströms of each other; beyond that range they record only that the residues are far apart. Feeding them back gives the next pass one consistent account of the current placement to revise. Like the Alice example, this illustrates a computation the feedback allows, not the steps the trained model takes.
AlphaFold 2’s authors measured recycling directly, training and running a version without it, which was less accurate on both of their test sets. On the CASP14 domains it lost about 3 to 5 points of GDT, a 0–100 score of how many residues lie near their true positions. On about 2,300 recent chains from the Protein Data Bank it lost about 2 points of lDDT-Cα, another 0–100 accuracy score (values read off their chart, as is the 16 below). On that larger set the average loss appeared at every alignment depth, not only for proteins with few related sequences. Jumper et al.
Removing recycling takes away several things at once: the fed-back structure, the extra depth, the training losses on intermediate passes and the shared weights. So the ablation cannot say whether the fed-back structure is why recycling helps. The authors list the same four features when discussing a second ablation, which removed recycling together with invariant point attention, the structure module’s geometry-aware attention. That cut about 16 points of GDT on CASP14, much more than removing recycling alone, and they wrote that it is not clear which of the missing features of recycling explains the severe drop.
What AlphaFold 3 recycles
AlphaFold 3 keeps the predicted structure out of its loop: it recycles features only, and a separate diffusion module generates coordinates after the loop, without feeding them back.
Its Pairformer, which replaces AlphaFold 2’s Evoformer as the main stack, updates features for individual molecular tokens and pairs of tokens. A token here represents a residue or an atom.
The resulting features guide a separate diffusion module, which generates atomic coordinates through successive updates to noisy coordinates. Those coordinates are not fed back through the feature-recycling loop. Abramson et al., released inference code
Because no coordinates are fed back, AlphaFold 3’s recycling is closer than AlphaFold 2’s to a looped transformer’s internal-state updates. One difference remains: like AlphaFold 2, it draws a new random subset of a deep alignment on every pass, so its input also varies from pass to pass. AlphaFold 3 supplementary information
None of the sources cited here reports an experiment that puts the structure back into AlphaFold 3’s loop. Leaving it out is a design change, not evidence about what the fed-back structure contributed in AlphaFold 2.
Diffusion is a second iterative computation with its own state and training objective. More recycles, more diffusion steps, and more independent samples spend computation in different parts of the prediction process; the right half of the diagram in the previous section marks where each happens.
Choosing a loop count
The useful number of passes differs between tasks and between inputs. In the one family of language models here run past its trained number, accuracy generally fell, so the count has to be measured for the trained model and task. A stopping rule can save passes, but a settled answer can still be wrong.
In Geiping’s model, as the chart of loop counts showed, benchmarks reached most of their gain at different loop counts, and that chart stops near the training average. The Ouro models, a family of looped language models trained with four passes, were run with one to eight. They generally scored best at three to five. The 1.4-billion-parameter reasoning version fell from 65 to 39 percent on the AIME 2024 math competition between four and eight passes. Zhu et al., 2025
The useful number also varies between inputs. In AlphaFold 2, one protein from the CASP14 prediction competition, LmrP, reached its final structure within the first pass, while another, Orf8, needed nearly the full depth of all four passes. The chart below follows both through the four passes, scoring the structure read out after every Evoformer block. Jumper et al.
Domain GDT (global distance test) runs from 0 to 100; higher means more of the domain’s residues lie close to their positions in the experimental structure · a pass is 48 Evoformer blocks · values read off the published figure, to within about 2 points
A model can use a fixed number of passes or a stopping rule. The Universal Transformer’s adaptive version learns when to stop processing each position, allowing different positions to receive different amounts of computation. Dehghani et al.
AlphaFold-Multimer, by default, runs up to 20 recycles and stops early once the predicted distances between residues change by less than half an ångström (root mean square) from one pass to the next. That rule saves computation, but it cannot tell a settled right answer from a settled wrong one: a stable output does not mean a correct one, and the model can repeat the same wrong answer. AlphaFold-Multimer configuration
How the loops are trained
Training a loop has a cost of its own. The repeated block is trained on states produced by its earlier passes, and tracing the training error back through every pass takes memory and computation that grow with the number of passes. AlphaFold 2 traces it back through only the final pass, and Geiping’s model through at most the last eight loops.
In two 2026 studies of smaller looped language models, judged by validation loss, truncation of this kind lowered how much each repeat was worth. It still paid off when the number of loops was fixed in advance, because the freed computation went into more training text and a larger model. Schwethelm et al., 2026, Xiong et al., 2026
When the number of loops could also be chosen, Xiong and colleagues found that full backpropagation through fewer loops did better at the same computation. Xiong et al., 2026
Backpropagation, AlphaFold 2's stop-gradient and Geiping's truncation
Backpropagation computes how the prediction error depends on the weights. Tracing this calculation through every pass can require substantial memory, because the intermediate values from each pass must be kept until the backward calculation reaches them.
AlphaFold 2 samples a training pass count and applies the loss at the final pass. Because the count is sampled, the model has to produce a plausible structure partway through, not only after the last pass. It uses stop-gradient between recycles: earlier outputs become fixed inputs to the final pass, and the derivative calculation stops at that boundary. The shared weights still learn through the final pass, but their effect through the earlier passes is omitted from the gradient. This saves both memory and computation. The authors note that it biases the gradient and report that this did not hamper training. Supplementary methods
Geiping’s model samples varying depths and backpropagates through at most the last eight loops, so its training memory and backward computation do not grow with the number of loops. Geiping et al.
Related methods
Feeding a model’s own intermediate output back to it is not limited to repeating layers. Coconut feeds it forward along a language model’s sequence of positions, and RFdiffusion feeds it into the next step of a diffusion process, a design its authors connect to AlphaFold recycling.
Coconut and RFdiffusion, and how each differs from a loop
Coconut feeds a language model’s last hidden state, the final layer’s output at the latest position, directly into the next sequence position, bypassing the conversion to a text token. It adds latent positions to the sequence, whereas depth recurrence revisits existing positions. Both allow intermediate computation without writing it out. Hao et al.
RFdiffusion uses self-conditioning: the previous estimate of the clean, noise-free protein structure helps condition the next denoising step. The authors explicitly connect this choice to AlphaFold recycling. Here, prediction feedback operates inside a diffusion process. Watson et al.
What is settled, what is interpretation, what is open
The sources settle what a loop costs and what it beats. It saves stored weights, not arithmetic, and in each comparison here it beat a model of its own size run once; in language models so far, it has usually not beaten separate layers given the same computation. Why it helps is still interpretation, and whether handing the next pass a predicted structure adds anything is open.
Settled, under the conditions stated in each section:
- Looping adds depth without adding stored weights, and without saving arithmetic: four layers run six times do the arithmetic of 24 layers from four layers’ weights. What sharing weights cuts is the memory for weights and the traffic of moving them.
- Against a model of the same size run once, extra passes helped in each comparison here: Saunshi’s looped language models on every measure, in one run each; Geiping’s model, run with 32 loops, against its single-pass twin at 180 billion tokens; and AlphaFold 2 against a version without recycling, on both test sets.
- Against separate layers given the same computation, looped language models have usually done no better overall in the studies so far, and they recall fewer facts.
- In Geiping’s model, trained with varying loop counts, more loops at test time raised scores on all eight benchmarks charted, up to 32 loops, near its training average, with most of each gain by 16 loops. Past the number of passes used in training, scores can fall: the Ouro models, trained with four, generally scored best at three to five.
- AlphaFold 2 hands the next pass distances measured on its predicted structure along with its features, and by default each pass reads a new sample of the aligned sequences. Removing recycling lowered its accuracy on both test sets, and on the larger one the average loss appeared at every alignment depth. AlphaFold 3 recycles only features and generates coordinates afterwards by diffusion.
- The useful number of passes differs between tasks and between inputs. A rule that stops once the answer stops changing, such as AlphaFold-Multimer’s, saves computation but cannot tell a settled right answer from a settled wrong one.
Interpretation, and whose:
- That many reasoning problems require a large depth but not necessarily many parameters, so a loop suits them: Saunshi and colleagues’ argument, and their reading of their variable-tracking results. At matched computation the evidence on reasoning is mixed.
- That AlphaFold 3’s loop is closer than AlphaFold 2’s to a looped transformer’s: this digest’s comparison, on what is fed back. Like AlphaFold 2, AlphaFold 3 still draws a new random subset of a deep alignment on each pass.
- That a looped language model reasons in its hidden states rather than in written text: the framing of Geiping and colleagues. With written reasoning suppressed, a probing study of their model found a gain of under two points on grade-school math problems (GSM8K) from 4 to 32 loops and little sign of step-by-step reasoning in the hidden states, though its authors do not rule it out.
Open:
- Whether looped models match deeper ones on multi-step reasoning at matched computation, where results so far are mixed and most studies report one run per model, and at larger scale.
- Whether Geiping’s test-time gains would hold against a larger fixed-depth model given the same computation. Its one twin matched parameters and training data, not computation.
- Whether the structure AlphaFold 2 feeds back is part of what recycling buys. Its ablation removes the structure together with the extra depth, the training losses on intermediate passes and the shared weights, and AlphaFold 3’s feature-only loop is a design change, not a test.
- How to choose the number of passes for each input, when an answer that has stopped changing can still be wrong.
- How much truncating the gradient costs at larger scale. The two studies that measured it used smaller models and judged by validation loss.
Sources
- Dehghani et al., 2018 / ICLR 2019. Universal Transformers. Depth recurrence and adaptive halting.
- Jumper et al., 2021, Nature. Highly accurate protein structure prediction with AlphaFold. Recycling, its inputs, its training procedure, and the ablation that removes it.
- Saunshi et al., 2025, ICLR. Reasoning with Latent Thoughts: On the Power of Looped Transformers. Comparisons at matched parameter counts or effective depths.
- Geiping et al., 2025. Scaling up Test-Time Compute with Latent Reasoning: A Recurrent Depth Approach. A recurrent language model evaluated at varying depths.
- Lu, Yang, Lee, Li and Liu, 2025. Latent Chain-of-Thought? Decoding the Depth-Recurrent Transformer. Probes Geiping’s model with written reasoning suppressed.
- Zhu et al., 2025. Scaling Latent Reasoning via Looped Language Models. The Ouro models, evaluated beyond their trained number of passes.
- Schwethelm, Rueckert and Kaissis, 2026. How Much Is One Recurrence Worth? Iso-Depth Scaling Laws for Looped Language Models. Looped against non-looped models at matched computation, and the effect of truncated backpropagation.
- Huang et al., 2026. Towards Looped Models Done Right, Part I: Topology, Input Injection, Recurrent-State Design. Looped against deeper models at matched computation, dense and mixture-of-experts.
- Xiong et al., 2026. Truncate or Not? A Scaling Study of Looped Transformers with Truncated Backpropagation. Truncated against full backpropagation at matched computation.
- Abramson et al., 2024, Nature. Accurate structure prediction of biomolecular interactions with AlphaFold 3. Feature recycling followed by diffusion; the supplementary information describes resampling the alignment on each pass.
- Hao et al., 2024. Training Large Language Models to Reason in a Continuous Latent Space. Coconut’s sequence of continuous states.
- Watson et al., 2023, Nature. De novo design of protein structure and function with RFdiffusion. Self-conditioning during structure generation.