Continuous learning method and device of dynamic graph, electronic equipment and storage medium

By fusing language models and graph structure features to generate base class prototypes and covariance matrices, and combining adaptive prompts and pseudo-sample generation technology, the problem of continuous learning of dynamic graph data is solved, and efficient classification and model adaptability are achieved in few-sample scenarios.

CN120782012AActive Publication Date: 2025-10-14SHENZHEN UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511290113.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-10
Publication Date
2025-10-14
Estimated Expiration
2045-09-10

AI Technical Summary

Technical Problem

Existing technologies are difficult to adapt to the evolution of dynamic graph data, easily fall into the stability-plasticity dilemma, leading to catastrophic forgetting, and cannot effectively handle the continuous learning problem of text attribute graphs.

Method used

通过语言模型编码动态图基类节点的文本特征,结合图结构特征生成基类原型和协方差矩阵,并进行矩阵收缩和标准化;在新任务样本不足时生成伪样本,利用自适应键-提示检索器动态选择提示,结合BERT编码新任务文本属性并通过马氏距离进行分类。

Benefits of technology

It effectively alleviates the catastrophic forgetting problem in continuous learning of dynamic graphs, improves the adaptability and robustness of the model in few-sample scenarios, and improves classification performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120782012A_ABST
    Figure CN120782012A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a continuous learning method and device for a dynamic graph, electronic equipment and a storage medium, and relates to the technical field of graph learning and continuous learning, and the method comprises the steps: coding text features of base class nodes of the dynamic graph into numerical vectors through a language model, obtaining a base class prototype and a covariance matrix in combination with structural features, and obtaining a covariance matrix; generating a corresponding prompt according to the difficulty of the new task, and if the number of the new samples is small, generating a pseudo sample based on the cosine similarity of the new prototype and the base prototype; initializing an orthogonal key vector, constructing an adaptive key-prompt retriever by minimizing the cosine similarity between the orthogonal key vector and a new sample, optimizing the adaptive key-prompt retriever, and dynamically selecting the most matched prompt; text attributes of new samples are coded into feature vectors through BERT, the feature vectors are combined with prompts, and categories are determined by calculating the mahalanobis distance between the feature vectors and a covariance matrix. According to the method, the problems that the prior art is difficult to adapt to dynamic graph data evolution, catastrophic forgetting is easily caused, and overfitting is easily caused in a few-sample scene are solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of graph learning and lifelong learning, and particularly relates to a dynamic graph lifelong learning method and device, electronic equipment and storage medium. BACKGROUND

[0002] With the rapid development of deep learning technology, artificial intelligence has made remarkable achievements in computer vision, natural language processing and graph learning. However, traditional deep learning models are usually trained on static datasets and assume that the training data and test data are consistent in distribution. In real-world applications, data often changes dynamically, such as friend relationship updates in social networks, real-time adjustments of traffic networks, and continuous expansion of citation networks. This dynamic nature poses a serious challenge to the lifelong learning ability of models, especially in the field of graph learning. Existing graph neural networks (GNNs) are mainly designed for static graphs and are difficult to adapt to the dynamic evolution of graph structures.

[0003] Traditional lifelong learning methods, such as EWC based on regularization, iCaRL based on memory replay, and HAG-Meta based on optimization, have significant limitations when dealing with dynamic graph scenarios. Regularization methods are prone to stability-plasticity dilemma and are difficult to balance old and new knowledge; memory replay methods consume a lot of memory and pose privacy and security risks; optimization methods can dynamically adjust task contributions, but are prone to overfitting in few-shot scenarios.

[0004] In addition, existing methods have not effectively solved the problem of lifelong learning based on text attribute graphs. When the graph structure carries text features, the model performance will be greatly reduced.

[0005] Therefore, there is an urgent need for a dynamic graph lifelong learning method that can efficiently process dynamic graph data, effectively alleviate catastrophic forgetting, and support text attribute graph lifelong learning, with strong stability and adaptability. SUMMARY

[0006] Embodiments of the present application provide a dynamic graph lifelong learning method to solve the problems that existing technologies are difficult to adapt to dynamic graph data evolution, are prone to stability-plasticity dilemma leading to catastrophic forgetting, are prone to overfitting in few-shot scenarios, and cannot effectively handle text attribute graph lifelong learning. The technical solution is as follows: According to one aspect of the present invention, a continuous learning method for dynamic graphs includes: encoding the text features of the base class nodes of the dynamic graph into numerical vectors through a language model, obtaining the base class prototype and covariance matrix in combination with the structural features of the dynamic graph, and performing matrix shrinkage and normalization on the covariance matrix; the base class prototype is the category mean vector of each base class; generating a corresponding prompt according to the difficulty of the new task, and if the number of samples of the new task is less than a set value, performing weighted summation of the base class prototype based on the cosine similarity between the prototype of the new task and the base class prototype to generate a pseudo sample; the prototype represents the category mean vector; initializing an orthogonal key vector, constructing an adaptive key-prompt retriever by minimizing the cosine similarity between the orthogonal key vector and the sample of the new task, optimizing the adaptive key-prompt retriever by parameter freezing and minimizing the negative log-likelihood loss, and dynamically selecting the best matching prompt; encoding the text attributes of the sample of the new task into a feature vector through BERT, and obtaining a final feature vector in combination with the prompt, and determining the category of the new task by calculating the Mahalanobis distance between the feature vector and the covariance matrix.

[0007] In one embodiment, the text features of the base class nodes in the dynamic graph are encoded into numerical vectors through a language model, and the base class prototype and covariance matrix are obtained in combination with the structural features of the dynamic graph by the following steps: the text descriptions of the base class nodes in the dynamic graph are encoded using a language model to obtain numerical vectors, and the base class prototype and covariance matrix are obtained in combination with the structural features of the dynamic graph through a graph neural network model; the numerical vector includes model parameters, adaptive prompts and base class numbers.

[0008] In one embodiment, generating corresponding prompts according to the difficulty of the new task is achieved by the following steps: if the number of samples of the new task is 0 or the average token length of the samples in the new task is not less than 200, the prompt length is set to 10, otherwise the prompt length is set to 6; a new prompt is generated for the new task according to the prompt length, and the prompt data is combined with the adaptive prompt of the base class to optimize the parameters of the new prompt.

[0009] In one embodiment, generating a pseudo sample by weighted summing the base class prototypes based on the cosine similarity between the prototype of the new task and the base class prototypes is achieved by the following steps: calculating the cosine similarity between the prototype of the new task and all base class prototypes, generating base class contribution weights by controlling sharpness through Softmax weighting and temperature coefficient, and linearly combining the samples of the base class according to the contribution weights to generate pseudo samples.

