Node classification method and device based on decoupling graph, equipment, medium and product

By obtaining hidden layer representations and optimizing input prompts through decoupling graph technology, the performance of traditional large language models in processing complex structural information is improved, thus enhancing the node classification ability of large language models.

CN117407529BActive Publication Date: 2026-06-05TSINGHUA UNIVERSITY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TSINGHUA UNIVERSITY
Filing Date
2023-10-26
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Traditional large language models cannot adequately represent the complex relationships between nodes when processing text attribute graphs containing complex structural information, resulting in poor processing performance.

Method used

By using a decoupling graph approach, node information from the text attribute graph is input into a large language model. Hidden layer representations are obtained through the decoupling channels, and input prompts are optimized based on these hidden layer representations, thereby improving the understanding ability of the large language model.

Benefits of technology

It effectively improves the processing performance of large language models on text attribute graphs, enabling them to perform node classification tasks better.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117407529B_ABST
    Figure CN117407529B_ABST
Patent Text Reader

Abstract

The application discloses a node classification method and device based on a decoupling graph, equipment, medium and product, and relates to the technical field of neural networks. The method comprises the following steps: obtaining a text attribute graph and an input prompt; inputting text information corresponding to each node into a large language model to obtain overall text representation corresponding to each node; inputting overall text representation corresponding to a target node into multiple decoupling channels, each decoupling channel aggregates neighbor information of the target node according to different graph structures to obtain multiple hidden layer representations; optimizing the input prompt based on the multiple hidden layer representations of the target node to obtain an optimized prompt, and inputting the optimized prompt into the large language model to obtain a node classification result. The application obtains hidden layer features containing different aspect graph structure information through decoupling channels, and optimizes the input prompt based on the hidden layer features, so that the large language model can better handle the node classification task of the text attribute graph, and effectively improves the processing performance of the large language model on the text attribute graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of neural network technology, and more specifically, to a node classification method, apparatus, device, medium, and product based on decoupled graphs. Background Technology

[0002] Large Language Models (LLMs) are deep learning models trained on large amounts of text data that can generate natural language text or understand the meaning of language text. LLMs can handle various natural language tasks, such as text classification, question answering, and dialogue, and are an important pathway to artificial intelligence. Among these, LLMs have demonstrated outstanding capabilities in the task of classifying nodes in text attribute graphs.

[0003] However, traditional large language models can only obtain structural information from text attribute graphs based on natural language prompts as input. For text attribute graphs containing complex structural information, these prompts cannot fully represent the hidden complex structural information, such as the complex relationships between nodes. This prevents existing node classification methods based on traditional large language models from fully utilizing the reasoning capabilities of large language models, resulting in insufficient understanding of this part of the information and ultimately poor performance in processing text attribute graphs. Therefore, how to improve the processing performance of large language models for text attribute graphs has become an urgent problem to be solved by those skilled in the art. Summary of the Invention

[0004] This application provides a node classification method, apparatus, device, medium, and product based on decoupled graphs, aiming to solve the problem of how to improve the processing performance of large language models on text attribute graphs.

[0005] The first aspect of this application provides a node classification method based on a decoupled graph, the method comprising:

[0006] Obtain a text attribute graph and input prompts, wherein the text attribute graph includes multiple nodes;

[0007] Input the text information corresponding to each node into the large language model to obtain the overall text representation corresponding to each node. The overall text representation is used to represent the collective information of each node in the text attribute graph.

[0008] The overall text representation corresponding to the target node is input into multiple decoupling channels. Each decoupling channel aggregates the neighbor information of the target node according to a different graph structure for the target node to obtain multiple hidden layer representations of the target node, where the target node is any one of the multiple nodes.

[0009] The input prompt is optimized based on multiple hidden layer representations of the target node to obtain an optimized prompt, which is then input into the large language model to obtain the node classification result.

[0010] In one optional implementation, the large language model includes N consecutive attention layers, and the step of inputting the text information corresponding to each node into the large language model to obtain the overall text representation corresponding to each node includes:

[0011] The text information corresponding to each node is input into the first attention layer, and each unit text in the text information is processed to output multiple first text representations;

[0012] Multiple (n-1)th text representations are input into the nth attention layer, the multiple (n-1)th text representations are processed, and multiple nth text representations are output, where n is a positive integer greater than or equal to 2 and less than or equal to N;

[0013] Based on multiple Nth text representations output by the Nth attention layer, the overall text representation corresponding to each node is obtained, and the overall text representation is the average value of the multiple Nth text representations.

[0014] In one optional implementation, the step of inputting the overall text representation corresponding to the target node into multiple decoupling channels, each of the decoupling channels aggregating the neighbor information of the target node according to a different graph structure for the target node, to obtain multiple hidden layer representations of the target node, including:

[0015] Based on the text attribute graph, multiple graph structures are constructed for the target node, and each graph structure contains different neighbor nodes of the target node;

[0016] The plurality of graph structures are assigned to the plurality of decoupling channels, and each of the decoupling channels performs forward propagation of the overall text representation;

[0017] The overall text representation corresponding to the target node is aggregated with the neighbor information of the neighbor nodes in the graph structure corresponding to each decoupling channel to obtain the hidden layer representation corresponding to each decoupling channel.

