Introduction
Many proteins work by switching between distinct structures, and the task asks for a method that, for a protein it has never seen, returns a ranked ensemble covering its experimentally observed states and nominates two structures as those states. AlphaFold2 [1] given the full alignment is very good at one of them and, repeated over its weight sets, returns essentially the same structure many times. The field has found the other states in three ways. Perturbing what AlphaFold2 reads, by subsampling the alignment [2, 3], by clustering it [4] or by other perturbations [5], makes it predict different structures on different inputs. Generative models trained for ensembles, by flow matching on top of a structure predictor [6] or on simulation data [7], sample a distribution rather than a point. And retraining on structures split by conformation [8] changes what the predictor has learned. Elastic-network normal modes around a single prediction [9, 10] are the classical physics-based alternative.
Producing alternative structures is only half of the problem. Our first measurements on the development pairs the task provides made the other half visible: the pooled outputs of several generators often contain a structure close to each state, yet picking two of them by the two largest structural clusters, the default nomination rule, scored almost nothing. Generators differ from each other by systematic offsets, thermal samplers spread far wider than the distance between two states, perturbed alignments produce junk alongside real alternatives, and the leading direction of variation in an ensemble is often a breathing or compaction motion rather than the change of state. The question we address is therefore: given a mixed ensemble, how do we find the axis along which the protein changes state, and where along it the two states lie, without seeing either state?
Method
Our method has a small training phase and a per-protein generation phase that does most of the work. The generation phase samples a pooled ensemble from several generator "arms", describes every structure by features that emphasise the residue pairs likely to switch, finds candidate state coordinates, decides which one is a change of state with a prior learned from the corpus, and rebuilds a clean structure at each end.
Training: a prior on what two states of one protein look like
train() learns four scalars from the structure corpus and writes them to a small JSON artefact.
For two chains it superposes their CA traces on the shared UniProt positions and records the
CA-RMSD and the difference of radii of gyration . From the two-state
development pairs it fits a log-normal prior to the inter-state distance, , with floored at 0.3; this is used only if at least 8 pairs can
be read. From up to 1,200 accessions with at least three chains, and at most six chains of each, it
then takes chain pairs of one accession below 1.5 Å as structures of the same state, whose 75th
percentile becomes the same-state noise , and pairs at 2.5 Å or more as
distinct states, whose mean compaction index becomes the scale
(each only with at least 200 pairs). If no artefact exists, built-in defaults are used:
, , , .
try: # 1. separation between the two states of a protein (two-state development pairs)
ds = []
try:
known = set(data_api.ids()) if data_api.seconds_left() > 120 else set()
except Exception:
known = set()
for name, v in sorted(data_api.dev_pairs().items()):
if data_api.seconds_left() < 120:
break
if v.get("state1") not in known or v.get("state2") not in known:
continue # only records the data API lists
try:
a, b = data_api.get([v["state1"], v["state2"]])
except Exception:
continue
st = pair_stats(a, b, 0.5)
if st is not None:
ds.append(st[0])
if len(ds) >= 8:
lg = np.log(np.maximum(np.array(ds), 0.3))
learned["sep_mu"] = float(lg.mean())
learned["sep_sigma"] = float(max(lg.std(), 0.3))
learned["sep_n"] = len(ds)
except Exception:
passGeneration: a pooled multi-arm ensemble
build() starts from the free seed model and fills the time budget in three phases. First,
AlphaFold2 at full depth over the five weight sets (arm full), within 13% of the budget. Second,
the samplers BioEmu v1.1, v1.2 and BioEmu2 in rotation (BioEmu2 every fifth round), each with a
small pilot call to measure its rate, for at least 38% of the budget and up to 55% while fewer than
400 sampler structures exist. Third, until the budget is spent, AlphaFold2 at reduced depth (arm
af2r): random sub-alignments of 8 to 128 rows, and a 128-row sub-alignment with 15% or 30% of its
columns masked, all with one compiled shape. This arm uses three recycles unless fewer than 64
three-recycle predictions would fit in what is left, judged from the measured time of a full-depth
prediction; then it uses one recycle, which roughly doubles its sample count where it would
otherwise be starved.
Features that see the switching pairs, and axes that ignore generator bias
Each structure is described by its inter-residue CA distances over at most 320 sampled residues, weighted by the symmetrised predicted aligned error of the seed model,
with the weight vector normalised to unit norm. The premise is that the pairs whose relative position the seed model is unsure about are the pairs that move between states. The same PAE also defines a set of rigid pairs, those with below both 3.0 and the 30% quantile, and, when there are enough of them, every structure gets a rigid-pair distortion
against a full-depth prediction : a real conformational state keeps the pairs the predictor is sure about, junk does not.
if pae is not None and hp["pw"] > 0:
P = np.asarray(pae, dtype=np.float64)
if P.shape == (L, L) and np.isfinite(P).any():
P = np.where(np.isfinite(P), P, np.nanmedian(P))
P = 0.5 * (P + P.T)[np.ix_(idx, idx)][iu]
W = np.maximum(P, 0.25) ** hp["pw"]
# rigid pairs: the pairs the seed model is most sure about (PAE below rigid_pae, at most a share rigid_q)
rigid = P < min(hp["rigid_pae"], float(np.quantile(P, hp["rigid_q"])))
W = W / np.sqrt((W ** 2).mean()) / np.sqrt(len(W))
Wt = torch.as_tensor(W, dtype=torch.float32, device=device)
i0 = torch.as_tensor(iu[0], device=device)
i1 = torch.as_tensor(iu[1], device=device)
feats = []The candidate state coordinates are principal axes, but not of the pooled covariance. Each arm is centred on its own mean and scaled to unit total variance, and the axes are the leading right singular vectors of the stacked blocks; arms with fewer than six samples are left out of the fit. Sample weights are balanced across arms and down-weighted for outliers, , where is the distance of structure from the weighted mean. A constant offset between two generators then contributes nothing to the axes; only variation inside each generator does.
blocks = []
for f in sorted(set(arms[fit].tolist())):
ii = np.where((arms == f) & fit)[0]
if len(ii) < int(hp["min_arm"]):
continue
it = torch.as_tensor(ii, device=device)
w_ = rw[it] / rw[it].sum()
G = F[it] - (F[it] * w_[:, None]).sum(0)
tot = ((G ** 2).sum(1) * w_).sum()
if float(tot) > 1e-12:
blocks.append(G * torch.sqrt(w_)[:, None] / torch.sqrt(tot))
if not blocks:
blocks = [(F - mu) * torch.sqrt(rw)[:, None]]
G = torch.cat(blocks)
if G.shape[0] <= G.shape[1]:
ev, U = torch.linalg.eigh(G @ G.T)
order = torch.argsort(ev, descending=True)[:kmax]
Vt = (U[:, order].T @ G) / torch.sqrt(ev[order].clamp(min=1e-12))[:, None]
else:
_, _, Vt = torch.linalg.svd(G, full_matrices=False)
Vt = Vt[:kmax]
sc = ((F - mu) @ Vt.T).cpu().numpy().astype(np.float64)
return sc, rw.cpu().numpy().astype(np.float64), drBefore this, AlphaFold2 predictions from the perturbed alignments whose mean pLDDT is below 0.88 times the best AlphaFold2 pLDDT are dropped as junk (unless fewer than six structures would remain); full-depth predictions are never dropped.
Which samplers to trust in their tails
A sampler that disagrees with AlphaFold2 about where the protein's basin is should not be allowed to define a state with its tails. In the first three coordinates we take the basin scale as the median -th nearest-neighbour distance among the AlphaFold2 samples, leaving out the near-duplicate full-depth predictions when at least eight perturbed ones exist (, or up to 6 when at least half of the reduced-depth arm was sampled at the one-recycle rate, so that the radius does not shrink with sample count), and give each sampler arm a trust equal to a ramp of the share of its samples that lie within of some AlphaFold2 sample:
AlphaFold2 arms have full trust; each arm's trust is spread evenly over its samples.
# trust of each sampler arm = share of its samples that lie in the AlphaFold2 basin
S = sc[:, :int(hp["ktrust"])]
Daa = np.linalg.norm(S[af][:, None] - S[af][None], axis=-1)
np.fill_diagonal(Daa, np.inf)
# scale of the AlphaFold2 basin: k-th neighbour distance among its samples (k = 3, or up to 6 when the perturbed
# arm was sampled at twice the rate: the same radius); the full-depth predictions are near-duplicates of each
# other and are left out when enough perturbed-alignment predictions exist
pert = A[af] != 'full'
k_nn = min(int(hp["k_nn"]), max(3, int(pert.sum()) // 4))
nn3 = np.sort(Daa, axis=1)[:, min(k_nn - 1, int(af.sum()) - 2)]
r_af = float(np.median(nn3[pert] if pert.sum() >= 8 else nn3))
w = np.zeros(len(A))
for f in sorted(set(A[~aux].tolist())):
mf = A == f
if af[mf].all():
w[mf] = 1.0 / mf.sum()
continue
dmin = np.linalg.norm(S[mf][:, None] - S[af][None], axis=-1).min(1)
frac = float(np.mean(dmin < 2.0 * r_af))
w[mf] = float(np.clip((frac - hp["t0"]) / max(hp["t1"] - hp["t0"], 1e-6), 0.0, 1.0)) / mf.sum()
use = w > 0
wu = w[use] / w[use].sum()
var = np.array([(wu * (sc[use][:, j] - (wu * sc[use][:, j]).sum()) ** 2).sum() for j in range(sc.shape[1])])Bracketing and rebuilding the two states
Along a candidate axis , the two ends are the trust-weighted quantiles at levels and . For each end we rank the trusted structures by
where are the other leading coordinates and their AlphaFold2 median, so that the preferred structures sit at the end, are not displaced sideways and keep the rigid blocks. The best of them and up to 11 more of the first 12, those within of along the axis, are averaged into a denoised structure. The average is a Procrustes mean, blended per residue with the central structure itself where the neighbours disagree about the local chain direction (order parameter between 0.8 and 0.95), so that floppy regions are not collapsed. At a soft end, whose neighbours spread along the axis rather than forming a tight cluster, a local-linear correction moves the mean from the neighbours' mean coordinate to the bracket position,
because a local average at the edge of a distribution is biased towards its bulk. Here is the neighbours' spread along the axis, and ramps from 0 to 1 as that spread, relative to the bracket width, grows from 0.025 to 0.045. Every residue of the central structure is then placed as a rigid body on the result, consecutive CA-CA distances are moved into Å, peptide bonds are closed by rotating residues about their CA, and the structure is kept only if it passes a geometry test stricter than the validity rule; otherwise the plain mean, and failing that the raw central structure, is nominated.
if z is not None and ll > 0 and len(nn) >= 4:
zz = np.asarray([z[i] for i in nn], dtype=np.float64)
dz = zz - zz.mean()
szz = float((dz * dz).sum())
if szz > 1e-12:
sd = float(np.sqrt(szz / len(nn)))
step = float(np.clip(zt - zz.mean(), -ll_cap * sd, ll_cap * sd))
mean = mean + ll * step * np.einsum('n,nlai->lai', dz, A - mean) / szz
v = A[:, 1:, 1] - A[:, :-1, 1]
u = v / np.maximum(np.linalg.norm(v, axis=-1, keepdims=True), 1e-9)
rb = np.linalg.norm(u.mean(0), axis=-1)
rho = np.minimum(np.concatenate([rb[:1], rb]), np.concatenate([rb, rb[-1:]]))
alpha = np.clip((c1 - rho) / max(c1 - c0, 1e-6), 0.0, 1.0)
alpha = np.convolve(np.pad(alpha, 2, mode='edge'), np.ones(5) / 5.0, mode='valid')
out = (1.0 - alpha)[:, None, None] * mean + alpha[:, None, None] * A[0]
out = _regularise_bb(_fit_residues(A[0], out))
return out if _strict_ok(out) else NoneChoosing the axis with the learned prior
The leading within-arm axis is often pure breathing of the generators. For each of the two leading axes we build its nominee pair and score it as the two states of one protein:
the log-normal separation prior, an exponential prior on the compaction index , and the share of trusted variance on that axis. The second axis replaces the first only if its score is higher by more than 0.5 nat. The factor of the log-normal density is deliberately left out: against a scale-free alternative it cancels, and keeping it made large-amplitude pairs lose to a small second axis.
best = None
for kc in range(min(int(hp["n_axes"]), sc.shape[1])):
picks, centres = pair_for(kc, hp["q"])
# plausibility of this pair as the two states of a protein, under the priors learned from the corpus:
# separation (log-normal) and compaction index |dRg| / RMSD (exponential), times the share of variance
ca = [bbs[p][:, 1] if isinstance(p, int) else p[:, 1] for p in picks]
Rk, tk = _kabsch_batch(ca[0][None], ca[1])
dd = ca[0] @ Rk[0] + tk[0] - ca[1]
sep = float(np.sqrt((dd * dd).sum(1).mean()))
rgs = [float(np.sqrt(((c_ - c_.mean(0)) ** 2).sum(1).mean())) for c_ in ca]
cidx = abs(rgs[0] - rgs[1]) / max(sep, 0.3)
# (the separation enters through its log-normal score only: against a scale-free alternative the 1/sep factor
# of the density cancels, and keeping it made large-amplitude pairs lose to a small second axis)
lp = (-0.5 * ((np.log(max(sep, 0.3)) - hp["sep_mu"]) / hp["sep_sigma"]) ** 2
- cidx / hp["cidx"] + hp["w_share"] * np.log(max(var[kc] / max(var.sum(), 1e-300), 1e-6)))
if best is None or lp > best[0] + hp["axis_margin"]:
best = (lp, picks, centres, kc)
_, picks, centres, kc = bestTwo further rules complete the nomination. A sampler arm of at least eight structures that forms a tight cluster far outside the AlphaFold2 basin, at least 2.0 times (3.0 when no distortion is available) the largest of its own spread, and away from the nearest AlphaFold2 sample, and whose median rigid-pair distortion is not above , is taken as a state of its own and replaces the bracket end nearer to it. The returned ensemble opens with the two nominated structures, then alternates from other bracket levels and the other axis, then the samples ordered by closeness to the central structures of the two ends, alternating between them. If any of this fails, the default two-cluster nomination is the fallback.
Results
| Method | ① | ② | ||
|---|---|---|---|---|
| Nominated-pair score ↑ | Ensemble score ↑ | Nominated-pair score ↑ | Ensemble score ↑ | |
| Claude Fable 5.2 | 0.078 | 0.100 | 0.134 | 0.106 |
| AlphaFold2, full MSA | 0.004 | 0.034 | 0.062 | 0.019 |
| Elastic-network normal modes | 0.011 | 0.015 | 0.064 | 0.028 |
| Random MSA subsampling | 0.027 | 0.061 | 0.061 | 0 |
| AF-Cluster | 0.022 | 0.043 | 0.034 | 0 |
| AFsample2 | 0.084 | 0.095 | 0.146 | 0.021 |
| BioEmu | 0.044 | 0.106 | 0.071 | 0.102 |
| AlphaFlow | 0.053 | 0.061 | 0.125 | 0.032 |
| ESMFlow | 0.033 | 0.046 | 0.009 | 0.012 |
| Coarse-grained simulation | 0.006 | 0.022 | 0.046 | 0 |
- ① Both states previously observed (frozen board of switching protein pairs)
- ② One state unseen by pretrained models (frozen board of switching protein pairs)
On Both states previously observed (frozen board of switching protein pairs) our nominated-pair score is 0.078, below the strongest published baseline there, AFsample2 [5] at 0.084, and well above the starter, AlphaFold2 on the full alignment over weight sets, at 0.004. The other generative baselines are behind us, for example AlphaFlow at 0.053 and BioEmu, one of the generators we sample, at 0.044.
On One state unseen by pretrained models (frozen board of switching protein pairs) we reach 0.134, against 0.062 for the starter, 0.071 for BioEmu and 0.125 for AlphaFlow, but behind AFsample2 [5] at 0.146. Our method is therefore behind AFsample2 on both settings and ahead of every other baseline with a published result.
In our own development, measured with our reimplementation of the nominated-pair score on the development pairs, an ablation of an intermediate version over fifteen development ensembles gave a mean of 0.276 for the full method (0.349 on the pairs whose states are observable without a partner). Among its rows, removing the PAE weighting gave 0.227 (0.307), nominating the nearest raw sample instead of the denoised structure 0.233 (0.293), always using the first axis 0.222 (0.259), trusting every sampler fully 0.214 (0.284) and never trusting samplers 0.190 (0.219). Among other later changes, the rigid-pair distortion, the local-linear correction and the adaptive recycles were added after that table and were evaluated on the same development ensembles and on ensembles saved from later end-to-end runs.
How we got here
Our first step was to collect the raw outputs of the oracles on a handful of development pairs and ask what a perfect selector could do with them. The best single structure per state reached a mean of 0.25 to 0.31 in our measurement, the two-largest-clusters default reached 0.003, and the starter scored 0 on every development pair we probed: on one pair the five full-depth predictions contained both states, but the two the starter nominated agreed. From then on we treated the problem as selection from a pooled ensemble.
- Simple selection rules failed. The extremes of the first principal component overshot, because BioEmu's thermal spread is much wider than the distance between two states. Minimum-Bayes- risk selection with random sample pairs as hypotheses reached 0.02 to 0.06, a pooled mixture likelihood about 0.02. A mixture model with a separate state preference and noise per generator arm was our first installed version, but it was fragile.
- The PAE turned out to mark the switching pairs. On six development pairs the seed model's PAE correlated with the experimental change in each pair distance with a Spearman coefficient between 0.42 and 0.80; in PAE-squared distance space the true change concentrated on one principal component, and the within-arm decomposition put it on the first axis for six of seven informative pairs. This is the core of the method.
- We did not train a change predictor, on evidence. Replacing the PAE weights by the true per-pair change, an oracle no model could beat, gave 0.312 to 0.338 against 0.318 with the PAE, so a corpus-trained predictor of which pairs change could add at most about 0.02 and we did not build one. A separation prior conditioned on single-structure features was barely sharper than the unconditional one (cross-validated of 0.09 to 0.15), so the prior stayed unconditional.
- The exception taught us the axis choice. On some proteins the first within-arm axis was a pure change of radius of gyration and the true axis was the second. The corpus showed that real state changes are rarely pure compaction (mean compaction index 0.19 over distinct-state pairs), which became the learned axis prior.
- Generators were kept or dropped by ablation. Removing BioEmu from the pool cost the most (0.155, against 0.256 to 0.286 when other arms were removed); promoting BioEmu2 from an auxiliary arm to a regular, trust-weighted one helped proteins whose minority state it samples more often than BioEmu v1.x. Adding AlphaFlow or ESMFlow as extra arms brought no gain, so they are not used. A probe of the retrained Cfold predictor cost about 60 s per structure, was less accurate than AlphaFold2 and did not produce the missing state, and was dropped. Clustered sub-alignments were no better than size-matched random ones on the two proteins we tried, fewer BioEmu integration steps gave worse geometry, and AlphaFold2 with dropout, fewer recycles or very shallow alignments did not reach the missing state where it was absent.
- A geometry audit led to the hybrid denoiser. Plain Procrustes means passed the stated validity rule but collapsed floppy regions, with consecutive CA-CA distances down to 1.4 to 2.1 Å; the per-residue blend and chain regularisation fixed that, with a slight gain in our measurement (0.276 against 0.268).
- Pushing the nominees apart was rejected; the local-linear correction was kept. Nominees at soft ends sat inward of their bracket position. Extrapolating both nominees along their difference helped those ends but hurt proteins whose ends are tight clusters (0.86 to 0.72 on one of them); the local-linear estimate corrects only soft ends.
- A latent crash was found by edge tests. For sequences with non-standard residues the oracles return a shorter chain, and a structure built in our own process with the oracles' length would be rejected; the method now returns only oracle predictions in that case.
- The last changes were one threshold and one prior term. The far-arm ratio threshold was lowered from 2.5 to 2.0 after one protein's distinct BioEmu2 state fell just under it, since 2.0 and 2.5 had scored identically in our sweep and the distortion gate already stopped every junk arm with a ratio of 1.8 or more. Finally we removed the factor from the axis prior: a margin table over our saved ensembles showed it cost a large-amplitude true axis 0.66 to 1.25 nat against a small second axis on the ensembles where the wrong axis was chosen or nearly chosen, and without it the method was at least as good on every offline set and differed on one ensemble. Sharpening the compaction penalty instead flipped correct axes and was rejected.
Across repeated end-to-end runs on the development pairs our mean rose from 0.331 to 0.455 between the early and the middle versions, with a large spread between repeat runs on single proteins; all of these figures are our own development measurements with our own reimplementation of the metric.
Limitations
- No setting is won. On both settings we are behind AFsample2. Our method can only select and refine what its arms sample, and on proteins where neither AlphaFold2 nor BioEmu samples the second state no selection rule helps. Two development pairs scored 0 for this reason in every version we ran.
- The learning is small.
train()estimates four scalars. The task's premise is that recovering other states has required changing what a model learned; our evidence is that, within the training cap, the PAE was already close to an oracle for which pairs move, but we did not test a trained generator, ranker or LoRA, and the method is mostly an inference-time procedure. - Many constants were set on few proteins. The selection rule has over thirty hyper-parameters, set on the development pairs, with fifteen ensembles in our main offline table. Our sweeps found most of them flat, but the bracket quantile, the far-arm threshold and the axis margin are each decided by a handful of proteins, and the far-arm statistic sat close to its threshold on one development protein in several runs.
- Small-amplitude and partner-dependent changes are weak. On development pairs whose two states are close, the experimental difference was a mixture of several comparable ensemble modes, not one axis, and the method stayed near 0 to 0.3. On two partner-dependent development pairs the installed version before the last change scored 0; the last change targets one of those failures but was validated only offline and in two short end-to-end smoke runs, not in a full end-to-end run. The binding-partner information the interface provides is not used.
- Our development metric is a reimplementation. All development figures above come from our own reimplementation of the nominated-pair score, not from the official one.
References
- John Jumper, Richard Evans, Alexander Pritzel et al. (2021). Highly accurate protein structure prediction with AlphaFold. Nature.
- Diego del Alamo, Davide Sala, Hassane S Mchaourab et al. (2022). Sampling alternative conformational states of transporters and receptors with AlphaFold2. eLife.
- Hanqun Cao, Zijun Gao, Chunbin Gu et al. (2026). SF-Cluster: Frustration-Guided MSA Subsampling for Alternative Protein Conformation Recovery. ICML.
- Hannah K. Wayment-Steele, Adedolapo Ojoawo, Renee Otten et al. (2024). Predicting multiple conformations via sequence clustering and AlphaFold2. Nature.
- Yogesh Kalakoti, Björn Wallner (2025). AFsample2 predicts multiple conformations and ensembles with AlphaFold2. Communications Biology.
- Bowen Jing, Bonnie Berger, Tommi Jaakkola (2024). AlphaFold Meets Flow Matching for Generating Protein Ensembles. ICML.
- Sarah Lewis, Tim Hempel, José Jiménez-Luna et al. (2025). Scalable emulation of protein equilibrium ensembles with generative deep learning. Science.
- Patrick Bryant, Frank Noé (2024). Structure prediction of alternative protein conformations. Nature Communications.
- A.R. Atilgan, S.R. Durell, R.L. Jernigan et al. (2001). Anisotropy of Fluctuation Dynamics of Proteins with an Elastic Network Model. Biophysical Journal.
- Ahmet Bakan, Lidio M. Meireles, Ivet Bahar (2011). <i>ProDy</i> : Protein Dynamics Inferred from Theory and Experiments. Bioinformatics.