The application discloses a zero
sample graph learning method based on a large
language model, comprising: neighborhood subgraph sampling on to-be-processed graph structure data to generate
graph query text; based on the
graph query text, a structured prompt template containing multi-stage reasoning instructions is constructed, and the prompt template instructs the large
language model to sequentially perform topological
structure analysis, semantic attribute interpretation, multi-candidate answer enumeration and deep reevaluation before generating a final answer; a graph reasoning training
data set is constructed; the basic large
language model is fine-tuned by full parameters by using the graph reasoning training
data set; the large language model is optimized by using a
reinforcement learning algorithm based on group relative
advantage; for a new graph task to be reasoned, the new graph task is input into the optimized large language model, and a final prediction answer containing a reasoning process is directly output. The application discards the dependence of a graph neural network, and only uses the text reasoning capability of the large language model to complete a graph task, so that the deployment complexity and the calculation cost are greatly reduced.