[0018] In one optional implementation, constructing multiple graph structures for the target node based on the text attribute graph includes:

[0019] Based on the text attribute graph, determine all neighboring nodes of the target node;

[0020] Based on the structural mapping parameters corresponding to each decoupling channel, candidate neighbor nodes corresponding to each decoupling channel are selected from the neighbor nodes of the target node. The candidate neighbor nodes corresponding to different decoupling channels are different. The structural mapping parameters are obtained based on task loss optimization.

[0021] Based on the connection relationships between nodes in the text attribute graph, a connection relationship is established between the target node and the candidate neighbor node corresponding to each decoupling channel to obtain the graph structure corresponding to each decoupling channel.

[0022] In one optional implementation, the optimization of the input prompt based on multiple hidden layer representations of the target node to obtain an optimized prompt includes:

[0023] The features in the input prompt located at a preset position are obtained as features to be optimized. The number of features to be optimized is the same as the number of the multiple hidden layer representations. The input prompt is the representation of the structural information of the text attribute graph at the natural language level.

[0024] The multiple hidden layer representations are combined with the feature to be optimized, and the feature to be optimized in the input prompt is replaced with the combined feature to obtain the optimization prompt.

[0025] In one optional implementation, the large language model includes N consecutive attention layers, and the step of inputting the optimization prompts into the large language model to obtain node classification results includes:

[0026] The optimized suggestion is input into the first attention layer, and node classification is performed based on the optimized suggestion to output the first suggestion representation.

[0027] The features at the preset positions in the (n-1)th cue representation are combined with the multiple hidden layer representations. The combined (n-1)th cue representation is used as the (n-1)th optimized cue. The (n-1)th optimized cue is input into the nth attention layer for node classification and the nth cue representation is output. Here, n is a positive integer greater than or equal to 2 and less than or equal to N.

[0028] The Nth cue representation output by the Nth attention layer is used as the node classification result.

[0029] A second aspect of this application provides a node classification device based on a decoupled graph, the device comprising:

[0030] The acquisition module is used to acquire a text attribute graph and input prompts, wherein the text attribute graph includes multiple nodes;

[0031] The overall text representation module is used to input the text information corresponding to each node into the large language model and obtain the overall text representation corresponding to each node. The overall text representation is used to represent the collective information of each node in the text attribute graph.

[0032] The decoupling module is used to input the overall text representation corresponding to the target node into multiple decoupling channels. Each decoupling channel aggregates the neighbor information of the target node according to a different graph structure for the target node to obtain multiple hidden layer representations of the target node, wherein the target node is any one of the multiple nodes.

[0033] The node classification module is used to optimize the input prompt based on multiple hidden layer representations of the target node to obtain an optimized prompt, and input the optimized prompt into the large language model to obtain the node classification result.

[0034] In one optional implementation, the overall text representation module includes:

[0035] The first attention layer submodule is used to input the text information corresponding to each node into the first attention layer, process each unit text in the text information, and output multiple first text representations;

[0036] The nth attention layer submodule is used to input multiple (n-1)th text representations into the nth attention layer, process the multiple (n-1)th text representations, and output multiple nth text representations, where n is a positive integer greater than or equal to 2 and less than or equal to N;

[0037] The overall text representation submodule is used to obtain the overall text representation corresponding to each node based on multiple Nth text representations output by the Nth attention layer, wherein the overall text representation is the average value of the multiple Nth text representations.

[0038] In one optional implementation, the decoupling module includes:

[0039] The graph structure submodule is used to construct multiple graph structures for the target node based on the text attribute graph, each graph structure containing different neighbor nodes of the target node;

[0040] An allocation submodule is used to allocate the plurality of graph structures to the plurality of decoupled channels, wherein each of the decoupled channels performs forward propagation of the overall text representation;

[0041] The neighbor aggregation submodule is used to aggregate the overall text representation corresponding to the target node with the neighbor information of the neighbor nodes in the graph structure corresponding to each decoupling channel to obtain the hidden layer representation corresponding to each decoupling channel.

[0042] In one optional implementation, the node classification module includes:

[0043] The feature to be optimized submodule is used to obtain the features in the input prompt at a preset position as the feature to be optimized. The number of the feature to be optimized is the same as the number of the multiple hidden layer representations. The input prompt is the representation of the structural information of the text attribute graph at the natural language level.

[0044] The optimization prompt submodule is used to combine the multiple hidden layer representations with the feature to be optimized, and replace the feature to be optimized in the input prompt with the combined feature to obtain the optimization prompt.

[0045] In one optional implementation, the node classification module further includes:

[0046] The first node classification submodule is used to input the optimization prompt into the first attention layer, classify nodes based on the optimization prompt, and output the first prompt representation.

[0047] The nth node classification submodule is used to combine the features in the (n-1)th cue representation that are located at the preset position with the multiple hidden layer representations, take the combined (n-1)th cue representation as the (n-1)th optimized cue, input the (n-1)th optimized cue into the nth attention layer for node classification, and output the nth cue representation, where n is a positive integer greater than or equal to 2 and less than or equal to N;

