Manuscript Offprint
arXiv:2610.26747recAMPLIFY: Large-Scale Pretraining of Recursive Protein Language Models
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Saurav Jha, Qianli Liao, Robert Vernon, Sarath Chandar, and Quentin Fournier
Mila – Quebec AI Institute, Polytechnique Montréal, Center for Brains, Minds, and Machines, MIT, Amgen, Canada CIFAR AI Chair, University of Montréal
Protein language models (pLMs) are powerful tools for protein annotation and mutation-effect prediction, but progress has largely depended on scaling model size and data, making them expensive and prone to memorization. Test-time scaling offers a complementary path, but methods developed for autoregressive LLMs do not transfer directly: masked encoders lack a generation loop, and amino acids do not verbalize in a reasoning language. Instead, we adapt recursive pretraining to masked pLMs, where a weight-tied Transformer core refines residue-aligned hidden states over an adjustable number of cycles. We instantiate this recipe as recAMPLIFY, a pLM with 155M unique parameters trained on the same 2T tokens as AMPLIFY-350M. Despite 56% fewer parameters, it improves CASP contact recovery and three out of four supervised tasks, notably raising fold accuracy by 22.5%. Because optimal depth for recAMPLIFY varies across tasks and assays, we then introduce Gated Mixture Recurrence (GMR), a framework that decodes each protein from a probability-weighted mixture of hidden states visited during recursion. GMR employs a learned residual gate at scalar, low-rank, or per-dimension resolution to control how much of each cycle's proposed update is accepted into the state. This unifies halting and gating into a single adaptive computation objective while recovering PonderNet-style halting as a special case without gates. Layered on top of recAMPLIFY, GMR further reduces expected layer depth by up to 37%, although the accuracy trade-off varies by task. Mechanistic analyses show that residual gating controls recurrence stability beyond the trained depth and that halt depth tracks biological properties.
Model Weights: huggingface.co/chandar-lab/recamplify
Code Repository: github.com/chandar-lab/AMPLIFY/tree/recamplify
1. Introduction
Proteins are sequences of amino acids shaped by evolutionary pressure to code diverse biological functions, including the ability to form specific folded structures. Protein language models (pLMs) attempt to learn these constraints directly from sequence [Rives et al., 2021, Elnaggar et al., 2022, Nijkamp et al., 2023, Ferruz et al., 2022], typically using bidirectional Transformer [Vaswani et al., 2017] encoders trained with masked language modeling (MLM) [Devlin et al., 2019]. By predicting masked residues from their surrounding context, these models must capture essential interactions, including those that are far apart in sequence but close in 3D space. The resulting conditional distributions enable zero-shot mutation scoring and contact recovery, while contextual representations enable downstream classification and regression tasks.
Recent progress in pLMs has largely been driven by scaling both model size and training data [Lin et al., 2023, Nijkamp et al., 2023, Candido et al., 2026]. However, parameter count alone does not determine performance. AMPLIFY-350M [Fournier et al., 2024], despite having 43× fewer parameters than ESM-2 15B [Lin et al., 2023], achieves comparable pseudo-perplexity on its curated validation set and better residue recovery on the human proteome. Several works further indicate that scaling can lead to undesirable memorization in larger pLMs [Cheng et al., 2024, Fournier et al., 2024, Hou et al., 2026]. These observations motivate test-time scaling and adaptive computation as complementary axes to increase compute while keeping the number of parameters fixed.
Test-time compute scaling in autoregressive LLMs typically relies either on generating verbalized reasoning tokens [Wei et al., 2022] or iteratively updating continuous latent states [Dehghani et al., 2019, Giannou et al., 2023, Hao et al., 2025]. For masked pLMs with no autoregressive generation loop, the discrete-token approach does not transfer. Furthermore, amino-acid sequences do not admit verbalized rationales, and inserting thought tokens would break the residue-to-state alignment required for masked prediction. In contrast, iterative refinement of continuous latent representations, hereafter latent refinement, offers a natural way to increase
Corresponding author(s): Saurav Jha (saurav.jha@polymtl.ca) and Quentin Fournier (quentin.fournier@mila.quebec)

Figure 1: recAMPLIFY architecture. A non-recurrent prelude maps input embeddings to a residue-aligned latent state , a weight-tied Transformer core iteratively refines this state, and a non-recurrent coda maps the refined state to the output space. Gated Mixture Recurrence (GMR) decodes from a probability-weighted mixture over the recurrence trajectory, with a per-sequence residual gate at scalar, low-rank, or per-dimension channel resolution controlling how much of each cycle's proposed update is accepted. Blue circles illustrate these channel-level parameterizations.
pLM computation. Latent refinement already has a strong precedent in protein structure prediction, where AlphaFold [Jumper et al., 2021] and ESMFold [Lin et al., 2023] recycle internal representations for a predefined number of cycles. However, these recycles operate on structural rather than sequence representations, leaving input-dependent test-time latent refinement unexplored in pLMs.
To approach test-time latent refinement, we hold a set of parameters as a recurrent unit [Nakano, 1972, Amari, 1972] that iteratively refines its hidden states in a recursive fashion. Building on depth-recurrent language models [Dehghani et al., 2019, Giannou et al., 2023, Geiping et al., 2025], we adapt a recursive pretraining framework for test-time scaling in pLMs. Applied to AMPLIFY, this framework yields recursive AMPLIFY (recAMPLIFY) that separates effective model depth from unique parameter count. In recAMPLIFY, a non-recurrent prelude first maps token embeddings into a residue-aligned latent representation space where recursion can be unrolled. A weight-tied core refines this state over a number of recurrent cycles, increasing compute without changing sequence length or residue alignment. A non-recurrent coda then maps the refined state to the MLM output space for masked-residue prediction (Figure 1). Because the core can be reapplied, the number of recurrent cycles, and therefore the effective depth, remains adjustable after pretraining.
Exposing recurrence depth as a test-time variable leaves open how to allocate the compute budget across inputs: fixed-depth recursion applies the same number of cycles to every input, yet we observe task- and assay-specific performance optima rather than monotonic gains from more cycles (Figures 2 and 3b). An effective recursion mechanism should thus decide both when to stop the update and how each cycle's update should shape the hidden state. Recent work in limited data regimes addresses the when question by training halting heads from verifiable answers [Jolicoeur-Martineau, 2025]. However, no such verifier exists for MLM since determining which residues are biologically valid at a masked position is itself the problem the pLM is being trained to solve. Instead, we propose Gated Mixture Recurrence (GMR), which decodes from a probability-weighted mixture of the hidden states visited during recursion and gates each cycle's residual update by a learned survival signal at a scalar, low-rank, or per-dimension channel resolution. When the state update is ungated and the decode weights come from an independent halt head, we recover PonderNet-style halting [Banino et al., 2021] as a special case of GMR. By unifying halt and gate into one framework, every learned GMR survival makes the recurrence trajectory itself input-adaptive, with the three gate resolutions progressing from coarser sequence-wide to finer feature-resolved control.
Our experiments on zero-shot and supervised probes show that recAMPLIFY with 155M unique parameters, after being pretrained on the same 2T tokens, remains competitive with the best performing AMPLIFY-350M with 56% fewer unique parameters. Namely, recAMPLIFY improves fold accuracy by 22.5% (from 56.8% to 69.6%) and localization accuracy by 3.5% (from 71.6% to 74.1%). It also outperforms the similar-sized AMPLIFY-120M across supervised probes by up to 23%. We further observe that more recursion is not always better: recAMPLIFY trained with fixed recurrence depth can degrade beyond the recursion horizon seen during
We define depth recurrence as the architectural mechanism of repeatedly applying a weight-tied block and recursive computation as the resulting strategy of increasing effective depth through repeated latent refinement.
training. While variable-depth pretraining improves robustness to unseen depths, it does not provide a single optimal test-time depth. In contrast, GMR enables adaptive recursion while reducing the expected number of recurrent cycles by 32–40% relative to a recAMPLIFY trained with six cycles, while improving CASP contact recovery and most supervised probes at a small cost in zero-shot DMS and KL calibration. Our mechanistic analyses further show that residual gating, rather than halting alone, stabilizes recurrence beyond the trained horizon, while the expected halt depth reflects a sequence's composition entropy. Our main contributions are:
• We introduce a recursive pretraining framework for test-time scaling in masked pLMs by separating effective depth from unique parameter count.
• We propose recAMPLIFY, a recursive pLM with 56% fewer unique parameters than AMPLIFY-350M, and show its competitiveness on downstream tasks after training on the same 2T tokens.
• To enable adaptive recursion in recAMPLIFY, we propose Gated Mixture Recurrence (GMR), a unified framework that decodes from a mixture over recurrence-depth hidden states and gates their updates by a learned survival at scalar, low-rank, or per-dimension resolution.
• We characterize the recurrent dynamics and the biological signal learned by recAMPLIFY, showing residual gating to stabilize recurrence and adaptive depth to track biological properties.
Scaling beyond parameters. Popular methods for scaling language models with fixed parameter count include repeated sampling [Cobbe et al., 2021, Baek et al., 2026], chain-of-thought (CoT) reasoning [Wei et al., 2022], or both [Wang et al., 2023, Yoran et al., 2023]. Nevertheless, these come with their own trade-offs. Repeated sampling needs additional verifiers for assessing candidates, which is not always possible for scientific discovery tasks [Cornelio et al., 2026]. CoT reasoning calls for committing to discrete verbalized tokens. Addressing these pitfalls, a third scaling axis involves thinking recursively in continuous latent spaces [Amari, 1972, Hao et al., 2025]. Universal [Dehghani et al., 2019] and Looped Transformers [Giannou et al., 2023] approach this through a weight-tied, iterative refinement lineage [Liao and Poggio, 2016]. Given the effectiveness of recursive thinking for limited data regimes [Wang et al., 2025, Jolicoeur-Martineau, 2025, Liao and Poggio, 2026] and how it helps compact models with better learning priors [Schwarzschild et al., 2021, Bansal et al., 2022, Kohli et al., 2026], we hypothesize that weight-tied recurrence is crucial for scaling compact pLMs, where larger models are known to memorize training data [Fournier et al., 2024]. A desirable property for such recurrence is adaptive computation [Graves, 2016] that refines the latent state in an input-dependent manner [Blayney et al., 2026, Fein-Ashley and Rashidinejad, 2026]. Here, a halting head can be trained either in a supervised [Jolicoeur-Martineau, 2025] or self-supervised manner [Banino et al., 2021] to recognize convergence. For a pLM encoder, supervised halting requires a verifier to recognize which residues are valid at each masked position, which is exactly the biology the model is being trained to learn. We thus adopt the latter self-supervised objective.
Mechanistic analyses of recursion. Depth recurrence defines a learned dynamical system whose hidden states can converge or oscillate, and where additional iterations can degrade a previously useful representation. Prior work links successful depth extrapolation to input recall [Bansal et al., 2022], path-independent attractors [Anil et al., 2022, Geiping et al., 2025], and stable cyclic fixed points [Prairie et al., 2026], and identifies “overthinking” beyond the trained depth as a recurring failure mode [Kohli et al., 2026, Blayney et al., 2026]. These studies treat recursion dynamics, such as depth sweeps, state changes, output convergence, and evolutionary properties, as operational rather than interpretive. We build on these works in our analysis of gated recurrence and protein properties.
3. Problem Setup
Test-time scaling through recursive pretraining. We formulate test-time scaling for masked pLMs using AMPLIFY [Fournier et al., 2024], whose released pretraining data, code and architecture recipe enable controlled comparisons under a fixed data budget. Let denote a protein sequence of length , where denotes the residue at position , drawn from the alphabet of 20 standard amino acids. AMPLIFY pretrains a pre-norm Transformer encoder by minimizing the masked-token cross-entropy to recover masked residues from a bidirectional context. Its hidden states remain in one-to-one alignment with the input residues, supporting masked-marginal mutation scoring and frozen-embedding probes. We seek to build a recursive AMPLIFY encoder whose inference-time computation can be increased per protein without changing its unique parameter count or disrupting residue alignment. To this end, we expose the number of applications of a weight-tied Transformer core as a test-time variable. This allows the model to iteratively refine its residue-aligned latent state under varying compute budgets.
Desired properties of a recursive pLM. Proteins vary widely in biological complexity, from short signal peptides to multi-domain enzymes and from structured domains to intrinsically disordered chains. pLMs must accommodate diverse proteins, and the per-assay optima suggest that no single recurrence depth is optimal across all proteins (Figure 2). These observations motivate learning a recurrence depth budget that adapts to each sequence. We thus seek a recursive pLM that can allocate compute adaptively while preserving stable latent dynamics. We then study whether its expected halt depth carries interpretable information about proteins.

