ContraNovo is a reimplementation of the Casanovo model with two primary modifications. First, ContraNovo provides additional inputs to the decoder, including the masses of the previously predicted amino acids, the total mass of the remaining uninferred peptide, and the masses of individual amino acids. Second, ContraNovo introduces a contrastive loss term to the loss function, in addition to the cross-entropy loss employed by Casanovo, aiming to enhance the similarity between the encoded spectrum and encoded peptide.