A dynamic graph continuous learning method and device, 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 techniques, the problem of continuous learning for dynamic graph data is solved, achieving efficient classification and adaptive enhancement.

CN120782012BActive Publication Date: 2025-12-09SHENZHEN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing technologies struggle to adapt to the evolution of dynamic graph data, easily falling into a stability-plasticity dilemma that leads to catastrophic forgetting, and are unable to effectively address the continuous learning problem of text attribute graphs.

Method used

The text features of the base class nodes in the dynamic graph are encoded into numerical vectors using a language model. The base class prototypes and covariance matrices are generated by combining graph structure features, and matrix shrinking and standardization are performed. When there are insufficient samples for new tasks, pseudo-samples are generated and the optimal prompt is dynamically selected by an adaptive key-hint retrieval system. The text attributes of the new task are encoded using BERT and classified by combining Mahalanobis distance.

Benefits of technology

It effectively alleviates the catastrophic forgetting problem in dynamic graph continuous learning, and improves classification performance in few-shot scenarios and the model's adaptability and robustness in dynamic environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120782012B_ABST
    Figure CN120782012B_ABST
Patent Text Reader

Abstract

Embodiments of the application disclose a dynamic graph continuous learning method and device, electronic equipment and storage medium, relating to the technical field of graph learning and continuous learning, wherein the method comprises: encoding the text features of the base class nodes of the dynamic graph into numerical vectors through a language model, combining the structural features to obtain the base class prototype and the covariance matrix, generating the corresponding prompt according to the difficulty of the new task, and if the new samples are few, generating pseudo samples based on the cosine similarity between the new prototype and the base class prototype; initializing the orthogonal key vector, constructing an adaptive key-prompt retriever by minimizing the cosine similarity between the orthogonal key vector and the new samples and optimizing, and dynamically selecting the most matching prompt; encoding the text attributes of the new samples into feature vectors through BERT in combination with the prompt, and determining the category by calculating the Mahalanobis distance between the feature vectors and the covariance matrix. The application solves the problems that the prior art is difficult to adapt to the evolution of dynamic graph data, is prone to catastrophic forgetting, and is prone to overfitting in the few-sample scenario.
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:

[0007] According to one aspect of the present application, a dynamic graph continuous learning method, the method comprising: encoding the text features of the dynamic graph base class nodes into numerical vectors by a language model, obtaining base class prototypes and covariance matrices in combination with the structural features of the dynamic graph, and performing matrix shrinkage and standardization on the covariance matrices; the base class prototype is a class mean vector of each base class; generating corresponding prompts according to the difficulty of a new task, if the number of samples of the new task is less than a set value, performing weighted summation on the base class prototypes based on the cosine similarity between the prototypes of the new task and the base class prototypes to generate pseudo samples; the prototype represents a class 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 samples of the new task, optimizing the adaptive key-prompt retriever through parameter freezing and minimizing the negative log-likelihood loss, and dynamically selecting the most matching prompt; encoding the text attributes of the samples of the new task into feature vectors by BERT, and obtaining the final feature vectors in combination with the prompts, and determining the class of the new task by calculating the Mahalanobis distance between the feature vectors and the covariance matrices.

[0008] In one embodiment, encoding the text features of the dynamic graph base class nodes into numerical vectors by a language model, obtaining base class prototypes and covariance matrices in combination with the structural features of the dynamic graph is achieved by the following steps: using a language model to encode the text description of the base class nodes in the dynamic graph to obtain numerical vectors, and obtaining base class prototypes and covariance matrices in combination with the structural features of the dynamic graph by a graph neural network model; the numerical vectors include model parameters, adaptive prompts, and base class numbers.

[0009] In one embodiment, generating corresponding prompts according to the difficulty of a 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, setting the prompt length to 10, otherwise setting the prompt length to 6; generating new prompts for the new task according to the prompt length, combining the adaptive prompts of the base classes to form prompt data, and optimizing the parameters of the new prompts.

[0010] In one embodiment, generating pseudo samples by weighted summation of the base class prototypes based on the cosine similarity between the prototypes 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 Softmax weighted sum and temperature coefficient control sharpness, linearly combining the samples of the base classes according to the contribution weights to generate pseudo samples.

[0011] In one of the embodiments, the initialization of the orthogonal key vector, and the construction of the adaptive key-prompt retriever by minimizing the cosine similarity between the orthogonal key vector and the sample of the new task are achieved by the following steps: a set of mutually orthogonal key vectors are randomly generated, and the number is consistent with the number of the new task, the parameters of the key vector are dynamically adjusted by minimizing the cosine similarity between the key vector and the sample feature of the new task, and the adaptive key-prompt retriever is constructed.

[0012] In one of the embodiments, the adaptive key-prompt retriever is optimized by parameter freezing and minimizing the negative log-likelihood loss, and the most matching prompt is dynamically selected by the following steps: when optimizing the adaptive key-prompt retriever, the prompt parameters of the base language model and the 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 of the prompt and the sample of the new task, and the most matching prompt is dynamically selected based on the cosine similarity between the key vector and the sample of the new task.

[0013] In one of the embodiments, the method further comprises the following steps: when the sample quantity of the new task is less than a set value, the pseudo sample is used as the training data, when the sample quantity of the new task meets the set condition, the pseudo sample and the sample of the new task are mixed in a 1:1 ratio as the training data, and the generation degree parameter of the pseudo sample is automatically adjusted according to the true sample quantity.