Figure 2: recAMPLIFY's per-assay optimal recurrence depth on ProteinGym DMS.
4. Method
We start by adapting the minimal recurrent design of Geiping et al. [2025] from a causal decoder to the bidirectional AMPLIFY encoder , yielding recAMPLIFY. Here, the early layers of the Transformer encoder form the prelude that runs once to produce the input representation from token embeddings. This is followed by an -layer weight-tied recurrent core that repeatedly refines a single state over cycles before passing it to a -layer coda that decodes the final state from the latest cycle: . For the core to act as a stable data-dependent iterative operator, we re-inject the input at every cycle [Bansal et al., 2022]. To encourage a more general solution, we initialize the latent state with a fixed vector shared by all residues, , where is drawn once from , with at model initialization and kept frozen, so every forward pass starts from the same state [Anil et al., 2022]:
where is the recurrent cycle. The coda output is passed to the LM head for masked-token prediction and zero-shot probing. For supervised evaluation, we train a two-layer MLP on frozen representations: the recurrent-core state for fixed- and variable-depth recAMPLIFY, and the coda output for GMR variants (the two choices are compared in Figure 8). We use the triplet for the unique layer counts and for the number of cycles. This gives an effective depth of while exposing as a globally specified inference-time compute value. Motivated by the heterogeneous depth need in §3, we next make this budget input-dependent.
4.1. Gated Mixture Recurrence
Adaptive recursion requires allocating compute along two axes: when recurrent refinement should stop, and how each cycle's update should shape the hidden state along the way. We propose Gated Mixture Recurrence (GMR), a framework that treats both these axes under a single learned survival signal aimed at unifying halting and gating. The recurrent core produces a trajectory of intermediate hidden states . GMR decodes each input from a probability-weighted mixture while gating each state update by a channel-resolved survival .
When to stop updating? As a supervised adaptive computation head [Jolicoeur-Martineau, 2025] would require a per-position verifier (§2), we instead adopt a self-supervised approach [Banino et al., 2021] within GMR. Here, a halt head reads the state and emits a conditional halt probability , where the stopgrad operator sg prevents the head's gradients from directly steering the LM features. This yields the unconditional halt mass that acts as mixture weights, with the training loss additionally maximizing the entropy to encourage more cycles:
where is the -th cycle output. We decode predictions from the mass-weighted state and stop once the continuation mass falls below a threshold and discard this residual mass. Since the continuation mass is non-increasing, probability committed to halting at cycle cannot be redistributed to later cycles.
How to update? In the halt-only case described above, a single halt probability weights the decode mixture but leaves state updates ungated, treating all hidden-state features as converging together. We relax this by allowing survival to vary across c channels of the feature space, so different features can stabilize at different cycles. To this end, a residual gate reads the proposal and emits channel-wise values , where preserves the channel's future update potential and suppresses subsequent updates. Gate values accumulate across cycles into the survival , which is broadcast or projected to the full hidden dimension to yield the per-feature update weights . Put together, the gated state update is:
where is the update magnitude at cycle set by the accumulated survival of previous gates, while the newly predicted gate contributes only to the current cycle's halt mass. Since the survival is monotonically non-increasing, this inherits the halt semantics of equation 2, where once a channel has committed to halting, its future updates are downweighted.
We instantiate the gate at three channel-level granularities: (a) the scalar gate broadcasts a single survival value (ch = 1) across all feature channels. This is similar to the halt scalar from equation 2, but acts on state-update magnitude rather than on decode; (b) the low-rank gate maintains ch shared survival trajectories (e.g., ch = 16, D = 960) and projects them onto every hidden feature through a learned row-stochastic assignment. This ensures that all D features are steered by the same shared survivors; (c) the per-dimension gate is our most granular variant, using one independently predicted survival trajectory per channel (ch = D). Halting occurs either when we reach the predefined limit L or when every channel has a survival below the threshold (see Listing 1 for the pseudocode).
5. Experiments
Training and evaluation. Following AMPLIFY's pretraining recipe and using its publicly released code and data [Fournier et al., 2024], we pretrain recAMPLIFY on the same mixture of the UniRef100 [Suzek et al., 2007], SCOP [Murzin et al., 1995], and OAS [Olsen et al., 2022] databases, making the original AMPLIFY our direct baseline. Further details are provided in §B.
Following Lin et al. [2023], we evaluate using two types of probes. Zero-shot probes: KL calibration [Le Breton et al., 2026], ProteinGym DMS [Notin et al., 2023], and CASP16 contact recovery [Yuan et al., 2026]. Supervised probes: we use the 18-task benchmark of Chen et al. [2025] and study four representative tasks reported to show clear benefits from pretraining [Le Breton et al., 2026]: fold accuracy [Rao et al., 2019], localization accuracy [Dallago et al., 2021], stability prediction [Rao et al., 2019, Dallago et al., 2021], and secondary-structure prediction (SSP) [Rao et al., 2019]. For each supervised task, we report the mean test performance over 5 seeds after re-training the best configuration from a 50-trial Bayesian TPE hyperparameter search. Further evaluation and hyperparameter details are provided in §C.
Table 1: Zero-shot and supervised performance. The top block reports ESM-2 for context, as its pretraining data favor structural modeling while AMPLIFY's data emphasize evolutionary calibration on consensus positions (KL). The middle block reports full-scale comparisons, where recurrence leads on CASP, stays close on KL (NT) and DMS, and improves three out of four supervised probes. The bottom block reports ablations with variable-depth training and four GMR variants. Effective depth counts layer applications, using at inference and expected cycles for GMR. Best scores within each block are bold. See Table 4 for standard deviations.
| Model | Zero-shot probes | Supervised probes | Param / compute | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| KL (T) | KL (NT) | DMS | CASP P@T | Fold acc. | Loc. acc. | Stability | SSP (Q3+Q8) | ||||
| ESM-2 baselines for context (500K pretraining steps on UniRef50/90) | |||||||||||
| ESM-2-150M | 37.79 | 31.54 | 0.388 | 0.239 | 0.645 | 0.734 | 0.764 | 0.777 | 149M | 30 | 30 |
| ESM-2-650M | 55.07 | 41.51 | 0.415 | 0.268 | 0.675 | 0.759 | 0.659 | 0.805 | 652M | 33 | 33 |
| ESM-2-3B | 63.11 | 44.22 | 0.407 | 0.281 | 0.723 | 0.782 | 0.694 | 0.808 | 2.8B | 36 | 36 |
| 1M pretraining steps on UniRef100 | |||||||||||
| AMPLIFY-120M | 57.33 | 37.87 | 0.345 | 0.126 | 0.566 | 0.651 | 0.591 | 0.724 | 118M | 24 | 24 |
| AMPLIFY-350M | 69.31 | 38.79 | 0.360 | 0.146 | 0.568 | 0.716 | 0.585 | 0.742 | 354M | 32 | 32 |
| fixed-L recAMPLIFY | 59.32 | 37.70 | 0.348 | 0.179 | 0.696 | 0.741 | 0.703 | 0.742 | 155M | 44 | 44 |
| 100K pretraining steps on UniRef100 | |||||||||||
| AMPLIFY-120M | 49.84 | 36.07 | 0.345 | 0.120 | 0.602 | 0.691 | 0.611 | 0.720 | 118M | 24 | 24 |
| AMPLIFY-350M | 59.79 | 38.79 | 0.359 | 0.104 | 0.570 | 0.672 | 0.479 | 0.729 | 354M | 32 | 32 |
| vary-L recAMPLIFY | 48.88 | 36.22 | 0.352 | 0.128 | 0.653 | 0.711 | 0.688 | 0.726 | 133M | 52 | 52 |
| fixed-L recAMPLIFY | 49.92 | 36.59 | 0.359 | 0.117 | 0.601 | 0.700 | 0.644 | 0.720 | 133M | 52 | 52 |
| + halt-only GMR | 49.71 | 36.27 | 0.347 | 0.135 | 0.637 | 0.714 | 0.650 | 0.729 | 133M | 52 | 33 |
| + scalar gated GMR | 49.82 | 36.45 | 0.346 | 0.161 | 0.628 | 0.708 | 0.737 | 0.722 | 133M | 52 | 37 |
| + rank-16 gated GMR | 50.39 | 36.51 | 0.346 | 0.150 | 0.621 | 0.708 | 0.703 | 0.721 | 133M | 52 | 36 |
| + per-dim gated GMR | 50.36 | 36.45 | 0.347 | 0.143 | 0.621 | 0.718 | 0.627 | 0.722 | 133M | 52 | 37 |
5.1. Scaling and Depth Behavior
Does recursive pretraining scale? We first examine whether the minimal recurrent design of recAMPLIFY remains viable at the full pLM pretraining scale of 1M steps. For a fair comparison, we match AMPLIFY-350M's 15 attention heads and a hidden dimension of 960, and set the number of layers to , i.e., roughly the budget of the compact AMPLIFY-120M baseline. Table 1 shows that recAMPLIFY, with 155M unique parameters, remains competitive with AMPLIFY-350M across downstream probes when both are trained on the same 2T tokens. The clearest gains appear on the four supervised probe tasks that most reliably measure information acquired during pretraining. Visualizing the coda embeddings across recurrent cycles (Figure 3a) shows that each additional cycle brings the embedding manifold closer to the downstream label geometry, improving 5-NN accuracy. Finally, we verify that the cost of our recursive pretraining recipe scales with depth alone. Table 5 shows that our 133M recAMPLIFY at achieves measured effective throughput comparable to AMPLIFY-350M, which has approximately as many unique parameters.
Comparison with ESM-2. A direct comparison with ESM-2 is confounded by differences in model size and pretraining data: its larger checkpoints have 4–18× as many parameters as recAMPLIFY and use an earlier UniRef release with a different clustering scheme. ESM-2 samples uniformly over UniRef50 clusters, whereas AMPLIFY's UniRef100 recipe retains more of the observed sequence redundancy, resulting in different training distributions (§B). ESM-2's unreleased pretraining code and exact data splits also make reproducing its training setup difficult. With these caveats, larger ESM-2 checkpoints outperform recAMPLIFY on three out of four supervised probes, while recAMPLIFY exceeds ESM-2-650M and 3B on stability prediction and achieves better target (T) KL calibration than ESM-2-150M and 650M.
A 100K-step regime for controlled ablations. Training recAMPLIFY for 1M steps makes extensive ablations computationally impractical. Following Le Breton et al. [2026], we next ask whether recursive pretraining at a smaller scale remains representative. Table 1 shows that a similar recAMPLIFY configuration, , achieves a representative task-performance profile at 100K steps. We therefore use 100K steps for subsequent experiments.
How does recursion behave with depth? Figure 4 shows that greater depth improves both validation perplexity and downstream separability for enzyme classes (EC) and subcellular localization (SCL). For SCL,

