SpecBind: Recovering Private Protein Sequences and Interface Maps Through Speculative Cache Channels in Interaction-Prediction Inference

Drug discovery pipelines increasingly query cloud-hosted protein models: a pharmaceutical company sends a proprietary target sequence to a service that runs a protein language model — a transformer trained on amino-acid sequences — and gets back the predicted binding interface, the exact residues where the protein touches its partners. That output is among the most closely guarded secrets in the industry, since it effectively names the candidate drug's binding motif. At the same time, modern CPUs execute instructions speculatively — ahead of permission and bounds checks — and when a check fails, the rolled-back work leaves fingerprints in caches and branch predictors that a co-located attacker can read out through timing. This proposal asks a question no work in either literature has asked: can a co-tenant on the same cloud machine recover a confidential protein sequence, or the interface map predicted from it, purely from the microarchitectural footprints of interaction-prediction inference?

The stakes are concrete. Interface-prediction models like SaLT&PepPr, which fine-tunes ESM-2 to classify each residue as binding or non-binding from sequence alone, already achieve an AUROC of 0.77 on Protein Data Bank test sets and have produced peptide degraders that eliminated over 60% of cytosolic β-catenin in colon cancer cells with no off-target depletion across roughly 6,700 quantified proteins SaLT&PepPr is an interface-predicting language model for designing peptide-guided protein degraders. Such models run as multi-tenant services, and the sequences and predicted interfaces flowing through them are worth enormous sums. Meanwhile the speculative-execution literature has mature tooling for finding and measuring transient leaks, from the six-step leak anatomy — mistrain, authorize, transiently access a secret, use it, send it into a shared structure, receive it via a timing probe SoK: Hardware Defenses Against Speculative Execution Attacks — to fuzzing and reinforcement-learning-based gadget discovery. But every one of those tools operates on synthetic x86 snippets or cryptographic kernels, never on real scientific inference workloads Towards Reinforcement Learning for Exploration of Speculative Execution Vulnerabilities. And every protein-side benchmark measures only accuracy and GPU memory, never what the hardware leaks PEER: A Comprehensive and Multi-Task Benchmark for Protein Sequence Understanding; DeepProtein: Deep Learning Library and Benchmark for Protein Sequence Learning. The gap between these two literatures is the opportunity.

Core Claim

The claim is that protein-protein interaction inference has a microarchitectural leak profile that is unusually severe and largely unexamined, for a structural reason: the amino-acid identity of each residue is used directly as a table index. When a transformer looks up the embedding vector for a residue, it fetches a row of the embedding matrix selected by the residue's identity among twenty possibilities — exactly the array[secret] pattern that speculative attacks amplify. We claim that (i) an attacker sharing a physical core can recover residue identities and, from the model's per-residue output path, predicted interface labels, at a measurable bits-per-query rate; (ii) the variable-length padding and masking logic around sequences creates speculative windows — bounds and length checks that can be mistrained — that let the attacker reach the token index transiently, bypassing naive constant-time patches; and (iii) a targeted mitigation that decouples memory accesses from residue identity at the handful of leak-relevant sites can hold overhead in the low tens of percent, far below full fencing, while preserving prediction accuracy.

We call the study SpecBind. It is a measurement-and-defense proposal: the protein direction supplies the workload, the confidentiality stakes, and the accuracy benchmarks; the speculative-execution direction supplies the threat model, the discovery methodology, and the quantitative overhead landscape that any defense must beat.

Threat Model and Why This Workload Is Special

The victim is a client sending a proprietary sequence to a cloud endpoint running an ESM-2-based interface predictor in the style of SaLT&PepPr SaLT&PepPr is an interface-predicting language model for designing peptide-guided protein degrader. The attacker is an unprivileged co-tenant process, possibly on a simultaneous-multithreading sibling, that can prime and probe caches and time memory accesses but cannot read the victim's memory architecturally. Two secrets matter: the input sequence (which residues, in which order) and the output interface map (which residues the model flags as binding — the piece of information that took expensive experiments or a valuable model to produce).

The speculative angle is essential to the threat model because of how inference code is structured. Sequence handling is full of data-dependent branches: padding loops bounded by sequence length, attention masks computed per token, and indirect dispatch through function pointers and virtual tables. The lifting result of Do You Even Lift? Strengthening Compiler Security Guarantees Against Spectre Attacks is a warning here in both directions: it proves that masking defenses such as Speculative Load Hardening break when indirect-jump speculation is enabled, while fencing lifts safely — meaning that a pLM inference pipeline patched with cheap masking is exactly the kind of code that remains exposed under the speculation mechanisms transformers exercise most heavily. The formal side supplies the yardstick: Spectector defines Speculative Non-Interference by comparing observation traces of speculative and non-speculative executions Spectector: Principled Detection of Speculative Information Flows, but its symbolic execution struggles with loops and indirect branches, which is precisely the shape of inference code. SpecBind instantiates that comparison empirically: we measure the observation trace directly with cache probes on real hardware rather than verifying it symbolically. Concretely, we quantify leakage as the reduction in uncertainty about the sequence,

$$L = H(R) - H(R \mid O),$$

