Auto-Scripted Warping: Zero-Shot Alignment of Molecular Unbinding Trajectories to Machine-Generated Event Sequences

Predicting how long a drug stays bound to its target — its residence time — is one of the most valuable and least accessible quantities in drug discovery. Experimental kinetic measurements exist for only a handful of compounds per target, and the physics simulations that could substitute for them produce long molecular trajectories that historically required a human expert to watch and label by hand. A 2024 PNAS study removed the human watcher by clustering trajectories with Dependent Dynamic Time Warping ($DTW_D$) — an elastic alignment method that compares two sequences by stretching and compressing their time axes so that events match events rather than clock ticks (Data-driven classification of ligand unbinding pathways). But that method still leans on a different kind of manual labor: for every protein–ligand system, a scientist must hand-pick which ligand-atom-to-residue contacts define the comparison. This note proposes to remove that second bottleneck by borrowing a trick from video understanding, where an ActAlign study had a language model write an ordered list of sub-actions and then used DTW to align that text script against raw video frames, achieving zero-shot classification with no task-specific training.

The core claim: for a new protein–ligand system with no labeled data and no human feature engineering, we can automatically generate an ordered "event script" of plausible unbinding mechanics (which contacts break, in what rough order, which water bridges form), embed every simulation frame into the same event vocabulary, and use DTW alignment between trajectory and script to classify unbinding pathways and estimate residence times. DTW supplies the mechanism, automated attribute discovery supplies the vocabulary, and extreme label scarcity in drug discovery supplies the regime where this matters.

Core Claim and Gap

Three lines of work motivate the proposal but none occupies its ground. The unbinding-pathways study (Data-driven classification of ligand unbinding pathways) demonstrated the payoff of trajectory warping: $DTW_D$ plus K-medoids reached 86–96% agreement with expert visual labels on benzene–T4 lysozyme, found 16 distinct kinetic clusters where manual studies had found 8, and predicted $\tau_{off} = 1.27$ ms against an experimental 1.1 ms. Its limitation is system-specific manual curation of contact descriptors and quadratic pairwise cost. ActAlign (ActAlign: Zero-Shot Fine-Grained Video Classification via Language-Guided Sequence Alignment) solved the analogous curation problem in video by asking a language model to decompose a class label into ordered sub-actions and aligning them to frames with DTW through a frozen image–text embedding backbone, reaching 30.4% top-1 on ActionAtlas — training-free. It is confined to human motion in RGB video. The drug-discovery side has automated away manual chemistry descriptors with pretrained molecular embeddings (Advancing Ligand-based Virtual Screening and Molecular Generation with Pretrained Molecular Embedding Distance), knowledge graphs with optimal-transport pseudo-labels (KGOT), and property-aware few-shot relation networks (PAR) — all on static molecular snapshots, none modeling time. The gap is the composition: nobody generates an ordered sequence of physical unbinding events and aligns uncurated trajectories to it, per system, with no human in the loop. The zero-shot-learning literature tells us this composition is worth attempting: manual attribute tables are expensive, subjective, and do not scale (Zero-Shot Learning - The Good, the Bad and the Ugly; Field-Guide-Inspired Zero-Shot Learning), and latent or text-derived attributes can replace them (I2DFormer; VGSE).

Research Program

The system has three components. First, the script writer. Given only the protein structure and the ligand graph, a generator — built from a protein language model over pocket residues and a pretrained molecular embedding of the ligand, conditioned with mechanistic knowledge of unbinding physics (cavity hydration, exit-channel topology) — emits a small library of candidate events: "contact between ligand atom class $a$ and residue type $r$ breaks," "water enters subpocket $s$," "ligand passes exit gate $g$," plus one or more ordered scripts over these events corresponding to plausible dissociation channels. The events are grounded in geometry, not free text: each event has a deterministic detector over an MD frame (a contact-distance indicator, a water-bridge count, a gate-passage indicator), so a frame maps to a vector of event intensities. This is the crucial difference from ActAlign, which relied on web-scale visual–textual grounding; here the language model only selects and orders which cheap geometric observables matter, which sidesteps the semantic-drift risk of free-form text in biophysics — a known failure mode of pretrained text embeddings outside their training domain.

Second, the alignment. For a trajectory of frames $T = (f_1, \dots, f_N)$ and a candidate script $\pi = (e_{\pi_1}, \dots, e_{\pi_K})$, each frame is mapped by the event detectors into an intensity vector $\phi(f_t) \in \mathbb{R}^{K}$, and the pathway score is

$$S(T, \pi) = \mathrm{DTW}\big(\phi(f_1), \dots, \phi(f_N);\; e_{\pi_1}, \dots, e_{\pi_K}\big),$$

the standard dynamic-programming warping cost, where the minimum over scripts and channels assigns the trajectory to a mechanistic class. Because the event channels are few and the detectors are scalar functions of frame geometry, cost stays far below the full-coordinate $DTW_D$ of the PNAS study, partially mitigating the quadratic bottleneck — following ActAlign's precedent of smoothing plus low-dimensional embeddings before warping. Third, calibration to kinetics: with at most a handful of experimental $\tau_{off}$ values per target, a simple regression from alignment statistics (per-channel costs, warp-path stretch factors, cluster weights under a survival-model mixture) to residence time is fit — the same few-to-one-calibration logic the PNAS paper used when the fastest cluster's rate reproduced the experimental timescale.