[0010] In one embodiment, initializing an orthogonal key vector and constructing an adaptive key-prompt retriever by minimizing the cosine similarity between the orthogonal key vector and the sample of the new task is achieved by the following steps: randomly generating a set of mutually orthogonal key vectors, and the number of which is consistent with the number of the new tasks, dynamically adjusting the parameters of the key vector by minimizing the cosine similarity between the key vector and the sample features of the new task, and constructing an adaptive key-prompt retriever.

[0011] In one embodiment, optimizing the adaptive key-prompt retriever by parameter freezing and minimizing the negative log-likelihood loss, and dynamically selecting the best-matching prompt is achieved by the following steps: when optimizing the adaptive key-prompt retriever, freezing the prompt parameters of the basic language model and the historical tasks, and only updating the key vector parameters of the current task; dynamically adjusting the key vector parameters by minimizing the negative log-likelihood loss between the prompt and the samples of the new task, and dynamically selecting the best-matching prompt based on the cosine similarity between the key vector and the samples of the new task.

[0012] In one embodiment, the method further includes the following steps: when the sample size of the new task is less than a set value, the pseudo sample is used as training data; when the sample size of the new task meets the set conditions, the sample of the new task and the pseudo sample are mixed in a 1:1 ratio as training data, and the generation degree parameter of the pseudo sample is automatically adjusted according to the number of real samples.

[0013] According to one aspect of the present invention, a continuous learning device for dynamic graphs includes: a graph data processing module for encoding the text features of the base class nodes of the dynamic graph into numerical vectors through a language model, obtaining the base class prototype and covariance matrix in combination with the structural features of the dynamic graph, and performing matrix shrinkage and standardization on the covariance matrix; the base class prototype is the category mean vector of each base class; a pseudo sample generation module for generating corresponding prompts according to the difficulty of the new task, and if the number of samples of the new task is less than a set value, performing a weighted summation on the base class prototype based on the cosine similarity between the prototype of the new task and the base class prototype Generate pseudo samples; the prototype represents the category mean vector; a retriever construction module is used to initialize the orthogonal key vector, construct an adaptive key-prompt retriever by minimizing the cosine similarity between the orthogonal key vector and the sample of the new task, optimize the adaptive key-prompt retriever by parameter freezing and minimizing the negative log-likelihood loss, and dynamically select the best matching prompt; a node classification module is used to encode the text attributes of the sample of the new task into a feature vector through BERT, and obtain the final feature vector in combination with the prompt, and determine the category of the new task by calculating the Mahalanobis distance between the feature vector and the covariance matrix.

[0014] According to one aspect of the present invention, an electronic device includes at least one processor and at least one memory, wherein the memory stores computer-readable instructions; the computer-readable instructions are executed by one or more of the processors, so that the electronic device implements the continuous learning method of dynamic graphs as described above.

[0015] According to one aspect of the present invention, a storage medium stores computer-readable instructions thereon, wherein the computer-readable instructions are executed by one or more processors to implement the continuous learning method of the dynamic graph as described above.

[0016] The beneficial effects brought about by the technical solution provided by the present invention are: In the above technical solution, the present invention first encodes the text features of base class nodes in a dynamic graph into numerical vectors using a language model. The base class prototype and covariance matrix are calculated based on the graph structure features, and matrix shrinkage and normalization are performed to cope with feature changes in dynamic graph scenarios. Furthermore, adaptive prompts are dynamically generated based on the difficulty of the new task. When the number of new task samples is extremely small, pseudo samples are generated using the cosine similarity between the new task and the base class prototype to supplement the training data. Simultaneously, an orthogonal key vector is initialized, and an adaptive key-prompt retriever is constructed by minimizing the cosine similarity between the key vector and the sample features. A parameter freezing strategy is used to optimize the retriever parameters and dynamically select the optimal prompt. Furthermore, the text attributes of the new task are encoded using the BERT model, and the final feature vector is obtained by combining the adaptive prompts. The node category is then determined based on a Mahalanobis distance classifier. When the number of new task samples is insufficient, only pseudo samples are used for training. When the sample size is sufficient, real samples and pseudo samples are mixed in a 1:1 ratio, and the pseudo sample generation rate is automatically adjusted. This effectively addresses the catastrophic forgetting problem in continuous learning of dynamic graphs, improves classification performance in low-sample scenarios, and enhances the adaptability and robustness of the model in dynamic environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. Those skilled in the art can also derive other drawings based on these drawings without inventive effort.

[0018] Figure 1 is a flow chart of a method for continuous learning of a dynamic graph according to an exemplary embodiment; Figure 2 is a block diagram of a device for continuous learning of a dynamic graph according to an exemplary embodiment; Figure 3 is a hardware structure diagram of an electronic device according to an exemplary embodiment; Figure 4 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0019] The following describes embodiments of the present invention in detail, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended only to explain the present invention and are not to be construed as limiting the present invention.

[0020] It will be understood by those skilled in the art that, unless expressly stated otherwise, the singular forms "a", "an", "said" and "the" used herein may also include the plural forms. It should be further understood that the term "comprising" used in the specification of the present disclosure refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, "connected" or "coupled" as used herein may include wireless connections or wireless couplings. The term "and / or" used herein includes all or any units and all combinations of one or more associated listed items.

[0021] The present invention provides a method for continuous learning of dynamic graphs. This method implements dynamic graph base class prototype modeling by fusing a language model with graph structure features. Combined with adaptive prompting and pseudo-sample generation technology, this method achieves continuous learning under dynamic graph continuous learning, solves the problem of catastrophic forgetting, and improves the classification performance of few-sample scenarios and the dynamic adaptability of the model. The method is suitable for use in a continuous learning device for dynamic graphs, which can be an electronic device. The method for continuous learning of dynamic graphs in embodiments of the present invention can be applied to a variety of scenarios, such as paper citation networks, social networks, transportation networks, and molecular chemistry.

[0022] See also Figure 1 , an embodiment of the present invention provides a continuous learning method for a dynamic graph, which is applicable to electronic devices.

[0023] In the following method embodiments, for ease of description, the execution subject of each step of the method is taken as an electronic device as an example for illustration, but this does not constitute a specific limitation.

[0024] like Figure 1 As shown, the method may include the following steps: Step 110: Encode the text features of the base class nodes of the dynamic graph into numerical vectors through the language model, obtain the base class prototype and covariance matrix in combination with the structural features of the dynamic graph, and perform matrix shrinkage and standardization on the covariance matrix.

[0025] In one possible implementation, a language model is used to encode the text description of the base class node in the dynamic graph to obtain a numerical vector, and a graph neural network model is combined with the structural characteristics of the dynamic graph to obtain the base class prototype and covariance matrix.

[0026] The numerical vector includes model parameters, adaptive hints and base class numbers, and the base class prototype refers to the category mean vector of each base class.

