Circular-Permutation Audits for Protein Language Models

When a language model scores suspiciously well on a benchmark, we rarely know whether it reasoned about the problem or remembered the answer. In natural language, one recent check is disarmingly simple: present a memorized multiple-choice question with its options reordered, and the model's token-level surprise (perplexity) jumps, because the memorized text appeared in one canonical order during training ABCD: All Biases Come Disguised. Nothing comparable exists for protein language models (pLMs) — networks trained on millions of natural amino-acid sequences that now score well on fitness-prediction benchmarks like ProteinGym. Yet the suspicion is at least as strong there: the benchmark's wild-type proteins and their homologs sit in the very UniRef databases used for pre-training, and nobody has checked how much of the reported accuracy is recall of familiar sequences in their familiar N-to-C order rather than learned biophysics ProteinGym: Large-Scale Benchmarks for Protein Fitness Prediction and Design.

This proposal builds a physically grounded version of the order-swap audit for protein models. The key move is to swap sequence order in ways with known thermodynamic consequences. Circular permutation — cutting a protein chain at one point and fusing the old ends — is a real biological event that largely preserves the folded structure and its stability, while completely rewriting every residue's linear position. Sequence reversal, by contrast, destroys the fold. A model that has internalized physics should be nearly invariant to the first and sensitive to the second; a model leaning on memorized canonical order or on transformer positional habits will treat them alike. The difference between these responses, measured on natural (possibly contaminated) sequences versus synthetic sequences that provably never appeared in any corpus, gives a three-way diagnostic that separates genuine thermodynamic understanding, architectural positional bias, and benchmark memorization — the three directions this note connects, which no paper in the Lacuna index currently spans.

Core Claim

The claim is that a pLM's response to physically classified order swaps is an interpretable, black-box signal that simultaneously detects benchmark contamination and measures positional bias, and that current top fitness-prediction methods have never been tested against it. Concretely, define the order-swap gap of a model on a sequence $s$ as

$$\Delta_{\mathrm{swap}}(s) = \log \mathrm{PPL}(\pi(s)) - \log \mathrm{PPL}(s),$$

where $\mathrm{PPL}$ is the model's per-token negative log-likelihood averaged over the sequence, and $\pi$ is a circular permutation of $s$. The proposal predicts, and will test, that $\Delta_{\mathrm{swap}}$ is large on natural benchmark families whose homologs were in the pre-training corpus, small on synthetic sequences generated along neutral networks (webs of mutations that preserve the fold) that no crawl could have contained, and — critically — that fitness-ranking accuracy under circular permutation tracks preservation of the structural contact map rather than linear displacement. Thermodynamic sequence filtering supplies the physics that makes the invariance prediction; positional bias supplies the mechanism of failure; contamination supplies the confound the whole audit exists to expose.

Background and the Gap

Three literatures meet here without touching. On the biophysical side, lattice simulations of structurally constrained evolution accept a mutation only if the sequence keeps the target fold as its ground state, folds kinetically in time, and clears an explicit stability threshold, the Z-score $Z = (E_{\mathrm{native}} - \langle E_{\mathrm{misfolded}} \rangle)/\sigma_E$, which measures the energy gap between the native fold and the ensemble of misfolded alternatives Structurally constrained protein evolution: results from a lattice simulation; Statistical properties of neutral evolution. Sequences drifting under these rules diverge enormously while preserving the fold Neutral evolution of model proteins: diffusion in sequence space and overdispersion, and the constraints are spatially heterogeneous: buried hydrophobic cores tolerate few substitutions while solvent-exposed surfaces tolerate many Structural and Functional Restraints on the Occurrence of Single Amino Acid Variations in Human Proteins. This literature gives us a generator of ground-truth physical landscapes — something the contamination literature lacks.

On the bias side, transformers demonstrably favor the start and end of their inputs: primacy effects dominated 73 of 104 model-task combinations, and the effects cluster by model architecture rather than by prompt, suggesting they are baked into positional encodings and attention rather than being removable by instruction Serial Position Effects of Large Language Models. Models also judge candidates relatively rather than absolutely, so permuting inputs flips predictions LLMs May Perform MCQA by Selecting the Least Incorrect Option. Nobody has asked whether pLMs inherit the same habits along the chain, even though their outputs are literally position-indexed residue predictions.