(a) UMAP of sequence embeddings.

(b) Test-time sweep across 100K pretraining setups.
Figure 3: recAMPLIFY at varying recurrence depths. (a) For 1M-step recAMPLIFY, the coda embeddings become progressively more class-separable (5-NN accuracy) with larger test-time depth . (b) For 100K-step recAMPLIFY, as increases past the trained depth (L = 6), the fixed-L model (red) degrades while the variable-L variant (blue) remains largely stable.

(a) Held-out set perplexity.

(b) Enzyme classification.

(c) Subcellular localization.
Figure 4: Effect of recurrence depth on sequence likelihood and downstream separability at 100K steps. (a) UniProt perplexity for fixed-L pretraining, evaluated at . (b) EC level-1 and level-2 5-NN macro-F1 across for recAMPLIFY trained with L = 6, using 14K Swiss-Prot enzymes balanced across the 7 top-level classes relabeled into 46 level-2 subclasses ( 30 samples each). (c) SCL 10-way 5-NN macro-F1 across five FLIP DeepLoc-1.0 splits [Didi et al., 2026], fitted on 11,181 shared training sequences and evaluated on each held-out test set.
deeper recursion yields macro-F1 gains of 20–31 pp across FLIP's train/test cluster splits. Given the diverse criteria used to construct these splits, this suggests benefits from recursion under distribution shift. Figure 3b shows downstream probe performance as recAMPLIFY is trained with larger cycles (marked by stars). For the model trained with , further varying shows that performs best on KL calibration, CASP and SSP, while Fold, Localization and Stability peak slightly earlier, . Finally, at a fixed depth, we find the physical layer counts (Figure 9a) and (Figure 9b) to perform best overall.
Going beyond fixed-depth recursion. The fixed-depth recAMPLIFY baseline uses L cycles during training and exposes recurrence depth as a test-time variable . Figure 3b shows that this model (red lines) degrades at unseen depths ( ), most on stability ( ) and on zero-shot KL and CASP, with milder losses on the other supervised probes. In contrast, pretraining with a variable number of cycles sampled uniformly from per minibatch generally improves robustness to unseen depths (blue lines). Several probes peak near the variable-depth model's mean training depth, suggesting a simple heuristic: vary the cycle count during training, then fix near that mean. However, the per-assay optima in Figure 2 suggest that no single depth is optimal across all assays. Put together, these observations support our motivation for an adaptive recursion mechanism that predicts when further refinement is no longer useful.
Gated Mixture Recurrence. Table 1 shows that every GMR variant reduces the expected test-time depth from 52 to 33–37 layer applications while improving over fixed-L recAMPLIFY on CASP contact recovery (0.135–0.161 vs. 0.117), Fold, Localization and SSP, and on Stability for three of the four variants. The cost is a small drop in zero-shot DMS (0.346–0.347 vs. 0.359) and KL calibration (at most 0.32 NT points). We quantify

(a) Difference across successive iterations.

(b) Normalized distance to the deepest state.
Figure 5: Dynamics of recurrent block layer on stability prediction upon training with cycles (vertical dashed lines). (a) The successive difference norm shows gating drives each layer's step size toward zero beyond the trained depth. (b) The normalized difference to each layer's deepest recorded state highlights the rate and timing of decay as key convergence diagnostics.
depth as the mean of the model's predicted halting distribution: . This characterizes the learned allocation policy rather than measured wall-clock savings, since our evaluation decodes the full mixture over the cycle budget. Gate resolution has no consistent effect on zero-shot calibration (KL (T) 49.7–50.4 across variants), but gated variants lead the 100K block on CASP and Stability (scalar) and on Localization (per-dim). Halt-only GMR reaches the shallowest expected depth ( , i.e., layers) while matching AMPLIFY-350M on SSP. To understand where gating helps, we next examine whether the gates produce an empirical fixed point of the recurrent state ( ); whether recursion preserves the depth-heterogeneous layerwise mixing profile of a feedforward Transformer ( ); and what the GMR halt signal encodes about proteins ( ).
5.1.1. Hidden State Evolution
Let denote the hidden state at physical layer of the recurrent block during cycle . The block-level state used in §4.1 is its top-layer output, i.e., . We analyze how recursion affects hidden-state dynamics within and beyond the depth seen during training. Following Blayney et al. [2026], we unroll each recAMPLIFY variant to and examine state changes across recurrent layers along three complementary axes: (a) the size of successive updates , (b) the normalized distance of each cycle's state to its deepest recorded state , taken as an approximate fixed point, and (c) the induced attention geometry, measured by pairwise Frobenius distances between attention maps across cycles.
Gates deliver the state-level stopping primitive that halting alone cannot. The per-layer step norms in Figures 5a and 13a reveal three distinct behaviors. Recurrence without GMR shows no consistent limiting behavior, although input injection keeps it bounded (Figure 12). Halt-only GMR changes only when updates stop, not the underlying step size. GMR with residual gates provides what halt-only lacks: a state-level “stop-moving” mechanism that drives the step norm toward zero for the scalar and per-dim variants ( E).
Scalar and per-dimension residual gates deliver empirical fixed-point convergence. We use “state convergence” for variants whose update magnitude approaches zero (Figures 5a and 13a) and whose normalized residual decays rapidly (Figures 5b and 13b). From this perspective, the four variants separate cleanly: scalar and per-dim gates reach near-zero residual within a few cycles of the trained horizon , and their step sizes vanish. Halt-only decays only linearly with an unbounded norm while the rank-16 gate drifts radially. Cosine alignment to is near-perfect for every variant and is therefore only an indirect diagnostic (Figure 13c). Lastly, the induced attention geometry shows scalar and per-dim gates collapse cross-cycle attention distances past the trained horizon, whereas halt-only does not (Figure 14). Empirical fixed-point convergence therefore requires a residual gate rather than the halting head alone.
5.1.2. Stages of Inference
Feedforward Transformer layers exhibit heterogeneous compute profiles, where early layers often cluster residues by local context, middle layers integrate over increasing spans, and late layers commit to global structural predictions [Vig et al., 2021, Siji et al., 2026]. We thus ask whether, for each recAMPLIFY variant, the tied block preserves this depth-heterogeneous mixing schedule within the trained recurrence depth and under extrapolation. Following de Llano et al. [2026], we measure attention geometry with ColSum concentration, (defined in §E). A non-flat layerwise profile of C indicates mixing heterogeneity across physical layers.

Figure 6: ColSum concentration through the recurrent block at . Cycles colored light (early) to dark (late). Dashed red line is the feedforward reference.
Within the trained depth, recursion preserves mixing heterogeneity. Within the trained horizon (solid curves in Figure 15), all recAMPLIFY variants retain a structured, non-flat ColSum profile across the eight tied core layers, with the earliest cycle closest to the feedforward reference.
Residual gates stabilize mixing beyond the trained horizon. Figure 15 shows that a stable per-layer state under deeper unrolling is marked by dashed extrapolated per-cycle profiles piled onto the solid trained range. Only the three GMR gates achieve this, all within a few cycles of the seen L. Stability alone, however, does not tell us whether the frozen profile reproduces the depth-heterogeneous mixing of a standard feedforward Transformer or has flattened into a distorted schedule. We next compare the two most contrastive variants at extrapolated depth: halt-only GMR, which never stabilizes, and per-dim GMR, which settles. Figure 6 shows that only per-dim gating approaches the feedforward reference in both shape and amplitude. Lastly, the scalar and per-dimension gates stabilize attention geometry beyond the trained horizon, whereas halt-only and rank-16 do not (Figure 14).
5.1.3. Does the GMR Halt Depth Encode Biological Signal?
For per-protein halt depth E[k] to be a reliable diagnostic signal, the model's distribution around an amino acid should align sharply with what evolution prefers at the position. However, once both are controlled for sequence length T and the model's own prediction sharpness , the correlation between E[k] and KL drops from to +0.11, a reduction of (Figure 7, other tasks in Table 7). Halt depth therefore mostly reflects how confidently the model predicts a protein rather than its agreement with evolution per se. We thus define a controlled E[k], the residual of E[k] after regressing out and , and ask what it still encodes. Since both controls come from the model alone, no MSA is needed, so we compute the controlled E[k] on 10K held-out UniProt sequences, bucket them into top- and bottom-decile groups intersected across all four GMR variants, and report Cohen's d between the buckets.
Table 2 identifies compositional diversity as the most robust signal, with over-pondered proteins reflecting higher sequence entropy and hydrophobic content. Unusually hydrophobic composition is only viable inside a specific fold or membrane pocket, so recovering the wild-type residue there requires long-range structural evidence and thus more cycles. In contrast, extreme polar composition is an alphabet-reduction cue, where once a residue class dominates, most masked positions become predictable from local statistics and fewer cycles suffice. §F shows hydrophobic content driving an overall depth increase while other class overrepresentations produce an inverted U-shape consistent with alphabet reduction.
Next, we extend this test from per-protein composition to per-gene identity, and study how GMR depth varies across alternative splice-isoforms of the same human gene. Across 335 human genes and 1,054 isoforms, same-gene isoforms cluster nearly twice as tightly in halt depth as size-matched random pairs of proteins (Table 2). This gap indicates that gates do not follow a fixed, input-independent decay schedule. Instead, the input governs the gate trajectory, at least at gene granularity. Moreover, what gates read is a property of the shared backbone rather than of exact residues since alternative isoforms differ only by one included or excluded functional domain, and E[k] consistently tracks the compositional constraint of the retained portion.