where $R$ is the residue-identity string of the input and $O$ is the attacker's timing-observation trace for one query. The per-residue ceiling is $\log_2 20 \approx 4.32$ bits if every embedding-row probe is read cleanly; the practical question is what fraction of that ceiling real inference and real noise allow.

Research Program

The program has three parts. First, a measurement campaign: we instrument a SaLT&PepPr-style interface predictor (ESM-2 with a per-position classification head, trained on the PDB-derived interface dataset described in SaLT&PepPr is an interface-predicting language model for designing peptide-guided protein degraders) on a commodity x86-64 CPU with SMT, and characterize which microarchitectural events during a forward pass depend on residue identity or on the interface label. Candidates include embedding-table row fetches, the branch pattern of the binding/non-binding output path, and the length-bounded padding loop. For each candidate we run a plain, non-speculative Prime+Probe and Flush+Reload attack first, because the honest baseline is that ordinary cache timing may already leak much of this; the speculative phase then asks what the six-step transient anatomy adds — specifically, gadgets that mistrain a length or bounds check so the processor transiently walks the embedding table past the architectural guard, reaching indices the plain attack cannot, and doing so without leaving any architectural trace.

Second, gadget discovery. Searching this space by random fuzzing is hopeless for programs of realistic size: Revizor's contract-driven fuzzing, even after its 100x speedup from contract-driven input generation, needed 130 million test-case executions and 16 hours across 13 ISA subsets, and its search cost grows exponentially once programs exceed about 40 instructions Hide and Seek with Spectres: Efficient discovery of speculative information leaks with random testing. SpecRL instead trains a reinforcement-learning agent with proximal policy optimization on microarchitectural feedback and finds leaks in programs up to 150 instructions in roughly 7 minutes on average, scaling near-linearly Towards Reinforcement Learning for Exploration of Speculative Execution Vulnerabilities. We adapt that agent, but with a change that is the methodological core of this half: instead of generating random x86 sequences, we seed and bound its action space with the actual hot instruction traces of the inference kernel, extracted from the compiled model. This makes the search workload-guided rather than open-ended, and the ablation that removes this seeding (plain SpecRL on synthetic sequences) isolates whether workload guidance is what makes real-kernel gadget discovery tractable.

Third, the defense. Full fencing is the always-available fallback, and it is a poor one: Serberus reports that inserting fences everywhere can exceed 400% overhead, while its targeted transient control-flow fencing for cryptographic code averages 21.3% (7.1% on 8KB buffers) Serberus: Protecting Cryptographic Code from Spectres at Compile-Time. Our mitigation, sequence-invariant access, makes memory behavior independent of residue identity at the leak sites: the embedding fetch touches a fixed set of rows per token (for example, striding the whole table or a padded block) so the probe trace carries no identity information, and the padding loop runs to a public maximum so it leaks nothing about length; the few remaining attacker-controllable guards get the Serberus-style fences. This is a compiler-plus-runtime patch, evaluated for both security (leakage rate under the full attack suite) and cost (inference latency overhead), against the published overhead landscape: hardware defenses range from roughly 10% (InvisiSpec) through 22% (STT) to 125% (NDA-Strict), and DOLMA's transient non-observability costs 10.2–29.7% for memory protection and 22.6–42.2% for memory-plus-register protection on SPEC 2017 SoK: Hardware Defenses Against Speculative Execution Attacks; DOLMA: Securing Speculation with the Principle of Transient Non-Observability. We do not need to beat hardware defenses — they need new silicon — but we must beat what a cloud provider can deploy today on existing CPUs.

Proposed Experiments

The accuracy substrate is the PDB-derived interface dataset of SaLT&PepPr, whose sequence-only fine-tuned ESM-2 pipeline reports an AUROC of 0.77 SaLT&PepPr is an interface-predicting language model for designing peptide-guided protein degraders; the mitigation must not move this materially, and we will additionally track a Yeast/Human PPI classification setting from DeepProtein, where graph neural networks achieved the best accuracies DeepProtein: Deep Learning Library and Benchmark for Protein Sequence Learning, as a secondary workload to test generality of the attack beyond transformers to the graph-traversal memory patterns of structural PPI code. The attack experiments run on a commodity CPU of the kind used in Towards Reinforcement Learning for Exploration of Speculative Execution Vulnerabilities (an AMD Zen-class part with SMT), with the victim and attacker pinned as co-tenants. Primary metrics: per-residue identification accuracy against the 5% chance floor (one of twenty amino acids), bits leaked per query via $L$ above, and interface-label recovery accuracy against the 50% base rate of a binding/non-binding guess; secondary metrics are wall-clock and per-query latency overhead for each defense configuration. The decisive go/no-go for the whole speculative half is measured in the first experiment: if plain non-speculative cache timing already recovers residue identities at close to the 4.32-bit ceiling and speculative gadgets add nothing beyond what masking defenses block, we report that plainly — the leakage finding stands, but the defense must be re-scoped to cover both channels, and the speculative component shrinks to a negative result with a precise boundary.

Baselines

