Spectral Feedback for Test-Time Alignment of Protein Diffusion Models

Shai Dickman, Mert Cemri, Landon Butler, Kannan RamchandranNeurIPS 2026

TL;DR

Generating custom proteins with AI is usually a one-way street: once a discrete diffusion model places an amino acid, it rarely gets a chance to change its mind. Spectral Feedback gives these models an "eraser," creating a plug-and-play loop that identifies which combinations of amino acids are holding a protein back, masks them out, and lets the model try again. By exploiting a deep mathematical property of biology—that amino acid interactions are sparse—it turns an impossible combinatorial search into a tractable optimization problem, dramatically boosting the stability of AI-designed proteins without retraining a single model weight.

What Problem Does This Paper Address?

Imagine trying to write a sequence of amino acids that will fold into a very specific 3D shape—a classic challenge known as inverse protein folding. Discrete diffusion models are fantastic at this: they start with a blank, fully masked sequence and progressively unmask tokens until a plausible protein emerges.

Often, however, getting the right 3D shape isn't enough; scientists also want the protein to be exceptionally stable. Rather than retraining massive models from scratch, researchers use test-time alignment—spending extra compute during generation to steer the output toward higher rewards (like stability).

Most existing alignment methods treat generation as unidirectional, nudging token probabilities or pruning search trees along the way, with no natural way to revisit early mistakes. You could take a finished sequence, mask out a few amino acids, and re-sample them. But which positions do you erase? In biology, amino acids exhibit epistasis: the effect of changing position A depends heavily on what sits at position B. For a protein of length $L$, there are $2^L$ possible subsets of positions to edit. Searching that space naively is computationally hopeless, forcing prior editing methods to mask tokens randomly or assume positions act independently.

Methods

The authors reframe alignment from asking "what amino acid goes here?" to "which set of positions should we revisit together?"

Figure 1: Spectral Feedback loop using targeted edits to iteratively improve attributes of a protein sequence with discrete diffusion.

Instead of peering inside the diffusion model or altering its denoising trajectory, Spectral Feedback wraps around any off-the-shelf model as a black box. At each step of a feedback loop, it takes a generated protein sequence and searches for the best edit-set (up to a budget of $k$ positions) to re-mask and re-sample:

  1. Probing the Landscape: The algorithm generates random binary masks (candidate edit-sets), runs them through the diffusion model, and scores the resulting sequences using a reward oracle (averaging rewards for standard models, or taking the max when paired with Best-of-N sampling).
  2. Sparse Fourier Approximation: Rather than modeling all $2^L$ combinations, it translates the problem into the Fourier domain, where each coefficient represents the interaction strength among a specific group of positions. Using a sample-efficient tree-based recovery algorithm called ProxySPEX, it learns a compact approximation of how edit-positions interact.
  3. Integer Optimization: Because the recovered Fourier representation is tiny (sparse), finding the optimal subset of positions to erase reduces to solving a small, fast integer program. Those winning positions are masked, the diffusion model fills them back in, and the loop repeats.
Figure 4: Spectral Feedback learns a sparse Fourier representation of the edit-set value function, then solves for the max-reward set via integer optimization over the sparse coefficients.

Datasets

The authors evaluate their method on inverse folding targets from the Megascale dataset, following the validation and test splits established by prior work (DRAKES). No new datasets are introduced. To measure success and guard against "reward hacking," generated sequences are evaluated by three distinct computational oracles:

  • Stability ($\Delta\Delta G$): Predicts whether a sequence has lower Gibbs free energy (higher stability) than the natural wild-type protein, using separate alignment and evaluation oracles trained on Megascale.
  • Self-consistency RMSD (scRMSD): Uses ESMFold to fold the generated sequence and checks if its 3D structure stays within $2\text{ \AA}$ of the target backbone.
  • Naturalness: Measures sequence log-likelihood via the ProtGPT2 protein language model.

Key Insights and Ideas

  • Biological sparsity carries over to AI editing: Biologists have long known that while amino acids interact, a protein's physical properties are governed by a relatively small number of low-order interacting groups. The authors empirically show that edit-set value functions inherit this exact structure: most spectral energy sits in 1st-, 2nd-, and 3rd-order terms.
Figure 3: Spectral analysis of the value function favg with the pre-trained diffusion model. The plots show results for two generated protein sequences conditioned on the 2KVV and R6-560 (r6_560_TrROS_Hall) backbones from the Megascale dataset. Experimental details and additional plots are provided in Appendix D.2.
  • Different proteins demand different interaction orders: Looking at two specific backbones (Figure 3 above), 2KVV is dominated by simple 1st-order effects (68% of spectral variance), whereas R6-560 relies heavily on 2nd- and 3rd-order interactions (over 50% combined). This neatly explains why simple, position-by-position greedy edits work on some proteins yet hit a wall on others.
  • True modularity: Because Spectral Feedback never touches model weights or logits, it stacks cleanly on top of pre-trained models, inference-time search (Best-of-10), and even models already fine-tuned with reinforcement learning (DRAKES).