[0048] The node classification result submodule is used to take the Nth cue representation output by the Nth attention layer as the node classification result.

[0049] A third aspect of this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps in any of the node classification methods based on decoupled graphs described in the first aspect.

[0050] A fourth aspect of this application provides a computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implements the steps in any of the node classification methods based on decoupled graphs described in the first aspect.

[0051] A fifth aspect of this application provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps in the node classification method based on a decoupled graph as described in the first aspect.

[0052] Beneficial effects:

[0053] This application provides a node classification method, apparatus, device, medium, and product based on decoupled graphs. The method includes: acquiring a text attribute graph and an input prompt, wherein the text attribute graph includes multiple nodes; inputting the text information corresponding to each node into a large language model to acquire a total text representation corresponding to each node, wherein the total text representation represents the collective information of each node in the text attribute graph; inputting the total text representation corresponding to a target node into multiple decoupled channels, wherein each decoupled channel aggregates the neighbor information of the target node according to different graph structures for the target node to obtain multiple hidden layer representations of the target node, wherein the target node is any one of the multiple nodes; optimizing the input prompt based on the multiple hidden layer representations of the target node to obtain an optimized prompt, and inputting the optimized prompt into the large language model to obtain a node classification result. This application acquires hidden layer features containing graph structure information of different aspects through decoupled channels, and optimizes the input prompt based on these hidden layer features, thereby fully utilizing the understanding ability of the large language model, enabling the large language model to better handle the node classification task of text attribute graphs, and effectively improving the processing performance of the large language model for text attribute graphs.

[0054] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0055] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0056] Figure 1 This is a flowchart of a node classification method based on a decoupled graph proposed in an embodiment of this application;

[0057] Figure 2 This is a schematic diagram illustrating the processing of target nodes using a node classification method based on a decoupled graph, as proposed in an embodiment of this application.

[0058] Figure 3 This is a schematic diagram of a node classification device based on a decoupling graph according to an embodiment of this application;

[0059] Figure 4 This is a schematic diagram of an electronic device according to an embodiment of this application. Detailed Implementation

[0060] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0061] Large Language Models (LLMs) are deep learning models trained on large amounts of text data that can generate natural language text or understand the meaning of language text. LLMs can handle various natural language tasks, such as text classification, question answering, and dialogue, and are an important pathway to artificial intelligence. Among these, LLMs have demonstrated outstanding capabilities in the task of classifying nodes in text attribute graphs.

[0062] In related technologies, traditional large language models can only obtain structural information in text attribute graphs based on prompts in the form of natural language as input. For text attribute graphs containing relatively complex structural information, such prompts cannot fully represent the complex structural information hidden in the text attribute graph, such as the complex relationships between nodes. This makes it impossible for existing node classification methods based on traditional large language models to fully utilize the reasoning ability of large language models, resulting in insufficient understanding of this part of the information by large language models, and ultimately leading to poor processing performance of text attribute graphs.

[0063] In view of this, embodiments of this application propose a node classification method based on decoupling graphs. Figure 1 A flowchart of a node classification method based on a decoupled graph, according to an embodiment of this application, is shown. Figure 1 As shown, the method includes the following steps:

[0064] S101. Obtain the text attribute graph and input prompts.

[0065] Obtain a text attribute graph and input prompts, wherein the text attribute graph includes multiple nodes.

[0066] In specific implementation step S101, the text attribute graph and its corresponding input prompt are first obtained, and then input into the large language model. Graphs are a crucial type of structured data with broad application scenarios. In the real world, graph nodes are often associated with attributes in text form. A text-attributed graph (TAG) is a graph where text is used as node attributes. It contains multiple nodes, each with its corresponding text information as its node attribute. For example, in an e-commerce scenario, a product graph is a text attribute graph where each node represents a product on an e-commerce website, and the product's text description can serve as the node's attribute. The input prompt is an input format used to represent the text information, structural information, and task description in the text attribute graph in a formatted way using natural language. This allows the large language model to determine the execution method and generate output results when performing node classification tasks. However, since the input prompt is a natural language input, it cannot fully represent the complex relationships hidden within a complex text attribute graph. Therefore, after obtaining the text attribute graph and the input prompt, this application needs to implement steps S102-S104 to obtain the graph structure information in the text attribute graph and optimize the input prompt based on the graph structure information.

[0067] S102. Input the text information corresponding to each node into the large language model to obtain the overall text representation corresponding to each node.

[0068] Input the text information corresponding to each node into the large language model to obtain the overall text representation corresponding to each node. The overall text representation is used to represent the collective information of each node in the text attribute graph.

[0069] In the specific implementation step S102, Figure 2 This illustration shows a schematic diagram of a node classification method based on a decoupled graph proposed in an embodiment of this application, processing a target node. Figure 2As shown, to obtain the complex graph structure information in the text attribute graph, it is necessary to first represent the text information of each node in the text attribute graph. Specifically, the text information corresponding to each node in the text attribute graph is input into the large language model, wherein the large language model includes multiple consecutive attention layers. Each attention layer is used to capture the text context information of each node and the collective information of the position of each node in the text attribute graph, and outputs multiple text representations of each unit text in the corresponding text information. The unit text is a preset text unit in the text information. For example, for the text information of the target node, the unit text can be each word in the text information of each node, such as... Figure 2 As shown in step 1, the text information of the target node is "Here is a paper". This text information is input into the large language model, where the attention layer generates a corresponding text representation for each word. It should be noted that the above example is merely an optional implementation method provided to help those skilled in the art better understand the solution of this application. The specific unit text can be determined according to the actual situation, and this application does not impose any limitations.