[0027] Specifically, a pre-trained language model (such as BERT) is used to encode the text descriptions of base class nodes in dynamic graphs. Through multiple layers of transformation, the language model converts text into semantically rich numerical vectors. These vectors not only capture the surface information of the text but also the implicit relationships between texts. This conversion of unstructured text data into a structured numerical representation facilitates subsequent graph neural network processing. This improves the representation capabilities of text features and provides a rich semantic foundation for the subsequent construction of base class prototypes.

[0028] Furthermore, based on the node representations output by the GNN, the mean vector (base class prototype) for each base class is calculated. This vector represents the central features of that class. Simultaneously, the covariance matrix between node features is calculated to capture inter-feature correlations. The covariance matrix reflects the changing relationships between different feature dimensions and is crucial for the subsequent Mahalanobis distance calculation. It provides fundamental statistics for subsequent continuous learning and classification tasks. The base class prototype and covariance matrix together constitute a comprehensive description of the base class features, providing a stable foundation for continuous learning on dynamic graphs.

[0029] Furthermore, a matrix contraction operation is performed on the covariance matrix to ensure its reversibility. In low-sample scenarios, the original covariance matrix may be irreversible due to insufficient samples. This contraction operation can make it reversible. The contracted covariance matrix is ​​normalized to eliminate the dimensionality effect of the Mahalanobis distances between different categories, making them comparable. This solves the problem of irreversibility of the covariance matrix in low-sample scenarios and ensures the comparability of distances between different categories, improving the stability and accuracy of the Mahalanobis distance classifier.

[0030] In the above process, the embodiment of the present invention constructs a stable and discriminative base class feature representation through steps such as text feature encoding, graph structure feature fusion, base class prototype and covariance matrix calculation, and matrix shrinkage and normalization, providing a solid foundation for subsequent continuous learning and classification tasks.

[0031] Step 120: Generate corresponding prompts according to the difficulty of the new task. If the number of samples of the new task is less than the set value, perform weighted summation of the base class prototypes based on the cosine similarity between the prototype of the new task and the base class prototype to generate pseudo samples.

[0032] Among them, the prototype represents the category mean vector.

[0033] In one possible implementation, if the number of samples of the new task is 0 or the average token length of the samples in the new task is not less than 200, the prompt length is set to 10, otherwise the prompt length is set to 6; a new prompt is generated for the new task according to the prompt length, and the prompt data is combined with the adaptive prompt of the base class to optimize the parameters of the new prompt.

[0034] In one possible implementation, the cosine similarity between the prototype of the new task and all base class prototypes is calculated, the base class contribution weight is generated by controlling the sharpness through Softmax weighting and temperature coefficient, and the base class samples are linearly combined according to the contribution weight to generate pseudo samples.

[0035] Among them, the prompt length is dynamically adjusted according to the task difficulty to save memory consumption and improve model adaptability, avoiding the resource waste or information shortage problems that may be caused by fixed-length prompts.

[0036] Specifically, a new prompt corresponding to the new task is generated and combined with the adaptive prompts of the base class to form a prompt dataset. The parameters of the new prompt are optimized by minimizing the negative log-likelihood loss between the new prompt and the new task samples. Generating prompts that are highly relevant to the new task improves the model's performance on the new task, enhancing the model's adaptability to new tasks and improving classification accuracy.

[0037] Specifically, when the number of new task samples is extremely small, the cosine similarity between the new task prototype and the base class prototype is calculated, and pseudo samples are generated through a weighted summation, where the weights are controlled by the Softmax function and the temperature coefficient to simulate the distribution of new task samples. This solves the problem of model overfitting in small-sample scenarios and improves the model's generalization ability. The introduction of pseudo samples effectively alleviates the problem of data scarcity and improves the model's classification performance in small-sample scenarios.

[0038] In the above process, the embodiment of the present invention effectively addresses the problems of insufficient sample size of new tasks and changes in task difficulty through steps such as adaptive prompt length setting, new prompt generation and parameter optimization, and pseudo sample generation, thereby improving the adaptability and classification performance of the model in small sample and dynamic environments.

[0039] Step 130: initialize the orthogonal key vector, construct an adaptive key prompt retriever by minimizing the cosine similarity between the orthogonal key vector and the samples of the new task, optimize the adaptive-prompt retriever by freezing parameters and minimizing the negative log-likelihood loss, and dynamically select the best matching prompt.

[0040] In one possible implementation, a set of mutually orthogonal key vectors are randomly generated, and the number of key vectors is consistent with the number of new tasks. The parameters of the key vectors are dynamically adjusted by minimizing the cosine similarity between the key vectors and the sample features of the new tasks to construct an adaptive key-prompt retriever.

[0041] In one possible implementation, when optimizing the adaptive key-prompt retriever, the prompt parameters of the base language model and historical tasks are frozen, and only the key vector parameters of the current task are updated; the key vector parameters are dynamically adjusted by minimizing the negative log-likelihood loss between the prompt and the samples of the new task, and the best matching prompt is dynamically selected based on the cosine similarity between the key vector and the samples of the new task.

[0042] Specifically, a set of orthogonal key vectors is randomly generated, matching the number of new tasks. Orthogonality ensures the independence of key vectors, helping to improve retrieval efficiency. This provides a base set of key vectors for subsequent key-hint retrieval, and the introduction of orthogonal key vectors improves retrieval accuracy and efficiency.

[0043] Furthermore, the key vector parameters are dynamically adjusted by minimizing the cosine similarity between the key vector and the features of the new task samples. In this process, the key vector gradually learns feature representations that are highly relevant to the new task. This allows the key vector to accurately reflect the feature distribution of the new task, improving retrieval accuracy. The dynamically adjusted key vector can better match the new task samples, enhancing the precision of the prompted retrieval.

[0044] Furthermore, when optimizing the adaptive key-prompt retriever, the base language model and the prompt parameters of previous tasks are frozen, and only the key vector parameters of the current task are updated. This avoids the computational overhead and performance fluctuations caused by global updates of model parameters, improving optimization efficiency. This parameter freezing strategy significantly reduces computational costs while ensuring rapid model adaptation to new tasks.

[0045] In the above process, the embodiment of the present invention constructs an efficient and accurate adaptive key-prompt retriever through steps such as orthogonal key vector initialization, dynamic adjustment of key vector parameters, and parameter freezing and optimization, realizes dynamic selection of the optimal prompt, and improves the model's adaptation speed and classification accuracy on new tasks.

[0046] In step 140 , the text attributes of the sample of the new task are encoded into a feature vector through BERT, and the final feature vector is obtained by combining the prompts. The category of the new task is determined by calculating the Mahalanobis distance between the feature vector and the covariance matrix.

[0047] In one possible implementation, when the sample size of the new task is less than a set value, the pseudo samples are used as training data, when the sample size of the new task meets the set condition, the pseudo samples are mixed with the new task samples in a 1:1 ratio as training data, and the generation degree parameter of the pseudo samples is automatically adjusted according to the number of real samples.