[0014] According to one aspect of the present application, a dynamic graph continuous learning device, the device comprises: a graph data processing module for encoding the text features of the dynamic graph base class nodes into numerical vectors through a language model, obtaining a base class prototype and a covariance matrix in combination with the structural features of the dynamic graph, and performing matrix contraction and standardization on the covariance matrix; the base class prototype is a class mean vector of each base class; a pseudo sample generation module for generating corresponding prompts according to the difficulty of a new task, if the sample number of the new task is less than a set value, the base class prototypes are weighted and summed to generate pseudo samples based on the cosine similarity between the prototypes of the new task and the base class prototypes; the prototype represents a class mean vector; a retriever construction module for initializing orthogonal key vectors, constructing an adaptive key-prompt retriever by minimizing the cosine similarity between the orthogonal key vectors and the samples of the new task, optimizing the adaptive key-prompt retriever by parameter freezing and minimizing the negative log-likelihood loss, and dynamically selecting the most matching prompt; a node classification module for encoding the text attributes of the samples of the new task into feature vectors through BERT, combining the prompts to obtain the final feature vectors, and determining the class of the new task by calculating the Mahalanobis distance between the feature vectors and the covariance matrix.

[0015] According to an aspect of the present application, an electronic device comprises 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, so that the electronic device implements the dynamic graph continuous learning method as described above.

[0016] According to an aspect of the present application, a storage medium has computer readable instructions stored thereon, which are executed by one or more processors to implement the dynamic graph continuous learning method as described above.

[0017] The technical solution provided by the present application has the following beneficial effects:

[0018] In the above technical solution, the present application first encodes the text features of the base class nodes in the dynamic graph into numerical vectors through the language model, and calculates the base class prototype and the covariance matrix in combination with the graph structure features, and performs matrix contraction and standardization processing on it to cope with the feature changes in the dynamic graph scenario. On this basis, adaptive prompts are dynamically generated for new tasks. When the sample size of the new task 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; at the same time, the orthogonal key vector is initialized, and the adaptive key-prompt retriever is constructed by minimizing the cosine similarity between the key vector and the sample features, and the parameter freezing strategy is used to optimize the retriever parameters to dynamically select the optimal prompt. Further, the BERT model is used to encode the text attributes of the new task, and the adaptive prompts are used to obtain the final feature vector, and the Mahalanobis distance classifier is used to determine the node category. When the sample size of the new task 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 generation degree of pseudo samples is automatically adjusted. Thus, the catastrophic forgetting problem in dynamic graph continuous learning is effectively solved, the classification performance in the few-sample scenario is improved, and the adaptability and robustness of the model in the dynamic environment are enhanced. BRIEF DESCRIPTION OF DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the description of the embodiments of the present application will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.

[0020] Figure 1 is a flow chart of a dynamic graph continuous learning method according to an exemplary embodiment;

[0021] Figure 2 is a block diagram of a dynamic graph continuous learning device according to an exemplary embodiment;

[0022] Figure 3is a hardware structure diagram of an electronic device according to an exemplary embodiment;

[0023] Figure 4 is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0024] Embodiments of the present application are described in detail below with reference to examples illustrated in the accompanying drawings, in which the same or similar components are denoted by the same or similar reference numerals throughout. The embodiments described below by reference to the accompanying drawings are exemplary and are for the purpose of explanation only, and are not to be construed as limiting the present application.

[0025] Those skilled in the art can understand that, unless specifically stated otherwise, the singular forms "a," "an," and "the" as used herein include plural referents. It should further be understood that the word "comprising" as used in the specification of the present disclosure means that the features, integers, steps, operations, elements, and / or components listed thereafter exist, 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 say an element is "connected" or "coupled" to another element, it can be directly connected or coupled to the other element, or there can be intervening elements. In addition, "connected" or "coupled" as used herein can include wireless connection or wireless coupling. The phrase "and / or" as used herein includes all or any combination of one or more of the associated listed items.

[0026] The present application provides a dynamic graph continuous learning method, which realizes dynamic graph base class prototype modeling through language model and graph structure feature fusion, realizes continuous learning under dynamic graph continuous learning by combining adaptive prompting and pseudo sample generation technology, solves the problem of catastrophic forgetting, improves the classification performance in the few sample scene and the dynamic adaptability of the model, and is suitable for a dynamic graph continuous learning device. The dynamic graph continuous learning device can be an electronic device. The dynamic graph continuous learning method in the embodiment of the present application can be applied to various scenes, such as a paper citation network, a social network, a traffic network, and molecular chemistry.

[0027] Referring to Figure 1 , the embodiment of the present application provides a dynamic graph continuous learning method, which is suitable for an electronic device.

[0028] In the following method embodiment, in order to facilitate description, the execution subject of each step of the method is taken as an example to be described as an electronic device, but this does not constitute a specific limitation.

[0029] As Figure 1 shown, the method can include the following steps:

[0030] In step 110, the text features of the dynamic graph base class nodes are encoded into numerical vectors by a language model, and the base class prototype and the covariance matrix are obtained by combining the structural features of the dynamic graph, and the covariance matrix is subjected to matrix shrinkage and standardization.

[0031] In one possible implementation, the text description of the base class nodes in the dynamic graph is encoded into a numerical vector using a language model, and the base class prototype and the covariance matrix are obtained by combining the structural features of the dynamic graph through a graph neural network model.

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

