Steering Sequence Generation in Protein Language Models through Iterative Lookback Monte Carlo Sampling

Francesco Calvanese, Gianluca Lombardi, Martin Weigt, Jorge Fernandez-de-cossio-diazGenBio @ ICML 2026

Generating a new protein is a bit like writing a poem in a language where the rules of grammar are incredibly complex and mostly unwritten. Protein Language Models (pLMs) have become remarkably good at learning this "biological grammar" from millions of natural sequences. However, a major hurdle remains: how do we "steer" these models to generate proteins with specific traits—like heat resistance or a specific shape—without the model getting stuck in a loop and generating the same few sequences over and over?

In their paper, "Steering Sequence Generation in Protein Language Models through Iterative Lookback Monte Carlo Sampling," Calvanese et al. introduce a training-free method to solve this "diversity collapse" while maintaining high biological quality.

TL;DR

The authors present Iterative Lookback Monte Carlo (ILMC), a sampling strategy that allows researchers to steer protein generation toward desired properties without retraining the model. By interleaving standard generation with a "lookback" refinement step, ILMC produces significantly more diverse and high-quality protein libraries than standard methods.

What Problem Does This Paper Address?

Standard pLMs generate sequences token-by-token (autoregressively). To get "better" proteins, researchers often use "low-temperature sampling," which essentially tells the model to only pick the most probable next amino acids. While this improves the average quality, it leads to diversity collapse: the model becomes "myopic," losing its ability to explore the vast space of possible proteins and instead outputting nearly identical sequences.

Existing fixes usually involve computationally expensive retraining or reinforcement learning, which can lead to "catastrophic forgetting," where the model optimizes for a specific reward but forgets how to make a functional protein.

Methods

The core innovation is Iterative Lookback Monte Carlo (ILMC). It is a "training-free" inference-time algorithm, meaning it works with existing pre-trained models.

  1. Autoregressive Elongation: The model generates a small block of amino acids (tokens) normally.
  2. Lookback Refinement: Instead of moving straight to the next block, the algorithm "looks back" at a window of recently generated tokens. It uses a Metropolis-Hastings (MH) refinement step to resample and potentially replace segments of that window.
  3. Maximum Entropy Targeting: The refinement is guided by a target distribution that mathematically balances two things: generative quality (how much it looks like a real protein) and steering potential (how well it fits the desired trait, like thermostability).

The authors prove that this approach targets the unique maximum-entropy distribution—the most diverse possible set of sequences that still satisfy the given quality and steering constraints.

Datasets

The authors validated ILMC across several protein families and model architectures:

  • Protein Families: Chorismate Mutase (CM), Phage Lysozyme (PL), and Response Regulator (RR).
  • Models: They tested a small custom Decoder-Only (sDO) transformer (~0.8M parameters) and the massive ProGen3 (112M parameters), which was pre-trained on the UniProt database.
  • Benchmarks: They compared ILMC against standard autoregressive sampling, rejection sampling, and FUDGE (a common classifier-guided steering method).

Key Insights and Ideas

  • The Myopia of pLMs: Standard autoregressive models are "blind" to the future. They might pick a high-probability amino acid now that leads to a "dead end" (a non-functional protein) later. ILMC’s lookback steps act as a "non-myopic" correction, allowing the model to fix early mistakes.
  • Diversity is a Constraint, Not an Accident: By framing the problem as a maximum-entropy optimization, the authors show that diversity isn't just a nice-to-have; it's a formal requirement that can be balanced against likelihood.
  • The Pareto Frontier: There is an inherent trade-off between steering for a property and maintaining natural likelihood. ILMC allows researchers to explicitly navigate this "Pareto frontier," finding the sweet spot where a protein is both highly engineered and biologically viable.

Key Results

  • Superior Diversity: At matched generative quality, ILMC produced significantly more unique sequences than standard sampling. For example, in high-probability regimes where standard sampling collapsed into a few modes, ILMC continued to cover the natural sequence space.
  • Enhanced Thermostability: Using a simple steering potential based on amino acid composition, ILMC increased predicted melting temperatures ($T_m$) by an average of 18.3°C compared to unsteered baselines and 7.1°C over compute-matched rejection sampling.
  • Classifier Guidance: When steered by a classifier to hit a specific structural class (Response Regulators), ILMC maintained much higher library diversity than FUDGE while achieving comparable structural accuracy (measured by iRMSD).

Limitations and Future Work

  • Computational Overhead: ILMC is slower than standard sampling. Depending on the "lookback window" size, the complexity can jump from $O(L^2)$ to $O(L^3)$, where $L$ is the sequence length.
  • Potential Design: The method relies on "prefix-friendly" steering potentials. If a desired trait can only be measured on a full, folded protein, it's harder to provide the "early signal" ILMC needs during the generation process.
  • Hyperparameter Tuning: The algorithm requires balancing several parameters ($\beta, \lambda, K, N_{MC}$), which currently requires some manual heuristic tuning. Automating this search is a clear next step.

Summary updated

BibTeX
@inproceedings{calvanese2026steering,
  author = {Francesco Calvanese and Gianluca Lombardi and Martin Weigt and Jorge FERNANDEZ-DE-COSSIO-DIAZ},
  title = {{Steering Sequence Generation in Protein Language Models through Iterative Lookback Monte Carlo Sampling}},
  booktitle = {GenBio @ ICML},
  year = {2026},
  url = {https://openreview.net/forum?id=mJdmO3FbCC},
}
Figure