[0070] In this embodiment, each attention layer in the large language model outputs multiple text representations of the corresponding unit text. The multiple text representations output by the previous attention layer serve as the input to the next attention layer. Multiple consecutive attention layers represent the text information corresponding to each node in the text attribute graph. The text information corresponding to each node is processed by multiple consecutive attention layers in the large language model, outputting multiple text representations corresponding to the last layer. To more comprehensively represent the text information of each node, after obtaining the multiple text representations corresponding to the last layer, the average value of these multiple text representations is output as the overall text representation corresponding to the text information of each node. The text information corresponding to all nodes in the text attribute graph is processed sequentially according to the above process based on the large language model to obtain the overall text representation corresponding to all nodes in the text attribute graph. The overall text representation includes the information representation of each node itself, as well as the collective information of the text attribute graph, that is, it implicitly contains structural information from different aspects of the text attribute graph.

[0071] In one optional implementation, the large language model includes N consecutive attention layers. The text information corresponding to each node is input into the first attention layer, and each unit text in the text information is processed to output multiple first text representations corresponding to multiple unit texts. Subsequently, multiple (n-1)th text representations are input into the nth attention layer, and the multiple (n-1)th text representations are processed to output multiple nth text representations. The number of nth text representations is the same as the number of first text representations, where n is a positive integer greater than or equal to 2 and less than or equal to N, i.e., n∈{1,2,…,N}. When n=N, the multiple (N-1)th text representations output by the (N-1)th attention layer are input into the Nth attention layer, and the Nth attention layer outputs multiple Nth text representations. The average value of the multiple Nth text representations is calculated as the overall text representation corresponding to each node.

[0072] This application embodiment extracts text features from the text attribute graph using a large language model, incorporating a wider range of language cues and dependencies into the text features of all nodes in the text attribute graph, and processes the text representation based on the mean, making the obtained overall text representation more robust and information-rich, thereby providing effective data assurance for the subsequent extraction of complex structural information and the performance of output node classification results.

[0073] S103. Input the overall text representation corresponding to the target node into multiple decoupling channels. Each decoupling channel aggregates the neighbor information of the target node according to different graph structures for the target node to obtain multiple hidden layer representations of the target node.

[0074] The overall text representation corresponding to the target node is input into multiple decoupling channels. Each decoupling channel aggregates the neighbor information of the target node according to a different graph structure for the target node to obtain multiple hidden layer representations of the target node, where the target node is any one of the multiple nodes.

[0075] In specific implementation step S103, after obtaining the overall text representation corresponding to each node, this embodiment of the application decouples the overall text representation corresponding to each node through multiple decoupling channels, thereby capturing graph structure information in the text attribute graph corresponding to different graph structures for each node. This graph structure information represents the complex information in the text attribute graph that cannot be fully represented by the input prompt. First, a preset number of decoupling channels are constructed. Each decoupling channel is used to control the forward propagation of the overall text representation based on learnable structure mapping parameters. Specifically, any node in the text attribute graph is first taken as the target node, and the overall text representation corresponding to the target node is input into the decoupling graph neural network in the node classification model. The decoupling graph neural network determines all neighboring nodes that form edges with the target node in the text attribute graph based on the text attribute graph. Subsequently, based on the structure mapping parameters in the decoupling graph neural network, a combination of different neighboring nodes is selected from the neighboring nodes of the target node to obtain the candidate neighboring nodes corresponding to each decoupling channel. The candidate neighboring nodes corresponding to different decoupling channels are different. Finally, based on the connection relationship between the neighbor nodes in the text attribute graph and the target node in each combination of neighbor nodes, a connection relationship is established between the target node and the candidate neighbor nodes corresponding to each decoupling channel, generating different graph structures corresponding to each combination of neighbor nodes, and assigning the graph structures to each decoupling channel to complete the construction of the decoupling channel in the decoupling graph neural network.

[0076] For example, if the neighboring nodes of target node A in the text attribute graph include B, C, and D, and the decoupled graph neural network has four decoupling channels, the decoupled graph neural network generates four combinations of different neighboring nodes (B, C), (B, D), (C, D), and (B, C, D) based on its structure mapping parameters. Then, according to the connection relationship of each neighboring node combination in the text attribute graph, each combination of neighboring nodes is connected to the target node A, forming four different graph structures for target node A. Subsequently, the four different graph structures for target node A are assigned to the four decoupling channels, so that each decoupling channel performs forward propagation of the overall text features of the target node according to the assigned graph structure. It should be noted that the above example is only an optional implementation method provided to enable those skilled in the art to better understand this application. The specific combinations of neighboring nodes and the graph structure corresponding to each decoupling channel can be determined according to the actual situation, and this application does not impose any limitations.