[0033] Specifically, the text description of the base class nodes in the dynamic graph is encoded using a pre-trained language model (such as BERT). The language model converts the text into numerical vectors rich in semantic information through multiple layers of transformation. These vectors not only contain the surface information of the text, but also capture the implicit relationships between texts. The unstructured text data is converted into structured numerical representation, which facilitates subsequent graph neural network processing. The representation ability of the text features is improved, providing a rich semantic basis for subsequent construction of the base class prototype.

[0034] Further, according to the node representation output by the GNN, the class mean vector (base class prototype) of each base class is calculated, which represents the central feature of the class. At the same time, the covariance matrix of the node features is calculated to capture the correlation between the features. The covariance matrix reflects the relationship between different feature dimensions, which is crucial for subsequent Mahalanobis distance calculation. The base class prototype and the covariance matrix together provide a comprehensive description of the base class features, providing a stable foundation for dynamic graph continual learning.

[0035] Further, the covariance matrix is subjected to matrix shrinkage operation to ensure its invertibility. In the few-shot scenario, the original covariance matrix may not be invertible due to insufficient samples. Through the shrinkage operation, it can meet the invertibility condition. The shrunk covariance matrix is standardized to eliminate the dimension influence of the Mahalanobis distance between different classes, so that it has comparability. This solves the problem of non-invertibility of the covariance matrix in the few-shot scenario and ensures the comparability of the distance between different classes, improving the stability and accuracy of the Mahalanobis distance classifier.

[0036] In the above process, the embodiment of the application constructs a stable and discriminative base class feature representation through the steps of text feature encoding, graph structure feature fusion, base class prototype and covariance matrix calculation, and matrix shrinkage and standardization, providing a solid foundation for subsequent continual learning and classification tasks.

[0037] In step 120, the corresponding prompt is generated according to the difficulty of the new task, and if the number of samples of the new task is less than a set value, the prototype of the new task and the cosine similarity of the base class prototype are weighted and summed to generate pseudo samples.

[0038] wherein the prototype represents the category mean vector.

[0039] 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; the new prompt is generated for the new task according to the prompt length, and the adaptive prompt of the base class is combined to constitute the prompt data to optimize the parameters of the new prompt.

[0040] In one possible implementation, the cosine similarity of 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 weighted sum and temperature coefficient, and the samples of the base class are linearly combined according to the contribution weight to generate pseudo samples.

[0041] wherein 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 deficiency problem caused by fixed length prompt.

[0042] Specifically, the new prompt corresponding to the new task is generated, and the adaptive prompt of the base class is combined to constitute the prompt data set, and the parameters of the new prompt are optimized by minimizing the negative log-likelihood loss of the new prompt and the new task samples. The prompt highly related to the new task is generated to improve the performance of the model on the new task, and the adaptability of the model to the new task is enhanced, and the classification accuracy is improved.

[0043] Specifically, when the number of new task samples is extremely small, the cosine similarity of the prototype of the new task and the prototype of the base class is calculated, and the pseudo samples are generated by weighted sum, wherein the weight is controlled by the Softmax function and the temperature coefficient to simulate the distribution of the new task samples. The problem of model overfitting in the few-sample scenario is solved, and the generalization ability of the model is improved. The introduction of pseudo samples effectively alleviates the problem of data scarcity and improves the classification performance of the model in the few-sample scenario.

[0044] In the above process, the adaptive prompt length setting, new prompt generation and parameter optimization, and pseudo sample generation steps of the embodiment of the present application effectively solve the problems of insufficient number of new task samples and task difficulty changes, and improve the adaptability and classification performance of the model in the few-sample and dynamic environment.

[0045] Step 130, initialize the orthogonal key vector, construct the adaptive key prompt retriever by minimizing the cosine similarity between the orthogonal key vector and the sample of the new task, optimize the adaptive prompt retriever by parameter freezing and minimizing the negative log-likelihood loss, and dynamically select the most matching prompt.

[0046] In one possible implementation, a set of mutually orthogonal key vectors is randomly generated, and the number 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 task, and the adaptive key-prompt retriever is constructed.

[0047] In one possible implementation, when optimizing the adaptive key-prompt retriever, the prompt parameters of the base language model and the 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 of the prompt and the sample of the new task, and the most matching prompt is dynamically selected based on the cosine similarity between the key vector and the sample of the new task.

[0048] Specifically, a set of orthogonal key vectors consistent with the number of new tasks is randomly generated. Orthogonality ensures the independence between key vectors, which helps to improve retrieval efficiency. The introduction of orthogonal key vectors provides a set of basic key vectors for subsequent key-prompt retrieval, which improves the accuracy and efficiency of retrieval.

[0049] Further, 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 task. During this process, the key vectors gradually learn the feature representation highly related to the new task. The key vectors can accurately reflect the feature distribution of the new task, improving the accuracy of retrieval. The dynamically adjusted key vectors can better match the new task samples, improving the precision of prompt retrieval.

[0050] Further, when optimizing the adaptive key-prompt retriever, the prompt parameters of the base language model and the historical 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 update of model parameters, improving optimization efficiency. The parameter freezing strategy significantly reduces the computational cost while ensuring the rapid adaptation of the model to new tasks.

