Zero-Shot Naming of Unknown Protein Modifications at Search-Time Cost

Proteins are routinely altered after they are made. These alterations, called post-translational modifications (PTMs), include phosphate groups, sugars and methyl groups, and they change what a protein does. To find them, mass spectrometers break peptides apart and record a tandem mass spectrum: a sparse list of fragment masses and intensities. Fast search engines can now flag millions of spectra as "this known peptide plus an extra mass of Δm daltons." This is open modification search, which compares each query against a reference library while allowing large precursor mass differences. It has recently been pushed to repository scale with hypervectors, which are long binary codes compared by counting differing bits. What these engines cannot do is say which chemical modification produced the extra mass. When that modification is rare, or was never labeled in any training set, no supervised classifier can say either. Many biologically different modifications share nearly the same mass, so looking the number up in a table often leaves the answer ambiguous.

We propose to treat modification naming as a generalized zero-shot learning problem. In that setting, a model must recognize classes it never saw during training from a description of each class, while still handling the familiar classes. Each modification will be described by its physically predicted fingerprints: the mass shift, which residues it can attach to, the neutral losses it causes during fragmentation, and the diagnostic fragment ions it releases. These fingerprints are written in the same locality-preserving hypervector space that the search engine already uses for spectra. Naming a modification then costs a few extra bit comparisons on a vector that was computed anyway during search. From the seen modifications, we learn only how much to trust each kind of fingerprint, and we correct the bias toward common modifications that zero-shot models are known to have.

Core Claim

Once open search has found a peptide backbone and a mass shift, the type of an unseen modification can be inferred from chemistry-derived attribute hypervectors. Two learned ingredients carry most of the benefit. The first is a set of attribute-reliability weights fitted on seen modifications. The second is a calibration penalty on seen classes. Together they should beat both mass-table lookup and unweighted physics rescoring on near-isobaric modifications, which are pairs whose masses differ by only a few thousandths of a dalton. The method should also stay close to a dense classifier built on a 47M-parameter transformer encoder while running at hypervector-search throughput. Two pieces of this claim are falsifiable. The first is the gain from learned reliability over uniform physics weighting. The second is the accuracy gap between search-time hypervectors and transformer embeddings.

Where This Sits

The proteomic scaling literature supplies both the substrate and the gap. HyperOMS and its DRAM-based follow-up encode spectra as 8,192-bit hypervectors. The encoding is locality-preserving: neighboring mass bins share bit patterns, so shifted peaks still partly match. They report 15.7× GPU speedups over ANN-SoLo. RapidOMS and FeNOMS move the same comparison onto FPGA-equipped SSDs and into flash memory. All of these are library search engines. They return a backbone and a Δm, never a chemical identity. That is the gap we fill, and we reuse their encoding as our method's input. The MS foundation model pretrains the Casanovo encoder on 30 million MassIVE-KB spectra and trains supervised heads, reaching AUROC 0.948 for phosphorylation and 0.976 for glycosylation. Those heads exist only for labeled classes and cannot name an unseen modification. It therefore motivates our problem and serves as our accuracy ceiling for seen classes, not as a competitor on unseen ones. ReNovo and RankNovo study generalization across species or across base models during sequencing, which is a different notion of "unseen" from an unseen class described by attributes.

From zero-shot learning, HDC-ZSC supplies the method template. It uses frozen random hypervector codebooks for attribute groups and values, bound together by XOR, and reaches 63.8% top-1 on CUB with fewer parameters than ESZSL. Our attribute codes are not random, however. They are rendered from predicted fragment masses through the spectrum encoder, which is what lets an unseen modification be described without any learned projection. BFM supplies the seen-class calibration idea through its Category Calibration Loss. Xian et al. constrain the evaluation design in two ways. They show that leakage from pretraining inflates zero-shot scores, and that the harmonic mean in the generalized setting, which covers seen and unseen classes together, is the honest metric. Xian et al. also find that feature-generating models degrade on large, attribute-scarce data. We take that as a reason not to build a generative spectrum synthesizer.

Research Program

The first component is an attribute compiler. For each Unimod-style modification entry, it emits a small set of attribute hypervectors from chemistry alone. One encodes the mass-shift bin. One encodes the allowed residues, bound to the positions of those residues in the identified backbone. One encodes the predicted b and y fragment ladders under each localization. One encodes the neutral-loss peaks, such as the loss of H3PO4 from phosphopeptides. One encodes the diagnostic low-mass ions, such as sugar oxonium ions. Every peak-type attribute is encoded with exactly the HyperOMS position code. As a result, its similarity to a query spectrum's hypervector measures whether the predicted peaks are actually present.

For a query spectrum with hypervector $h_x$ and candidate modification $m$, the score is

$$s(x,m) = \sum_{k} w_k \,\mathrm{sim}(h_x, a_{m,k}) \;-\; \lambda\,\mathbb{1}[m \in \mathcal{Y}_S].$$

Here $a_{m,k}$ is the attribute hypervector of type $k$ for modification $m$. The similarity $\mathrm{sim}$ is one minus the normalized Hamming distance. Each $w_k$ is a learned weight per attribute type, shared across all modifications. The term $\lambda$ is a calibration penalty on the set of seen modifications $\mathcal{Y}_S$. Candidates are restricted to modifications whose Δm falls within the instrument tolerance. Because the weights attach to attribute types rather than to classes, they transfer to any modification the compiler can describe. Fitting them on seen modifications amounts to learning, for HCD fragmentation (the common collision-based method), which kinds of fingerprints are reliable.