[0077] After constructing the graph structure corresponding to each decoupling channel, since the neighbor nodes of the graph structure corresponding to each decoupling channel are different, each decoupling channel can capture different graph structure information when processing the overall text representation of the target node, thereby representing the structural information of the text attribute graph from different aspects. Specifically, the overall text representation corresponding to the target node is input into each decoupling channel. Each decoupling channel aggregates the overall text representation corresponding to the target node with the neighbor information of the neighbor nodes in the graph structure corresponding to each decoupling channel according to the connection relationship between the nodes in the text attribute graph. Then, it performs forward propagation through the message passing step of the decoupling graph neural network to obtain the hidden layer representation corresponding to each decoupling channel. The neighbor information of the neighbor nodes is the overall text representation output by the neighbor nodes based on the large language model.

[0078] Thus, for each target node, through the propagation process of the decoupled graph neural network, multiple hidden layer representations corresponding to multiple decoupling channels can be obtained. The number of decoupling channels in the decoupled graph neural network can be set according to the actual situation. Preferably, since the number of neighboring nodes of each node is generally large for the text attribute graph corresponding to common application scenarios, in order to ensure the decoupling speed of the decoupled graph neural network for each node, the number of decoupling channels is the same as the number of graph structures. The number of graph structures is less than or equal to the number of graph structures formed by all different combinations of candidate neighboring nodes of the target node in the text attribute graph.

[0079] This application decouples the overall text representation of each node through a dedicated graph structure for each decoupling channel. This allows for the acquisition of multiple hidden representations of structural information from different aspects for each node, based on different graph structure benchmarks. These hidden representations reflect deeper structural information in the text attribute graph, information that is difficult to represent in the natural language level input representation. Subsequently, step S104 is executed. This application optimizes the input prompt by acquiring the hidden representations of different aspects corresponding to each node. This allows the large language model to fully utilize the information contained in the optimized input prompt (i.e., the original information in the input prompt and the complex structural information at different levels reflected in the hidden representations) to classify nodes, effectively leveraging the understanding capabilities of the large language model.

[0080] S104. Optimize the input prompt based on multiple hidden layer representations of the target node to obtain an optimized prompt, and input the optimized prompt into the large language model to obtain the node classification result.

[0081] In specific implementation step S104, the input prompt is first preprocessed to ensure that the number of features in the input prompt is not changed when optimizing the input prompt based on multiple hidden layer representations of the target node. Specifically, after obtaining the input prompt corresponding to the text attribute graph, features at preset positions in the input prompt are marked, and the number of features at the preset positions is the same as the number of decoupling channels in the decoupled graph neural network. Subsequently, after obtaining multiple hidden layer representations corresponding to the target node, features in the input prompt at preset positions are obtained according to pre-generated labels as features to be optimized. Since the number of features to be optimized and the number of hidden layer representations are consistent with the number of decoupling channels, the number of features to be optimized is the same as the number of multiple hidden layer representations. Finally, the multiple hidden layer representations and the features to be optimized are combined, and the combined features replace the features to be optimized in the input prompt to obtain the optimized prompt. Preferably, the combination of the multiple hidden layer representations and the features to be optimized can be achieved by adding the hidden layer representations at corresponding positions to the features to be optimized, replacing the original features to be optimized at the preset positions with the summed features, and using the input prompt after the hidden layer representation replacement as the optimized prompt.

[0082] After receiving the optimized prompt, compared to the original input prompt, the optimized prompt adds graph structure information from different aspects, which can better represent the complex features of the text attribute graph. When the large language model processes based on the optimized prompt, it can make full use of the understanding ability of the large language model to perform effective node classification tasks on the text attribute graph and output the node classification result of each input target node.

[0083] In this embodiment, after obtaining the optimized representation corresponding to each node, the optimized representation corresponding to each node is input into the large language model. Each attention layer in the large language model performs node classification based on the optimized suggestions input by each attention layer, and outputs the optimized suggestions processed by each attention layer. The optimized suggestions output by the previous attention layer are used as the input of the next attention layer. The optimized suggestions corresponding to each node in the text attribute graph are processed by multiple consecutive attention layers in the large language model. The optimized suggestions corresponding to each node are processed by multiple consecutive attention layers in the large language model, and the optimized suggestions corresponding to the last layer are output as the node classification result of each node.

[0084] In one optional implementation, after obtaining the optimized representation corresponding to each node, the optimized representation corresponding to each node is input into the large language model, which includes N consecutive attention layers. The text information corresponding to each node is input into the first attention layer, and node classification is performed based on the optimized prompts, outputting a first prompt representation. Subsequently, the (n-1)th prompt representation is input into the nth attention layer for node classification, outputting the nth prompt representation, where n is a positive integer greater than or equal to 2 and less than or equal to N, i.e., n∈{1,2,…,N}. When n=N, the (N-1)th prompt representation output by the (N-1)th attention layer is input into the Nth attention layer, and the Nth attention layer outputs the Nth prompt representation, which is used as the node classification result for each node.