[0048] Specifically, the sample text attributes of the new task are encoded using the BERT model to obtain feature vectors rich in semantic information. Through the pre-training and fine-tuning process, BERT can capture complex semantic relationships in the text, convert the text attributes of the new task into numerical features, facilitate subsequent processing, and improve the representation quality of the text features and the input quality of the classification task.

[0049] Further, the feature vectors obtained by BERT encoding are combined with adaptive prompts to obtain the final feature vectors. In this process, the adaptive prompts provide highly relevant context information for the feature vectors, enhancing the discriminability of the feature vectors and improving classification accuracy. The combined feature vectors can better reflect the true class of the sample, which is helpful for subsequent classification tasks.

[0050] Further, the Mahalanobis distance between the final feature vector and the covariance matrix is calculated to determine the class of the new task. The Mahalanobis distance takes into account the correlation between features, which can more accurately measure the similarity between samples and classes. This realizes accurate classification of new task nodes. The Mahalanobis distance classifier has shown high accuracy and stability in dynamic graph continual learning tasks.

[0051] Specifically, when the sample size of the new task is insufficient, only pseudo samples are used to train the classifier; when the sample size is sufficient, real samples and pseudo samples are mixed in a 1:1 ratio for training. At the same time, the generation degree parameter of the pseudo samples is automatically adjusted according to the number of real samples. The training strategy is dynamically adjusted according to the sample size to improve the generalization ability and robustness of the classifier. The sample size adaptive adjustment strategy effectively addresses classification challenges in different sample size scenarios, improving the overall performance of the classifier.

[0052] In the above process, the BERT encoding, feature vector combination, Mahalanobis distance classification, and sample size adaptive adjustment steps implemented by the embodiments of the present application realize efficient and accurate classification of new task nodes. This method not only improves classification accuracy, but also significantly enhances the adaptability and robustness of the model in dynamic environments, providing an effective solution for continual learning of dynamic graph data.

[0053] Through the above process, the present invention uses BERT to encode text attributes and combines it with GNN to process graph structural features, constructing base class prototypes and covariance matrices. Adaptive prompts and a key-prompt retriever are introduced to dynamically select the optimal prompt. In low-sample scenarios, pseudo-sample supplementary data is generated, and efficient classification is achieved using the Mahalanobis distance. This solution addresses the problems of catastrophic forgetting and data scarcity in continuous learning of dynamic graph data, significantly improving the model's adaptability and classification accuracy in dynamic environments.

[0054] In one application scenario, a dynamic graph data set is used, where nodes represent papers and edges represent citation relationships between papers. As new papers are published, the graph structure and node categories (e.g., research fields) continue to expand. The continuous learning method proposed in this embodiment of the present invention is used to efficiently classify new papers in the citation network.

[0055] Specifically, the following steps may be included: Step 1: Data preparation and preprocessing.

[0056] Specifically, we first collected an initial set of papers from the Paper Citation Network from academic databases, including their text abstracts, titles, keywords, and citation relationships. This served as the initial dataset for building the basic classification model, ensuring the model had basic recognition capabilities for existing paper categories. This initial dataset, encompassing papers from multiple research fields, provided the data foundation for subsequent model training.

[0057] Furthermore, we cleaned the text abstract and title of each paper to remove HTML tags, special characters, and stop words. We then used a word segmentation tool (such as Jieba or NLTK) to segment the text. This improved the accuracy and efficiency of text encoding and reduced the interference of noisy data on model training. This resulted in clean text data for subsequent text encoding.

[0058] Furthermore, an initial graph structure is constructed based on the citation relationships between papers, where nodes represent papers and edges represent citation relationships. A graph database (such as Neo4j) or a network library (such as NetworkX) is used to store and manage the graph structure. This provides the underlying graph data for subsequent graph neural network processing, accurately reflecting the academic connections between papers. A dynamic graph structure reflecting the citation relationships between papers is constructed.

[0059] In the above process, the embodiment of the present invention constructs the initial data set and graph structure required for the basic classification model by collecting and preprocessing the initial data of the paper citation network, providing a high-quality data foundation for subsequent model training.

[0060] Step 2: Construction of base class prototype and covariance matrix.

[0061] Specifically, the text abstract and title of each paper are encoded using a pre-trained BERT model to obtain a numerical feature vector. The feature vectors output by BERT are averaged and pooled to obtain a fixed-length feature representation for each paper. The text data is converted into a numerical form that can be processed by the model, while retaining the semantic information of the text.

[0062] The numerical feature representation of each paper is obtained, which facilitates subsequent processing by the graph neural network.

[0063] Further, the graph neural network (GNN) model, such as GCN or GAT, is initialized. The GNN is trained using the initial graph structure and node features to obtain an enhanced feature representation for each paper. The node feature representation is improved by incorporating graph structure information, resulting in a node feature representation that includes graph structure information and enhances the discriminability of the features.

[0064] Further, based on the node representation output by the GNN, the class mean vector of each research field (base class) is calculated as the base class prototype. The base class prototype is stored for use in subsequent new class classification in continuous learning. The stable class center feature is provided for subsequent continuous learning, improving the model's adaptation speed to new classes. A stable feature representation of each research field is obtained, facilitating the rapid identification of new classes in subsequent continuous learning.

[0065] Further, the covariance matrix between node features is calculated to reflect the correlation between different features. The covariance matrix is shrunk, such as adding an identity matrix multiplied by a small shrinkage rate, to ensure its invertibility. This solves the problem of non-invertibility of the covariance matrix in the few-shot scenario, improving the stability of the Mahalanobis distance classifier. An invertible and stable covariance matrix is obtained, facilitating subsequent Mahalanobis distance calculation.

[0066] In the above process, the embodiments of the present application construct stable and discriminative base class feature representations through text encoding, graph neural network processing, base class prototype calculation, and covariance matrix construction and shrinkage, providing a solid foundation for subsequent continuous learning.

[0067] Step three: continuous learning and classification.

[0068] Specifically, when a new paper is published, it is added to the graph as a new node, and the possible research field categories are determined based on its text content. The continuous learning capability of the model is achieved, allowing the model to adapt to the changing academic environment. The model can dynamically receive new paper data for subsequent processing.

[0069] Furthermore, the prompt length is dynamically adjusted based on the sample size and average token length of the new paper. For new tasks with fewer samples or shorter token lengths, a shorter prompt length is set to conserve memory; conversely, a longer prompt length is set to fully capture the task characteristics. New prompts are generated for the new task and concatenated with the prompts from the previous task (if applicable). This improves the model's adaptability to new tasks and avoids the resource waste that can result from fixed-length prompts. The model can dynamically adjust prompt length based on the difficulty of different tasks, improving learning efficiency.