The second component is a dense counterpart that uses the same attributes and loss but takes frozen foundation-model embeddings as input, with an ESZSL-style bilinear compatibility. This separates the cost of the cheap hypervector input from the cost of the scoring rule.

The third component is a benchmark construction, since the file reports no existing zero-shot PTM benchmark. We will assemble modified peptide-spectrum matches with confidently assigned modification types. The pool comes from MassIVE-KB, from PRIDE datasets (PRIDE 2016 update) that were enriched for specific modifications, and from the iPRG2012 and HEK293 open-search sets. We will then define leave-modification-family-out splits. The splits deliberately include near-isobaric pairs where one member is held out, for example acetylation versus trimethylation, or phosphorylation versus sulfation. Following Xian et al., any held-out modification that appears in the foundation model's pretraining vocabulary is excluded. Where exclusion is impossible, the encoder is retrained without those spectra and the leakage effect is reported separately.

Baselines

The naive reference is mass-table lookup. It takes the Δm from open search and assigns the nearest-mass modification, or the most prevalent one when several fall within tolerance. It is what practitioners do today, and it is near chance on near-isobaric pairs by construction. No reported result was found on Lacuna for mass-lookup accuracy on modification typing. We will report it on our splits.

The strongest training-free competitor is uniform physics rescoring. It renders each candidate's predicted spectrum, including neutral losses and diagnostic ions, and picks the best match. This is our own method with every $w_k$ equal and $\lambda = 0$. It is therefore also the ablation that isolates the learned ingredients. We will run it in hypervector space and also as a floating-point cosine match on the same candidate sets, so that any loss due to binarization becomes visible.

The strongest learned competitor is the dense zero-shot head on frozen foundation-model embeddings described above. It gets identical attributes, splits and a matched hyperparameter search budget.

As a supervised ceiling for seen classes, we train linear heads in the style of the foundation model. That paper reports AUROC 0.948 for phosphorylation and 0.976 for glycosylation. These are seen-class supervised numbers, not zero-shot ones, and serve only as a reference ceiling.

Our method beats the baselines if it exceeds uniform physics rescoring on unseen-class accuracy and harmonic mean over the near-isobaric subset, by more than the spread across five resampled splits. It should also stay within the dense head's accuracy while running at the throughput of the HyperOMS search itself. The upstream identification deficit (HyperOMS 4,141 versus ANN-SoLo 5,327 identifications on iPRG2012) bounds which spectra reach our stage. We will report it rather than hide it.

Why not just…?

Why not just look Δm up in a modification table? For modifications with unique masses, this works and needs nothing new, and we expect our method to tie it there. The proposal stands or falls on the ambiguous subset. Lookup cannot separate classes within the tolerance window without a prior, and its prior is exactly the bias toward common modifications that the calibration term corrects. We report results stratified by mass ambiguity, so the advantage, or its absence, is localized.

Why not just rescore candidate theoretical spectra with physics, no learning? This is the real threat. If the predicted fingerprints were equally reliable, our learned weights would add nothing. We think they are not equally reliable: under HCD, phosphate neutral loss is strong while some diagnostic ions are weak or drowned in noise. But this is an empirical bet. The uniform-weight ablation settles it directly. If the ablation matches the full model, we would report the physics renderer in hypervector space as the contribution, and drop the zero-shot learning framing.

Why not just fine-tune supervised heads on the foundation model, adding a class when labels appear? That approach needs labels for each new modification, and rare or newly discovered modifications are exactly where labels are missing. The foundation-model paper's own low-data result (AUROC 0.881 with about 7,600 spectra) shows that thousands of examples are still needed. Its multi-task run also hurt glycosylation, so adding classes is not free. We include a few-shot variant with 10 and 100 labeled spectra per held-out modification to locate the crossover point at which supervision overtakes zero-shot.

Why not just use the transformer embeddings and skip hypervectors? If accuracy were the only concern, this would be the default choice. The dense head measures exactly what that choice buys. The hypervector path matters because it reuses vectors that the repository-scale search already produced, avoiding a 47M-parameter forward pass over hundreds of millions of spectra. If the accuracy gap is large, the honest recommendation becomes a cascade. Hypervectors would screen all spectra, and transformer embeddings would be computed only for the ambiguous ones.

Proposed Experiments

The primary experiment trains on seen modification families and evaluates in the generalized setting. Test sets mix seen and held-out families. We report unseen top-1, seen top-1 and their harmonic mean, each stratified by mass ambiguity. A secondary analysis sweeps hypervector dimension from 2,048 to 16,384 bits. HyperOMS reports up to 10% more identifications at 16k bits, so we test whether naming accuracy saturates earlier than identification does. We also measure throughput in spectra per second for the naming stage relative to the search stage on the same GPU.

The decisive checks are three. The first is whether learned weights beat uniform physics rescoring on held-out near-isobaric pairs. The second is whether the calibration term raises the harmonic mean without collapsing seen accuracy. The third is whether the hypervector model's gap to the dense head is small enough that the cascade is unnecessary.

A final application pass runs the trained model over open-search hits from a PRIDE human dataset. Its outputs are reported as candidate annotations whose spot-check precision is measured against targeted re-search. They are not presented as discoveries.