[0085] In one optional implementation, to accelerate node classification efficiency in a large language model, before inputting the cue representation output by the previous attention layer into the next attention layer, the cue representation output by the previous attention layer is combined and replaced at a preset position using multiple hidden layer representations corresponding to each node. The combined cue representation is then used as the optimized cue input for the next layer. Preferably, the combination of the multiple hidden layer representations and the cue representation can be achieved by adding the hidden layer representation at the corresponding position to the feature at the preset position of the cue feature, replacing the original cue feature at the preset position with the summed feature, and using the cue feature after replacement by the hidden layer representation as the optimized cue input for the next layer.

[0086] In one optional implementation, after obtaining the optimized representation corresponding to each node, the optimized representation corresponding to each node is input into the large language model, which includes N consecutive attention layers. The text information corresponding to each node is input into the first attention layer, and node classification is performed based on the optimized prompt, outputting a first prompt representation. Subsequently, the multiple hidden layer representations are combined with the features in the (n-1)th prompt representation at the preset position, and the combined (n-1)th prompt representation is used as the (n-1)th optimized prompt. The (n-1)th optimized prompt is input into the nth attention layer for node classification, outputting the nth prompt representation, where n is a positive integer greater than or equal to 2 and less than or equal to N, i.e., n∈{1,2,…,N}. When n=N, the (N-1)th prompt representation output by the (N-1)th attention layer is optimized to obtain the (N-1)th optimized prompt, and the (N-1)th optimized prompt is input into the Nth attention layer. The Nth attention layer outputs the Nth prompt representation, and the Nth prompt representation is used as the node classification result for each node.

[0087] In this embodiment, the node classification model includes the large language model and the decoupled graph neural network as described above. During the training of the node classification model, the parameters of the large language model do not need to be trained; only the structure mapping parameters in the decoupled graph neural network need to be trained and optimized. This allows the optimized decoupled graph neural network to effectively capture graph structure feature information at different levels for each node in the text attribute graph based on the trained and optimized structure mapping parameters. Specifically, the training process of the node classification model is as follows: First, a training dataset is obtained, containing node representation samples and their corresponding category labels. In each training process, target node representation samples are extracted from the training dataset. These target node representation samples are mini-batch samples in the training dataset, serving as text attribute graph samples for that training process. Simultaneously, input prompt samples corresponding to the target node representation samples are constructed. Subsequently, the target node representation samples are input into each decoupled channel in the initial decoupled neural network. Each decoupled channel forms a different graph structure based on the structure mapping parameters, and forward propagation is performed according to the graph structure to obtain the hidden layer representation prediction value corresponding to each node in the target node representation sample. The hidden layer representation prediction value corresponding to each node is combined with the input prompt sample and input into the large language model to obtain the node category prediction value corresponding to each node. Based on the node category prediction value and the category label, the cross-entropy loss function value is calculated as the task loss.

[0088] In this embodiment, backpropagation is performed after each calculation of the task loss for node classification. After obtaining the predicted node category result for each node, when performing the above process on another node in the target node representation sample, after optimizing the input prompt sample based on the hidden layer representation prediction value, the previously obtained predicted node category result is combined with the optimized prompt sample to obtain the predicted node category result for that node. After all nodes in the target node representation sample have been predicted, the structure mapping parameters in the decoupled graph neural network are updated using gradient descent.

[0089] In an alternative implementation, since the training of the node classification model only focuses on the prediction results of the large language model for the node category, when constructing the input prompt sample for the target node representation sample during each training process, the embodiments of this application design a response template as part of the constructed input prompt sample, so that the large language model can directly output the node category prediction value when generating the first character.

[0090] This application provides a node classification method based on decoupled graphs. The method includes: acquiring a text attribute graph and input prompts, wherein the text attribute graph includes multiple nodes; inputting the text information corresponding to each node into a large language model to acquire the overall text representation corresponding to each node, wherein the overall text representation represents the collective information of each node in the text attribute graph; inputting the overall text representation corresponding to a target node into multiple decoupled channels, wherein each decoupled channel aggregates the neighbor information of the target node according to different graph structures for the target node to obtain multiple hidden layer representations of the target node, wherein the target node is any one of the multiple nodes; optimizing the input prompts based on the multiple hidden layer representations of the target node to obtain optimized prompts, and inputting the optimized prompts into the large language model to obtain node classification results. This application acquires hidden layer features containing graph structure information of different aspects through decoupled channels, and optimizes input prompts based on these hidden layer features, thereby fully utilizing the understanding ability of the large language model, enabling the large language model to better handle the node classification task of text attribute graphs, and effectively improving the processing performance of the large language model for text attribute graphs.

[0091] Based on the same inventive concept, embodiments of this application disclose a node classification device based on a decoupled graph. Figure 3 This illustration shows a schematic diagram of a node classification device based on a decoupling graph according to an embodiment of this application, as follows: Figure 3 As shown, the device includes:

[0092] The acquisition module is used to acquire a text attribute graph and input prompts, wherein the text attribute graph includes multiple nodes;

[0093] The overall text representation module is used to input the text information corresponding to each node into the large language model and obtain the overall text representation corresponding to each node. The overall text representation is used to represent the collective information of each node in the text attribute graph.

[0094] The decoupling module is used to input the overall text representation corresponding to the target node into multiple decoupling channels. Each decoupling channel aggregates the neighbor information of the target node according to a different graph structure for the target node to obtain multiple hidden layer representations of the target node, wherein the target node is any one of the multiple nodes.