[0070] When the number of new task samples is extremely small (e.g., only one example), pseudo samples are generated to supplement the data. Based on the cosine similarity between the new class prototype and all base class prototypes, a scaling factor is calculated and pseudo samples are generated. Real samples and pseudo samples are mixed proportionally to form a mixed training set. This addresses overfitting in low-sample scenarios and improves the model's generalization ability. The model maintains good classification performance even in low-sample scenarios.

[0071] Furthermore, the Mahalanobis distance between the new paper's feature vector and its covariance matrix is ​​calculated to determine the research field category to which it belongs. Based on the Mahalanobis distance, the new paper is classified into the research field category that is closest to it. This achieves efficient and accurate node classification without the need for sample storage or model updates. Classification accuracy is significantly improved, while also achieving high computational efficiency.

[0072] In the above process, the embodiment of the present invention realizes efficient continuous learning and accurate classification of the model in a dynamic academic environment through adaptive prompt generation, pseudo sample supplementation and Mahalanobis distance classification when new papers arrive, significantly improving the adaptability and classification performance of the model.

[0073] In another application scenario, a social network is used as a dynamic graph data scenario, where nodes represent users and edges represent relationships between users (such as friendships). As new users join and social relationships constantly change, the graph structure and node categories (such as interest groups) continue to expand. The dynamic graph continuous learning method proposed in this embodiment of the present invention can be applied to efficiently classify new users in the social network.

[0074] Specifically, we first collected initial user data from social media platforms, including user profiles (such as age, gender, and occupation), posted content, and friendships. This data set was used to build the basic classification model, ensuring the model had basic recognition capabilities for existing user categories. We also obtained an initial dataset containing users from multiple interest groups, providing a data foundation for subsequent model training.

[0075] Furthermore, we clean the user posts to remove HTML tags, special characters, and stop words. We use a word segmentation tool to segment the posts and obtain word sequences. This improves the accuracy and efficiency of text encoding and reduces the interference of noisy data on model training. This results in clean text data, which facilitates subsequent text encoding.

[0076] Furthermore, an initial social network graph structure is constructed based on the friendship relationships between users, where nodes represent users and edges represent friendship relationships. A graph database or network library is used to store and manage the graph structure. This provides the underlying graph data for subsequent graph neural network processing, accurately reflecting the social connections between users. A dynamic graph structure reflecting the friendship relationships between users is constructed.

[0077] In the above process, the embodiment of the present invention constructs the initial data set and graph structure required for the basic classification model by collecting and preprocessing the initial data of the social network, thereby providing a high-quality data foundation for subsequent model training.

[0078] Furthermore, a pre-trained language model (such as BERT or RoBERTa) is used to encode the content of user posts, generating a numerical feature vector. The feature vectors output by the language model are average-pooled to obtain a fixed-length feature representation for each post. This converts the text data into a numerical form that the model can process, preserving the semantic information of the text. The resulting numerical feature representation of each post facilitates subsequent graph neural network processing.

[0079] Furthermore, we concatenate user profile features (such as age, gender, and occupation, which are one-hot encoded) with post content features to form a comprehensive feature representation of the user. This combination of multiple user feature information improves the comprehensiveness of the user feature representation, resulting in a comprehensive feature representation that encompasses both the user's profile and social behavior information.

[0080] Furthermore, a graph neural network (GNN) model is initialized, such as one using the GraphSAGE or GIN (Graph Isomorphism Network) architecture. These models excel at processing large-scale graph data and capturing complex inter-node relationships. A comprehensive feature representation of each user is used as the initial node features and fed into the GNN model. Through multi-layer graph convolution or message passing, the model incorporates graph structural information to update the feature representation of each node, incorporating information about neighboring nodes and enhancing feature discriminability. Leveraging this graph structural information improves the richness and accuracy of user feature representations, providing a solid foundation for subsequent classification. After GNN processing, each user node acquires a high-dimensional feature vector that integrates its own attributes and social relationships.

[0081] Furthermore, based on the node representations output by the GNN, a category mean vector is calculated for each known interest group (base class) as the prototype of that class. Simultaneously, the covariance matrix between all node features is calculated to capture inter-feature correlations. The covariance matrix is ​​regularized, for example, by adding an identity matrix and multiplying it by a small regularization coefficient to ensure its reversibility and numerical stability. This provides stable category centers and feature distribution information for subsequent continuous learning, enhancing the model's adaptability to new categories. This results in a stable prototype and reversible covariance matrix for each interest group, paving the way for subsequent classification and continuous learning.

[0082] Furthermore, after the base class features are constructed, an adaptive key-hint retriever is introduced. This retriever mainly consists of a key generation module and a hint generation module. For each base class prototype, a learnable neural network (such as a multi-layer perceptron (MLP)) is used to map it to a low-dimensional key space and generate a corresponding key vector. The parameters of this neural network are continuously optimized during the training process so that the generated key vector can better represent the characteristics of the base class. For example, for the prototype vector of interest group A, the key vector is obtained through the key generation neural network. Mapping the high-dimensional base class prototype to a low-dimensional key space reduces computational complexity while retaining the key feature information of the base class, facilitating subsequent rapid retrieval and matching. The generated key vector can concisely and effectively represent the base class, providing an efficient index for hint retrieval.

[0083] A learnable neural network is used to generate corresponding hint vectors based on the base class prototypes. Hint vectors are designed to provide the model with additional information about the base class in subsequent classification tasks, helping it better understand and distinguish between different categories. For example, using interest group A, a hint vector was generated using a hint generation neural network.

[0084] Generate hint information related to the base class, enhance the model's understanding and expression of the base class characteristics, and improve classification performance. Hint vectors can provide valuable prior knowledge to the model, making the model more accurate and robust during classification.

[0085] Furthermore, when a new user registers and joins the social network, their profile and initial posts are collected. The new user is added to the graph as a new node and connected to existing nodes based on their friendships. This allows the model to dynamically scale, adapting to the ever-changing structure of the social network. The model can receive new user data in real time, providing the latest information for subsequent classification.

[0086] Furthermore, for new users, the same feature extraction method (such as GNN processing) as used for base class feature construction is first used to obtain their feature vector. This feature vector is then fed into the similarity neural network (with shared parameters) of the key generation module to obtain the corresponding key vector for the new user. The similarity between this key vector and the key vectors of each base class is calculated, using common similarity metrics such as cosine similarity. This allows the base class most similar to the new user's features to be quickly located, narrowing the classification scope and improving classification efficiency. Accurately identifying base classes with similar characteristics to the new user provides strong support for subsequent hint-based classification.

[0087] Furthermore, based on the key matching results, we select the prompt vectors corresponding to the base classes with the highest similarity. We then design an adaptive prompt fusion mechanism to weight the selected prompt vectors based on similarity. This fused prompt vector is then concatenated or otherwise fused with the new user's feature vector to produce an enhanced feature representation. This generates adaptive prompt information tailored to the new user and effectively integrates it with the new user's features, improving the model's ability to represent the new user's characteristics. This enhanced feature representation better reflects the relationship between the new user and the base classes, providing richer information for subsequent classification.