[0051] In the above process, the embodiments of the present application construct an efficient and accurate adaptive key-prompt retriever through the steps of orthogonal key vector initialization, dynamic adjustment of key vector parameters, and parameter freezing and optimization, realize the dynamic selection of the optimal prompt, and improve the adaptation speed and classification accuracy of the model to new tasks.

[0052] Step 140, encode the text properties of the sample of the new task into a feature vector through BERT, and combine the prompt to obtain the final feature vector, and determine the category of the new task by calculating the Mahalanobis distance between the feature vector and the covariance matrix.

[0053] In one possible implementation, when the sample size of the new task is less than a set value, 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.

[0054] 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.

[0055] 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.

[0056] 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.

[0057] 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.

[0058] 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.

[0059] Through the above process, the application encodes the text attributes by BERT, combines GNN to process the graph structure features, and constructs the base class prototype and the covariance matrix. The adaptive prompt and the key-prompt retriever are introduced to dynamically select the optimal prompt. In the few-shot scene, pseudo samples are generated to supplement the data, and the Mahalanobis distance is used to realize efficient classification. The scheme solves the problems of catastrophic forgetting and data scarcity in dynamic graph data continuous learning, and significantly improves the adaptability and classification accuracy of the model in the dynamic environment.

[0060] In an application scenario, a paper citation network is taken as a dynamic graph data scenario, wherein the nodes represent papers, and the edges represent the citation relationship between the papers. As new papers are continuously published, the structure of the graph and the node categories (such as research fields) are continuously expanded. The continuous learning method proposed by the embodiment of the application is used to efficiently classify the new papers in the paper citation network.

[0061] Specifically, the following steps can be included:

[0062] Step 1: Data preparation and preprocessing.

[0063] Specifically, first, the initial paper set of the paper citation network is collected from the academic database, including the text abstract, title, keywords and citation relationship of the paper. The initial dataset required for building the basic classification model is constructed to ensure that the model has basic recognition ability for the existing paper categories. An initial dataset containing papers of multiple research fields is obtained to provide a data basis for subsequent model training.

[0064] Further, the text abstract and title of each paper are cleaned to remove HTML tags, special characters and stop words. A word segmentation tool (such as Jieba or NLTK) is used to perform word segmentation processing on the text. The accuracy and efficiency of the text encoding are improved, and the interference of noise data on model training is reduced. Clean text data is obtained to facilitate subsequent text encoding processing.

[0065] Further, the initial graph structure is constructed according to the citation relationship between the papers, wherein the nodes represent the papers and the edges represent the citation relationship. A graph database (such as Neo4j) or a network library (such as NetworkX) is used to store and manage the graph structure. The basic graph data is provided for subsequent graph neural network processing to accurately reflect the academic association between the papers. A dynamic graph structure reflecting the citation relationship between the papers is constructed.

[0066] In the above process, the embodiment of the application collects and preprocesses the initial data of the paper citation network to construct the initial dataset and the graph structure required for the basic classification model, thereby providing a high-quality data basis for subsequent model training.

[0067] Step 2: Base class prototype and covariance matrix construction.

[0068] 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.

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

[0070] Further, a 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.

[0071] 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.

[0072] 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.

[0073] 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.

[0074] Step three: continuous learning and classification.

[0075] 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.

[0076] Further, the prompt length is dynamically set according to the number of samples and the average token length of the new paper. For a new task with a small number of samples or short token length, a shorter prompt length is set to save memory; otherwise, a longer prompt length is set to fully capture the characteristics of the task. A new prompt corresponding to the new task is generated and connected with the prompts of the previous tasks (if applicable). The adaptability of the model to the new task is improved, and the waste of resources caused by the fixed length prompt is avoided. The model can dynamically adjust the prompt length according to the difficulty of different tasks, and improve the learning efficiency.

[0077] When the number of samples of the new task is extremely small (such as only one sample), a pseudo sample is generated to supplement the data. According to the cosine similarity between the new class prototype and all base class prototypes, a scaling factor is calculated and a pseudo sample is generated. The real samples and the pseudo samples are mixed in proportion to form a mixed training set. The overfitting problem in the few-sample scenario is solved, and the generalization ability of the model is improved. The model can still maintain good classification performance in the few-sample scenario.

[0078] Further, the Mahalanobis distance between the new paper feature vector and the covariance matrix is calculated to determine the research field category to which it belongs. According to the size of the Mahalanobis distance, the new paper is classified into the research field category closest to it. Efficient and accurate node classification is achieved without storing samples or updating the model. The classification accuracy is significantly improved, and the calculation efficiency is high.

[0079] In the above process, the adaptive prompt generation, pseudo sample supplementation and Mahalanobis distance classification of the new paper are realized by the embodiments of the present application, which realizes efficient and continuous learning and accurate classification of the model in a dynamic academic environment, and significantly improves the adaptability and classification performance of the model.

[0080] 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 friend relationships). As new users join and social relationships change, the structure of the graph and the node categories (such as interest groups) continue to expand. The dynamic graph continuous learning method proposed by the embodiments of the present application is applied to efficiently classify new users in the social network.

[0081] Specifically, first, initial user data is collected from a social media platform, including user profiles (such as age, gender, occupation), post content and friend relationships. An initial dataset required for building a basic classification model is constructed to ensure that the model has basic recognition ability for existing user categories. An initial dataset containing users of multiple interest groups is obtained to provide a data basis for subsequent model training.

