Reading a sentence by weighing it
In 1913, J.J. Thomson sent a beam of charged neon through electric and magnetic fields and found it split into two paths: neon came in two different masses. That experiment grew into the mass spectrometer, which today is an absurdly precise scale for molecules.
Proteins are long chains built from 20 amino acids, and a peptide is a short piece of one. Think of a peptide as a word written in a 20-letter alphabet where every letter has its own weight. A tandem mass spectrometer snaps the word into fragments and weighs each one. Fragments come in two families, b-ions growing from the front of the word and y-ions from the back. The weight difference between neighbouring fragments in a family is the weight of one letter, so in principle the spectrum spells the word out.
In practice the spectrum is noisy, peaks go missing, and some letters weigh almost the same. Reading it is the hard part.
Why not just look it up
The standard approach is a dictionary lookup: compare the spectrum against the predicted spectra of every protein in a database. That works when the protein is in the database. It fails exactly where discovery matters most: novel organisms and mixed microbial communities, like a sample of wastewater full of microbes nobody has catalogued.
De novo sequencing skips the dictionary and generates the amino-acid sequence from the spectrum alone. That was the problem we picked.
Why a crossword beats a typewriter
We started with the obvious design: read the spectrum, then write the sequence left to right, one letter at a time, with an LSTM or a GRU. They reached 2.7% and 6.7% peptide accuracy. Writing left to right is like a typewriter with no backspace: an early mistake poisons everything after it.
A crossword solver works differently. You fill in the letters you are surest of first, then use them to crack the harder ones. Diffusion models generate this way. Ours starts with every position masked and unmasks residues over 20 steps, guided by the spectrum at every step.
We chose the discrete kind of diffusion on purpose. The better-known Gaussian kind works on continuous numbers, so for amino acids it has to round its output back into letters at the end, and that rounding introduces its own errors. Absorbing diffusion treats the 20 amino acids as tokens from the start: forward diffusion absorbs tokens into a [MASK] state, and the reverse process unmasks them on a cosine schedule.
The model
A PeakEncoder maps the top 200 m/z peaks into a dense representation, with a learnable bias for pairs of b-ions and y-ions, since a matched pair brackets a residue from both ends. A Transformer denoiser then works over the amino-acid tokens.
Self-conditioning is the crossword-in-pencil trick. At each reverse step the model sees its own previous best guess as an extra input, so it can reread its draft before committing. Finally, beam search with K = 8 proposes candidates, and two spectrum-based scores, CFID and SGIR, pick the one whose predicted fragments best match the spectrum that was actually measured.
Where the accuracy came from
On the E. coli EV benchmark at 5% FDR, averaged over three seeds, the final model reached 76.00% amino-acid recall and 59.96% peptide accuracy. InstaNovo's published numbers on that benchmark are 72.90% and 33.10%.
The gains were not evenly spread, and the biggest one was a surprise in its plainness. Removing the PeakEncoder dropped amino-acid recall from 74.8% to 41.9%. Reading the evidence well mattered more than anything clever downstream. Self-conditioning was the largest single jump in peptide accuracy, at 12.5 points over the first version.
Peptide accuracy, E. coli EV benchmark at 5% FDR (%)
The idea that made it worse
A peptide's total mass is known from the spectrum, so filtering candidates by mass consistency sounds like free accuracy. Think of a bouncer with a guest list accurate to a fraction of a gram. It was not free. A post-hoc 50 ppm filter cut peptide accuracy from 59.60% to 50.44%, about nine points. The model had never been trained with a mass-consistency constraint, so the bouncer turned away correct sequences along with wrong ones.
We kept that result and reported it in the repository as a negative finding. A negative result tells you where the next fix should go: the constraint belongs in training, as a mass-conditioned loss, not in a stricter filter bolted on afterwards.
V2 reranking ablation · peptide accuracy (%), 3-seed mean
Back to the wastewater
The reason to sequence without a database was samples like wastewater, so we ran the model on one. Six peptides from a mixed-community sample survived 5% FDR filtering with no reference proteome, and protein-language-model scores suggest they look unlike the E. coli reference.
That is a hint, not a discovery. BLAST validation is still pending, so these are candidates until someone checks them.