Key Results

Across 5 feedback iterations (with an edit budget of $k=20$), Spectral Feedback shifts reward distributions substantially to the right across every baseline tested:

Figure 2: Spectral Feedback in different protein model inference settings, aligning for stability (∆∆G - kcal/mol). These are reward evaluation distributions from experiments in Section 5.
  • Big jumps in stable proteins: The percentage of generated proteins more stable than wild-type ($\Delta\Delta G > 0$) jumps by +32.3 percentage points over a pre-trained ProteinMPNN diffusion model, +24.8 points over Best-of-10, and +5.8 points on top of DRAKES (a state-of-the-art RL fine-tuned model).
  • Structural integrity holds (mostly): Overall design success ($\Delta\Delta G > 0$ and $\text{scRMSD} < 2\text{ \AA}$) improves by +28.6% on the pre-trained model and +24.8% on Best-of-10, with slight improvements in sequence naturalness. On DRAKES, pushing stability to extreme levels ($1.38\text{ kcal/mol}$ average $\Delta\Delta G$) triggers a stability–structure trade-off, raising average scRMSD from $1.17$ to $1.53$ and nudging overall success down by $1.4\%$.
  • Better parallel scaling: Compared to sequential greedy Hill Climbing, Spectral Feedback evaluates candidate edit-sets in parallel batches, achieving a superior reward-vs.-latency trade-off as sample counts scale.

Limitations and Future Work

  • Sample hunger and compute overhead: Learning a reliable sparse Fourier representation requires thousands of edit-set evaluations—each invoking the diffusion model and reward oracle. Replacing full rollouts with a lightweight learned value predictor for partially masked sequences could slash this overhead.
  • Global fit vs. finding the peak: Optimizing global $R^2$ across all edit-sets doesn't strictly guarantee accuracy at the single highest-reward peak (the argmax), motivating future work on exponentially tilted objectives and alternative sparse recovery algorithms.
  • Smarter reverse-process scheduling: Currently, every re-masked sequence runs through the entire reverse diffusion trajectory from start to finish. Starting from a later diffusion timestep matched to the fraction of masked tokens is a natural next step for faster inference.

Summary updated

Abstract

Discrete diffusion models have become leading architectures for inverse protein folding, which involves complex non-causal interactions. Test-time alignment is a useful technique in protein design to guide these models at inference to generate proteins with desirable attributes. Alignment methods for discrete diffusion models have primarily focused on steering the diffusion reverse process, either by influencing token logits or by selecting favorable sequences at intermediate steps to eventually yield high-reward samples. These approaches largely treat inference as a unidirectional process, lacking effective mechanisms for revisiting undesirable token selections. We introduce Spectral Feedback, an algorithm that selects edit-positions in a feedback loop, allowing the model to iteratively correct its own generations. This approach leverages the masking structure of discrete diffusion models by re-masking and re-sampling tokens, analogous to image editing methods that reintroduce noisy latents and re-run the reverse diffusion process. While prior alignment methods focus on what token labels to assign to maximize a target reward, we instead treat which tokens to revisit as the central alignment problem. Selecting edit-positions is challenging because edit effects are interdependent: the impact of modifying one token depends on which others are edited simultaneously. We define an edit-set as a set of positions to edit by re-masking and re-sampling the corresponding tokens in a sequence. Motivated by prior work on sparse interactions in biological systems, we find empirically that edit-set value functions for protein inverse folding admit sparse Fourier representations. This structure enables Spectral Feedback to efficiently learn and optimize the value functions for edit-position selection. Spectral Feedback is model-agnostic and can be applied to pre-trained, test-time aligned, and fine-tuned diffusion models without modifying the underlying generative processes. Applied to inverse folding with a protein stability reward oracle, Spectral Feedback increases the proportion of stable proteins by 32.3 percentage points over a pre-trained model, 24.8 over Best-of-10, and 5.8 over a state-of-the-art RL fine-tuned diffusion model.
BibTeX
@inproceedings{dickman2026spectral,
  author = {Shai Dickman and Mert Cemri and Landon Butler and Kannan Ramchandran},
  title = {{Spectral Feedback for Test-Time Alignment of Protein Diffusion Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=PhVaSdnP4b},
}
Figure