Figure 7: Per-protein expected depth vs mean per-position KL to MSA consensus (halt-only GMR, 6,868 human proteins). Colors code the model's prediction sharpness , averaged over positions. Left: raw scatter; right: residuals of and KL after regressing out and sharpness.
across all family members (see §F for details).
6. Conclusion
We introduced recursive pretraining for test-time compute scaling in masked pLMs. With 56% fewer unique parameters, the resulting recAMPLIFY improves CASP contact recovery, fold, localization and stability over AMPLIFY-350M while remaining close on DMS and non-target KL calibration. Our Gated Mixture Recurrence (GMR) unifies self-supervised halting and residual gating into one adaptive computation framework, reducing the expected per-protein cycle count by 32–40% while improving contact recovery and most supervised probes over fixed-depth recursion. Mechanistically, scalar and per-dimension gates drive the recurrent state toward an empirical fixed point beyond the trained horizon, and only per-dimension gating recovers the feedforward layerwise mixing profile. Finally, after controlling for length and model confidence, halt depth tracks sequence entropy and hydrophobic composition, making it an interpretable compute allocator.
Acknowledgments and Disclosure of Funding
We thank Lola Le Breton and David Heurtel-Depeiges for their valuable feedback on biology. We are grateful to Johan Obando-Ceron for his constructive feedback on mechanistic analyses of recAMPLIFY. Funding. Saurav Jha is supported by the IVADO postdoctoral fellowship and the Canada First Research Excellence Fund. Qianli Liao would like to thank Prof. Tomaso Poggio for helpful guidance, and was supported by MIT's K. Lisa Yang ICoN Center, Center for Brains, Minds and Machines (CBMM, NSF STC CCF-1231216), and McGovern Institute for Brain Research. Sarath Chandar is supported by the Canada CIFAR AI Chairs program, the Canada Research Chair in Lifelong Machine Learning, and the NSERC Discovery Grant. Quentin Fournier is supported by Amgen. This research was enabled in part by compute resources provided by Amgen (amgen.com) and Mila (mila.quebec). Competing interests. Robert Vernon is an employee of Amgen. The other authors declare no competing interests.
References
José Juan Almagro Armenteros, Casper Kaae Sønderby, Søren Kaae Sønderby, Henrik Nielsen, and Ole Winther. Deeploc: prediction of protein subcellular localization using deep learning. Bioinformatics, 33(21):3387–3395, 11 2017. ISSN 1367-4803. doi: 10.1093/bioinformatics/btx431.
S.-I. Amari. Learning patterns and pattern sequences by self-organizing nets of threshold elements. IEEE Transactions on Computers, C-21(11):1197–1206, 1972. doi: 10.1109/T-C.1972.223477.
Cem Anil, Ashwini Pokle, Kaiqu Liang, Johannes Treutlein, Yuhuai Wu, Shaojie Bai, J. Zico Kolter, and Roger B. Grosse. Path independent equilibrium models can better exploit test-time computation. In Advances in Neural Information Processing Systems, volume 35, pages 7796–7809, 2022.
Junyeob Baek, Mingyu Jo, Minsu Kim, Mengye Ren, Yoshua Bengio, and Sungjin Ahn. Generative recursive reasoning. arXiv preprint arXiv:2605.19376, 2026.
Andrea Banino, Jan Balaguer, and Charles Blundell. PonderNet: Learning to ponder. In ICML 2021 Workshop on Automated Machine Learning, 2021.
Arpit Bansal, Avi Schwarzschild, Eitan Borgnia, Zeyad Emam, Furong Huang, Micah Goldblum, and Tom Goldstein. End-to-end algorithm synthesis with recurrent networks: Extrapolation without overthinking. Advances in Neural Information Processing Systems, 35:20232–20242, 2022.
Hugh Blayney, Álvaro Arroyo, Johan Obando-Ceron, Pablo Samuel Castro, Aaron Courville, Michael M. Bronstein, and Xiaowen Dong. A mechanistic analysis of looped reasoning language models. arXiv preprint arXiv:2604.11791, 2026.
Salvatore Candido, Thomas Hayes, Alexander Derry, Roshan Rao, Zeming Lin, Robert Verkuil, Bryan Z. Wu, Jin Sub Lee, Elise S. Bruguera, Jehan A. Keval, Mykhailo Kopylov, John E. Pak, Wesley Wu, Neil Thomas, Samson Mataraso, Alvin Hsu, Ashton C. Trotman-Grant, Kilian Fatras, Allan dos Santos Costa, Rohil Badkundri, Halil Akin, Deniz Oktay, Jonathan Deaton, Elizabeth Montabana, Hrishita Sitwala, Yue Yu, Marius Wiggert, Dylan Alexander Carlin, Anthony W. Goering, Tomasz Blazejewski, McCullen Sandora, Michael Hla, Tina Z. Jia, Leon H. Kloker, Nicholas J. Sofroniew, Masatoshi Uehara, Jassi Pannu, Sharrol Bachas, Daniel S. Liu, Tom Sercu, and Alexander Rives. Language modeling materializes a world model of protein biology. bioRxiv, 2026. doi: 10.64898/2026.06.03.729735.
John-Marc Chandonia, Lindsey Guan, Shiangyi Lin, Changhua Yu, Naomi K Fox, and Steven E Brenner. SCOPe: improvements to the structural classification of proteins - extended database to facilitate variant interpretation and machine learning. Nucleic Acids Research, 50(D1):D553–D559, 2022. ISSN 1362-4962. doi: 10.1093/nar/gkab1054.
Bo Chen, Xingyi Cheng, Pan Li, Yangli-ao Geng, Jing Gong, Shen Li, Zhilei Bei, Xu Tan, Boyan Wang, Xin Zeng, Chiming Liu, Aohan Zeng, Yuxiao Dong, Jie Tang, and Le Song. xtrimopglm: unified 100-billion-parameter pretrained transformer for deciphering the language of proteins. Nature Methods, 22(5):1028–1039, 2025. doi: 10.1038/s41592-025-02636-z.
Xingyi Cheng, Bo Chen, Pan Li, Jing Gong, Jie Tang, and Le Song. Training compute-optimal protein language models. Advances in Neural Information Processing Systems, 37:69386–69418, 2024.
Yaozhong Cheng, Hao-Bo Wang, Hua Xu, Yuan Liu, Bin bin Ma, Xuemin Chen, Xin Zeng, Xianghe Wang, Bo Wang, Carina Shiau, Sergey Ovchinnikov, Xiao-Dong Su, and Chu Wang. Co-evolution-based prediction of metal-binding sites in proteomes by machine learning. Nature Chemical Biology, 19:548–555, 2023. URL https://api.semanticscholar.org/CorpusID:255469189.
Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, Christopher Hesse, and John Schulman. Training verifiers to solve math word problems. arXiv preprint arXiv:2110.14168, 2021.
Cristina Cornelio, Takuya Ito, Ryan Cory-Wright, Sanjeeb Dash, and Lior Horesh. The need for verification in artificial intelligence-driven scientific discovery. Philosophical Transactions of the Royal Society A: Mathematical, Physical and Engineering Sciences, 384(2317):20240591, 04 2026. ISSN 1364-503X. doi: 10.1098/rsta.2024.0591.
Christian Dallago, Jody Mou, Kadina E Johnston, Bruce Wittmann, Nick Bhattacharya, Samuel Goldman, Ali Madani, and Kevin K Yang. FLIP: Benchmark tasks in fitness landscape inference for proteins. In Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track (Round 2), 2021.
Enrique Queipo de Llano, Alvaro Arroyo, Federico Barbero, Xiaowen Dong, Michael M. Bronstein, Yann LeCun, and Ravid Shwartz-Ziv. Attention sinks and compression valleys in LLMs are two sides of the same coin. In The Fourteenth International Conference on Learning Representations, 2026.
Mostafa Dehghani, Stephan Gouws, Oriol Vinyals, Jakob Uszkoreit, and Lukasz Kaiser. Universal transformers. In International Conference on Learning Representations, 2019.
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 conference of the North American chapter of the association for computational linguistics: human language technologies, volume 1 (long and short papers), pages 4171–4186, 2019.
Kieran Didi, Sarah Alamdari, Alex Xijie Lu, Bruce James Wittmann, Kadina E Johnston, Ava P Amini, Ali Madani, Maya Czeneszew, Christian Dallago, and Kevin K Yang. FLIP2: Expanding protein fitness landscape benchmarks for real-world machine learning applications. In Forty-third International Conference on Machine Learning, 2026.
Ahmed Elnaggar, Michael Heinzinger, Christian Dallago, Ghalia Rehawi, Yu Wang, Llion Jones, Tom Gibbs, Tamas Feher, Christoph Angerer, Martin Steinegger, Debsindhu Bhowmik, and Burkhard Rost. ProtTrans: Toward understanding the language of life through self-supervised learning. IEEE Transactions on Pattern Analysis and Machine Intelligence, 44(10):7112–7127, 2022. doi: 10.1109/TPAMI.2021.3095381.
Jacob Fein-Ashley and Paria Rashidinejad. Solve the loop: Attractor models for language and reasoning. arXiv preprint arXiv:2605.12466, 2026.
Noelia Ferruz, Steffen Schmidt, and Birte Höcker. ProtGPT2 is a deep unsupervised language model for protein design. Nature Communications, 13(1):4348, 2022. doi: 10.1038/s41467-022-32007-7.
Quentin Fournier, Robert M. Vernon, Almer van der Sloot, Benjamin Schulz, Sarath Chandar, and Christopher James Langmead. Protein language models: Is scaling necessary? bioRxiv, 2024. doi: 10.1101/2024.09.23.614603.
Naomi K. Fox, Steven E. Brenner, and John-Marc Chandonia. Scope: Structural classification of proteins—extended, integrating scop and astral data and classification of new structures. Nucleic Acids Research, 42(D1):D304–D309, 01 2014. ISSN 0305-1048. doi: 10.1093/nar/gkt1240.
Jonas Geiping, Sean McLeish, Neel Jain, John Kirchenbauer, Siddharth Singh, Brian Bartoldson, Bhavya Kailkhura, Abhinav Bhatele, and Tom Goldstein. Scaling up test-time compute with latent reasoning: A recurrent depth approach. In D. Belgrave, C. Zhang, H. Lin, R. Pascanu, P. Koniusz, M. Ghassemi, and N. Chen, editors, Advances in Neural Information Processing Systems, volume 38, Main Conference, pages 41340–41391. Curran Associates, Inc., 2025. doi: 10.52202/085713-1380.
Angeliki Giannou, Shashank Rajput, Jy-Yong Sohn, Kangwook Lee, Jason D. Lee, and Dimitris Papailiopoulos. Looped transformers as programmable computers. In Proceedings of the 40th International Conference on Machine Learning, volume 202, pages 11398–11442. PMLR, 2023.
Alex Graves. Adaptive computation time for recurrent neural networks. arXiv preprint arXiv:1603.08983, 2016.
Shibo Hao, Sainbayar Sukhbaatar, DiJia Su, Xian Li, Zhiting Hu, Jason E Weston, and Yuandong Tian. Training large language models to reason in a continuous latent space. In Second Conference on Language Modeling, 2025.
Chao Hou, Di Liu, Aziz Zafar, and Yufeng Shen. Understanding language model scaling for protein fitness prediction. Nature Computational Science, 6(7):778–788, 2026. doi: 10.1038/s43588-026-01010-z.
Alexia Jolicoeur-Martineau. Less is more: Recursive reasoning with tiny networks. arXiv preprint arXiv:2510.04871, 2025.
John Jumper, Richard Evans, Alexander Pritzel, Tim Green, Michael Figurnov, Olaf Ronneberger, Kathryn Tunyasuvunakool, Russ Bates, Augustin Žídek, Anna Potapenko, et al. Highly accurate protein structure prediction with alphafold. nature, 596(7873):583–589, 2021.
Michael Schantz Klausen, Martin Closter Jespersen, Henrik Nielsen, Kamilla Kjaergaard Jensen, Vanessa Isabell Jurtz, Casper Kaae Sønderby, Morten Otto Alexander Sommer, Ole Winther, Morten Nielsen, Bent Petersen, and Paolo Marcatili. Netsurfp-2.0: Improved prediction of protein structural features by integrated deep learning. Proteins: Structure, Function, and Bioinformatics, 87(6):520–527, 2019. doi: https://doi.org/10.1002/prot.25674.
Harsh Kohli, Srinivasan Parthasarathy, Huan Sun, and Yuekun Yao. Loop, think, & generalize: Implicit reasoning in recurrent-depth transformers. In Third Conference on Language Modeling, 2026.
Lola Le Breton, David Heurtel-Depeiges, Douglas C Millar, Lara E Zetzsche, Robert M Vernon, Christopher James Langmead, Sarath Chandar, and Quentin Fournier. plm representations unlock metagenomic space beyond homology. bioRxiv, 2026. doi: 10.64898/2026.07.28.739874.
Qianli Liao and Tomaso Poggio. Bridging the gaps between residual learning, recurrent neural networks and visual cortex. arXiv preprint arXiv:1604.03640, 2016.
Qianli Liao and Tomaso Poggio. Simple recursive model: Simplified, single-state reasoning with skip connections, 01 2026.
Zeming Lin, Halil Akin, Roshan Rao, Brian Hie, Zhongkai Zhu, Wenting Lu, Nikita Smetanin, Robert Verkuil, Ori Kabeli, Yaniv Shmueli, Allan dos Santos Costa, Maryam Fazel-Zarandi, Tom Sercu, Salvatore Candido, and Alexander Rives. Evolutionary-scale prediction of atomic-level protein structure with a language model. Science, 379(6637):1123–1130, 2023. doi: 10.1126/science.ade2574.
Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In International Conference on Learning Representations, 2019.
Joshua Meier, Roshan Rao, Robert Verkuil, Jason Liu, Tom Sercu, and Alexander Rives. Language models enable zero-shot prediction of the effects of mutations on protein function. In Advances in Neural Information Processing Systems, volume 34, pages 29287–29303, 2021.
Alexey G Murzin, Steven E Brenner, Tim Hubbard, and Cyrus Chothia. Scop: a structural classification of proteins database for the investigation of sequences and structures. Journal of molecular biology, 247(4):536–540, 1995.
Kaoru Nakano. Associatron-a model of associative memory. IEEE Transactions on Systems, Man, and Cybernetics, SMC-2(3):380–388, 1972. doi: 10.1109/TSMC.1972.4309133.
Erik Nijkamp, Jeffrey A. Ruffolo, Eli N. Weinstein, Nikhil Naik, and Ali Madani. ProGen2: Exploring the boundaries of protein language models. Cell Systems, 14(11):968–978.e3, 2023. doi: 10.1016/j.cels.2023.10.002.
Pascal Notin, Aaron Kollasch, Daniel Ritter, Lood van Niekerk, Steffanie Paul, Han Spinner, Nathan Rollins, Ada Shaw, Rose Orenbuch, Ruben Weitzman, Jonathan Frazer, Mafalda Dias, Dinko Franceschi, Yarin Gal, and Debora Marks. Proteingym: Large-scale benchmarks for protein fitness prediction and design. In A. Oh, T. Neumann, A. Globerson, K. Saenko, M. Hardt, and S. Levine, editors, Advances in Neural Information Processing Systems, volume 36, pages 64331–64379. Curran Associates, Inc., 2023.
Tobias H Olsen, Fergus Boyles, and Charlotte M Deane. Observed antibody space: A diverse database of cleaned, annotated, and translated unpaired and paired antibody sequences. Protein Science, 31(1):141–146, 2022.
Hayden Prairie, Zachary Novack, Taylor Berg-Kirkpatrick, and Daniel Y Fu. Parcae: Scaling laws for stable looped language models. arXiv preprint arXiv:2604.12946, 2026.
Roshan Rao, Nicholas Bhattacharya, Neil Thomas, Yan Duan, Peter Chen, John Canny, Pieter Abbeel, and Yun Song. Evaluating protein transfer learning with tape. Advances in neural information processing systems, 32, 2019.
Alexander Rives, Joshua Meier, Tom Sercu, Siddharth Goyal, Zeming Lin, Jason Liu, Demi Guo, Myle Ott, C. Lawrence Zitnick, Jerry Ma, and Rob Fergus. Biological structure and function emerge from scaling unsupervised learning to 250 million protein sequences. Proceedings of the National Academy of Sciences, 118(15):e2016239118, 2021. doi: 10.1073/pnas.2016239118.
Gabriel J. Rocklin, Tamuka M. Chidyausiku, Inna Goreshnik, Alex Ford, Scott Houliston, Alexander Lemak, Lauren Carter, Rashmi Ravichandran, Vikram K. Mulligan, Aaron Chevalier, Cheryl H. Arrowsmith, and David Baker. Global analysis of protein folding using massively parallel design, synthesis, and testing. Science, 357(6347):168–175, 2017. doi: 10.1126/science.aan0693.
Avi Schwarzschild, Eitan Borgnia, Arjun Gupta, Furong Huang, Uzi Vishkin, Micah Goldblum, and Tom Goldstein. Can you learn an algorithm? generalizing from easy to hard problems with recurrent networks. In M. Ranzato, A. Beygelzimer, Y. Dauphin, P.S. Liang, and J. Wortman Vaughan, editors, Advances in Neural Information Processing Systems, volume 34, pages 6695–6706. Curran Associates, Inc., 2021.
Aleena Siji, Amir Mohammad Karimi Mamaghan, Ferdinand Kapl, Tobias Höppe, Emmanouil Angelis, Andrea Dittadi, Maurice Brenner, Michael Heinzinger, Karl Henrik Johansson, Kaitlin Maile, Johannes von Oswald, and Stefan Bauer. From words to amino acids: Does the curse of depth persist? In Learning Meaningful Representations of Life (LMRL) Workshop at ICLR 2026, 2026.
Jianlin Su, Murtadha Ahmed, Yu Lu, Shengfeng Pan, Wen Bo, and Yunfeng Liu. Roformer: Enhanced transformer with rotary position embedding. Neurocomputing, 568:127063, 2024.
Baris E. Suzek, Hongzhan Huang, Peter McGarvey, Raja Mazumder, and Cathy H. Wu. Uniref: comprehensive and non-redundant uniprot reference clusters. Bioinformatics, 23(10):1282–1288, 05 2007. ISSN 1367-4803. doi: 10.1093/bioinformatics/btm098.
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017.
Jesse Vig, Ali Madani, Lav R. Varshney, Caiming Xiong, Richard Socher, and Nazneen Rajani. BERTology meets biology: Interpreting attention in protein language models. In International Conference on Learning Representations, 2021.
Guan Wang, Jin Li, Yuhao Sun, Xing Chen, Changling Liu, Yue Wu, Meng Lu, Sen Song, and Yasin Abbasi-Yadkori. Hierarchical reasoning model. arXiv preprint arXiv:2506.21734, 2025.
Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc V Le, Ed H. Chi, Sharan Narang, Aakanksha Chowdhery, and Denny Zhou. Self-consistency improves chain of thought reasoning in language models. In The Eleventh International Conference on Learning Representations, 2023.
Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Brian Ichter, 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, pages 24824–24837, 2022.
Ori Yoran, Tomer Wolfson, Ben Bogin, Uri Katz, Daniel Deutch, and Jonathan Berant. Answering questions by meta-reasoning over multiple chains of thought. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pages 5942–5966, 2023.
Rongqing Yuan, Jing Zhang, Andriy Kryshtafovych, R Dustin Schaeffer, Jian Zhou, Qian Cong, and Nick V Grishin. Casp16 protein monomer structure prediction assessment. Proteins: Structure, Function, and Bioinformatics, 94(1):86–105, 2026.
Zhidian Zhang, Hannah K. Wayment-Steele, Garyk Brixi, Haobo Wang, Dorothee Kern, and Sergey Ovchinnikov. Protein language models learn evolutionary statistics of interacting sequence motifs. Proceedings of the National Academy of Sciences, 121(45):e2406285121, 2024. doi: 10.1073/pnas.2406285121.
A. Forward-Pass Pseudocode for recAMPLIFY With GMR
Listing 1 shows a single training-time forward pass of recAMPLIFY for all four GMR variants (halt-only and the three residual gate resolutions). Notation follows §4.1: sg is the stopgrad operator, halt_head and gate_head are linear heads that produce and , Norm is RMSNorm, and Map_A is the channel-to-feature broadcast for scalar gate, row-stochastic low-rank projection, or the identity for per-dim gate. The final Loss is the MLM cross-entropy on the mixture-decoded state minus the halt-distribution entropy regularizer H from equation 2. The backward pass uses standard autograd with stopgrad boundaries as marked.
x, z = Prelude(Embed(u)), z_init inj = x + f_c(z_init)
f = optional SRM-styled context encoder f_c
if mode == "halt_only_GMR": p_left, z_bar, p = 1, 0, [] for k in 1..L: z = f(z + inj) lam_k = sigmoid(halt_head(sg(z_bos))) if k == L: lam_k = 1 p_k = p_left * lam_k p_left *= 1 - lam_k p.append(p_k) z_bar += p_k * z if all_sequences(p_left < eps): break else: # scalar | low_rank | per_dim gate S_c, z_bar, p_ch = ones(C), 0, [] for k in 1..L: z_new = f(z + inj) g_ch = sigmoid(gate_head(sg(z_new_bos))) if k == L: g_ch = 0 S_D = Map_A(S_c) z = z + S_D * (z_new - z) p_k_ch = S_c * (1 - g_ch) p_ch.append(p_k_ch) w_k = Map_A(p_k_ch) if per_dim_decode else mean(p_k_ch) z_bar += w_k * Norm(z) S_c *= g_ch if all_sequences(max_channel(S_c) < eps): break
Loss = L_MLM(LM_head(Norm(Coda(z_bar))), labels) Loss -= entropy(p if mode == "halt_only_GMR" else p_ch) return Loss
Listing 1: Python-styled pseudocode for a single training-time forward pass of recAMPLIFY with Gated Mixture Recurrence (GMR). Map_A broadcasts a scalar gate, applies the learned low-rank assignment for the low-rank gate, or is the identity for per-dimension gate.
B. Pretraining Setup
Following AMPLIFY [Fournier et al., 2024], we train for 100K steps with a 210B-token budget on 8 NVIDIA H100 GPUs. This includes 32,768 tokens per device, packed into a single FLASHATTENTION varlen buffer, with 8 gradient-accumulation steps on the training mixture of UniRef100 [Suzek et al., 2007] for the general proteome, SCOP [Chandonia et al., 2022] for structural domains, and OAS [Olsen et al., 2022] for antibody sequences. We use the standard MLM objective with a masking rate of 0.15 and truncate input sequences to a maximum length of 512. Optimization uses AdamW [Loshchilov and Hutter, 2019] with and a weight decay factor of . We clip gradients to a maximum norm of 1.0 and use a cosine learning-rate schedule with a 10% minimum-LR floor and a 1,000-step warm-up. All models, including the AMPLIFY baselines, use a peak learning rate of . Architecturally, in the 1M-step training setup, our 155M-parameter backbone matches AMPLIFY-350M's hidden width of 960 with 15 attention heads, each of dimension 64, alongside an FFN width of 2,560 and RoPE [Su et al., 2024] with . Following Banino et al. [2021], we set .
Dataset. We pretrain on a mixture of three corpora: UniRef100 [Suzek et al., 2007] for the general proteome, SCOP [Chandonia et al., 2022] for structural domain diversity, and OAS [Olsen et al., 2022] for antibody sequences. During training, we do not apply explicit resampling or per-corpus weighting. Each sequence therefore appears in the training stream in proportion to the raw size of its source corpus, so UniRef100 contributes the vast majority of samples, while SCOP and OAS increase structural and antibody coverage. Training batches are formed by a token-budget sampler that greedily packs variable-length sequences into blocks of 32,768 tokens per device, with per-epoch shuffling over the concatenated index, so every batch is a well-mixed sample drawn across all three corpora. The three held-out validation splits are evaluated separately, yielding one perplexity (PPL) curve per corpus (Figure 4a).
Why do we choose the pretraining recipe of AMPLIFY over ESM-2's UniRef50/90? Fournier et al. [2024] argue that UniRef50, obtained by clustering UniRef100 at 50% identity, systematically distorts the natural sequence distribution in three ways. First, cluster size in UniRef100 is an observational signal. Since large clusters correspond to families for which many related sequences have been deposited, their redundancy reflects real evidence for the underlying subspace of the fitness landscape. However, 50%-identity clustering discards this signal and upweights singletons, which are more likely to arise from sequencing errors. Second, the fraction of ambiguous reads, fragmentary sequences, and hypothetical proteins in UniRef50 is markedly higher than in UniRef100. Third, specific functional classes are depleted under 50%-identity clustering. AMPLIFY's own 350M model, trained on a mixture of UniRef100, OAS, and SCOP, either matches or exceeds ESM-2 15B on the proteome-completeness-weighted validation despite the scale gap, which we take as empirical confirmation of the recipe.
C. Evaluation Setup
C.1. Evaluation Tasks
We describe the four tasks introduced in §5 in detail. The full pipeline is a two-stage protocol: a zero-shot stage in which the model is queried via its frozen MLM head, and a supervised stage in which frozen per-token embeddings are extracted once and used to train a downstream MLP head with a controlled hyperparameter search.
C.1.1. Zero-Shot Tasks
We evaluate our frozen MLM heads on the following three zero-shot tasks:
KL-calibration to human MSA consensus (T, NT) [Le Breton et al., 2026]. We consider 6,868 human proteins. For each position i with an MSA consensus profile, we mask that position and read the model's per-position 20-way amino-acid distribution from the MLM head. Independently, we compute a consensus profile at each position from a curated multiple sequence alignment (MSA) of homologs. For each position, we report the scaled calibration score: , where higher is better. We separately average across positions where the wild-type residue matches the consensus (target, T) and where it does not (non-target, NT). This split isolates the target (T) predictions that the model is expected to recover accurately from the non-target (NT) predictions that require distinguishing evolutionarily tolerated variants. Higher T rewards accurate consensus recovery, while higher NT implies better generalization.
ProteinGym DMS mutation-effect ranking. We use the full substitution benchmark from ProteinGym [Notin et al., 2023], which contains 217 deep mutational scanning assays covering 2,465,767 single- and multi-mutant variants. For each assay, mutation effects are scored using the ESM-2-style masked-marginal formula popularized by Meier et al. [2021]:
where enumerates the mutated positions. Following ProteinGym, we compute the Spearman correlation per assay, average it within each protein and functional category, then across the five categories (Activity, Binding, Expression, Organismal Fitness, Stability). No supervision from DMS labels is used.
CASP16 categorical-Jacobian contacts. We evaluate residue-residue contact prediction on 41 CASP16 targets, with a median length of 291 and a maximum length of 466, using the categorical-Jacobian construction of Zhang et al. [2024]. For each position , we substitute each of the 20 amino acids into the unmasked wild-type sequence and record how the MLM's log-probabilities over the 20 amino acids at every position shift relative to the wild type, giving a categorical Jacobian of shape . We then center it, symmetrize it, take the Frobenius norm over the amino-acid axes and apply average product correction (APC), and rank residue pairs by the resulting score. Precision at the length of the protein sequence in residues over long-range contacts () is reported, i.e., .
C.1.2. Supervised Tasks
The supervised tasks in our rubric come from the 18-task suite curated by Chen et al. [2025], which includes tasks from FLIP [Dallago et al., 2021] and TAPE [Rao et al., 2019], among others. These tasks span four biological categories (structure, developability, interaction, and function) and include classification (C) and regression (R) at the residue, sequence, and sequence-pair levels. Examples include secondary structure, fold, fluorescence, stability, GB1 fitness, DeepLoc localization, and solubility prediction. We use the same tasks and metrics with three changes: we evaluate residue-level SSP with both Q3 and Q8 variants on the pooled test set, omit contact-map prediction because it overlaps with our zero-shot CASP16 contact probe (§C.1.1), and replace the original probe with a tuned two-layer MLP head (§C.2). Table 3 summarizes the resulting 18 tasks, and Table 6 compares baseline AMPLIFY models with our recursive variant after 1M training steps.
Table 3: The 18-task supervised suite from Chen et al. [2025]. “Type” distinguishes classification ‘C’ from regression ‘R’ tasks. Sizes are the standard train/test split, where if multiple test splits exist, we report the aggregate size. Validation uses the dataset’s own split where one exists and a random 10% of train (seed 42) otherwise. “Metric” follows Chen et al. [2025] and is also the hyperparameter-selection criterion. Results for all 18 tasks are in Table 6.
| Task | Type | Metric | Prediction target | Source dataset | |train| / |test| |
|---|---|---|---|---|---|
| SSP Q3 | C | acc. | 3-class per-residue secondary structure (H/E/C) | NetSurfP-2.0; test: CB513, TS115, CASP12, CASP14 | 10,848 / 667 |
| SSP Q8 | C | acc. | 8-class per-residue secondary structure | NetSurfP-2.0; test: CB513, TS115, CASP12, CASP14 | 10,848 / 667 |
| Fold prediction | C | acc. | 1,195-way fold class from SCOP 1.75 | SCOP / DeepSF split | 12,312 / 3,244 |
| Solubility prediction | C | acc. | binary soluble vs. insoluble | DeepSol | 62,478 / 6,942 |
| Stability prediction | R | Spearman ρ | protease-concentration fold-retention threshold | TAPE / Rocklin et al. [2017] | 53,614 / 12,851 |
| Temperature stability | C | MCC | structural stability at 65°C | TemStaPro | 283k / 73k |
| Optimal temperature | R | Spearman ρ | enzyme optimal reaction temperature | DeepET | 1,706 / 190 |
| Optimal pH | R | Spearman ρ | enzyme optimal reaction pH | EpHod | 7,124 / 1,971 |
| Cloning failure | C | AUROC | cloning-stage failure in X-ray crystallography | PredPPCrys | 23,375 / 4,791 |
| Material production | C | AUROC | material-stage failure in X-ray crystallography | PredPPCrys | 23,339 / 4,791 |
| Metal-ion binding | C | acc. | presence of any metal-ion binding site | Cheng et al. [2023] | 6,000 / 1,332 |
| Enzyme catalytic efficiency | R | Pearson r | log from the enzyme sequence (no substrate input) | DLKcat | 13,470 / 1,684 |
| Peptide affinity | C | AUROC | peptide binding to HLA/MHC-I (paired input) | CcBHLA | 57,357 / 8,406 |
| TCR affinity | C | AUROC | TCR binding to peptide-MHC (paired input) | epiTCR / VDJdb | 19,526 / 4,485 |
| Fluorescence prediction | R | Spearman ρ | fluorescence intensity of engineered GFP (extrapolation split) | TAPE [Rao et al., 2019] | 21,446 / 27,217 |
| Fitness prediction | R | Spearman ρ | GB1 4-position combinatorial fitness | FLIP GB1 (sampled split) | 6,289 / 1,745 |
| Localization prediction | C | acc. | 10-way subcellular localization | DeepLoc | 6,622 / 1,842 |
| Antibiotic resistance | C | acc. | 19-way antibiotic-resistance class | CARD | 2,072 / 1,344 |
Why do we report only four of the eighteen supervised tasks? Le Breton et al. [2026] find that the aggregate F1/MCC score across the 18 tasks differs by less than among 5 pLMs (AMPLIFY 120M/350M, ESM-2 35M/150M/650M). To separate genuine pretraining signal from task-intrinsic ceiling effects, they measure the score gap between a shallow head on pretrained embeddings and the same head on randomly initialized weights, averaged over the five models. The results show that only four tasks account for essentially all the pretraining boost: stability prediction , fold prediction , and secondary-structure prediction Q3, Q8). Every other task either saturates, with random embeddings already recovering most of the accuracy, or depends on features that MLM captures only weakly. For instance, TCR-pMHC affinity is lower with pretrained embeddings than with random ones. We follow this observation and report the four structural/stability-sensitive tasks (fold, SSP mean of Q3 and Q8, stability, and localization) in the main-paper Table 1 and Appendix Table 4. We further detail these tasks below.
Fold prediction. Given an amino-acid sequence, the model must predict its top-1 fold class out of 1,195 SCOP 1.75 folds. We use the DeepSF split with 12,312 train and 3,244 test samples. Because remote homologs are grouped into the same fold, high accuracy requires representations that recognize structural similarity across sequences with identity. This is exactly the regime where handcrafted alignment features fail and where pretraining should help. The metric is the sequence-level total accuracy (top-1 fold match) [Rao et al., 2019, Fox et al., 2014].
Localization prediction. A 10-way sequence-level classification of subcellular localization derived from UniProt annotations of ~ 8.5k eukaryotic proteins with 6,622 train and 1,842 test samples [Almagro Armenteros et al., 2017]. Signal peptides and transmembrane spans are informative, but the label ultimately requires integrating long-range motifs and organelle-specific sequence patterns, which frozen bag-of-embedding baselines only partially capture. We report the total test accuracy here.
Stability prediction. A sequence-level regression on the protease concentration at which a designed mini-protein retains its native fold, from the massively parallel proteolysis assay of Rocklin et al. [2017] with 53,614 train and 12,851 test sequences. The target is a real-valued proxy for thermodynamic stability, and the reported score is the Spearman rank correlation between predicted and measured values across the test split. Le Breton et al. [2026] find stability to be the single largest pretraining-driven task where pretraining performs up to +57.7% over the random baseline. This makes it the most discriminative task for comparing pLMs at similar overall scale.
Secondary-structure prediction (SSP). A per-residue classification into either 3 classes (Q3 with helix, strand and coil) or 8 classes (Q8 with DSSP labels) trained on the NetSurfP-2.0 corpus [Klausen et al., 2019] and evaluated on the pooled test split (667 proteins from CB513, TS115, CASP12 and CASP14), with per-residue accuracy computed over all scored test residues. Q3 and Q8 use the same encoder feature map and differ only in the final softmax head. We report the equal-weight mean of the two per-residue accuracies. Secondary structure is the residue-level task where pretraining most clearly beats random embeddings [Le Breton et al., 2026] because the label is a direct function of local backbone geometry that MLM implicitly learns during masked reconstruction.
C.2. Task Head and Hyperparameter Search for Downstream Supervised Tasks
During evaluation of the downstream supervised tasks, the encoder is frozen. Embeddings are extracted once and cached: the recurrent-core state for fixed- and variable-depth recAMPLIFY and the coda output for GMR variants and the final-layer output for AMPLIFY and ESM-2. Sequence-level tasks mean-pool over residue positions, excluding the special tokens. On top of these embeddings, we fit a two-layer MLP head (one hidden GELU layer) with a softmax output for classification and a single-scalar linear output for regression. Regression targets are standardized with the training set's mean and standard deviation. The head is selected by a 50-trial Bayesian TPE search over hidden size , learning rate , number of epochs , weight decay and batch size . For SSP, we instead search the corresponding exhaustive grid of 72 configurations. Each configuration is trained with early stopping on the task's validation split (the dataset's own split where provided, otherwise a random 10% of the training set), and selection uses the task's reported metric. The best configuration is then retrained with 5 random seeds and evaluated on the held-out test split. We report the mean (main-paper Table 1) and the standard deviation (Appendix Table 4).
D. Additional Results
Recursion offers a better representation choice for training supervised probes. Besides the standard coda output , recAMPLIFY exposes a second readout choice for training downstream supervised task probes: the refined latent state . Figure 8 shows that the latent state provides a better representation space for most supervised tasks at the depths seen during training ( ), with the largest margins at shallow depth (e.g., at , fold 0.63 vs. 0.45, stability 0.69 vs. 0.47). In the unseen depth regime ( ), coda probes are steadier on SSP and localization, where gradually declines, while the two are on par for fold and recovers and overtakes coda on stability at the largest depths. Given its superior performance for seen recurrence depths, we report supervised probe results for fixed- and variable-depth recAMPLIFY using the latent state . Our GMR variants are probed on their coda output, which decodes the halting mixture.
Table 4: Mean standard deviation scores for supervised probes reported by rerunning the best HPO configuration over 5 seeds. Small standard deviations signify that most of the gains from recursion are beyond the noise regime.
| Model | Fold | Localization | Stability | SSP |
|---|---|---|---|---|
| 1M pretraining steps | ||||
| AMPLIFY-120M (1M) | ||||
| AMPLIFY-350M (1M) | ||||
| recAMPLIFY (1M) | ||||
| 100K pretraining steps | ||||
| AMPLIFY-120M (100K) | ||||
| AMPLIFY-350M (100K) | ||||
| recAMPLIFY (fixed-L) | ||||
| recAMPLIFY (varying-L) | ||||
| +GMR (halt-only) | ||||
| +GMR (scalar gate) | ||||
| +GMR (rank-16 gate) | ||||
| +GMR (per-dim gate) | ||||
Table 5: Throughput comparison for our recursive pretraining recipe at three cycle budgets against that of the non-recurrent AMPLIFY baselines. “Blocks” is the effective depth used in Table 1, i.e., prelude, applications of the tied recurrent core, and coda. The 133M recAMPLIFY rows use . The last column normalizes the throughput by that count. All reported values are measured over 500 optimizer steps on one A100-SXM4-40GB with 32 sequences per device packed into a single FLASHATTENTION varlen buffer ( tokens) using bf16 precision without gradient accumulation. Throughput is logged over every 100-step window. To compensate for the warm-up from data loading in the early windows, we use the mean of the last two windows for comparisons.
| Model | Model size | Measured training cost | ||||
|---|---|---|---|---|---|---|
| Trainable parameters | Hidden width | Blocks per forward pass | Throughput (K tokens/s) | Relative throughput | Throughput per block (M blk-tok/s) | |
| AMPLIFY-120M | 118M | 640 | 24 | 142.4 | 3.42 | |
| AMPLIFY-350M | 354M | 960 | 32 | 59.1 | 1.89 | |
| recAMPLIFY (fixed ) | 133M | 960 | 28 | 54.3 | 1.52 | |
| recAMPLIFY (fixed ) | 133M | 960 | 44 | 37.9 | 1.67 | |
| recAMPLIFY (fixed ) | 133M | 960 | 60 | 29.1 | 1.75 | |
Design decisions that do not scale well for pretraining. Inspired by a recent line of work on recursive refinement in a limited-data regime, we ablate the effects of truncated backpropagation (BPTT) [Jolicoeur-Martineau, 2025] and context type [Liao and Poggio, 2026]. Figures 10 and 11 show that neither design helps at pretraining scale: truncated BPTT degrades fold, localization and SSP at every evaluation depth, and a learned context transform (fzLO) collapses, whereas the identity ('zero') and zLO contexts perform comparably. We therefore train with full BPTT and an identity transformation of the previous cycle's latent state.
E. Additional Mechanistic Analyses
Gates help achieve stable attention geometry. For the recurrent block to converge to an actual fixed point, the attention pattern it induces must also stabilize in addition to the hidden states. Figure 14 shows that once past the trained horizon (), the scalar gate's cross-cycle attention-map distances collapse, whereas the variable-depth model at fixed test-time depth and halt-only GMR retain cycle-dependent attention maps alongside their continued state drift. The low-rank gate's attention distances also fail to collapse, which is consistent with its magnitude drift.
Table 6: Full 18-task supervised comparison at 1M pretraining steps. Each cell reports the mean standard deviation of the test-set metric for the best HPO configuration retrained with 5 random seeds ( C.2). “Metric” follows the source benchmark (Table 3): accuracy, MCC or AUROC for classification and Spearman or Pearson correlation for regression; higher is better for every metric. AMPLIFY-120M and AMPLIFY-350M are the standard AMPLIFY 1M-step checkpoints and recAMPLIFY is our recursive 1M checkpoint with that is trained and evaluated at . Best cell per task is bold. recAMPLIFY wins on 14 of 18 tasks despite having 56% fewer unique parameters than AMPLIFY-350M.
| Task | Metric | AMPLIFY-120M | AMPLIFY-350M | recAMPLIFY |
|---|---|---|---|---|
| SSP Q3 | acc. | |||
| SSP Q8 | acc. | |||
| Fold prediction | acc. | |||
| Solubility prediction | acc. | |||
| Stability prediction | Sp. | |||
| Temperature stability | MCC | |||
| Optimal temperature | Sp. | |||
| Optimal pH | Sp. | |||
| Cloning failure | AUROC | |||
| Material production | AUROC | |||
| Metal-ion binding | acc. | |||
| Enzyme catalytic efficiency | Pearson | |||
| Peptide affinity | AUROC | |||
| TCR affinity | AUROC | |||
| Fluorescence prediction | Sp. | |||
| Fitness prediction | Sp. | |||
| Localization prediction | acc. | |||
| Antibiotic resistance | acc. |
ColSum concentration. For a row-stochastic attention matrix of a sequence with real-token length , we define the column mass and its length-normalized version . The ColSum concentration is then given as:
where the right-hand-side term is the residual of the length-normalized entropy of the column-mass distribution. therefore corresponds to uniform mixing, where every key receives an equal share of the attention mass and corresponds to all mass pooled on a single key. We compute per attention head, per protein, and per physical layer, and report the mean over heads and over the 32 probe proteins of our stability probe. Query positions are already summed inside so no averaging over query indices is needed. The dashed red curve throughout §5.1.2 is our feedforward reference consisting of a non-recurrent recAMPLIFY with identical width, attention heads, and total layers, trained at so the core layers are applied untied. A non-flat layerwise profile of signals mixing heterogeneity across physical layers while proximity to the dashed red

Figure 8: Performance comparison of different representation choices used for training downstream supervised task probes: uses the output of the recurrent core while coda is the standard pre-LM head output . We sweep on the same recAMPLIFY trained with , and ( denotes with matched ).

(a) Varying recursive layers r while fixing .

(b) Varying the prelude p and coda c while adjusting r to keep the number of layers .
Figure 9: Ablation of physical layer counts: we train each variant for 100K steps and evaluate at its training depth: in (a) and in (b). Overall, performs best in (a) on DMS, CASP, fold and SSP, while is best on KL (NT). The prelude/coda split in (b) changes every probe by less than 1 pp.
curve signals fidelity to the feedforward reference in both shape and amplitude.
F. Additional Results on GMR Depth Encoding Biological Signal
Compositional axes of the GMR halt signal. Main-paper Table 2 shows two independent per-protein composition signals for the controlled GMR halt depth (residualized on and ): high sequence entropy and high hydrophobic (FILMVWY) content both correlate with depth. We now show that these are two projections of a single compositional-vocabulary axis. Figure 16 bins the 10K UniProt held-out sequences into deciles based on their hydrophobic content against either Shannon entropy (left) or Jensen–Shannon (JS) divergence to uniform (right), where the JS divergence particularly remains less sensitive to rare amino acids (AAs). Both metrics tell us the same story in that they are nearly perfectly anti-correlated (Pearson -0.99) and both show the highest cycles to be clustered at the high-hydrophobicity end, with halt depth mostly dropping as hydrophobicity falls.

Figure 10: Effect of truncated backpropagation (BPTT) steps on supervised probes. We sweep across for four checkpoints that are trained with but differ in the truncated backprop-through-time window : full BPTT ( , gradients through every cycle) and truncated windows . Here, the last cycles receive gradients, while the earlier do not. Full-BPTT holds up across the sweep and remains competitive with AMPLIFY-350M (main-paper Table 1). Truncated variants lose about 0.2 in fold accuracy and 0.08 in SSP accuracy at every depth, and do not benefit from additional cycles on SSP. Stability is the exception, with and matching or exceeding full BPTT, while becomes unstable across seeds at larger depths.

Figure 11: Varying context type for L = 4. All models are evaluated at the matched depth [Liao and Poggio, 2026]. The simplest context type, ‘zero’, which uses an identity transformation of the previous cycle’s latent , performs surprisingly well throughout all tasks.
Input injection ablation — fixed depth

Figure 12: Input-injection ablation for recAMPLIFY. Blue line shows a normal forward pass while red denotes injection stream removed from the recurrent core. Left: . Right: on log-y. With input injection, the state is a bounded iterated map ( plateaus below ). Without the injection, the state diverges by three orders of magnitude within a few cycles. Input injection thus helps keep the recurrence bounded, matching the finding of Blayney et al. [2026] on causal-LM looped Transformers. We note that this boundedness does not imply convergence. The blue plateau in the right panel stays around throughout the OOD range, motivating main-paper Figure 5.
Figure 17 decomposes the effect per amino acid, with the seven hydrophobic/aromatic residues grouped at the bottom and columns being within-AA composition deciles. Each cell reports the median E[k] residual for sequences in that AA's decile bin. The pattern splits cleanly along the horizontal separator: every one of the seven hydrophobic AAs (F, L, I, V, M, W, Y) shows an overall increase, i.e., higher composition of a hydrophobic residue drives more GMR cycles in general. By contrast, every non-hydrophobic AA (from A downward) shows an inverted U-shape, where extreme dominance of a single polar or charged residue drives fewer recurrent cycles.
The two mechanisms are the two sides of the same question — how many independent decisions does this residue distribution actually require? Overrepresentation of a hydrophobic residue is evolutionarily rare because random sequences with that composition would aggregate. The ones that survive do so through a specific fold or a membrane pocket, and recovering the wild-type residue at masked positions requires the model to integrate long-range structural evidence. Overrepresentation of any other residue is instead an alphabet-reduction cue, where once a polar or charged class dominates, many masked positions are predictable from local statistics and the model can commit early. The halt signal thus reads a reduced-alphabet grammar in the sense that restricted vocabularies get fewer cycles, unless the vocabulary happens to be the demanding kind.
Splice-isoform collection and analysis. For our analyses on alternative isoform sequences in Table 2, we use curator-annotated Swiss-Prot alternative isoforms, fetched from UniProt REST (rest.uniprot.org/uniprotkb/stream) with includeIsoform=true on the human accessions of our 10K UniProt held-out split. UniProt returns for each accession the canonical sequence together with every alternative isoform

(a) Difference across successive iterations .

(b) Normalized distance to the deepest state.

(c) Cosine similarity with the deepest recorded state.
Figure 13: Per-layer dynamics of each recurrent block layer on the stability prediction task (median over 32 probes). (a) Successive-difference norm: gating drives each layer's step size toward zero past the cycles seen during training. (b) Normalized operator residual to each layer's deepest recorded state (taken as an approximate fixed point) over cycles shows the key diagnostic being the rate and timing of decay. Scalar and per-dim gates reach near-zero residual within a few cycles of the trained horizon, whereas halt-only and rank-16 decay only slowly and remain substantially non-zero at intermediate cycles. (c) Cosine similarity to : alignment is near-perfect for every variant, so cosine is an indirect diagnostic and must be read jointly with (a) and (b). Read together, only the scalar and per-dimension gates deliver empirical fixed-point convergence.
Swiss-Prot curators derived from experimental transcript evidence (alternative splicing, alternative promoter usage, alternative initiation, etc., depending on the entry). We keep the isoforms as returned (no mutation or ad-hoc reconstruction). As for the held-out set, halt depth is computed on the first 512 residues. Excluding the 50 genes whose isoforms differ only beyond residue 512 leaves the result unchanged ( 46% tighter than the size-matched null). The raw fetch returns 1,730 isoform sequences across the human accessions in the held-out split. After restricting to families with at least two isoforms and applying the length- and sharpness-controlled halt-depth aggregation of §5.1.3, we obtain 335 genes covering 1,054 measured isoforms (family-size distribution: 163 genes with two isoforms, 83 with three, 44 with four, and a long right tail up to one gene with 17). For each family we compute the within-family standard deviation of the controlled E[k]. The observed mean within-family std (0.013) is 46% smaller than the size-matched bootstrap null over the full held-out population (0.025; over resamples), yielding the Cohen's reported in the main paper.
G. Limitations
This is the first work targeting adaptive computation for test-time scaling of pLMs. As such, several caveats bound our claims. First, per-protein expected halt depth varies within only of its mean across the 10K UniProt held-out set. GMR's adaptivity is thus a small, structured modulation around a learned mean. Second, state-level convergence is characterized empirically through vanishing update norms and residual decay. We do not establish local stability of the recurrent operator via a Jacobian analysis. Third, gates are per-sequence rather than per-token, i.e., computation adapts across proteins but not within a sequence, and moving to per-token survivals is a natural extension. Finally, all experiments are on recAMPLIFY variants

Figure 14: Post-halt attention stability. Head-averaged attention Frobenius distance between recurrent cycles for three representative variants at . Each cell is averaged over probe sequences from the stability prediction task, and the dashed line marks the trained halt horizon at . For the variant with fixed test-time depth and varying-L pretraining (left), attention keeps drifting through all 50 cycles, despite the recurrence being bounded (Figure 12). For halt-only GMR (middle), a discontinuity appears at the halt horizon but off-diagonal cells continue to darken smoothly. For the scalar gate, cycles 8–50 collapse into uniform differences. The comparison isolates the role of the residual gate where neither variable-L training nor a halt signal on its own produces a post-halt attention fixed point; only the gate achieves this.

Figure 15: ColSum concentration vs. physical layer position across five recAMPLIFY variants, evaluated at . Solid lines with circles are the trained cycles ([1, 6]). Dashed lines with diamonds: the six evenly spaced samples from the extrapolation range [7, 50], orange square: prelude, black triangle: coda. The dashed red line is the feedforward reference which is a recAMPLIFY trained with the same physical layer counts without recursion, i.e., .
trained under the AMPLIFY data recipe, and generalization to substantially different scales, architectures, or modalities remains open.
The gate’s stability comes at the price of reduced input sensitivity. Figure 18 shows that removing input injection collapses the fixed-depth and the halt-only GMR states toward a null attractor with the halt-only variant’s decode particularly collapsing to a low-confidence generic token. In contrast, the scalar gate becomes more confident about a token that disagrees with its own input-injected prediction on 90% of positions. This is a specific artifact of residual gating with low degrees of freedom. With only one survival channel, the scalar gate’s survival distribution collapses to an input-invariant trajectory. The gate thus buys representational stability by substituting a stored default in place of a truly input-driven recurrence.
Table 7: Partial correlations between GMR halt depth and sharpness across probing tasks alongside the compute budget: denotes the partial correlation between per-protein expected halt depth and task-specific per-protein error err, after regressing out the log sequence length ; , log Sharp denotes the same after additionally regressing out the task-specific sharpness proxy log Sharp; is the signed length-controlled partial correlation of with log Sharp. Per-task error and sharpness proxy: for KL, err is the mean and sharpness is the model's mean prediction sharpness ; for fold and localization, err is test misclassification and sharpness is the negative softmax entropy of the classifier; for DMS, err per assay and sharpness is the log standard deviation of the model's scores. The two rightmost columns give per-protein (on the KL probe) and the potential budget reduction with respect to the fixed budget under hard stopping.
| Variant | KL calibration | Fold prediction | Localization prediction | ProteinGym DMS | Compute | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| raw | ctrl | coup | raw | ctrl | coup | raw | ctrl | coup | raw | ctrl | coup | reduction | ||
| Halt-only GMR | 0.42 | 0.11 | +0.50 | 0.08 | 0.01 | -0.15 | 0.08 | 0.04 | -0.13 | 0.13 | 0.08 | +0.10 | 3.57 | 40% |
| Scalar gate | 0.28 | 0.03 | +0.29 | 0.11 | 0.04 | -0.13 | 0.07 | 0.02 | -0.16 | 0.06 | 0.01 | +0.10 | 4.07 | 32% |
| Low-rank-16 | 0.59 | 0.05 | +0.63 | 0.06 | 0.02 | +0.08 | 0.02 | 0.00 | -0.08 | 0.00 | 0.04 | +0.05 | 4.06 | 32% |
| Per-dim | 0.21 | 0.04 | +0.22 | 0.00 | 0.02 | -0.03 | 0.03 | 0.01 | -0.06 | 0.05 | 0.04 | -0.04 | 4.08 | 32% |

Figure 16: Median residual halt depth binned by composition-diversity hydrophobicity. Left: Shannon entropy of the AA distribution (rows) against % of FILMVWY (columns). Right: Jensen–Shannon divergence of the AA distribution to the uniform 1/20 prior (rows) against % of FILMVWY (columns). Both panels are computed on the 10K UniProt held-out sequences of §5.1.3 and use residualized against and the model's prediction sharpness . Diverging color scale is centered at 0. Positive (red) means the model spends more cycles than a length- and sharpness-matched null.
Median by amino acid × composition decile
| Amino acid | Median by amino acid × composition decile | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| R | -0.002 | +0.003 | +0.001 | +0.003 | +0.003 | +0.003 | +0.002 | +0.001 | -0.001 | -0.009 |
| K | -0.003 | +0.001 | +0.004 | +0.004 | +0.002 | +0.003 | +0.002 | +0.002 | -0.001 | -0.009 |
| E | -0.002 | +0.003 | +0.001 | +0.005 | +0.000 | +0.002 | +0.002 | +0.003 | -0.001 | -0.009 |
| D | -0.002 | +0.002 | +0.004 | -0.000 | +0.002 | +0.002 | +0.002 | +0.001 | +0.001 | -0.007 |
| Q | -0.005 | +0.003 | +0.002 | +0.002 | +0.003 | +0.000 | +0.003 | +0.001 | +0.001 | -0.004 |
| N | -0.005 | +0.001 | +0.002 | +0.005 | +0.002 | +0.002 | +0.001 | +0.003 | -0.001 | -0.004 |
| P | -0.004 | +0.001 | +0.004 | +0.002 | +0.004 | +0.002 | +0.002 | +0.000 | +0.000 | -0.008 |
| S | -0.002 | +0.002 | +0.005 | +0.004 | +0.004 | +0.004 | +0.001 | -0.002 | -0.002 | -0.007 |
| G | -0.007 | +0.003 | +0.004 | +0.002 | +0.003 | +0.003 | +0.002 | +0.002 | -0.000 | -0.007 |
| T | -0.005 | +0.001 | +0.001 | +0.002 | +0.003 | +0.004 | +0.004 | +0.001 | +0.001 | -0.005 |
| H | -0.007 | -0.003 | -0.000 | +0.001 | +0.002 | +0.003 | +0.004 | +0.003 | +0.004 | -0.001 |
| A | -0.005 | +0.001 | +0.003 | +0.003 | +0.003 | +0.003 | +0.001 | +0.001 | +0.000 | -0.005 |
| C | -0.010 | -0.002 | +0.001 | +0.001 | +0.004 | +0.005 | +0.002 | +0.003 | +0.006 | -0.002 |
| Y | -0.014 | -0.006 | -0.003 | +0.002 | +0.003 | +0.003 | +0.004 | +0.005 | +0.006 | +0.003 |
| W | -0.008 | -0.003 | -0.000 | +0.003 | +0.002 | +0.001 | -0.000 | +0.005 | +0.005 | +0.001 |
| M | -0.006 | -0.004 | -0.001 | -0.001 | +0.001 | +0.003 | +0.004 | +0.004 | +0.005 | +0.001 |
| F | -0.012 | -0.006 | -0.002 | -0.001 | +0.002 | +0.003 | +0.004 | +0.004 | +0.008 | +0.008 |
| V | -0.013 | -0.002 | -0.000 | +0.003 | +0.003 | +0.004 | +0.004 | +0.003 | +0.003 | +0.001 |
| L | -0.014 | -0.004 | -0.001 | +0.002 | +0.004 | +0.004 | +0.005 | +0.001 | +0.006 | +0.004 |
| I | -0.010 | -0.003 | -0.002 | +0.001 | +0.001 | +0.003 | +0.004 | +0.003 | +0.004 | +0.006 |

Figure 17: Median residual halt depth by amino acid × per-AA composition decile. Rows are grouped into the seven hydrophobic/aromatic residues (bottom) and the remaining residues (top). The horizontal line separates the hydrophobic block (I, L, V, F, M, W, Y) from the non-hydrophobic block above. Columns are within-AA composition deciles (bin 1: lowest fraction, bin 10: highest). Hydrophobic AAs show increases over most of the range: heavier hydrophobic content in general drives more GMR cycles. Non-hydrophobic AAs show an inverted U-shape with extreme composition dominance driving fewer cycles.

Figure 18: LM-head top-1 probability per real token on stability prediction, evaluated with (ON) and without (OFF) input-injection.