The naive reference point is unmodified inference with no attacker: the SaLT&PepPr-style pipeline running as deployed, which both fixes the accuracy reference — the AUROC of 0.77 reported in SaLT&PepPr is an interface-predicting language model for designing peptide-guided protein degraders — and gives the zero-overhead security floor of doing nothing, against which any defense's cost is judged. The strongest attack-side competitor is plain Flush+Reload/Prime+Probe timing on the embedding table without any speculative component, because if ordinary timing recovers the sequence, the fancier machinery is unnecessary; we run it on identical hardware, victim code, and query workload as the speculative attack, and the speculative attack only earns its keep by recovering more bits per query, or by succeeding where a constant-time-style patch has defeated the plain attack. The strongest discovery-side competitor is Revizor with contract-driven input generation Hide and Seek with Spectres: Efficient discovery of speculative information leaks with random testing, given the same wall-clock budget as our guided agent and the same trace-seeded target programs; its documented exponential scaling beyond 40 instructions Towards Reinforcement Learning for Exploration of Speculative Execution Vulnerabilities predicts it will find few or no gadgets in inference-length traces, and beating it means finding strictly more verified leaks per unit time. The strongest defense-side competitors are full fencing, with its published overhead in excess of 400% Serberus: Protecting Cryptographic Code from Spectres at Compile-Time, and Speculative Load Hardening-style masking, which the lifting result shows breaks under indirect-jump speculation Do You Even Lift? Strengthening Compiler Security Guarantees Against Spectre Attacks; each is applied to the same inference binary and tuned with the same effort budget, and our mitigation must drive measured leakage to near-chance at lower latency cost than fencing while surviving the indirect-jump gadgets that defeat masking. Finally, the key ablation is our discovery agent with the workload-guided seeding removed — SpecRL run on unconstrained synthetic sequences against the same kernels — which isolates whether trace-guided search, the proposal's main methodological bet, is what makes real inference code attackable.

Why not just…?

Why not just detect the attack at runtime with hardware performance counters? This is the most serious alternative, because counter-based detection is deployable today and reports strong numbers: AdaBoost on four counters sampled at 1ms reached 99.88% test and 99.76% validation accuracy on Spectre and Meltdown attacks Attack detection based on machine learning algorithms for different variants of Spectre attacks and different Meltdown attack implementations. It falls short for three reasons that paper itself documents: the evaluation covered only synthetic stress tests, desktop applications, and MiBench, with the authors calling the software coverage limited; benign complex applications already flood the branch predictor and make counter-based detection noisy; and the sampling interval must stay coarse (500µs to 1ms) to be affordable, while a transient gadget executes entirely within one sampling window and leaves no architectural trace. We will run this detector as a defense baseline on our own attack traces and report its miss rate directly; if it catches our attacks, that is a finding in favor of the cheap alternative and we will say so.

Why not just fence everything, or disable speculative execution for the inference service? Full fencing exceeds 400% overhead per Serberus: Protecting Cryptographic Code from Spectres at Compile-Time, and hardware "no-access" defenses cost about 125% SoK: Hardware Defenses Against Speculative Execution Attacks. For a low-volume, high-value service one might pay this, and honestly, a dedicated isolated machine also solves the co-tenant problem outright; the proposal's answer is that cloud economics push exactly these inference workloads toward shared hardware, so the interesting question is the price of security on shared infrastructure, and our experiments quantify that price per defense. If isolation is available and cheap, that is the right deployment and our numbers say when it is unnecessary.

Why not just patch with existing constant-time compiler mitigations? Because the lifting result proves that Speculative Load Hardening, the cheap masking option, breaks under indirect-jump speculation Do You Even Lift? Strengthening Compiler Security Guarantees Against Spectre Attacks], and transformer inference is dominated by indirect dispatch. Our attack suite explicitly includes indirect-jump gadgets, so this is not an argument but an experiment: we apply masking to the victim, run the gadget search, and expect leaks to persist; if they do not, the masking defense is vindicated and our defense must beat it on cost alone.

Why not just use the sequence-only model remotely and never send structure? This misses the point: SaLT&PepPr is already structure-agnostic — it works from sequence alone, which is exactly why the confidential artifact traveling through the shared machine is the sequence itself and its per-residue interface output SaLT&PepPr is an interface-predicting language model for designing peptide-guided protein degraders. Swapping model classes changes which memory patterns leak, not whether confidential biological data transits shared silicon.

Decisive Checks

Three results decide the proposal. The plain-timing attack's bits-per-query against the speculative attack's, on identical workloads, settles whether the speculative machinery is necessary and where the real exposure lies. The guided-versus-unseeded agent comparison on inference-length traces, with Revizor as the fuzzing control, settles whether workload-guided discovery is a real method or a convenience. And the defense's leakage-versus-overhead curve, plotted against the published fencing, masking, and DOLMA-class reference points DOLMA: Securing Speculation with the Principle of Transient Non-Observability, settles whether sequence-invariant access is deployable: success means near-chance residue identification at under roughly 20% latency overhead with AUROC within a point of the 0.77 unmodified baseline. No reported result found on Lacuna for any side-channel leakage measurement on protein-model inference, which is exactly the hole this work fills.