[0082] Further, the post content published by the user is cleaned to remove HTML tags, special characters and stop words. The post content is segmented using a segmentation tool to obtain a sequence of words. The accuracy and efficiency of text encoding are improved, and the interference of noise data on model training is reduced. Clean text data is obtained to facilitate subsequent text encoding processing.

[0083] Further, an initial social network graph structure is constructed according to the friend relationship between users, wherein the nodes represent users and the edges represent friend relationships. The graph structure is stored and managed using a graph database or network library. The basic graph data is provided for subsequent graph neural network processing, accurately reflecting the social association between users. A dynamic graph structure reflecting the friend relationship between users is constructed.

[0084] In the above process, the embodiment of the application collects and pre-processes the initial data of the social network to construct the initial data set and the graph structure required by the basic classification model, providing a high-quality data foundation for subsequent model training.

[0085] Further, the post content published by the user is encoded using a pre-trained language model (such as BERT or RoBERTa) to obtain a numerical feature vector. The feature vector output by the language model is averaged and pooled to obtain a fixed-length feature representation for each post. The text data is converted into a numerical form that can be processed by the model, while retaining the semantic information of the text. A numerical feature representation is obtained for each post to facilitate subsequent graph neural network processing.

[0086] Further, the user's personal profile features (such as one-hot encoding of age, gender, occupation) are concatenated with the post content features to form a comprehensive feature representation of the user. Combining various feature information of the user improves the comprehensiveness of the user feature representation. A comprehensive feature representation is obtained that includes the user's personal profile and social behavior information.

[0087] Further, the graph neural network (GNN) model is initialized, for example, using the GraphSAGE or GIN (Graph Isomorphism Network) architecture, which is good at processing large-scale graph data and capturing complex node relationships. The comprehensive feature representation of the user is input into the GNN model as the initial feature of the node, and through multi-layer graph convolution or message passing mechanism, the feature representation of each node is updated to include the information of the neighbor nodes, enhancing the discriminability of the feature. The richness and accuracy of the user feature representation are improved using the graph structure information, providing a solid foundation for subsequent classification. After GNN processing, each user node obtains a high-dimensional feature vector that integrates its own attributes and social relationships.

[0088] Further, according to the node representation output by the GNN, the class mean vector is calculated for each known interest group (base class) as the prototype of the class. At the same time, the covariance matrix between all node features is calculated to capture the correlation between features. Regularization is performed on the covariance matrix, such as adding a unit matrix multiplied by a small regularization coefficient, to ensure the invertibility and numerical stability of the matrix. To provide stable class center and feature distribution information for subsequent continuous learning, enhance the model's ability to adapt to new classes. A stable prototype and invertible covariance matrix are obtained for each interest group, preparing for subsequent classification and continuous learning.

[0089] Further, after the base class feature construction is completed, an adaptive key-prompt retriever is introduced. The retriever is mainly composed of a key generation module and a prompt 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 will be continuously optimized during training to enable the generated key vector to better represent the features of the base class. For example, for the prototype vector of interest group A, a 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 preserving key feature information of the base class, facilitating subsequent fast retrieval and matching. The generated key vector can succinctly and effectively represent the base class, providing efficient indexing for prompt retrieval.

[0090] where a learnable neural network is used to generate a corresponding prompt vector according to the base class prototype. The design of the prompt vector is to provide additional information about the base class to the model in subsequent classification tasks, helping the model better understand and distinguish different classes. For example, for interest group A, a prompt vector is obtained through the prompt generation neural network.

[0091] The generation of prompt information related to the base class enhances the model's understanding and expression ability of the base class features, improving the classification performance. The prompt vector can provide valuable prior knowledge to the model, making the model more accurate and robust in classification.

[0092] Further, when a new user registers and joins the social network, collect their personal information and initial post content. Add the new user as a new node to the graph and establish connections with existing nodes according to their friend relationships. Realize the dynamic expansion of the model, so that the model can handle the changing social network structure. The model can receive new user data in real time to provide the latest information for subsequent classification.

[0093] Further, for new users, first use the same feature extraction method as the base class feature construction (such as GNN processing) to obtain their feature vectors, and then input the feature vectors into the similar neural network (shared parameters) of the key generation module to obtain the key vector corresponding to the new user. Calculate the similarity between the key vector and each base class key vector. Common similarity measurement methods include cosine similarity, etc. Quickly locate the base class with the most similar new user features, narrow the classification range, and improve classification efficiency. It can accurately find the base class similar to the new user's features, and provide strong support for subsequent prompt-based classification.

[0094] Further, according to the results of key matching, select the prompt vectors corresponding to the several base classes with the highest similarity. Design an adaptive prompt fusion mechanism to weight and fuse the selected prompt vectors according to the similarity. Concatenate or perform other fusion operations on the fused prompt vectors and the feature vectors of the new user to obtain enhanced feature representations. Generate adaptive prompt information suitable for new users and effectively fuse it with new user features to improve the model's expression ability for new user features. The enhanced feature representation can better reflect the relationship between the new user and the base class, providing more abundant information for subsequent classification.

