arXiv:2610.26747cs.LGOct 2026

Manuscript Offprint

arXiv:2610.26747

recAMPLIFY: Large-Scale Pretraining of Recursive Protein Language Models

Saurav Jha, Qianli Liao, Robert Vernon, Sarath Chandar, Quentin Fournier

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Saurav Jha1,2^{1,2}, Qianli Liao3,4^{3,4}, Robert Vernon5^{5}, Sarath Chandar1,2,6^{1,2,6}, and Quentin Fournier1,7^{1,7}

1^{1}Mila – Quebec AI Institute, 2^{2}Polytechnique Montréal, 3^{3}Center for Brains, Minds, and Machines, 4^{4}MIT, 5^{5}Amgen, 6^{6}Canada CIFAR AI Chair, 7^{7}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

Figure 1: recAMPLIFY architecture. A non-recurrent prelude maps input embeddings to a residue-aligned latent state zkz_k, 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. 1^{1}

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

1^{1}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.

References (74)