Liquid chromatography-mass spectrometry (LC-MS)-based metabolomics identification relies heavily on high-quality MS/MS data; MS/MS prediction is a good way to address this issue. However, the accuracy of the prediction, resolution, and correlation with chemical structures have not been well-solved. In this study, we have developed a MS/MS prediction method, PPGB-MS2, which transforms the MS/MS prediction into fragment intensity prediction, and the concept of precursor-product ion pair graph bags (PPGBs) was introduced to represent fragments, achieving uniform representation of precursor and product ion structures and MS/MS fragmentation information. The chemical structure information is kept before it is incorporated into machine learning models. Due to the PPGB representation, graph neural networks (GNNs) can be utilized to achieve MS/MS fragment intensity prediction. The system was trained and evaluated using [M+H]+ and [M-H]- data acquired by an Agilent QTOF 6530 in the NIST 20 tandem MS database. Results demonstrated that the average cosine similarity is 0.71 in the test set, which is higher than classical MS/MS prediction methods. PPGB-MS2 also achieves high-resolution MS/MS prediction due to its effective management of the correspondence between fragments and structures.