On the contamination side, the survey of benchmark data contamination lays out leakage levels from semantic overlap down to raw question-answer pairs, and records standard defenses: n-gram matching, membership inference, chronological cliffs, and refactoring — the last causing an average 39.4% performance drop when 51 code models were moved from HumanEval to the refactored EvoEval Benchmark Data Contamination of Large Language Models: A Survey. Dynamic generators like DyVal create fresh reasoning instances on the fly and exposed models scoring near zero despite strong static-benchmark results, but DyVal is confined to formal rule-based domains — arithmetic, logic, graph reachability — and cannot express a folding landscape DyVal: Dynamic Evaluation of Large Language Models for Reasoning Tasks. The closest existing work to this proposal is ABCD, which detected contamination in MMLU-Pro through perplexity differences between original and permuted option order and reduced permutation variance 3x with its Matched-and-Dashed protocol, but only for text multiple-choice benchmarks and with no physical ground truth for what a "correct" order response would be ABCD: All Biases Come Disguised. Our proposal differs on the ingredient that matters: in proteins, order swaps have physically computable consequences, so the audit does not just flag that something was memorized — it names what the model should have done instead, by reference to the Z-score physics, and it separates memorization from architecture-driven positional bias via synthetic controls.

Research Program

The program builds three things. First, a permutation-probe suite: for every evaluation sequence we construct circular permutations at all cut points (physically fold-preserving, position-rewriting), a reversal (fold-destroying), and matched random segment shuffles (partially structure-destroying), each tagged with the fraction of the native residue-residue contact map it preserves, computable from predicted or known structures. Second, a synthetic ground-truth generator: we reimplement the lattice neutral-evolution engine with its three acceptance criteria and explicit Z-score thresholds Structurally constrained protein evolution: results from a lattice simulation, and generate on the fly large families of neutral-network trajectories and off-network destabilizing jumps. These sequences are guaranteed absent from any training crawl, making them the clean control that natural benchmarks cannot provide — a DyVal-style dynamic benchmark, but for biophysical landscapes rather than formal logic. Third, the audit protocol itself: the contamination signature is the difference between the model's order-swap behavior on natural benchmark families (whose UniRef homologs were plausibly seen) and on matched synthetic families (never seen), holding length, composition, and predicted structure constant. Positional-bias signature is behavior on synthetic sequences alone, where memorization is impossible by construction, stratified by a residue's linear position versus its structural environment (buried core versus exposed surface).

A key design decision is using circular permutation rather than blind shuffling as the primary swap. Blind shuffles confound two effects: they change linear position and they destroy structure. Circular permutation changes linear position almost maximally while preserving structure, which is exactly the contrast needed to attribute a model's failure to positional habit rather than physics. This is also what makes the audit a test of thermodynamic understanding: the physical prediction — invariance under fold-preserving permutation, sensitivity under fold-destroying reversal — is written down before any model is run.

Proposed Experiments

Experiment one applies the perplexity audit to the pLMs named in the benchmark literature (ESM-1v-class and diffusion/generative models pre-trained on UniRef) across the 217 substitution assays of ProteinGym, their wild types, and homolog families ProteinGym: Large-Scale Benchmarks for Protein Fitness Prediction and Design, against matched synthetic lattice families. The readout is $\Delta_{\mathrm{swap}}$ on natural versus synthetic sequences; a significantly larger gap on natural sequences is the contamination signature, directly extending ABCD's MMLU-Pro finding to biology ABCD: All Biases Come Disguised. Experiment two evaluates zero-shot fitness ranking under permutation: for each ProteinGym assay with structural annotations, we recompute the model's Spearman correlation between predicted and measured variant fitness on circularly permuted wild types, stratifying mutations by solvent accessibility and by linear position. The decisive pattern is whether accuracy loss correlates with contact-map disruption (physical) or with distance of the mutation's new linear position from the termini (positional). Experiment three scores models on the dynamic lattice benchmark: rank variants along neutral trajectories versus destabilizing jumps against ground-truth Z-scores, with difficulty scaled by trajectory depth — the on-the-fly generation that static DMS assays cannot offer. Experiment four stress-tests structure models in the spirit of AF2-mutation, which showed that 1–3 adversarial residue edits cause an average lDDT drop of 10.76 and up to 46.61 on CASP14 targets AF2-mutation: adversarial sequence mutations against AlphaFold2 in protein tertiary structure prediction: we relocate equivalent edits to the same structural context at different linear positions via circular permutation and test whether the disruption is equal, as physics demands.

Baselines