[0095] The node classification module is used to optimize the input prompt based on multiple hidden layer representations of the target node to obtain an optimized prompt, and input the optimized prompt into the large language model to obtain the node classification result.

[0096] In one optional implementation, the overall text representation module includes:

[0097] The first attention layer submodule is used to input the text information corresponding to each node into the first attention layer, process each unit text in the text information, and output multiple first text representations;

[0098] The nth attention layer submodule is used to input multiple (n-1)th text representations into the nth attention layer, process the multiple (n-1)th text representations, and output multiple nth text representations, where n is a positive integer greater than or equal to 2 and less than or equal to N;

[0099] The overall text representation submodule is used to obtain the overall text representation corresponding to each node based on multiple Nth text representations output by the Nth attention layer, wherein the overall text representation is the average value of the multiple Nth text representations.

[0100] In one optional implementation, the decoupling module includes:

[0101] The graph structure submodule is used to construct multiple graph structures for the target node based on the text attribute graph, each graph structure containing different neighbor nodes of the target node;

[0102] An allocation submodule is used to allocate the plurality of graph structures to the plurality of decoupled channels, wherein each of the decoupled channels performs forward propagation of the overall text representation;

[0103] The neighbor aggregation submodule is used to aggregate the overall text representation corresponding to the target node with the neighbor information of the neighbor nodes in the graph structure corresponding to each decoupling channel to obtain the hidden layer representation corresponding to each decoupling channel.

[0104] In one optional implementation, the node classification module includes:

[0105] The feature to be optimized submodule is used to obtain the features in the input prompt at a preset position as the feature to be optimized. The number of the feature to be optimized is the same as the number of the multiple hidden layer representations. The input prompt is the representation of the structural information of the text attribute graph at the natural language level.

[0106] The optimization prompt submodule is used to combine the multiple hidden layer representations with the feature to be optimized, and replace the feature to be optimized in the input prompt with the combined feature to obtain the optimization prompt.

[0107] In one optional implementation, the node classification module further includes:

[0108] The first node classification submodule is used to input the optimization prompt into the first attention layer, classify nodes based on the optimization prompt, and output the first prompt representation.

[0109] The nth node classification submodule is used to combine the features in the (n-1)th cue representation that are located at the preset position with the multiple hidden layer representations, take the combined (n-1)th cue representation as the (n-1)th optimized cue, input the (n-1)th optimized cue into the nth attention layer for node classification, and output the nth cue representation, where n is a positive integer greater than or equal to 2 and less than or equal to N;

[0110] The node classification result submodule is used to take the Nth cue representation output by the Nth attention layer as the node classification result.

[0111] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0112] Based on the same inventive concept, this application discloses an electronic device. Figure 4 A schematic diagram of an electronic device according to an embodiment of this application is shown, such as... Figure 4 As shown, the electronic device 100 includes a memory 110 and a processor 120. The memory 110 and the processor 120 are connected via a bus. The memory 110 stores at least one instruction, at least one program, code set, or instruction set. The at least one instruction, the at least one program, the code set, or the instruction set can be loaded and run on the processor 120 to implement the steps in the node classification method based on decoupling graph disclosed in the embodiments of this application.

[0113] Based on the same inventive concept, embodiments of this application disclose a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set thereon. The at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the steps in the node classification method based on decoupled graphs disclosed in embodiments of this application.

[0114] Based on the same inventive concept, embodiments of this application disclose a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps in the node classification method based on decoupled graphs disclosed in embodiments of this application.

[0115] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0116] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, apparatuses, electronic devices, and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0117] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0118] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0119] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.

[0120] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0121] The present application provides a detailed description of a node classification method, apparatus, device, medium, and product based on a decoupling graph. Specific examples have been used to illustrate the principles and implementation methods of the present application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present application. At the same time, those skilled in the art will recognize that there will be changes in the specific implementation methods and application scope based on the ideas of the present application. Therefore, the content of this specification should not be construed as a limitation of the present application.

Claims

1. A node classification method based on decoupled graphs, characterized in that, The method includes: Obtain a text attribute graph and input prompts, wherein the text attribute graph includes multiple nodes; Input the text information corresponding to each node into the large language model to obtain the overall text representation corresponding to each node. The overall text representation is used to represent the collective information of each node in the text attribute graph. The overall text representation corresponding to the target node is input into multiple decoupling channels. Each decoupling channel aggregates the neighbor information of the target node according to different graph structures for the target node to obtain multiple hidden layer representations of the target node, where the target node is any one of the multiple nodes. The overall text representations corresponding to the multiple nodes are decoupled through the multiple decoupling channels to capture the graph structure information of the text attribute graph for different graph structures corresponding to the multiple nodes. The input prompt is optimized based on multiple hidden layer representations of the target node to obtain an optimized prompt, and the optimized prompt is input into the large language model to obtain the node classification result; The overall text representation corresponding to the target node is input into multiple decoupling channels. Each decoupling channel aggregates the neighbor information of the target node according to a different graph structure for the target node, resulting in multiple hidden layer representations of the target node, including: Based on the text attribute graph, multiple graph structures are constructed for the target node, and each graph structure contains different neighbor nodes of the target node; The plurality of graph structures are assigned to the plurality of decoupling channels, and each of the decoupling channels performs forward propagation of the overall text representation; The overall text representation corresponding to the target node is aggregated with the neighbor information of the neighbor nodes in the graph structure corresponding to each decoupling channel to obtain the hidden layer representation corresponding to each decoupling channel. The step of constructing multiple graph structures for the target node based on the text attribute graph includes: Based on the text attribute graph, determine all neighboring nodes of the target node; Based on the structural mapping parameters corresponding to each decoupling channel, candidate neighbor nodes corresponding to each decoupling channel are selected from the neighbor nodes of the target node. The candidate neighbor nodes corresponding to different decoupling channels are different. The structural mapping parameters are obtained based on task loss optimization. Based on the connection relationships between nodes in the text attribute graph, a connection relationship is established between the target node and the candidate neighbor node corresponding to each decoupling channel to obtain the graph structure corresponding to each decoupling channel.

