InstaNovo-FM: a foundation model for tandem mass spectra

InstaNovo-FM is an encoder-only transformer trained to reconstruct masked regions of MS/MS spectra without ever seeing a peptide sequence label. It was pretrained on 1.63 billion spectra from 92 public PRIDE submissions spanning 72 organisms.

Every existing proteomics model is trained for one supervised task. This one is not trained for any, which is why the first three tabs are possible at all: you can run its pretraining objective, identify spectra without a sequence database, and reuse its frozen 768-dimensional representation for whatever you like. Sequencing is in the last tab, because it is the one thing here that is not unique.

This is the pretraining objective itself, run live. Hide peaks in a spectrum and the model predicts which cell of a 0.2 Da grid each one belongs to, using only the peaks around it. A de novo model has no way to answer this question, because it emits sequences, not spectra.

Two things to be clear about. A hidden peak is not erased: the encoder replaces it with its true m/z blurred by Gaussian noise of σ = 10 Da plus a learned "masked" bias, and keeps its true intensity. And because peaks arrive sorted by m/z, the model also knows a hidden peak lies between its nearest still-visible neighbours. Its job is to sharpen all of that into one 0.2 Da bin, so the baseline it is measured against uses the same two hints.

fig4_TGVELGKPTHFTVNAK .mgf 3.1 KB ⇣
Example files (press one, then Load spectra)
Spectrum
Which peaks to hide

Hidden peaks


Step 2: explain one reconstruction

Every peak the model could still see is deleted in turn and the reconstruction re-run, so what comes out is the evidence the model needed, not merely what it attended to. The mass gap to each peak that mattered is then matched against residue masses, isotope spacings and neutral losses, which is arithmetic the model was never taught.

The manuscript's Fig. 4 is what loads by default, so reproducing it takes three button presses and no setup. The spectrum is TGVELGKPTHFTVNAK, HCD on a Q Exactive at precursor charge 3+, and step 1 is already set to hide peaks 91, 92: its y5 ion at 532.308 m/z together with the isotope co-masked alongside it. Press Step 1, then Explain it here, then Step 3 below. The peak that matters is y6 at 679.379, one phenylalanine step of 147.07 Da away, which is the ladder neighbour the figure reports.

To score the model over many spectra instead, load one of the other example files and switch to a masking mode that hides more than one chosen peak.

Explain which hidden peak

Lists only the peaks that step 1 actually hid, so run it first.

Reading the lower panel: it has one entry for every peak that was deleted. A grey dot on the zero line means deleting that peak changed nothing, so it carried no evidence. A green bar means the correct bin became less likely, and the bar's height is how much probability it lost. A single tall green bar in a field of grey dots means the model was leaning on one specific peak, and the label says which chemical relationship connects the two. Probability on the correct bin is used rather than added error because a rich spectrum carries redundant evidence: deleting one peak of a hundred rarely moves the answer out of the right bin, but it still shows in how strongly the model backs it.

Peaks the answer depended on


Step 3: the three views of Fig. 4A

Panel A of the manuscript's Fig. 4 draws one spectrum three times, and the three together say more than any one of them. Ion type comes from matching the known peptide, so it is ground truth and owes nothing to the model. Attribution is integrated gradients against a zero-intensity baseline, the same quantity the paper plots, and says what the reconstruction drew on. Confidence is what the model thinks it knows about every peak, hidden or not.

Reading down a column is how you separate "the model used the fragment ladder" from "the model happened to be right". On the bundled Fig. 4 spectrum the most attributed peak is the y ion at 679.379, which is the ladder neighbour the figure reports.

The figure's remaining panels follow underneath. B lays the same attribution along the peptide backbone, b ions above and y ions below, so you can see where in the sequence the evidence sits. C sums it by how each peak relates to the hidden one. D plots it against intensity, which is the figure's check that the model is not merely following the tallest peaks. E is a Lorenz curve showing how few peaks carry most of the attribution.

{}

Running on ZeroGPU, which is free but rate-limited per user. Uploads are capped at 2000 spectra for embedding tasks and 128 for sequencing, so please test with small files.