[0088] Furthermore, when the sample size of the interest group to which a new user belongs is extremely small (e.g., in the cold start problem), data augmentation techniques are used to generate pseudo samples. Based on the new user's features and base class prototypes, realistic pseudo samples are generated through methods such as random perturbation, feature interpolation, or generative adversarial networks (GANs). The pseudo sample generation process is guided by information provided by an adaptive key-hint retriever. For example, based on the key matching results between the new user and the base class and the adaptive hints, the feature distribution of the generated pseudo samples is adjusted to better match the characteristic pattern of the target base class. Real samples are mixed with pseudo samples to form an expanded training set, which is used to fine-tune the model or update classifier parameters.

[0089] This solves the overfitting problem in low-sample scenarios, improves the model's generalization ability, and leverages information from the adaptive key-hint retriever to generate more reasonable pseudo samples. By supplementing the model with pseudo samples, the model can maintain high classification accuracy even in low-sample scenarios, and the generated pseudo samples are more targeted and reasonable.

[0090] Finally, the Mahalanobis distance between the enhanced feature vector of the new user and the prototype of each base class is calculated, taking into account the correlation between features and improving the robustness of classification. The new user is classified into the interest group with the closest distance, completing the initial classification.

[0091] Furthermore, based on the classification results and feedback from new users, the base class prototypes, covariance matrix, and parameters of the adaptive key-prompt retriever are regularly updated. For example, the base class prototypes and covariance matrix are recalculated using new classification samples, while the neural network parameters of the key generation module and prompt generation module are updated using the backpropagation algorithm. This achieves efficient and accurate node classification while maintaining the model's continuous learning capability, enabling the adaptive key-prompt retriever to continuously adapt to the dynamic changes of social networks. The result is an adaptive key-prompt retriever with high classification accuracy that can continuously optimize itself as social networks evolve.

[0092] Through the above process, the embodiments of the present invention effectively address the continuous learning problem in dynamic graph data scenarios by constructing base class features and implementing continuous learning and classification. Specifically, the present invention first utilizes graph neural networks combined with users' multimodal features (personal information and social behavior) to construct rich node representations. Next, the base class prototypes and covariance matrices are calculated to provide a stable reference for subsequent classification. When new users join, adaptive prompts and pseudo-sample generation techniques are used to enhance the model's adaptability and generalization performance. Finally, the Mahalanobis distance is used for efficient classification, and model parameters are updated as needed to achieve continuous learning. This framework is applicable not only to social networks but also to other dynamic graph data scenarios.

[0093] In an exemplary embodiment, to verify the effectiveness of the present invention, detailed experiments were conducted on three graph datasets with text attributes: arxiv-2023, ogbn-products (subset), and ogbn-arxiv. The main purpose of the experiments was to evaluate the performance of the present invention in handling continuous learning problems based on text attribute graphs, specifically its adaptability and classification accuracy when new categories are added and the data is dynamically changing.

[0094] Experimental setup: The dataset includes arxiv-2023: containing 46,198 nodes and 78,548 edges, divided into 40 categories; ogbn-products (subset): containing 54,025 nodes and 74,420 edges, divided into 47 categories; ogbn-arxiv: containing 169,343 nodes and 1,166,243 edges, divided into 40 categories, a large citation graph dataset.

[0095] For each dataset, its categories are divided into base categories and novel categories. The base categories are used to pre-train the GNN model, and the novel categories are used for incremental learning. A 3-way 5-shot experimental setup is adopted, meaning that each incremental session contains 3 novel categories, with 5 samples per category. The language model uses bert-base-uncased as the base language model, and its parameters remain frozen during the experiment. A GCN is used as the backbone of the graph neural network. Adaptive prompt training is performed for 20 epochs. Adaptive key-prompt retriever training: 5 epochs are set for training the adaptive key-prompt retriever.

[0096] Specifically, six SOTA (State-of-the-Art) models are selected as benchmarks, including Finetune, EWC, Naive Replay, IDBR, Shared Prompt, Per-session Prompt, and ProgPrompt, to comprehensively evaluate the embodiments of the present invention.

[0097] Experiments were conducted over seven incremental sessions on each dataset, consisting of one base phase and six incremental phases. The classification accuracy for each session and the average accuracy (AA) across all sessions were reported. The impact of support set size (i.e., the number of samples per new class) on model performance was analyzed on the ogbn-arxiv and arxiv-2023 datasets. Particular attention was paid to model performance with very small samples (e.g., one-shot or two-shot training), and pseudo-sample generation was employed to address the non-invertibility of the covariance matrix.

[0098] Furthermore, ablation experiments were conducted on the OGBN-arxiv and OGBN-products (subset) datasets to verify the effectiveness of the adaptive hint and adaptive key-hint retriever. The model performance was tested using only shallow features, adding adaptive hints, and adding both the adaptive hint and the adaptive key-hint retriever.

[0099] Ultimately, across all datasets, the embodiments of the present invention outperformed all methods that did not rely on data replay, demonstrating their effectiveness in enhancing text attribute graph representation learning and continuous learning. Among the methods that relied on data replay, the embodiments of the present invention also outperformed some baseline methods on the arxiv-2023 and ogbn-arxiv datasets, further highlighting their performance advantages. Even in the case of extremely small samples, by generating pseudo samples, the embodiments of the present invention were able to maintain good performance, which is attributed to the effectiveness of the pseudo samples and the robustness of the model.

[0100] Furthermore, the use of shallow features combined with a graph-incremental classifier performed poorly, failing to meet expectations. However, the introduction of adaptive hints significantly improved the performance of the embodiment of the present invention, particularly on the ogbn-products (subset) dataset. Furthermore, the addition of an adaptive key-hint retriever achieved optimal performance, demonstrating that the retriever can accurately retrieve appropriate adaptive hints, positively impacting model guidance.

[0101] The above experiments demonstrate the effectiveness and advantages of the embodiments of the present invention in handling continuous learning problems based on text attribute graphs. They not only maintain stable classification performance in an environment with dynamically changing data, but also effectively mitigate the problem of catastrophic forgetting.

[0102] The following is an embodiment of the device of the present invention, which can be used to perform the method for continuous learning of dynamic graphs involved in the present invention. For details not disclosed in the embodiment of the device of the present invention, please refer to the method embodiment of the method for continuous learning of dynamic graphs involved in the present invention.

[0103] See also Figure 2 , an embodiment of the present invention provides a continuous learning device 800 for a dynamic graph.

[0104] The dynamic graph continuous learning device 800 includes but is not limited to: a graph data processing module 810 , a pseudo sample generation module 830 , a retriever construction module 850 and a node classification module 870 .