2. The node classification method based on decoupled graphs according to claim 1, characterized in that, The large language model comprises N consecutive attention layers. The step of inputting the text information corresponding to each node into the large language model to obtain the overall text representation corresponding to each node includes: The text information corresponding to each node is input into the first attention layer, and each unit text in the text information is processed to output multiple first text representations; Multiple (n-1)th text representations are input into the nth attention layer, the multiple (n-1)th text representations are processed, and multiple nth text representations are output, where n is a positive integer greater than or equal to 2 and less than or equal to N; Based on multiple Nth text representations output by the Nth attention layer, the overall text representation corresponding to each node is obtained, and the overall text representation is the average value of the multiple Nth text representations.

3. The node classification method based on decoupled graphs according to claim 1, characterized in that, The input prompt is optimized based on multiple hidden layer representations of the target node to obtain an optimized prompt, including: The features in the input prompt located at a preset position are obtained as features to be optimized. The number of features to be optimized is the same as the number of the multiple hidden layer representations. The input prompt is the representation of the structural information of the text attribute graph at the natural language level. The multiple hidden layer representations are combined with the feature to be optimized, and the feature to be optimized in the input prompt is replaced with the combined feature to obtain the optimization prompt.

4. The node classification method based on decoupled graphs according to claim 3, characterized in that, The large language model includes N consecutive attention layers. The optimized prompts are input into the large language model to obtain node classification results, including: The optimized suggestion is input into the first attention layer, and node classification is performed based on the optimized suggestion to output the first suggestion representation. The features at the preset positions in the multiple hidden layer representations and the n-1th cue representations are combined, and the combined n-1th cue representation is used as the n-1th optimized cue. The n-1th optimized cue is input into the nth attention layer for node classification, and the nth cue representation is output. Here, n is a positive integer greater than or equal to 2 and less than or equal to N. The Nth cue representation output by the Nth attention layer is used as the node classification result.

5. A node classification device based on a decoupled graph, characterized in that, The device includes: The acquisition module is used to acquire a text attribute graph and input prompts, wherein the text attribute graph includes multiple nodes; The overall text representation module is used to input the text information corresponding to each node into the large language model and obtain the overall text representation corresponding to each node. The overall text representation is used to represent the collective information of each node in the text attribute graph. The decoupling module is used to input the overall text representation corresponding to the target node into multiple decoupling channels. Each decoupling channel aggregates the neighbor information of the target node according to different graph structures for the target node to obtain multiple hidden layer representations of the target node, where the target node is any one of the multiple nodes. The overall text representations corresponding to the multiple nodes are decoupled through the multiple decoupling channels to capture the graph structure information of the text attribute graph for different graph structures corresponding to the multiple nodes. The node classification module is used to optimize the input prompt based on multiple hidden layer representations of the target node to obtain an optimized prompt, and input the optimized prompt into the large language model to obtain the node classification result; The decoupling module is further configured to: construct multiple graph structures for the target node based on the text attribute graph, each graph structure containing different neighbor nodes of the target node; assign the multiple graph structures to the multiple decoupling channels, each decoupling channel performing forward propagation of the overall text representation; aggregate the overall text representation corresponding to the target node with the neighbor information of the neighbor nodes in the graph structure corresponding to each decoupling channel to obtain the hidden layer representation corresponding to each decoupling channel; determine all neighbor nodes of the target node based on the text attribute graph; select candidate neighbor nodes corresponding to each decoupling channel from the neighbor nodes of the target node based on the structure mapping parameters corresponding to each decoupling channel, wherein the candidate neighbor nodes corresponding to different decoupling channels are different, and the structure mapping parameters are obtained based on task loss optimization; and establish connection relationships between the target node and the candidate neighbor nodes corresponding to each decoupling channel according to the connection relationships between nodes in the text attribute graph to obtain the graph structure corresponding to each decoupling channel.

6. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps in the node classification method based on decoupled graphs as described in any one of claims 1-4.

7. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instruction is executed by the processor, it implements the steps in the node classification method based on decoupled graphs as described in any of claims 1-4.

8. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the steps in the node classification method based on the decoupled graph as described in any one of claims 1-4.