[0095] Further, when the sample size of the interest group to which the new user belongs is extremely small (such as the cold start problem), use data augmentation techniques to generate pseudo samples. Based on the new user features and base class prototypes, generate realistic pseudo samples through random perturbation, feature interpolation, or generative adversarial networks (GAN). In the process of generating pseudo samples, use the information provided by the adaptive key-prompt retriever for guidance. For example, based on the key matching results and adaptive prompts of the new user and the base class, adjust the feature distribution of the generated pseudo samples to make them more consistent with the feature patterns of the target base class. Mix real samples with pseudo samples to form an expanded training set, which is used to fine-tune the model or update the classifier parameters.

[0096] Solve the overfitting problem in the few-shot scenario and improve the generalization ability of the model. At the same time, use the information of the adaptive key-prompt retriever to generate more reasonable pseudo samples. Through pseudo sample supplementation, the model can still maintain high classification accuracy in the few-shot scenario, and the generated pseudo samples are more targeted and reasonable.

[0097] Finally, calculate the Mahalanobis distance between the enhanced feature vector of the new user and each base class prototype, consider the correlation between features, and improve the robustness of classification. Classify the new user into the interest group with the closest distance to complete the initial classification.

[0098] Further, according to the classification results and feedback of new users, the base class prototype, covariance matrix and parameters of the adaptive key-prompt retriever are updated regularly. For example, the base class prototype and covariance matrix are recalculated using new classification samples, and the neural network parameters of the key generation module and prompt generation module are updated through the back propagation algorithm. Efficient and accurate node classification is achieved, and the continuous learning ability of the model is maintained, enabling the adaptive key-prompt retriever to continuously adapt to the dynamic changes of the social network. An adaptive key-prompt retriever with high classification accuracy and the ability to continuously optimize itself as the social network develops is obtained.

[0099] Through the above process, the embodiment of the present application effectively solves the problem of continuous learning in the dynamic graph data scenario by constructing base class features and implementing continuous learning and classification. Specifically, the present application first constructs rich node representations using graph neural networks combined with the multi-modal features of users (personal profiles and social behavior); then, by calculating the base class prototype and covariance matrix, a stable reference is provided for subsequent classification; when new users join, the adaptive prompt and pseudo-sample generation techniques are used to enhance the adaptability and generalization performance of the model; finally, the Mahalanobis distance is used for efficient classification, and the model parameters are updated as needed to achieve continuous learning. This framework is not only suitable for social networks, but can also be extended to other dynamic graph data scenarios.

[0100] In an exemplary embodiment, in order to verify the effectiveness of the embodiment of the present application, detailed experiments were conducted on three graph data sets with text attributes, namely arxiv-2023, ogbn-products (subset) and ogbn-arxiv. The main purpose of the experiment is to evaluate the performance of the embodiment of the present application in handling continuous learning problems based on text attribute graphs, especially the adaptability and classification accuracy when facing the addition of new classes and dynamic changes in data.

[0101] Experimental setup: The data sets include 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: a large citation graph data set containing 169,343 nodes and 1,166,243 edges, divided into 40 categories.

[0102] For each dataset, its classes are divided into base classes and new classes. Base classes are used to pre-train the GNN model, and new classes are used for incremental learning. The experiment setting of 3-way 5-shot is adopted, that is, each incremental session contains 3 new classes, and each class has 5 samples. The language model selects bert-base-uncased as the basic language model, and the parameters remain frozen during the experiment. The graph neural network adopts GCN as the backbone of the graph neural network. The adaptive prompt training is set to 20 epochs for adaptive prompt training. Adaptive key-prompt retriever training: set 5 epochs for adaptive key-prompt retriever training.

[0103] 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 application.

[0104] Experiments of seven incremental sessions are conducted on each dataset, including a base stage and six incremental stages. The classification accuracy of each session and the average accuracy (AA) of all sessions are reported. The influence of the support set size (i.e., the number of samples per new class) on the model performance is analyzed on the ogbn-arxiv and arxiv-2023 datasets. Special attention is paid to the model performance in the case of extremely small samples (such as 1-shot or 2-shot), and the problem of irreversible covariance matrix is solved by generating pseudo samples.

[0105] Further, ablation experiments are conducted on the ogbn-arxiv and ogbn-products (subset) datasets to verify the effectiveness of the adaptive prompt and the adaptive key-prompt retriever. The model performance in three cases is tested, namely using only shallow features, adding adaptive prompts, and adding both adaptive prompts and adaptive key-prompt retrievers.

[0106] Finally, on all datasets, the embodiments of the present application are superior to all methods that do not rely on data replay, proving their effectiveness in enhancing text attribute graph representation learning and continuous learning. Among the methods that rely on data replay, the performance of the embodiments of the present application on the arxiv-2023 and ogbn-arxiv datasets is also superior to some benchmark methods, further highlighting their performance advantages. Even in the case of extremely small samples, by generating pseudo samples, the embodiments of the present application can maintain good performance, which is attributed to the effectiveness of the pseudo samples and the robustness of the model.

[0107] Further, the effect of using shallow features combined with a graph incremental classifier is not good, and it is difficult to meet the expected requirements. After introducing the adaptive hint, the performance of the embodiment of the present application is significantly improved, especially on the ogbn-products (subset) data set. Further adding the adaptive key-hint retriever achieves the best performance, indicating that the retriever can accurately retrieve suitable adaptive hints, which has a positive impact on model guidance.

[0108] Through the above experiments, the effectiveness and advantages of the embodiment of the present application in handling the problem of continuous learning based on text attribute graphs are verified. Not only can stable classification performance be maintained in a dynamic data environment, but the problem of catastrophic forgetting can also be effectively alleviated.

