In recent years, the advantages of Graph Neural Networks (GNNs) in solving complex combinatorial optimization problems have become more and more obvious. Under this background, this paper demonstrates a method based on GNNs to solve large-scale Unconstrained 0–1 Quadratic Programming (UBQP) problems. Firstly, the UBQP problem models of different combinatorial optimization problems are converted into a unified graph model. This approach makes up for the shortcoming that GNNs cannot be effectively applied to combinatorial optimization problems not based on graph. Secondly, based on Graph Attention Network (GAT) algorithm, this study designs a general GNN model capable of solving UBQP problems. In addition, a random sampling scheme for the complete graph structure is devised, which greatly alleviates the pronounced over-smoothing phenomenon when the model is applied to complete graphs and speeds up the convergence rate. In this paper, a supervised learning approach is adopted to train and test a unified structured model (without changing network parameters) on UBQP problems of varying sizes, and to evaluate the model's generalization ability on high-dimensional UBQP problems. Furthermore, an unsupervised learning mechanism is utilized to train and solve individual sample problems of different dimensions. These experimental results consistently demonstrate that the model and strategy presented in this paper exhibit strong solving ability and generalization ability for combinatorial optimization problems.