The naive reference point is the unmodified zero-shot pLM evaluated on canonical-order ProteinGym — the number every current paper reports and the one our audit suspects. The strongest existing method on this benchmark family is PsiFit, which injects multimodal stability priors ($\Delta\Delta G$ predictions) as logit-level corrections into ESM-1v Learning Protein Fitness Landscapes with Multimodal Stability Priors; in its low-N evaluation on 114 non-stability assays with 96 labels per protein, PsiFit reached a mean Spearman correlation of 0.509 versus 0.433 for the ESM-1v baseline and 0.479 for augmented DeepSequence, winning on 65 of 114 datasets and beating ESM-1v on 84. On the supervised side, ProteinNPT reported a Spearman correlation of 0.613 on ProteinGym ProteinGym: Large-Scale Benchmarks for Protein Fitness Prediction and Design; TranceptEVE was the top zero-shot substitution performer, but no reported result found on Lacuna for its exact score. We will run PsiFit and the raw pLM under identical conditions — same ProteinGym subset, same 96-label tuning budget for PsiFit's fitted layers, same compute — first on canonical order to reproduce its advantage, then under circular permutation and on the synthetic benchmark. Beating the baseline here means one of two results: matching PsiFit's canonical-order Spearman while degrading less under fold-preserving permutation, or showing that PsiFit's advantage shrinks materially on decontaminated (synthetic and homolog-filtered) splits — either outcome reframes what its stability prior actually buys. The ablation that isolates our key ingredient compares the three swap types on identical sequences: if predictions track contact-map preservation across circular permutation, reversal, and segment shuffle, physics dominates; if they track linear displacement uniformly, positional bias dominates; the spread between these regressions is the measurement.

Why not just…?

Why not just average over all input permutations at inference? This is the brute-force fix the NLP literature already tried. ABCD showed that shuffling options and averaging reduces variance but leaves residual positional preference, and its Matched-and-Dashed protocol cut permutation variance 3x without eliminating the underlying bias ABCD: All Biases Come Disguised. More fundamentally, averaging mitigates but does not measure: it cannot tell you whether the remaining error is memorization or positional habit, and in proteins it would average over mostly structure-destroying orders, destroying the signal. We will still run circular-permutation averaging as an ablation, because if it fully closes the gap on synthetic sequences it would weaken the claim that positional bias needs architectural rather than procedural fixes — and we would report that honestly.

Why not just check for overlap between the test set and the training corpus with n-gram or sequence-identity matching? This is the standard detection method in the contamination survey, and where corpus access exists it is cheaper and should be run alongside our audit Benchmark Data Contamination of Large Language Models: A Survey. But it fails exactly where ProteinGym is most vulnerable: the survey's own taxonomy places homolog-level and information-level leakage below the resolution of string matching, and the benchmark's families have homologs throughout UniRef, so exact matching yields false negatives while a model still exploits family-level familiarity. Our perplexity gap works black-box, without corpus access, and the synthetic control gives it a memorization-free reference point that no matching method has. The honest caveat: if the two methods disagree on a family, we cannot adjudicate without corpus access, and we will treat disagreement as a finding, not a victory.

Why not just add a stability prior to the model, as PsiFit already does? This is a real threat to the practical value of the proposal, and we do not claim to replace it. PsiFit demonstrably improves fitness prediction in the low-N regime Learning Protein Fitness Landscapes with Multimodal Stability Priors. But PsiFit was evaluated on static ProteinGym assays without any contamination audit, and if part of its advantage comes from the pLM's recall of homolog sequences in canonical order, a decontaminated evaluation could erase it. Our second experiment tests precisely this, and if PsiFit's edge survives circular permutation and the synthetic benchmark intact, that would be strong evidence its stability prior is doing genuine physical work — a result we would welcome and would make the audit worth running before, not instead of, building such priors.

Decisive Checks

Three outcomes would decide the proposal. First, the natural-versus-synthetic contrast in $\Delta_{\mathrm{swap}}$: a significant gap on natural ProteinGym families and none on synthetic lattice families establishes the contamination signature; a gap on both would instead indict architecture and shrink the contamination claim to a secondary role — a publishable finding either way, but a different one. Second, the attribution regression: fitness-accuracy loss under permutation must correlate with contact-map disruption more than with linear displacement for the "physics learned" reading to hold for any given model, and the coefficients give a per-model positional-bias score comparable across architectures, in the spirit of the architecture-clustered serial-position analysis Serial Position Effects of Large Language Models. Third, the causal check: continue-pre-training a small pLM on an order-augmented corpus (UniRef sequences plus their circular permutations). If its swap gap falls and its permuted-sequence fitness ranking rises while its canonical-order scores hold, the mechanism is training-order exposure, and the audit measures something fixable. Together these checks turn a vague worry — "are protein benchmarks inflated by leakage?" — into a quantity with a physical null hypothesis, which is what the field currently lacks.