[0109] The following is an apparatus embodiment of the present application, which can be used to perform the dynamic graph continuous learning method involved in the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the method embodiment of the dynamic graph continuous learning method involved in the present application.

[0110] Please refer to Figure 2 In the embodiment of the present application, a dynamic graph continuous learning device 800 is provided.

[0111] 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.

[0112] The graph data processing module 810 is configured to encode the text features of the dynamic graph base class nodes into numerical vectors through a language model, obtain a base class prototype and a covariance matrix in combination with the structural features of the dynamic graph, and perform matrix contraction and standardization on the covariance matrix. The base class prototype is a class mean vector of each base class.

[0113] The pseudo sample generation module 830 is configured to generate a corresponding hint according to the difficulty of a new task. If the number of samples of the new task is less than a set value, the base class prototypes are weighted and summed to generate pseudo samples based on the cosine similarity between the prototypes of the new task and the base class prototypes.

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

[0115] The node classification module 870 is configured to encode the text attributes of the samples of the new task into feature vectors through BERT, obtain a final feature vector in combination with the hint, and determine the class of the new task by calculating the Mahalanobis distance between the feature vector and the covariance matrix.

[0116] It should be noted that the dynamic graph continuous learning provided by the above embodiments is only illustrated by the division of the above functional modules, and in actual application, the above functional distribution can be completed by different functional modules according to needs, that is, the internal structure of the dynamic graph continuous learning device is divided into different functional modules to complete all or part of the functions described above.

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

[0118] Figure 3 According to an exemplary embodiment, a structure of an electronic device is shown.

[0119] It should be noted that the electronic device is only an example adapted to the present application and should not be considered as providing any limitation on the scope of use of the present application. The electronic device should also not be interpreted as being dependent on or necessarily having Figure 3 One or more components in the exemplary electronic device 2000 shown.

[0120] The hardware structure of the electronic device 2000 can vary greatly due to different configurations or performance, 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.

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

[0122] The interface 230 includes at least one wired or wireless network interface 231 for interacting with external devices. Of course, in other examples adapted to the present application, the interface 230 can further include at least one serial-parallel conversion interface 233, at least one input-output interface 235, and at least one USB interface 237, etc., as Figure 3 shown, which is not specifically limited here.

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

[0124] 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.

[0125] 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

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

[0127] 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.

[0128] 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.

[0129] 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.

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

[0131] ​The data interaction between the processor 4001 and the memory 4003 can be realized through at least one communication bus 4002. The communication bus 4002 can include a channel for transmitting data between the processor 4001 and the memory 4003. The communication bus 4002 can be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. 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 to represent the communication bus 4002 in the figure, but it does not mean that there is only one bus or only one type of bus.

[0132] Optionally, the electronic device 4000 can further include a transceiver 4004, which can be used for data interaction, such as data sending and / or data receiving, between the electronic device and other electronic devices. It should be noted that the transceiver 4004 is not limited to one in actual application, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present application.

[0133] The processor 4001 can 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, a transistor logic device, a hardware component or any combination thereof. It can realize or execute various exemplary logical blocks, modules and circuits described in combination with the present disclosure. The processor 4001 can also be a combination realizing a computing function, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0134] The memory 4003 can be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, a magneto-optical disk storage (including a compact flash, a laser disc, an optical disc, a digital versatile disc, a Blu-ray disc, and the like), 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 in the form of instructions or data structures and that can be accessed by the electronic device 4000, but is not limited thereto.

[0135] The memory 4003 stores computer readable instructions, which can be read by the processor 4001 through the communication bus 4002.

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

[0137] In addition, the storage medium provided in the embodiments of the present application stores computer readable instructions, which are executed by one or more processors to implement the dynamic graph continuous learning method as described above.

[0138] The computer program product provided in the embodiments of the present application includes computer readable instructions stored in a storage medium, and 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 dynamic graph continuous learning method as described above.

[0139] Compared with the related art, the present application has the following beneficial effects:

[0140] 1. The present application can significantly improve the continuous learning ability of the text attribute graph; by introducing an adaptive prompting mechanism, the mechanism dynamically adjusts the prompt length according to the difficulty of each session task, not only saving memory consumption, but also enhancing the adaptability and stability of the model in the continuous learning process. Specifically, the adaptive prompt does not depend on task IDs, which widens the application scenarios, so that the model can still learn efficiently without explicit task identification.

[0141] 2. The application has the ability of efficient retrieval and matching adaptive prompts; by designing an adaptive key-prompt retriever, which is constructed by minimizing the cosine similarity between key vectors and target task samples, the most relevant prompt to the current input can be dynamically selected during testing. This design enhances the model's continuous learning ability, ensuring accuracy and efficiency when switching between different tasks.

[0142] 3. The application can effectively alleviate the catastrophic forgetting problem in continuous learning of graph data; by modeling the feature covariance relationship and using Mahalanobis distance for efficient node classification, the method maintains the model's memory of old knowledge without storing samples or updating the model, while effectively learning new knowledge. This strategy is particularly suitable for scenarios where graph data changes dynamically, such as social networks and transportation networks.

[0143] 4. The application improves the model performance in the few-shot learning scenario; to address the unreliable empirical risk minimization problem in few-shot learning, pseudo samples are constructed and the semantic similarity of base class data is used to optimize the classification of new classes. This method can still maintain good classification performance with very small samples.

