Steering Protein Language Models

Long-Kai Huang, Rongyi Zhu, Bing He, Jianhua Yao

Abstract

Protein Language Models (PLMs) have emerged as powerful tools for sequence generation, yet controlling them to produce specific biological traits remains a significant challenge. Traditional methods like fine-tuning are computationally expensive and risk degrading the model's general biological knowledge. This paper explores "Activation Steering," a training-free technique adapted from Large Language Models, to direct PLM generation. By intervening in the model's internal activations during inference, we demonstrate that PLMs can be precisely steered toward properties such as high thermostability and solubility. Our results show that steering consistently outperforms traditional fine-tuning and established optimization baselines, offering a more efficient path toward programmable protein engineering.

Introduction

Foundational Protein Language Models (PLMs) like ESM and ProGen have revolutionized the field of protein design by learning the underlying "grammar" of biological sequences from massive evolutionary datasets. Despite their success, these models are often treated as "black boxes" when it comes to specific functional requirements. If a researcher requires a protein with a specific trait—such as high thermostability for industrial applications—they typically face two suboptimal paths: computationally intensive fine-tuning on specialized datasets or massive stochastic screening of generated sequences.

This research introduces a "third way": Activation Steering. By leveraging the latent knowledge already embedded within a model's hidden layers, we can nudge the generation process toward desired biological properties without altering the model's weights. This approach treats the model's internal representations as a navigable space where specific directions correspond to specific functional traits.

Methods

The study proposes two primary frameworks for controlling protein generation and optimization.

1. Activation Addition (ActAdd)

Activation Addition is designed for the de novo generation of proteins with specific properties. The process begins by identifying a "steering vector" ($v_l$) within the model's latent space. This vector is calculated as the mean difference between the activations of a "positive" set (proteins exhibiting the desired trait) and a "negative" set (those lacking it).

During the inference phase, this vector is added to the model's hidden states at a specific layer $l$, scaled by a steering strength parameter $\alpha$: $$\tilde{h}_l = h_l + \alpha v_l$$

This simple linear intervention shifts the model's internal state toward the desired property space, influencing the probability distribution of the next predicted amino acid without requiring any retraining.

2. Activation Steering based Protein Optimization (ASPO)

For the task of optimizing existing protein sequences, the authors developed the Activation Steering based Protein Optimization (ASPO) algorithm. ASPO identifies specific residues within a sequence that are suboptimal for a target property. It calculates a "relatedness score" based on the cosine similarity between a token's representation and the steering vector. Tokens with the lowest scores—indicating they are most "at odds" with the desired trait—are masked. The PLM then re-predicts these masked positions while under the influence of activation steering, effectively "repairing" the sequence to enhance its fitness.

Experimental Results

The effectiveness of these methods was evaluated across several benchmarks, including thermostability, solubility, and fluorescence.

Thermostability and Solubility

Using the ESM2 (650M) architecture, activation steering was applied to the generation of lysozyme-like proteins. The results were striking: the average predicted thermostability of generated sequences rose from 56.48°C to 82.20°C. In comparison, a model fine-tuned using LoRA (Low-Rank Adaptation) only reached 63.56°C. Similar success was seen in solubility tasks, where steering achieved a fitness score of 0.494, nearly doubling the original model's performance of 0.289.

GFP Optimization

In the Green Fluorescent Protein (GFP) brightness task—a common benchmark for protein engineering—ASPO was compared against established baselines like AdaLead and PEX. In the "hard" difficulty setting, ASPO achieved a fitness score of 3.907, significantly outperforming AdaLead (1.255) and PEX (1.320). Notably, while many optimization algorithms suffer from "mode collapse" (generating repetitive, low-diversity sequences), activation steering maintained high sequence novelty and diversity.

Discussion and Insights

Latent Knowledge and Architecture Agnosticism

A central finding of this work is that PLMs inherently encode complex biophysical properties in their hidden layers, even without explicit supervision. Activation steering simply provides a mechanism to "activate" this latent knowledge. Furthermore, the method proved to be architecture-agnostic, showing consistent results across auto-encoding models (ESM2, ESM3) and auto-regressive models (ProLLaMA).

Steering vs. Fine-tuning

The superiority of steering over fine-tuning suggests that fine-tuning may lead to overfitting on small, property-specific datasets, causing the model to lose the broad "evolutionary common sense" it gained during pre-training. Steering preserves the base model's weights, allowing it to retain its general biological understanding while following a specific functional "compass."

Limitations

Despite its advantages, the method is sensitive to the steering strength ($\alpha$). While thermostability proved robust to high $\alpha$ values, solubility was more fragile; excessive steering could lead to a collapse in the model's generative quality. Additionally, the quality of the steering vector is dependent on the diversity and size of the initial positive/negative protein sets.

Conclusion

Activation steering represents a significant shift toward programmable protein design. By interacting with the latent spaces of foundation models through simple mathematical interventions, researchers can direct the generation of proteins with high precision and efficiency. Future work will explore multi-objective steering—optimizing for multiple traits like stability and solubility simultaneously—and extending these techniques to complex structural design tasks.

Summary updated

BibTeX
@inproceedings{huang2025steering,
  author = {Long-Kai Huang and Rongyi Zhu and Bing He and Jianhua Yao},
  title = {{Steering Protein Language Models}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=pu2aw2zwMx},
}
Figure