Casanovo uses a transformer architecture to treat de novo sequencing as a sequence-to-sequence translation task, translating from the series of peaks in an MS2 spectrum to a series of amino acids. The model comprises an encoder and a decoder, both transformers. The encoder learns an in-context representation of the input MS2 spectrum, while the decoder predicts the next amino acid in the peptide sequence given the spectrum representation and previously predicted amino acids. The encoder and decoder each consist of nine layers with eight heads per layer, a hidden dimension of 512, and a feedforward dimension of 1024. Like other deep learning models, Casanovo predicts a peptide sequence one amino acid at a time, using beam search decoding to find the predicted peptide sequence with the highest score . No post-processing step is included to force the predicted peptide mass to match the observed precursor mass, but an optional filter can penalize predictions that lie outside the precursor mass tolerance by assigning them negative scores.