Baselines

The naive reference point is temporal mean-pooling: average each trajectory's frame features over time and cluster with K-medoids under Euclidean distance. This destroys event order entirely, and both the video and molecular literatures show why that fails — ActAlign's ablations found DTW gave a significant boost over frame mean-pooling, and the unbinding-pathways paper showed two dissociation routes can share an average spatial footprint while differing in the order contacts break. The strongest existing competitor is the manual pipeline itself: hand-specified contact descriptors, $DTW_D$, K-medoids, and per-system inspection, which reports 86–96% agreement with expert labels and a fastest-cluster $\tau_{off}$ of 1.27 ms against 1.1 ms experimental on benzene–T4 lysozyme (Data-driven classification of ligand unbinding pathways). The comparison is made fair by running both on identical trajectories, identical clustering and calibration backends, and the same compute, so the only difference is the source of the descriptor vocabulary. Beating it means matching or exceeding label agreement and $\tau_{off}$ accuracy while requiring zero per-system human feature selection, and, decisively, transferring to systems where the manual recipe was never instantiated. A second strong competitor on any screening-flavored evaluation is Pretrained Embedding Distance with MoLFormer, which reports an average enrichment factor EF1% of 4.53 on LIT-PCBA (Advancing Ligand-based Virtual Screening and Molecular Generation with Pretrained Molecular Embedding Distance); we note honestly that no reported result found on Lacuna gives a static-embedding baseline for residence-time prediction, because such methods score molecules, not trajectories. Finally, the key ablation isolates the proposal's central ingredient: a fixed, generic, unordered contact vocabulary (all ligand-atom-class × residue-type channels, no script writer, no ordering) fed to the same DTW machinery. If that matches the auto-scripted version, the script writer is not earning its keep.

Why not just…?

Why not just use a fixed generic contact vocabulary with DTW and skip the script writer? This is the most serious alternative, and it may partially work: generic channels would already remove per-system manual curation. The counter-hypothesis, supported by two cited results, is that which contacts matter is system- and property-dependent: PAR showed molecular similarity must be reweighted per task (PAR), and ActAlign found contextual templates essential for disambiguating fine-grained classes (ActAlign). A flat vocabulary of hundreds of channels buries the two or three decisive events in noise and provides no ordering to align against. The head-to-head ablation above is designed to settle this, and we commit in advance to reporting it prominently either way; if the flat vocabulary wins, the paper's contribution narrows honestly to the generic-channel method.

Why not just rank compounds with static pretrained embeddings, which are already fast and zero-shot? Static distances demonstrably work for actives-versus-decoys enrichment — PED's EF1% of 4.53 on LIT-PCBA and 1.5–3.3× speedups over physical alignment tools (Advancing Ligand-based Virtual Screening and Molecular Generation with Pretrained Molecular Embedding Distance) — and its own authors flag that it misses dynamics and mechanism entirely. Residence time is governed by the unbinding pathway, not the bound snapshot; two analogs with near-identical SMILES can dissociate through different channels. On pure activity screening PED will likely win on speed; our experiments therefore target kinetics ranking, where static methods have no signal by construction, and include PED as the reference on any screening-style check so the boundary of each method's competence is measured rather than asserted.

Why not just fine-tune a small graph network on the labeled trajectories? Few-shot supervised learning on static graphs is exactly the PAR regime, which beat Meta-MGNN by an average of 1.49% ROC-AUC on MoleculeNet few-shot tasks (PAR) — but those are dozens of binary labels per task, and a supervised kinetic regressor would have far fewer continuous residence-time labels, plus no trajectory input at all. More fundamentally, a fine-tuned black box cannot say which contacts broke in which order, which is the mechanistic output practitioners actually want; the aligned warp path gives this for free.

Proposed Experiments

Experiment one is reproduction-and-replacement on benzene–T4 lysozyme, the only system with expert labels and an experimental timescale in the literature. We regenerate the study's trajectory set, then compare four pipelines on pathway classification against expert labels (target: manual $DTW_D$'s 86–96%), on number of resolved kinetic clusters (manual: 16, vs. 8 in prior manual studies), and on fastest-cluster $\tau_{off}$ (manual: 1.27 ms vs. 1.1 ms experimental) — all from Data-driven classification of ligand unbinding pathways. Experiment two is the zero-shot transfer test, the decisive check: apply the pipeline with no retuning to alanine dipeptide and the Müller-Brown potential (both used qualitatively in that paper; no reported result found on Lacuna for either as a quantitative transfer benchmark), then to one or more protein–ligand systems where no manual descriptor study exists, reporting cluster stability and event-detector sanity rather than accuracy against nonexistent labels. Experiment three is the kinetic ranking check: with a small set of simulated or literature residence times, test whether warping-based similarity to known slow-unbinders ranks compounds by $\tau_{off}$ better than static PED distance and than mean-pooled trajectory features, and separately run an actives-versus-decoys sanity check on LIT-PCBA against PED's EF1% of 4.53 and KGOT's [email protected]% of 9.12 (KGOT) to locate the method's honest limits in conventional screening. The proposal succeeds if auto-scripted warping matches the manual pipeline on experiment one, survives transfer in experiment two, and adds a kinetic ranking signal that no static baseline in the file provides; it fails, informatively, if the flat generic vocabulary matches it — in which case we report the simpler method as the finding.