[0144] 5. The application reduces the computational and storage overhead in the continuous learning process; by designing an efficient incremental learning strategy, the model can efficiently update on changing graph data without training the entire network from scratch. This not only significantly reduces computational overhead, but also reduces memory consumption, improving the practical application value of the model.

[0145] It should be understood that although each step in the flowchart of the accompanying drawings is displayed in sequence according to the direction of the arrow, these steps are not necessarily executed in sequence according to the direction of the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and they can be executed in other orders. Moreover, at least part of the steps in the flowchart of the accompanying drawings can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence is not necessarily sequential, but can be alternately or alternately executed with at least part of other steps or sub-steps or stages of other steps.

[0146] The above only describes some embodiments of the application, and it should be pointed out that for those skilled in the art, without departing from the principles of the application, several improvements and refinements can be made, which should also be considered within the scope of protection of the application.

Claims

1. A dynamic graph continual learning method, characterized in that, The method comprises: encoding the text features of the dynamic graph base class nodes into numerical vectors through a language model, obtaining base class prototypes and covariance matrices in combination with the structural features of the dynamic graph, and performing matrix shrinkage and standardization on the covariance matrices; the base class prototype is a class mean vector of each base class; generating corresponding prompts according to the difficulty of a new task, if the number of samples of the new task is less than a set value, performing weighted summation on the base class prototypes based on the cosine similarity between the prototypes of the new task and the base class prototypes to generate pseudo samples; the prototype represents a class mean vector; randomly generating a set of mutually orthogonal key vectors, the number of which is consistent with the number of the new tasks, dynamically adjusting the parameters of the key vectors by minimizing the cosine similarity between the key vectors and the sample features of the new tasks, and constructing an adaptive key-prompt retriever, wherein, when optimizing the adaptive key-prompt retriever, the prompt parameters of the basic language model and the historical tasks are frozen, and only the key vector parameters of the current task are updated; dynamically adjusting the key vector parameters by minimizing the negative log-likelihood loss of the prompt and the samples of the new task, and dynamically selecting the most matched prompt based on the cosine similarity between the key vectors and the samples of the new task; encoding the text attributes of the samples of the new task into feature vectors through BERT, combining the prompts to obtain the final feature vectors, and determining the class of the new task by calculating the Mahalanobis distance between the feature vectors and the covariance matrices. 2.The dynamic graph persistent learning method of claim 1, wherein, The method comprises: using a language model to encode the text description of the base class nodes in the dynamic graph to obtain numerical vectors, and obtaining base class prototypes and covariance matrices in combination with the structural features of the dynamic graph through a graph neural network model; the numerical vectors include model parameters, adaptive prompts, and base class numbers. 3.The dynamic graph persistent learning method of claim 1, wherein, The method comprises: 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, setting the prompt length to 10, otherwise setting the prompt length to 6; generating new prompts for the new task according to the prompt length, combining the adaptive prompts of the base classes to form prompt data, and optimizing the parameters of the new prompts. 4.The dynamic graph persistent learning method of claim 1, wherein, The method comprises: calculating the cosine similarity between the prototype of the new task and the prototypes of all base classes, generating base class contribution weights by controlling the sharpness through Softmax weighting and a temperature coefficient, linearly combining the samples of the base classes according to the contribution weights to generate pseudo samples. 5.The dynamic graph persistent learning method of claim 1, wherein, The method further comprises: when the sample quantity of the new task is less than a set value, using the pseudo samples as training data, when the sample quantity of the new task meets a set condition, mixing the samples of the new task and the pseudo samples in a 1:1 ratio as training data, and automatically adjusting the generation degree parameters of the pseudo samples according to the number of real samples. 6.A dynamic graph continuous learning device, characterized in that, The device is applied to the dynamic graph continuous learning method of claim 1, and the device comprises: a graph data processing module, configured to encode text features of dynamic graph base class nodes into numerical vectors through a language model, obtain a base class prototype and a covariance matrix by combining structural features of the dynamic graph, and perform matrix shrinkage and standardization on the covariance matrix; the base class prototype is a class mean vector of each base class; a pseudo-sample generation module, configured to generate a corresponding prompt according to a difficulty of a new task, and if a sample number of the new task is less than a set value, perform weighted summation on the base class prototypes based on cosine similarity of prototypes of the new task and the base class prototypes to generate pseudo samples; the prototype represents a class mean vector; a retriever construction module, configured to initialize an orthogonal key vector, construct an adaptive key-prompt retriever by minimizing cosine similarity of the orthogonal key vector and samples of the new task, optimize the adaptive key-prompt retriever by parameter freezing and minimizing a negative log-likelihood loss, and dynamically select the most matching prompt; a node classification module, configured to encode text attributes of samples of the new task into feature vectors through BERT, obtain a final feature vector by combining the prompt, and determine a class of the new task by calculating Mahalanobis distance of the feature vector and the covariance matrix.

7. An electronic device, comprising: comprise: at least one processor and at least one memory, computer readable instructions are stored on the memory; the computer readable instructions are executed by one or more of the processors, so that the electronic device implements the dynamic graph continuous learning method of any one of claims 1 to 5.

8. A storage medium having stored thereon computer readable instructions, characterized in that, the computer readable instructions are executed by one or more processors to implement the dynamic graph continuous learning method of any one of claims 1 to 5.

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