[0105] Among them, the graph data processing module 810 is used to encode the text features of the dynamic graph base class nodes into numerical vectors through the language model, combine the structural features of the dynamic graph to obtain the base class prototype and covariance matrix, and perform matrix shrinkage and standardization on the covariance matrix; the base class prototype is the category mean vector of each base class.

[0106] The pseudo sample generation module 830 is used to generate corresponding prompts according to the difficulty of the new task. If the number of samples of the new task is less than the set value, the pseudo sample is generated by weighted summing the base class prototypes based on the cosine similarity between the prototype of the new task and the base class prototype.

[0107] The retriever construction module 850 is used to initialize the orthogonal key vector, construct an adaptive key-prompt retriever by minimizing the cosine similarity between the orthogonal key vector and the samples of the new task, optimize the adaptive key-prompt retriever by parameter freezing and minimizing the negative log-likelihood loss, and dynamically select the best matching prompt.

[0108] The node classification module 870 is used to encode the text attributes of the sample of the new task into a feature vector through BERT, and obtain the final feature vector by combining the prompts, and determine the category of the new task by calculating the Mahalanobis distance between the feature vector and the covariance matrix.

[0109] It should be noted that, in the above-mentioned embodiment, the continuous learning of the dynamic graph is only illustrated by the division of the above-mentioned functional modules. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the continuous learning device of the dynamic graph will be divided into different functional modules to complete all or part of the functions described above.

[0110] In addition, the continuous learning device for dynamic graphs and the continuous learning method for dynamic graphs provided in the above embodiments belong to the same concept, and the specific manner in which each module performs operations has been described in detail in the method embodiments and will not be repeated here.

[0111] Figure 3 The following is a schematic diagram of the structure of an electronic device according to an exemplary embodiment.

[0112] It should be noted that the electronic device is only an example adapted to the present invention and cannot be considered to provide any limitation on the scope of use of the present invention. The electronic device cannot be interpreted as needing to rely on or must have Figure 3 One or more components of exemplary electronic device 2000 are shown.

[0113] The hardware structure of the electronic device 2000 may vary greatly due to different configurations or performances, such as Figure 3 As shown, the electronic device 2000 includes a power supply 210 , an interface 230 , at least one memory 250 , and at least one central processing unit (CPU) 270 .

[0114] Specifically, the power supply 210 is used to provide operating voltage for various hardware devices on the electronic device 2000 .

[0115] The interface 230 includes at least one wired or wireless network interface 231 for interacting with external devices. Of course, in other examples adapted by the present invention, the interface 230 may further include at least one serial-to-parallel conversion interface 233, at least one input / output interface 235, and at least one USB interface 237, etc. Figure 3 As shown, this does not constitute a specific limitation.

[0116] The memory 250 serves as a carrier for resource storage and can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon include an operating system 251, application 253 and data 255, etc. The storage method can be temporary storage or permanent storage.

[0117] The operating system 251 is used to manage and control each hardware device and the application 253 on the electronic device 2000, so as to realize the operation and processing of the central processing unit 270 on the massive data 255 in the memory 250. The operating system 251 can be Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0118] The application 253 is computer readable instructions for completing at least one specific work based on the operating system 251. The application 253 can include at least one module (not shown), and each module can respectively contain computer readable instructions of the electronic device 2000. For example, the dynamic graph continuous learning device can be regarded as an application 253 deployed on the electronic device 2000. Figure 3

[0119] The data 255 can be signal information, etc., and is stored in the memory 250.

[0120] The central processing unit 270 can include one or more processors, and is configured to communicate with the memory 250 through at least one communication bus, so as to read the computer readable instructions stored in the memory 250, and then realize the operation and processing of the massive data 255 in the memory 250. For example, the dynamic graph continuous learning method is completed in the form of reading a series of computer readable instructions stored in the memory 250 by the central processing unit 270.

[0121] In addition, the present application can also be realized by hardware circuit or hardware circuit combined with software, and therefore, the realization of the present application is not limited to any specific hardware circuit, software and combination of the two.

[0122] Please refer to Figure 4 In the embodiments of the present application, an electronic device 4000 is provided, which can include a desktop computer, a notebook computer, a server, etc. with sensor identification capability.

[0123] In Figure 4 , the electronic device 4000 includes at least one processor 4001 and at least one memory 4003.

[0124] ​The data exchange between the processor 4001 and the memory 4003 can be achieved through at least one communication bus 4002. The communication bus 4002 may include a path for transmitting data between the processor 4001 and the memory 4003. The communication bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The communication bus 4002 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0125] Optionally, the electronic device 4000 may further include a transceiver 4004, which may be used for data exchange between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the number of transceivers 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present invention.

[0126] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic device, transistor logic device, hardware component, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the present disclosure. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0127] The memory 4003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program instructions or codes in the form of instructions or data structures and can be accessed by the electronic device 4000, but is not limited to these.

[0128] Computer-readable instructions are stored in the memory 4003 , and the processor 4001 can read the computer-readable instructions stored in the memory 4003 through the communication bus 4002 .

[0129] The computer-readable instructions are executed by one or more processors 4001 to implement the continuous learning method of the dynamic graph in the above embodiments.

[0130] In addition, an embodiment of the present invention provides a storage medium having computer-readable instructions stored thereon, and the computer-readable instructions are executed by one or more processors to implement the continuous learning method of the dynamic graph as described above.

[0131] A computer program product is provided in an embodiment of the present invention. The computer program product includes computer-readable instructions, which are stored in a storage medium. One or more processors of an electronic device read the computer-readable instructions from the storage medium, load and execute the computer-readable instructions, so that the electronic device implements the continuous learning method of the dynamic graph as described above.

[0132] Compared with the related art, the present invention has the following beneficial effects: 1. This invention significantly improves the continuous learning capabilities of text attribute graphs. By introducing an adaptive prompt mechanism that dynamically adjusts prompt length based on the difficulty of each conversational task, it not only saves memory but also enhances the adaptability and stability of the model during continuous learning. Specifically, adaptive prompts are independent of task IDs, broadening the application scenarios and enabling the model to maintain efficient learning even without explicit task identifiers.

[0133] 2. This invention has the ability to efficiently retrieve and match adaptive cues. By designing an adaptive key-cue retriever, which is constructed by minimizing the cosine similarity between the key vector and the target task sample, it can dynamically select the cue most relevant to the current input during testing. This design enhances the model's continuous learning ability and ensures accuracy and efficiency when switching between different tasks.

[0134] 3. This invention effectively mitigates the catastrophic forgetting problem in continuous learning of graph data. By modeling feature covariance relationships and utilizing Mahalanobis distance for efficient node classification, this method preserves the model's memory of past knowledge while effectively learning new knowledge, without requiring sample storage or model updates. This strategy is particularly well-suited for scenarios where graph data is dynamically changing, such as social networks and transportation networks.

