Text attribute graph comparative learning method based on large language model and coupling enhancement
By using an adaptive correction node connection mechanism and semantic supervision from a large language model, the problems of noise interference and label scarcity in text attribute graph learning are solved, enabling more efficient text attribute graph comparison learning and improving node classification performance.
Patent Information
- Application Number
- CN202511481961.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-16
- Publication Date
- 2026-01-13
AI Technical Summary
Traditional text attribute graph learning methods suffer from problems such as conflicting optimization objectives, instability, and low computational efficiency. In real-world scenarios, structural and attribute noise exists, and sample labels are scarce, which affects the learning effect.
We design an adaptive node connection correction mechanism, optimize the graph structure through a large language model, introduce semantic supervision, construct high-quality positive and negative sample pairs, perform coupled reinforcement learning, reduce noise interference, and improve semantic modeling capabilities.
It effectively reduces the complexity of the data augmentation process, filters noisy connections, completes latent semantic relationships, improves node classification performance and robustness, and achieves seamless collaborative training of graph models and text models.
Smart Images

Figure CN121328645A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer graph representation learning technology, and in particular to a text attribute graph contrastive learning method based on a large language model and enhanced coupling. Background Technology
[0002] Large language models are a type of deep learning model, particularly within the field of Natural Language Processing (NLP). They generally refer to language models containing hundreds of billions (or more) of parameters trained on massive amounts of text data. The purpose of large language models is to understand and generate natural language by learning from large amounts of text data to predict the next word or generate content related to a given text.
[0003] Text-attributed graph learning (TAGL), as an important interdisciplinary approach combining graph learning and natural language processing (NLP), has shown broad application prospects in the real world. Its core value lies in simultaneously capturing structured topological relationships and semantic information, providing a new paradigm for modeling complex systems. However, traditional learning methods rely on joint modeling using language models and graph neural networks, which suffers from problems such as conflicting optimization objectives, instability, and low computational efficiency. Furthermore, real-world text attribute graphs often contain structural noise (such as redundancy or faulty connections) and attribute noise (such as irrelevant node text information), and suffer from a scarcity of sample labels. These factors significantly affect the effectiveness of text attribute graph learning, further exacerbating the difficulty of modeling and learning.
[0004] Therefore, a text attribute graph contrastive learning method based on a large language model and enhanced coupling is needed. Summary of the Invention
[0005] In view of this, this invention provides a text attribute graph contrastive learning method based on a large language model and coupling enhancement. It designs an adaptive node connection correction mechanism to optimize the graph structure, reducing the complexity of the data augmentation process and suppressing noise interference with the topology by optimizing the connection relationships at the structural level. Semantic supervision from a large language model is introduced to construct cross-modal semantic consistency constraints, achieving collaborative noise correction between text attributes and the original topology. Based on this, high-quality positive and negative sample pairs are constructed to achieve effective coupling enhancement.
[0006] Therefore, the present invention provides the following technical solution: A text attribute graph contrastive learning method based on a large language model and enhanced coupling includes: The node embedding representation of the text is obtained by depth walking, and the structural similarity between nodes is measured by the cosine similarity function to construct the original text attribute graph. Based on the connection relationships and similarity measures between nodes, four non-overlapping candidate sets are constructed for each node, including a strong association set, a weak association set, a suspicious association set, and a potential association set; Input the suspicious association set and the potential association set into the large language model for inference and output the relevant point set and the irrelevant point set; The relevant point set and the strongly correlated set are used as positive samples, while the weakly correlated set and the irrelevant point set are used as negative samples for comparative learning.
[0007] Furthermore, the step of obtaining the node embedding representation of the text through depth walk and measuring the structural similarity between nodes using a cosine similarity function includes:
[0008] in, The cosine similarity function is used. Let n be the embedding representation of node n. Let n be the embedding representation of node m, where m and n are both arbitrary nodes; For in-depth exploration.
[0009] Furthermore, The strongly associated set includes nodes that are directly connected to node n and have the highest similarity. One node; The weak association set consists of nodes that are not connected to node n and have the lowest similarity. It consists of nodes; The suspicious association set includes nodes that are directly connected to node n but have the lowest similarity. One node; The potential association set consists of nodes that are not connected to node n but have the highest similarity. It consists of several nodes.
[0010] Furthermore, the step of inputting the suspicious association set and the potential association set into the large language model for inference and outputting the relevant point set and the irrelevant point set includes: The large language model is guided by preset prompts to perform deep semantic analysis on the input candidate set and to determine the candidate nodes. Based on the judgment results of the large language model, the candidate set is divided into relevant point set and irrelevant point set respectively.
[0011] Furthermore, the step of guiding the large language model to perform deep semantic analysis on the input candidate set through preset prompt words and determining the candidate nodes includes:
[0012] in, This represents the semantic judgment result of the large language model for candidate node m, where 1 indicates semantic relevance and 0 indicates semantic irrelevance. This indicates a hint constructor, and X represents the candidate set. or .
[0013] Furthermore, the step of dividing the candidate set into relevant point sets and irrelevant point sets based on the judgment results of the large language model includes:
[0014] in, Represents the set of related points; Represents a set of independent points; Indicates a set of suspicious associations. This represents a potential set of associations.
[0015] Furthermore, the loss function for the contrastive learning is:
[0016] in, Calculate the cosine similarity between vectors a and b; and These represent the text and graphic embeddings in the original view, respectively. and Embedded in the front view; and Indicates embedding in the negative view; This represents the coupling loss of the text model. This represents the coupling loss of the graph model.
[0017] Furthermore, the number of nodes in the strong association set, weak association set, suspicious association set, and potential association set is:
[0018] in, Let n be the set of its neighboring nodes. Represents the set of non-neighbor nodes; The value of i ranges from 1 to 4.
[0019] Advantages and positive effects of the present invention: 1. This method reduces potential and redundant connections between nodes by constructing relevant point sets and irrelevant node sets, effectively reducing the complexity of the enhancement process; 2. This method evaluates semantic relevance through a large language model, fully explores the deep semantic information in text attributes, achieves the filtering of noisy connections and the completion of potential semantic relationships, and comprehensively improves semantic modeling capabilities. 3. The coupling enhancement strategy of this method establishes interaction between multiple candidate embeddings, effectively integrates the semantic association between graph structure and text attributes, effectively bridges the gap between graph model and text model, successfully optimizes negative sample generation, and significantly alleviates the interference of pseudo negative samples. 4. This method achieves more robust node classification performance by supporting seamless collaborative training between graph models and text models. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a flowchart of the text attribute graph comparison learning method based on a large language model and enhanced coupling in an embodiment of the present invention; Figure 2 This is a framework diagram of the text attribute graph contrastive learning method based on a large language model and enhanced coupling in an embodiment of the present invention. Detailed Implementation
[0022] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0023] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0024] This invention provides a text attribute graph contrastive learning method based on a large language model and enhanced coupling, comprising: S1. Obtain the embedded representation of the node through depth walk, and measure the structural similarity between nodes through the cosine similarity function.
[0025] S2. Based on the connection relationships and similarity measures between nodes, construct four non-overlapping candidate sets for each node, including strong association set, weak association set, suspicious association set, and potential association set.
[0026] S3. Input the suspicious association set and the potential association set into the large language model for inference and output the relevant point set and the irrelevant point set.
[0027] S4. Use relevant point sets and strongly correlated sets as positive samples, and weakly correlated sets and irrelevant point sets as negative samples for comparative learning.
[0028] Example This example provides a text attribute graph contrastive learning method based on a large language model and enhanced coupling, such as... Figure 1 As shown, it includes the following steps: S1. By using a large language model to evaluate the semantic relevance of node pairs in a graph structure, potential connections are mined and redundant edges are removed, and deep semantic modeling of node text is performed.
[0029] S11: The primary concern for the noise correction module based on the large language model in practical operation is that as the node size expands, the edge search space grows rapidly, significantly increasing the computational cost of semantic evaluation based on the large language model. Considering this issue, the model constructs a structure-aware candidate set from a structural perspective to optimize the connections between nodes, thereby significantly reducing the computational burden of the large language model. A structure-aware candidate set construction method based on DeepWalk is adopted, mapping nodes to a hidden space H containing only structural information, and measuring the structural similarity between nodes using a cosine similarity function. The embedding of any node n is represented as... The calculation method for the generation and evaluation process of ∈H is as follows:
[0030] in, The cosine similarity function is used. Let n be the embedding representation of node n. Let n be the embedding representation of node m, where m and n are both arbitrary nodes.
[0031] S12: Based on the connections and similarity metrics between nodes, construct four non-overlapping candidate sets for each node n, including a strongly associated set. Weakly related sets Suspicious association set and potential association set A strongly associated set contains nodes that are directly connected to node n and have the highest similarity. The set of nodes represents the most reliable connection candidates; the weak association set consists of nodes that are not connected to node n and have the lowest similarity. The set of nodes represents the least reliable candidate connections. The suspicious association set contains nodes that are directly connected to node n but have the lowest similarity. Each node represents a possible redundant or noisy connection; the potential association set consists of nodes that are not connected to node n but have the highest similarity. Each set consists of nodes, representing potentially missing valid connections. These sets are calculated as follows:
[0032] S13: Strongly related sets and weakly related sets Used to measure the similarity of structural connections between nodes. This is a globally uniform value, and its calculation method is as follows:
[0033] in, Let n be the set of its neighboring nodes. Represents the set of non-neighbor nodes; The value of i ranges from 1 to 4.
[0034] S14: Due to the candidate set and There is a clear conflict between connectivity and structural similarity, indicating that relying solely on single structural data is insufficient to capture the true relationships between nodes. To address this issue, textual attributes are introduced to further measure the degree of association between nodes and distinguish between the two candidate sets.
[0035] Define a hint constructor , where X represents the candidate set or By using preset prompts, the large language model is guided to perform deep semantic analysis on the input candidate set, thereby identifying noisy connections. The mapping function is defined and its complement is calculated as follows:
[0036] in, This represents the semantic judgment result of the large language model on candidate node m, where 1 indicates semantic relevance and 0 indicates semantic irrelevance.
[0037] S5: Based on the judgment results of the large language model, the candidate set is... and They are divided into two new interpretable sets: the relevant point set and the relevant point set. and the set of irrelevant points Two new interpretable sets. Their computation is as follows:
[0038] in, This includes candidate nodes that, according to the large language model, are semantically strongly related to node n and should be connected; while This includes candidate nodes with weak semantic relevance that are not suitable for establishing connections. and This reflects the closeness of semantic relationships between nodes. By comprehensively considering text attributes and topological structure information, noisy connections in the original text attribute graph were identified and filtered, reducing the complexity of the enhancement process. This significantly improves the overall graph structure robustness while also enhancing the accuracy of relationships between nodes, providing a reliable basis for subsequent text-structure coupling enhancement modules.
[0039] S6: A contrastive learning method coupling text and structural enhancement aims to fully explore the complementarity between text attributes and graph structure, construct a collaboratively optimized bimodal enhancement mechanism, and achieve more discriminative node representation learning. To this end, an interpretable positive and negative sample generation strategy is designed, which finely implements positive and negative enhancement operations by fusing the structural and semantic information of nodes in the candidate set.
[0040] Specifically, in the positive and negative sample construction stage, the TF-IDF algorithm is used to extract the previous positive samples from the text descriptions of candidate nodes. Each keyword replaces the original text and is then concatenated with the root node text to highlight key semantic elements, forming a more distinctive enhanced text representation. The formula for the above operation is:
[0041] in, This represents the node description text for node m. This refers to the subsequence of text attributes extracted from the neighbors of the candidate set. This represents the root node. This strategy preserves the core information in the context, avoids redundant text interfering with model training, and overcomes the limitations of single-neighbor information in capturing semantic and structural relationships, achieving coupled interaction between text and graph structure modalities.
[0042] S7: A text attribute graph contrastive learning method based on enhanced coupling is proposed to achieve effective information exchange between text contrastive learning and graph contrastive learning. It is divided into a text-graph embedding stage and a text-graph contrastive stage. In the embedding stage, the text information of the three views is effectively embedded using the cls token in the tag sequence. The embedding function is expressed as follows: The original view refers to the node embedding representation jointly generated by a graph neural network and a text encoder under the default graph structure and original text attributes; the positive view and negative view are generated by fusing the graph structure and text attributes of the corresponding nodes based on the positive and negative samples constructed in Section S6 above, respectively, through a coupling enhancement mechanism.
[0043] S8: In the text embedding stage of the text comparison learning process, the following formulas are proposed for calculating the node attribute embedding function of the original view, positive view, and negative view:
[0044] S9: In the graph embedding stage of the graph contrast learning process, the following formulas are proposed for calculating the node attribute embedding functions of the original view, the front view, and the negative view: And satisfy and .in, The aggregation process formula for a single graph convolutional layer is as follows:
[0045] in, Indicates having parameters The fully connected layer It is the aggregate weight calculated from neighbor node m to root node n.
[0046] S10: Within the joint contrastive learning framework, the core objective of model training is to maximize the representational consistency between the original view and the positive view, while minimizing the similarity with the negative view, thereby optimizing the discriminativeness and robustness of node representations. By constructing embedding pairs under three views, the model can perform self-supervised contrastive learning under multimodal and consistency constraints, thus enhancing the model's comprehensive modeling ability for semantic associations and structural relationships. To achieve this goal, this invention further defines a coupled contrastive loss function. Specifically, in the contrastive phase, a graph-based loss LG is first created for the text model, and a text-based loss LT is created for the graph model, as shown in the following formula:
[0047] in, and These represent the basic losses for the text and graph models, respectively. It is a classification function in a text model. It is a classification function on a graphical model, where N is the sample vector and K is the number of label categories. It is the label of sample i in category c.
[0048] S11: This represents the coupling loss of the text model. This represents the coupling loss of the graphical model. The coupling contrast loss function is shown in the following formula:
[0049] in, Calculate the cosine similarity between vectors a and b; and These represent the text and graphic embeddings in the original view, respectively. and Embedded in the front view; and This indicates embedding within a negative view.
[0050] The effectiveness of this method is further illustrated by experiments: Experimental results show that the proposed method outperforms baseline methods in node classification tasks, achieving an average accuracy improvement of 5%. It demonstrates stronger generalization ability and robustness, maintaining stable performance even with very few labels, reflecting the model's high adaptability to complex semantic structures and graph patterns. Comparisons are made with two classic graph contrastive learning methods, GraphCL and BGRL. GraphCL is an unsupervised representation learning framework for graph data, which introduces prior knowledge of the data distribution through four graph data augmentation methods, and then uses the views generated by these augmentations for contrastive learning. BGRL is a self-supervised method for large-scale graph representation learning, encoding two augmented versions of the graph using two graph encoders. Experimental results demonstrate that the proposed method achieves the best performance.
[0051] In summary, this method addresses the common problems of noise interference and label scarcity in text attribute graphs in real-world scenarios. By employing a coupling enhancement strategy, it effectively bridges the gap between graph models and text models, supporting seamless interaction between text and graph models without interrupting their respective training processes. The model consists of three core modules: a noise correction module based on a large language model, a text-structure coupling enhancement module, and a joint contrastive learning module. From a structural perspective, it prioritizes potential and redundant connections between nodes to reduce the complexity of the enhancement process. Simultaneously, it introduces a large language model to evaluate semantic relevance, mining deep semantic information in text attributes to filter noisy connections and complete potential semantic relationships, thereby improving semantic modeling capabilities. Subsequently, the model designs a coupling enhancement strategy to establish interactions between multiple candidate embeddings, fusing the semantic associations between graph structures and text attributes, optimizing negative sample generation, and mitigating pseudo-negative sample interference. Finally, by supporting seamless collaborative training between graph and text models, the model achieves more robust node classification performance.
[0052] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A text attribute graph contrastive learning method based on a large language model and enhanced coupling, characterized in that, include: The node embedding representation of the text is obtained by depth walking, and the structural similarity between nodes is measured by the cosine similarity function to construct the original text attribute graph. Based on the connection relationships and similarity measures between nodes, four non-overlapping candidate sets are constructed for each node, including a strong association set, a weak association set, a suspicious association set, and a potential association set; Input the suspicious association set and the potential association set into the large language model for inference and output the relevant point set and the irrelevant point set; The relevant point set and the strongly correlated set are used as positive samples, while the weakly correlated set and the irrelevant point set are used as negative samples for comparative learning.
2. The method according to claim 1, characterized in that, The process of obtaining node embeddings of text through depth walk and measuring structural similarity between nodes using a cosine similarity function includes: in, The cosine similarity function is used. Let n be the embedding representation of node n. Let n be the embedding representation of node m, where m and n are both arbitrary nodes; For in-depth exploration.
3. The method according to claim 1, characterized in that: The strongly associated set includes nodes that are directly connected to node n and have the highest similarity. One node; The weak association set consists of nodes that are not connected to node n and have the lowest similarity. It consists of nodes; The suspicious association set includes nodes that are directly connected to node n but have the lowest similarity. One node; The potential association set consists of nodes that are not connected to node n but have the highest similarity. It consists of several nodes.
4. The method according to claim 1, characterized in that, The step of inputting the suspicious association set and the potential association set into the large language model for inference and outputting the relevant point set and the irrelevant point set includes: The large language model is guided by preset prompts to perform deep semantic analysis on the input candidate set and to determine the candidate nodes. Based on the judgment results of the large language model, the candidate set is divided into relevant point set and irrelevant point set respectively.
5. The method according to claim 4, characterized in that, The step of guiding a large language model to perform deep semantic analysis on the input candidate set through preset prompt words and determining candidate nodes includes: in, This represents the semantic judgment result of the large language model for candidate node m, where 1 indicates semantic relevance and 0 indicates semantic irrelevance. This indicates a hint constructor, and X represents the candidate set. or .
6. The method according to claim 4, characterized in that, The step of dividing the candidate set into relevant point sets and irrelevant point sets based on the judgment results of the large language model includes: in, Represents the set of related points; Represents a set of independent points; Indicates a set of suspicious associations. This represents a potential set of associations.
7. The method according to claim 1, characterized in that, The loss function for the contrastive learning is: in, Calculate the cosine similarity between vectors a and b; and These represent the text and graphic embeddings in the original view, respectively. and Embedded in the front view; and Indicates embedding in the negative view; This represents the coupling loss of the text model. This represents the coupling loss of the graph model.
8. The method according to claim 1, characterized in that, The number of nodes in the strong association set, weak association set, suspicious association set, and potential association set is: in, Let n be the set of its neighboring nodes. Represents the set of non-neighbor nodes; The value of i ranges from 1 to 4.