[0135] 4. This invention improves the model performance in the few-sample learning scenario; in response to the problem of unreliable empirical risk minimization in few-sample learning, by constructing pseudo samples and using the semantic similarity of base class data to optimize the classification of new categories, this method can still maintain good classification performance in the case of extremely small samples.

[0136] 5. This invention reduces computational and storage overhead during continuous learning. By designing an efficient incremental learning strategy, the model can be efficiently updated on ever-changing graph data without having to retrain the entire network from scratch. This significantly reduces both computational overhead and memory consumption, enhancing the model's practical application value.

[0137] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the flowcharts of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0138] The above descriptions are only partial embodiments of the present invention. It should be pointed out that ordinary technicians in this technical field can make several improvements and modifications without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.

Claims

1. A continuous learning method for dynamic graphs, characterized in that: The method comprises: The text features of the base class nodes of the dynamic graph are encoded into numerical vectors through a language model, and the base class prototype and covariance matrix are obtained by combining the structural features of the dynamic graph. The covariance matrix is ​​then subjected to matrix shrinkage and normalization; the base class prototype is the category mean vector of each base class; Generate a corresponding prompt based on the difficulty of the new task. If the number of samples of the new task is less than a set value, generate a pseudo sample by weighted summing the base class prototypes based on the cosine similarity between the prototype of the new task and the prototype of the base class; the prototype represents the class mean vector; Initializing an orthogonal key vector, constructing an adaptive key-cue retriever by minimizing the cosine similarity between the orthogonal key vector and samples of the new task, optimizing the adaptive key-cue retriever by freezing parameters and minimizing negative log-likelihood loss, and dynamically selecting the best matching cue; The text attributes of the sample of the new task are encoded into a feature vector through BERT, and the final feature vector is obtained by combining the prompt, and the category of the new task is determined by calculating the Mahalanobis distance between the feature vector and the covariance matrix.

2. The continuous learning method of dynamic graph according to claim 1, characterized in that: The text features of the dynamic graph base class nodes are encoded into numerical vectors through the language model, and the base class prototype and covariance matrix are obtained by combining the structural features of the dynamic graph, including: A language model is used to encode the text description of the base class node in the dynamic graph to obtain a numerical vector, and a graph neural network model is combined with the structural characteristics of the dynamic graph to obtain the base class prototype and covariance matrix; the numerical vector includes model parameters, adaptive prompts and base class numbers.

3. The continuous learning method of dynamic graph according to claim 1, characterized in that: Generating corresponding prompts according to the difficulty of the new task includes: If the number of samples in the new task is 0 or the average token length of the samples in the new task is not less than 200, the prompt length is set to 10; otherwise, the prompt length is set to 6; A new prompt is generated for the new task according to the prompt length, and the parameters of the new prompt are optimized by combining the adaptive prompt of the base class to form prompt data.

4. The method for continuous learning of dynamic graphs according to claim 1, wherein: The step of generating a pseudo sample by weighted summing the base class prototype based on the cosine similarity between the prototype of the new task and the base class prototype includes: The cosine similarity between the prototype of the new task and all base class prototypes is calculated, the base class contribution weight is generated by controlling the sharpness through Softmax weighting and temperature coefficient, and the samples of the base class are linearly combined according to the contribution weight to generate pseudo samples.

5. The method for continuous learning of dynamic graphs according to claim 1, wherein: The initializing orthogonal key vector and constructing an adaptive key-prompt retriever by minimizing the cosine similarity between the orthogonal key vector and the sample of the new task include: A set of mutually orthogonal key vectors is randomly generated, and the number of key vectors is consistent with the number of new tasks. The parameters of the key vectors are dynamically adjusted by minimizing the cosine similarity between the key vectors and the sample features of the new tasks to construct an adaptive key-prompt retriever.

6. The method for continuous learning of dynamic graphs according to claim 1, wherein: The adaptive key-cue retriever is optimized by parameter freezing and minimizing the negative log-likelihood loss, and the best matching cue is dynamically selected, including: When optimizing the adaptive key-prompt retriever, freeze the prompt parameters of the base language model and historical tasks, and only update the key vector parameters of the current task; The key vector parameters are dynamically adjusted by minimizing the negative log-likelihood loss between the prompt and the samples of the new task, and the best matching prompt is dynamically selected based on the cosine similarity between the key vector and the samples of the new task.

7. The method for continuous learning of dynamic graphs according to claim 1, wherein: The method further comprises: When the sample size of the new task is less than the set value, the pseudo sample is used as training data. When the sample size of the new task meets the set conditions, the sample of the new task and the pseudo sample are mixed in a 1:1 ratio as training data, and the generation degree parameter of the pseudo sample is automatically adjusted according to the number of real samples.

8. A continuous learning device for dynamic graphs, characterized in that: The device comprises: A graph data processing module is used to encode the text features of the dynamic graph base class nodes into numerical vectors through a language model, obtain the base class prototype and covariance matrix based on the structural features of the dynamic graph, and perform matrix shrinkage and normalization on the covariance matrix; the base class prototype is the category mean vector of each base class; A pseudo-sample generation module is configured to generate corresponding prompts based on the difficulty of the new task. If the number of samples of the new task is less than a set value, a pseudo-sample is generated by weighted summing the base class prototypes based on the cosine similarity between the prototype of the new task and the base class prototype; the prototype represents the class mean vector; A retriever construction module is used to initialize an orthogonal key vector, construct an adaptive key-prompt retriever by minimizing the cosine similarity between the orthogonal key vector and samples of the new task, optimize the adaptive key-prompt retriever by parameter freezing and minimizing the negative log-likelihood loss, and dynamically select the best matching prompt; A node classification module is used to encode the text attributes of the sample of the new task into a feature vector through BERT, and obtain a final feature vector by combining the prompt, and determine the category of the new task by calculating the Mahalanobis distance between the feature vector and the covariance matrix.

9. An electronic device, characterized in that: include: at least one processor and at least one memory, wherein: The memory has computer-readable instructions stored thereon; The computer-readable instructions are executed by one or more processors to enable the electronic device to implement the continuous learning method for a dynamic graph according to any one of claims 1 to 7.

10. A storage medium having computer-readable instructions stored thereon, characterized in that: The computer-readable instructions are executed by one or more processors to implement the continuous learning method of a dynamic graph according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Intelligent equipment near field sensing method and device, computer equipment and storage medium

    CN113015148A

  • Intelligent real-time emotion evaluation method for social media and online text data based on multi-modal knowledge graph

    CN119202270A

  • Micro-video popularity prediction method based on graph prompt enhancement

    CN120472365A

  • Machine operation assistance using language model-augmented operator monitoring

    US20250136134A1