Federated learning based teaching model training and teaching task processing method and device

By employing a federated learning-based teaching model training method, combined with knowledge graph constraints and global alignment mapping, the legal compliance and cultural adaptability issues of generative AI education technology in globalized education scenarios are addressed, thereby improving the accuracy and adaptability of the teaching model.

CN121388844BActive Publication Date: 2026-05-01BEIJING SANSAN SMART EDUCATION TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING SANSAN SMART EDUCATION TECHNOLOGY CO LTD
Filing Date
2025-10-27
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing generative AI education technologies suffer from deficiencies in legal compliance, cultural adaptability, and professional reliability in globalized education scenarios, resulting in limited practical effectiveness and application scope.

Method used

A federated learning-based teaching model training method is adopted. The initial teaching model is received from the central server and trained by combining local data sample sets and composite loss functions. Knowledge graph constraints are introduced to generate model update volume and entity embedding matrix. Global alignment mapping is performed on the central server to ensure that the model produces similar internal representations under different cultures.

Benefits of technology

Without disclosing local data, the accuracy, generalization ability, and interpretability of the teaching model are improved, promoting stable convergence of the model and adapting to different education systems and cultural contexts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121388844B_ABST
    Figure CN121388844B_ABST
Patent Text Reader

Abstract

The present disclosure provides a kind of teaching model training based on federal learning, teaching task processing method and device, it is related to artificial intelligence, natural language processing, big language model, deep learning and other technical fields.The specific implementation scheme is: receiving the initial teaching model output by central server, initial teaching model is used to generate or execute teaching task;Using local data sample set and composite loss function, the initial teaching model is trained, and the teaching model that training is completed is obtained, the composite loss function includes: the task loss function of teaching task and the atlas constraint loss function for making the internal representation generated by teaching model when processing text and the knowledge concept involved in text in the structured representation of knowledge graph in alignment;Based on the model update amount of the teaching model that training is completed and initial teaching model;Based on knowledge graph, obtain entity embedding matrix;The model update amount and entity embedding matrix are sent to central server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure pertains to the field of artificial intelligence, specifically relating to technical areas such as natural language processing, educational technology, large language models, and deep learning. In particular, it discloses a method and apparatus for training teaching models and processing teaching tasks based on federated learning, as well as electronic devices and computer-readable storage media. Background Technology

[0002] In the field of artificial intelligence education technology, generative AI technology, with large language models at its core, has made groundbreaking progress in recent years, demonstrating its enormous potential to empower the education industry. Theoretically, this technology can act as an intelligent teaching assistant available 24 / 7 across all subjects, enabling automated generation of teaching plans, personalized question creation, and intelligent Q&A, thereby freeing teachers from repetitive tasks and promoting the large-scale implementation of personalized education.

[0003] However, when applying existing generative AI technologies to globalized and systematic educational scenarios, a technological gap exists between the ideal and reality. These gaps not only severely restrict the actual effectiveness and application breadth of AI education products, but also create huge barriers at the legal, cultural, and trust levels.

[0004] In summary, existing technological approaches have fundamental flaws in terms of legal compliance, cultural adaptability, and professional reliability. Summary of the Invention

[0005] This disclosure provides a method and apparatus for training instructional models based on federated learning, a method and apparatus for processing instructional tasks, an electronic device, and a computer-readable storage medium.

[0006] According to the first aspect, a method for training a teaching model based on federated learning is provided, which is applied to each participating node in federated learning. The method includes: receiving an initial teaching model output by a central server, the initial teaching model being used to generate or execute teaching tasks; training the initial teaching model using a local data sample set and a composite loss function to obtain a trained teaching model, the composite loss function including: a task loss function for the teaching task and a graph constraint loss function used to align the internal representation generated by the teaching model when processing text with the structured representation of the knowledge concepts involved in the text in the knowledge graph; obtaining a model update based on the trained teaching model and the initial teaching model; obtaining an entity embedding matrix based on the knowledge graph; and sending the model update and the entity embedding matrix to the central server.

[0007] According to the second aspect, another method for training a teaching model based on federated learning is provided, applied to the central server of federated learning. This method includes: after sending the initial teaching model to all participating nodes, receiving the entity embedding matrix and model update amount of the knowledge graph sent by each participating node; for any two participating nodes, calculating the target transfer matrix of those two nodes based on their entity embedding matrices; constructing a global alignment mapping library of equivalent concepts under different cultures based on the target transfer matrices of all participating nodes; calculating an intermediate teaching model based on the model update amounts of all participating nodes and the initial teaching model; fine-tuning the intermediate teaching model based on the global alignment mapping library and a preset alignment loss function to obtain the final teaching model, where the alignment loss function is used to ensure that the intermediate teaching model produces similar internal representations of semantically equivalent concepts from different cultures in the global alignment mapping library; and sending the final teaching model to each participating node.

[0008] According to the third aspect, a teaching task processing method is provided, the method comprising: receiving an input data sequence input by a learning object or a teaching object; inputting the input data sequence into a final teaching model generated by a method as described in any of the second aspects; and outputting a target output sequence related to the teaching task.

[0009] According to the fourth aspect, a training device for a teaching model based on federated learning is provided, applied to various participating nodes in federated learning. The device includes: a model receiving unit configured to receive an initial teaching model output by a central server, the initial teaching model being used to generate or execute teaching tasks; a training unit configured to train the initial teaching model using a local data sample set and a composite loss function to obtain a trained teaching model, the composite loss function including: a task loss function for the teaching task and a graph constraint loss function used to align the internal representation generated by the teaching model when processing text with the structured representation of the knowledge concepts involved in the text in a knowledge graph; an update unit configured to obtain a model update amount based on the trained teaching model and the initial teaching model; an obtaining unit configured to obtain an entity embedding matrix based on the knowledge graph; and a first sending unit configured to send the model update amount and the entity embedding matrix to the central server.

[0010] According to the fifth aspect, another teaching model training device based on federated learning is provided, applied to the central server of federated learning. This device includes: a graph receiving unit, configured to receive the entity embedding matrix and model update amount of the knowledge graph sent by each participating node after sending the initial teaching model to all participating nodes; a matrix calculation unit, configured to calculate the target transmission matrix of any two participating nodes based on their entity embedding matrices; a construction unit, configured to construct a global alignment mapping library of equivalent concepts under different cultures based on the target transmission matrices of all participating nodes; a model calculation unit, configured to calculate an intermediate teaching model based on the model update amount and the initial teaching model of all participating nodes; a fine-tuning unit, configured to fine-tune the intermediate teaching model based on the global alignment mapping library and a preset alignment loss function to obtain the final teaching model, wherein the alignment loss function is used to make the intermediate teaching model produce similar internal representations of semantically equivalent concepts under different cultures in the global alignment mapping library; and a second sending unit, configured to send the final teaching model to each participating node.

[0011] According to a sixth aspect, a teaching task processing apparatus is provided, the apparatus comprising: a data receiving unit configured to receive an input data sequence input by a learning object or a teaching object; and a processing unit configured to input the input data sequence into a final teaching model generated by the apparatus of any of the fifth aspects, and output a target output sequence related to the teaching task.

[0012] According to a seventh aspect, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform a method as described in any implementation of the first or second aspect.

[0013] According to the eighth aspect, a non-transitory computer-readable storage medium is provided that stores computer instructions for causing a computer to perform the method as described in any implementation of the first or second aspect.

[0014] The embodiments of this disclosure provide a method and apparatus for training a teaching model and processing teaching tasks based on federated learning. First, an initial teaching model output from a central server is received. This initial teaching model is used to generate or execute teaching tasks. Second, the initial teaching model is trained using a local data sample set and a composite loss function to obtain a trained teaching model. The composite loss function includes a task loss function for the teaching task and a graph constraint loss function to align the internal representation generated by the teaching model when processing text with the structured representation of the knowledge concepts involved in the text in the knowledge graph. Third, based on the trained teaching model and the initial teaching model, a model update is obtained. Then, based on the knowledge graph, an entity embedding matrix is ​​obtained. Finally, the model update and the entity embedding matrix are sent to the central server. This deeply embeds the knowledge graph into the core gradient calculation of the training loop. The structured knowledge obtained through the graph constraint loss function is directly and in real-time distilled into the parameters of the initial teaching model, greatly alleviating the problem of factual illusions in the initial teaching model and ensuring that the output content of the initial teaching model possesses localized professionalism and pedagogical rationality from the source, thus improving the reliability and accuracy of the teaching model training.

[0015] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0016] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0017] Figure 1 This is a flowchart of an embodiment of a teaching model training method based on federated learning according to this disclosure;

[0018] Figure 2 This is a flowchart of a round t of federated learning between two participating nodes and the central server.

[0019] Figure 3 This is a flowchart of another embodiment of the teaching model training method based on federated learning according to this disclosure;

[0020] Figure 4 This is a flowchart of an embodiment of the teaching task processing method according to this disclosure;

[0021] Figure 5 This is a schematic diagram of the structure of one embodiment of the teaching model training device based on federated learning disclosed herein;

[0022] Figure 6 This is a schematic diagram of another embodiment of the teaching model training device based on federated learning disclosed herein;

[0023] Figure 7 This is a schematic diagram of the structure of one embodiment of the teaching task processing device disclosed herein;

[0024] Figure 8 This is a block diagram of an electronic device used to implement the federated learning-based teaching model training method or teaching task processing method of the embodiments of this disclosure. Detailed Implementation

[0025] Unless otherwise expressly stated, throughout the specification and claims, the term "comprising" or its variations such as "including" or "comprises" shall be understood to include the stated elements or components without excluding other elements or other components.

[0026] The technical solutions of this disclosure are illustrated below through specific embodiments. It should be understood that one or more steps mentioned in this disclosure do not preclude the existence of other methods and steps before or after the combined steps, or that other methods and steps may be inserted between these explicitly mentioned steps. It should also be understood that these examples are for illustrative purposes only and are not intended to limit the scope of this disclosure. Unless otherwise stated, the numbering of each method step is only for the purpose of identifying each method step, and not to limit the order of each method or to limit the scope of implementation of this disclosure. Changes or adjustments to their relative relationships, without substantial changes to the technical content, can also be considered as within the scope of implementation of this disclosure.

[0027] To address the shortcomings of traditional technologies, this disclosure proposes a teaching model training method based on federated learning, which is applied to each participating node in federated learning. Without disclosing local data, knowledge graph constraints are integrated into federated training and model updates and entity embeddings are uploaded, so that the text representation of the global teaching model is fully aligned with knowledge concepts, thereby improving the accuracy, generalization and interpretability of teaching tasks and promoting stable convergence. Figure 1 A flowchart 100 illustrates an embodiment of the federated learning-based instructional model training method of this disclosure. The above-described federated learning-based instructional model training method, applied to each participating node in the federated learning process, includes the following steps:

[0028] Step 101: Receive the initial teaching model output by the central server.

[0029] In this embodiment, the initial teaching model can adopt an encoder and decoder structure. The initial teaching model is used to generate or execute teaching tasks, which can be natural language understanding and generation tasks that provide teaching assistance to the teaching subject or the learning subject. Teaching tasks include: automated generation of teaching content, for example, based on the teacher's instruction to "generate a variation of the chicken-and-rabbit problem," the initial teaching model can automatically generate a question that meets the requirements; personalized question generation and tutoring, for example, for a student's incorrect answer, the initial teaching model can generate an inspiring and targeted comment to guide the student to correct it themselves – intelligent Q&A. The mathematical representation of the initial teaching model... In the diagram, X is the input sequence and Y is the target sequence. This represents the probability distribution of the target sequence. In the initial teaching model, the input and target sequences are closely tied to specific teaching tasks. For example, to generate teaching comments: the input sequence X can be a concatenated text of "question content" + "student's incorrect answer"; the target sequence Y is the "standard teacher guidance comments." Similarly, to generate courseware: the input sequence X can be information such as the course's knowledge points and teaching objectives; the target sequence Y is the complete courseware text generated by the model.

[0030] In this embodiment, the initial teaching model is a global model distributed from the central server to the participating nodes in the federated learning process. Each participating node is the main operating entity of the teaching model training method based on federated learning disclosed herein, such as... Figure 2 As shown, there are two participating nodes. After receiving the initial teaching model, each participating node executes steps 101 to 105 of this disclosure, sending the trained teaching model to the central server. Specifically, as... Figure 2 The two "receive initial teaching model" steps are the execution steps 101 of the two participating nodes.

[0031] In this embodiment, each participating node in the federated learning system is a teaching terminal of the client. The teaching terminal establishes a session with the central server through a secure communication protocol (such as HTTPS / gRPC) and initiates an initial teaching model retrieval request based on the teaching task identifier, terminal computing power, and model version policy. The central server returns the model package download address, version number, and verification information. The model package adopts a standardized format (such as ONNX or TensorFlow SavedModel) and includes a dependency list and configuration file. After receiving the data, the teaching terminal performs integrity verification (such as SHA-256) and signature verification. After successful verification, the teaching terminal decompresses the model package to the local cache directory and loads the model into the inference engine (such as TensorRT or PyTorchRuntime) according to the resource management policy, while registering it with the teaching task scheduling module. If there is a network error or verification failure, a retry and rollback to the last available model are performed. After the model is loaded, it is coupled with the question bank, student profile data, and interactive components through a unified interface to enable teaching tasks such as question recommendation, explanation generation, and interactive evaluation. During the task execution process, the terminal periodically collects running indicators and logs and sends them back to the central server to support subsequent model iteration and optimization.

[0032] Step 102: Use the local data sample set and composite loss function to train the initial teaching model to obtain the trained teaching model.

[0033] In this embodiment, the composite loss function includes: a task loss function for the teaching task and a graph constraint loss function for aligning the internal representation generated by the teaching model when processing text with the structured representation of the knowledge concepts involved in the text in the knowledge graph. That is, the composite loss function is achieved by the task loss function and the graph constraint loss function.

[0034] In this embodiment, as Figure 2 The two sets of steps, namely "calculating task loss value and calculating graph constraint loss value", "calculating total loss value of composite loss function" and "backpropagation to update initial teaching model", are the specific processes of two participating nodes executing step 102.

[0035] In this embodiment, step 102 is specifically implemented as follows: the local data sample set is preprocessed, entity / concept recognition is performed and knowledge graph links are completed, and subgraphs are formed by extracting the concepts involved in the text and their adjacent relationships; end-to-end training is carried out with the initial teaching model as the backbone, and the teaching task prediction results and the text representation of the intermediate layer (such as tokens or sentence-level latent vectors) are output simultaneously during forward feeding. The task loss function is selected according to the task type, such as cross-entropy or mean squared error; the graph constraint loss projects the intermediate representation to the same representation space as the knowledge graph embedding through linear or MLP (Multi-Layer Perceptron), and uses GNN (Graph Neural Network) or pre-trained graph embedding to encode the concept / relation vector of the corresponding subgraph. Through contrastive learning or triple loss (with negative sampling), the text internal representation is aligned with the concept / relation embedding of its links and distanced from non-corresponding concepts; the two are weighted according to the set weights to form a composite loss, and iterative updates are performed using optimizer, learning rate scheduling and gradient pruning. Training stops when the validation set index or loss converges, thereby obtaining the trained teaching model.

[0036] It should be noted that the graph constraint loss function is used to align the internal representation generated by the teaching model when processing text with the structured representation of the knowledge concepts involved in the text in the knowledge graph. Therefore, any loss function that can achieve the goal of bringing positive samples closer and pushing negative samples further away is within the scope of this invention. For example, the graph constraint loss function can adopt the triplet loss function, which considers not only positive or negative samples, but also the relationship between the anchor point, positive samples, and negative samples simultaneously. Here, the anchor point is the text context representation generated by the model, where the text is a sample in the current data sample, the positive sample is the entity embedding vector in the knowledge graph corresponding to the text, and the negative sample is an entity embedding vector sampled from the entity embedding vectors of the knowledge graph that is unrelated to the text. The goal of the triplet loss function optimization is to ensure that the distance between the "anchor point" and the "positive sample," plus a preset "margin," is still less than the distance between the "anchor point" and the "negative sample." This forces the model to learn a representation space where related text and knowledge points are clustered very close in vectors, while unrelated ones are pushed far apart.

[0037] Step 103: Based on the trained teaching model and the initial teaching model, obtain the model update amount.

[0038] In this embodiment, after training is completed, the weights and bias parameters of each layer of the teaching model are read and aligned with the initial teaching model one by one according to parameter name and dimension. The difference between the trained parameters and the initial parameters is calculated layer by layer as the model update amount. To improve robustness and transmission efficiency, the difference can be normalized according to the training round or the number of samples, and threshold sparsity or quantization compression is applied to updates with small amplitudes. Finally, the update amount, along with meta-information such as layer name, shape, and data type, is encapsulated into an update package for subsequent model synchronization or incremental deployment.

[0039] Optionally, step 103 above further includes: subtracting the initial teaching model from the trained teaching model to obtain the model update amount.

[0040] Step 104: Based on the knowledge graph, obtain the entity embedding matrix.

[0041] In this embodiment, the knowledge graph is a graph representing information about teaching and cultural content. It is a directed heteromorphic graph composed of sets of triples. ,in, It is the set of entities of node k, as shown in Table 1; It is the set of relations of node k, as shown in Table 2.

[0042] Table 1

[0043] Node type Example (a type of CKG) Example (CKG from another culture) describe KnowledgeConcept Pythagorean theorem Pythagorean Theorem Subject knowledge points Curriculum Standard Compulsory Education Mathematics Curriculum Standards CCSS.Math Course syllabus or standards Cognitive Level Understanding, Application, Creation Bloom's: Understand, Apply Cognitive levels Cultural Elements Spring Festival, Chinese Zodiac Thanksgiving, Halloween Local cultural symbols

[0044] Table 2

[0045] edge type Example (a type of CKG) Example (CKG from another culture) describe isPrerequisiteFor (A linear equation in one variable, isPrerequisiteFor; a system of linear equations in two variables) (Linear Equation,isPrerequisiteFor, System ofEquations) Priority relationship of knowledge points isExemplifiedBy (Fraction word problem, isExemplifiedBy, Chicken and Rabbit Problem) (Fraction Problem, isExemplifiedBy,Pizza Sharing Problem) Typical examples of knowledge points targetsCognitiveLevel (Design experiments, targets Cognitive Level, creation) (Design Experiment, targetsCognitiveLevel, Bloom's:Create) Cognitive objectives corresponding to teaching activities

[0046] In this embodiment, the entity embedding matrix is ​​a matrix representation of the vectors of entities in the knowledge graph. Specifically, it refers to a large matrix composed of the embedding vectors corresponding to each entity in the local knowledge graph's entity set. Mathematically, it is represented as... Here d represents the total number of entities in the local knowledge graph (e.g., CKG has 50,000 entities); d represents the vector dimension assigned to each entity (e.g., 256-dimensional, meaning the matrix is ​​a huge table with 50,000 rows and 256 columns, where each row uniquely corresponds to an entity), and the 256 numbers in this row are the mathematical coordinates of that entity in the semantic space.

[0047] Step 104 above includes: in response to the fact that some or all entities in the knowledge graph have not generated vector representations, using a graph representation learning algorithm on the triples of the knowledge graph. Pre-training is performed on each entity. Generate a low-dimensional, dense vector representation (embedding). The entity embedding matrix is ​​obtained by combining these components. For details of pre-training, please refer to the description below. Since all entities in the knowledge graph have generated vector representations, the existing entity embedding matrix is ​​used. This matrix captures the semantic and structural information of entities in the knowledge graph and will be used for subsequent constraint training.

[0048] In this embodiment, the pre-training process is as follows: First, unique ID mapping is performed on entities and relations in the knowledge graph, standard triples (h, r, t) are extracted and cleaned, and the training / validation partition is completed; the embedding dimension d and training hyperparameters are set, and a representation learning model (such as TransE, DistMult, ComplEx, or message-passing-based R-GCN) is selected, and entity and relation vectors are randomly initialized; positive and negative triples are constructed using negative sampling, and the scoring function is optimized using marginal ranking loss or cross-entropy loss, so that the model assigns higher scores to positive samples and lower scores to negative samples, and L2 regularization and vector normalization are used to suppress overfitting; after iterating through mini-batch training and early stopping strategy until the validation set converges, the entity embedding matrix is ​​derived in the order of entity ID, where each row corresponds to a d-dimensional vector representation of an entity, which can be directly used for similarity retrieval, clustering, or downstream prediction tasks.

[0049] Step 105: Send the model update amount and entity embedding matrix to the central server.

[0050] In this embodiment, after completing local training, the terminal generates the model update quantity Δθ ​​and the entity embedding matrix E, and encapsulates them together with the model identifier, client identifier, training round number, timestamp, and integrity check code into an update message. To reduce bandwidth consumption, sparse representation is preferentially used to perform index-value encoding on Δθ and E, and efficient serialization formats such as Protobuf and compression are used. Subsequently, the terminal initiates an upload to the aggregation interface exposed by the central server through the established secure communication channel. The request carries an idempotent key to support duplicate submissions and deduplication. After verifying the signature and hash, the server persists the data into the queue and returns an acknowledgment. The terminal maintains a retransmission mechanism and exponential backoff before receiving the acknowledgment to improve reliability. To protect privacy, differential privacy noise or pruning and normalization can be added to the update quantity locally, and no original sample data is uploaded. Before aggregation, the central server performs a version consistency check based on the round number, performs key alignment and completion on the embedding matrix as needed, and includes the verified Δθ and E into the global aggregation process of this round.

[0051] like Figure 2As shown, without any cross-border transfer of original or sensitive educational data, a unified teaching model is collaboratively trained using globally distributed private domain data. This teaching model not only possesses powerful universal language and knowledge capabilities but also deeply understands and automatically adapts to the education systems, curriculum standards, and cultural contexts of different countries and regions. During the training of this teaching model, the introduction of a structured "cultural knowledge graph" as an "intelligent constraint" significantly improves the accuracy, logic, and credibility of the model's generated content. It should be noted that... Figure 2 The process of obtaining the model update and entity embedding matrix is ​​omitted. In actual operation, each participating node will send the model update and entity embedding matrix to the central server.

[0052] This disclosure does not apply federated learning or knowledge graphs in isolation, but rather innovatively couples them deeply to design a dual, closed-loop, cross-domain intelligent constraint and alignment framework. This framework is specifically designed to address the three fundamental challenges of law, culture, and trust faced when building global education models.

[0053] The federated learning-based instructional model training method disclosed herein is applied to each participating node in a federated learning process. First, an initial instructional model output from a central server is received. This initial model is used to generate or execute instructional tasks. Second, the initial model is trained using a local data sample set and a composite loss function to obtain a trained instructional model. The composite loss function includes a task loss function for the instructional task and a graph constraint loss function to align the internal representation generated by the instructional model when processing text with the structured representation of the knowledge concepts involved in the text within the knowledge graph. Third, based on the trained instructional model and the initial instructional model, a model update is obtained. Then, based on the knowledge graph, an entity embedding matrix is ​​obtained. Finally, the model update and entity embedding matrix are sent to the central server. Thus, without disclosing local data, knowledge graph constraints are integrated into federated training, and model updates and entity embeddings are uploaded, ensuring full alignment between the text representation of the global instructional model and knowledge concepts. This improves the accuracy, generalization, and interpretability of the instructional tasks and promotes stable convergence.

[0054] In some optional implementations of this disclosure, the task loss function includes a cross-entropy loss function, the graph constraint loss function includes an information noise contrast estimation function, and the training of the initial teaching model using a local data sample set and a composite loss function to obtain a trained teaching model includes: in the current iteration cycle, inputting local data samples selected from the local data sample set into the initial teaching model to obtain the target output sequence of the initial teaching model; calculating the task loss value of the cross-entropy loss function based on the local data samples and the target output sequence; calculating the contrast loss value of the information noise contrast estimation function based on the local data samples, the knowledge graph, and the context representation output by the encoder of the initial teaching model; calculating the total loss value based on the task loss value and the contrast loss value; and obtaining the trained teaching model in response to the detection that the initial teaching model meets the training completion condition based on the total loss value.

[0055] In this optional implementation, the task loss value The calculation method is shown in Equation (1), which is the standard supervised learning loss. For generating instructional tasks, it is usually the cross-entropy loss function:

[0056] (1)

[0057] In equation (1) It is the input data sequence. This is the target output sequence. This loss function drives the model to learn how to complete a specified instructional task (such as generating questions).

[0058] Comparison of loss values The goal of the corresponding graph constraint loss function is to align the internal representation generated by the teaching model when processing text with the structured representation of the knowledge concepts involved in the text in the knowledge graph. As shown in Equation (2), the contrastive loss value of the above-mentioned information noise contrastive estimation function includes: for sample batches The text is analyzed to identify the CKG entities mentioned. For example, the text "Please explain the proof of the Pythagorean theorem" links to the entity KnowledgeConcept: Pythagorean Theorem. Let the set of linked entities be... Input the text into the current initial teaching model. It also extracts the contextual representation of the text from the last layer of its Encoder. ; Query the entity set from the pre-trained local CKG embedding library. Each entity corresponding embedding vector The contrast loss value is calculated using the information noise contrast estimation function. By using the information noise contrast estimation function, the difference can be narrowed. Its corresponding positive sample entity embedding The distance, while pushing away from all other "negative sample" entity embeddings. The distance.

[0059] (2)

[0060] In equation (2), It is a learnable projection head used to represent text. Dimensions Mapped to the same dimension as entity embedding ; It is cosine similarity; It is a temperature hyperparameter used to control the sharpness of softmax; It is a set of negative sample entities randomly sampled from the knowledge graph, and the composite loss value is obtained through backpropagation of the composite loss function. Local initial teaching model The update not only fits the data, but is also "shaped" to better fit the knowledge structure of the local knowledge graph.

[0061] In this optional implementation, the local data sample set can be input into the encoder-decoder structure of the initial teaching model in batches. The decoder calculates the task loss value based on the labeled target sequence. At the same time, a contrastive learning signal is constructed for each sample according to the knowledge graph: the context representation output by the encoder is paired with the entity / relation embedding that is adjacent or semantically related to it in the knowledge graph as a positive sample, and paired with the entity / relation embedding that is irrelevant or randomly sampled as a negative sample. The contrastive loss value is calculated using the information noise contrastive estimation function under a set temperature coefficient. The total loss value of the composite loss function is obtained through weighted fusion (e.g., total loss = task loss value + λ × contrastive loss value). The optimizer is used to backpropagate and update the parameters. The process is iterated and the training completion condition is determined when the total loss of the validation set converges, the early stopping condition is triggered, or the preset number of training rounds is reached. The trained teaching model is then output.

[0062] Figure 3 A flowchart 300 illustrates another embodiment of the federated learning-based instructional model training method of this disclosure. The above-described federated learning-based instructional model training method, applied to a central server for federated learning, includes the following steps:

[0063] Step 301: After sending the initial teaching model to all participating nodes, receive the entity embedding matrix and model update amount of the knowledge graph sent by each participating node.

[0064] In this embodiment, in the federated learning system, the central server first broadcasts the initial teaching model to all participating nodes; each participating node then runs as follows: Figure 1 The federated learning-based teaching model training method shown obtains the entity embedding matrix and model update values. The entity embedding matrix and model update values ​​are calibrated and aligned according to agreed version number / dimensional specifications (e.g., through shared anchor entities or a unified dictionary), and optionally compressed and privacy-preserving (quantization, differential privacy, or secure aggregation) are performed before being sent back to the central server. The central server receives the entity embedding matrix and model update values ​​from each node, performs identity and integrity verification, timestamp / round verification, and dimensional consistency checks, and uses weighted averaging or other aggregation strategies to fuse and update the initial teaching model. It also fuses the entity embedding matrices of each node according to anchor alignment or mapping rules to obtain a global or aligned embedding representation. After the update is completed, the central server records the contribution and training metadata, and distributes the final teaching model, i.e., the new global model for this iteration (and necessary embedding alignment information), to each node, entering the next iteration until convergence.

[0065] like Figure 2 As shown, the central server is the main body responsible for executing the teaching model training method based on federated learning disclosed in this paper. The central server receives the entity embedding matrix and the model update amount.

[0066] Step 302: For any two participating nodes among all participating nodes, calculate the target transmission matrix of the two participating nodes based on the entity embedding matrix of the two participating nodes.

[0067] In this embodiment, the target transmission matrix It is the result obtained by pairwise pairing calculations between any two participating nodes. It is a transfer matrix used to measure and indicate the instance-level correspondence and structural similarity between two nodes. The high-value element (k, m) indicates that "entity e_k from one participating node" and "entity e_m from another participating node" have a high structural similarity. It only reflects the correspondence between the two knowledge graphs of any two participating nodes.

[0068] Specifically, the target transmission matrix can be calculated using the formula shown in equation (3).

[0069] (3)

[0070] In equation (3), nodes i and j are two nodes in the knowledge graph, each containing several "instances / samples" (such as examples, corpus fragments, etc. under the node). It is the distance within the embedded space (such as Euclidean distance). It is a transfer matrix. It represents the entity distribution of nodes i and j. High-value elements Representing entities and They have a high degree of structural similarity. , Let represent the k-th instance of node i and the m-th instance of node j, respectively. , It is the embedding vector (representation in a certain vector space) of the above instances.

[0071] In equation (3), the objective function is... This means first looking at the distance within each group on both sides, and using P to associate a pair of instances (k, l) on side i with a pair of instances (m, n) on side j; then penalizing the square of the difference in the corresponding intra-group distances on both sides, and using P... km ·P ln Weighted summation yields a sum, and minimizing this sum is equivalent to finding a P such that, under this pairing, the internal geometry of the two sets of instances is as consistent as possible.

[0072] Step 303: Based on the target transmission matrix of all participating nodes, construct a global alignment mapping library for equivalent concepts under different cultures.

[0073] In this embodiment, the global alignment mapping library is the final global result constructed on the central server after integrating all target transmission matrices between all participating node pairs.

[0074] In this embodiment, the target transfer matrix (describing the mapping from the local cultural semantic space to the neutral intermediate semantic space) learned locally by each participating node is aggregated. After integrity verification and noise evaluation, a confidence weight is assigned to each matrix, and dimensional alignment and spectral normalization are performed. Subsequently, a multi-view concept graph is constructed using the concept ontology of each node as vertices and cross-cultural co-occurrence / alignment scores as edge weights. Weighted multi-view matrix fusion and global orthogonal Procrustes / optimal transfer joint optimization are used to solve for the shared standard semantic coordinate system and the optimal transformation from each culture to this coordinate system. Based on the obtained global latent embedding, an "equivalent concept—standard ID—multicultural mapping" is generated. The system generates reference entries for "emissive functions / synonymous clusters," along with confidence scores and source tracing data, which are then written into a searchable global alignment mapping library. Conflicting entries are automatically adjudicated through ontology consistency constraints (hierarchy / mutual exclusion / cross-corpus verification) and robust estimations (such as Huber loss and truncated mean), with low-confidence mappings entering a pending pool. The library is maintained using a federated aggregation incremental update mechanism (sliding window + versioning), performing rapid adaptation on new node matrices (minor calibration of anchor concepts + warm start), and protecting node privacy with differential privacy and secure aggregation. Finally, it provides interfaces for concept-based retrieval, cross-cultural equivalence queries, and vector projection, enabling global alignment of equivalent concepts across different cultures. It should be noted that each participating node corresponds to a culture, and any two participating nodes can have the same or different cultures.

[0075] Step 304: Calculate the intermediate teaching model based on the model update amount of all participating nodes and the initial teaching model.

[0076] In this embodiment, the intermediate teaching model is a temporary global model applicable to all participating nodes. Specifically, the intermediate teaching model can be obtained by performing a standard federated average on the model update amount, and then summing the federated average with the initial teaching model.

[0077] like Figure 2 As shown, the central server will calculate the target transmission matrix and construct the global alignment mapping library based on the received entity embedding matrix. Simultaneously, the steps 302-304 and 305, namely "aggregate the model update amount of all participating nodes" and "calculate the intermediate teaching model", can all be run synchronously in the central server.

[0078] Optionally, step 304 above includes: collecting the parameter update Δ from each participating node relative to the initial teaching model after each round of federated training. i (e.g., weight difference or gradient), first perform integrity checks and outlier pruning, and then base the results on the node weights w. i (This can be determined by local sample size, data quality, or validation set performance) Weighted aggregation of the update amounts yields the global update Δ = ∑ iw i Δ i Then, this global update is superimposed onto the initial teaching model θ using the set learning rate η, and the intermediate teaching model θ is calculated. mid =θ0 + η·Δ.

[0079] Step 305: Based on the global alignment mapping library and the preset alignment loss function, fine-tune the intermediate teaching model to obtain the final teaching model.

[0080] In this embodiment, the alignment loss function is used to enable the intermediate teaching model to produce similar internal representations of semantically equivalent concepts from different cultures in the global alignment mapping library. See also Figure 2 The process involves "fine-tuning the intermediate teaching model" to "obtaining the final teaching model".

[0081] In this embodiment, step 305 is used to use an alignment mapping library. and alignment loss function The intermediate teaching model is fine-tuned once or several times. The alignment loss function is shown in equation (4).

[0082] (4)

[0083] In equation (4), From the alignment mapping library High-confidence aligned entity pairs sampled in the middle; It is the text name of the entity; This indicates that the entity name is obtained using the encoder part of the intermediate teaching model; It is a distance metric, such as mean squared error; the goal of the alignment loss function is to make the aggregated model produce the most similar internal representations possible for concepts that are semantically equivalent in different cultures.

[0084] In this embodiment, fine-tuning the intermediate teaching model is the process of training the intermediate teaching model. Specifically, fine-tuning the intermediate teaching model includes applying gradient descent to minimize the intermediate teaching model in this round. As shown in equation (5), the final teaching model for this round is obtained. The final teaching model is a global model generated by the central server that can be distributed to all participating nodes.

[0085] (5)

[0086] In equation (5), This represents the intermediate teaching model. This represents the final teaching model.

[0087] Optionally, during the fine-tuning phase, semantically equivalent concept pairs or concept sets (such as p, q) from different cultures are extracted in batches from the global alignment mapping library. Their descriptions or examples are input into the intermediate teaching model, and internal representations are obtained through a unified encoding sublayer. An alignment loss is defined to make the representations of equivalent concepts similar. At the same time, the loss L_task of the original teaching task is weighted and fused with the loss L_task by weight λ to obtain the total loss L = L_task + λ·L_align. During training, teaching data and alignment data are mixed in each batch. An optimizer and learning rate warm-up / annealing strategy are used, and the alignment effect is improved by hard example mining and in-batch negative sampling. After several iterations, the cross-cultural retrieval / representation similarity index on the validation set converges or stops early, and finally the final teaching model is obtained, which makes the semantically equivalent concepts of different cultures converge in the internal space.

[0088] Step 306: Send the final teaching model to each participating node.

[0089] In this embodiment, when federated learning meets the termination conditions (e.g., the number of rounds between the central server and all participating nodes in federated learning exceeds a threshold (e.g., 100 rounds), the parameter changes of the final teaching model are less than a certain threshold, or the performance improvement of the final teaching model is no longer significant after multiple rounds of training, the federated learning reaches its maximum training time, and the model performance reaches the expected target), the final teaching model is considered to have converged, training is terminated, and the final teaching model is used as a usable teaching model for teaching. If federated learning does not meet the termination conditions, the final teaching model of this round will be sent as the initial teaching model for the next round to each participating node, so that each participating node can train the initial teaching model locally.

[0090] exist Figure 2 After obtaining the final teaching model and sending it to all participating nodes, the current round of federated learning (round t) ends. If the termination condition is not met, round t+1 of federated learning can begin. If the termination condition is met, no further rounds of federated learning will be performed.

[0091] The federated learning-based teaching model training method disclosed herein is applied to a central server of a federated learning system. First, after sending the initial teaching model to all participating nodes, the system receives the entity embedding matrix and model update amount of the knowledge graph from each participating node. Second, for any two participating nodes, a target transfer matrix is ​​calculated based on their entity embedding matrices. Third, a global alignment mapping library of equivalent concepts across different cultures is constructed based on the target transfer matrices of all participating nodes. Fourth, an intermediate teaching model is calculated based on the model update amounts and the initial teaching model from all participating nodes. Fifth, the intermediate teaching model is fine-tuned based on the global alignment mapping library and a preset alignment loss function to obtain the final teaching model. Finally, the final teaching model is sent to each participating node. Thus, while protecting the data privacy of each node, global semantic alignment of cross-cultural equivalent concepts is achieved, significantly improving the generalization ability, consistency, and collaborative training effect of the final teaching model.

[0092] In some optional implementations of this disclosure, the aforementioned global alignment mapping library stores the equivalent entities of each entity in the knowledge graph and the confidence level of the entity and its equivalent entity. Constructing a global alignment mapping library of equivalent concepts under different cultures based on the target transfer matrix of all participating nodes includes: detecting whether there are multiple entities from different cultural regions pointing to the same equivalent concept based on the target transfer matrix of all participating nodes; in response to detecting multiple entities from different regions pointing to the same equivalent concept, detecting whether the confidence level of each entity among the multiple entities is greater than a confidence threshold; in response to detecting that the confidence level of an entity among the multiple entities is greater than the confidence threshold, storing the entity with a confidence level greater than the confidence threshold into the global alignment mapping library.

[0093] In this optional implementation, it is assumed that all participating nodes include three nodes: country A, country B, and country C. The target transmission matrix between country A and country B is determined from the target transmission matrices of all participating nodes. Target transmission matrix between country A and country C And the target transmission matrix between country B and country C. The central processing unit synthesizes the results of all pairwise calculations to determine the global alignment mapping library. For example, the target transfer matrix between country A and country B. In the study, it was found that the Pythagorean Theorem of country A and country B are highly similar. The target transfer matrix between country A and country C was also analyzed. In the study, it was found that the Pythagorean theorem of country A and the Pythagoras' Theorem of country C also have a high degree of similarity. The target transfer matrix between countries B and C was also examined. Furthermore, it was discovered that the "Pythagorean Theorem" from country B and the "Pythagoras's Theorem" from country C are extremely similar. These three calculations corroborate each other, essentially meaning these three entities "voted" for each other. By aggregating all paired calculation results in this way, the system can ultimately construct a global, probabilistic, globally aligned mapping library, concluding that these three entities from different countries actually point to the same core mathematical concept.

[0094] In this optional implementation, the system collects the target transmission matrix (matrix entries represent the confidence level of a local entity pointing to a globally equivalent concept) from all participating nodes, extracts candidate equivalent concepts and confidence levels for each entity (e.g., taking the maximum value or the entry exceeding the minimum supported value), aggregates them by equivalent concept ID, and detects whether multiple entities from different cultural regions point to the same concept based on the entity's cultural region label. If such a situation is detected, the confidence level of each entity in the group is compared with a preset threshold. Entities with confidence levels not lower than the threshold, along with their equivalent concept ID, confidence level, source node, and cultural region metadata, are stored in a global alignment mapping library (which can be a distributed key-value or graph storage). Deduplication, versioning, and consistency updates are performed to ensure subsequent maintenance and rollback.

[0095] Figure 4 A flowchart 400 illustrates an embodiment of the teaching task processing method of this disclosure, which includes the following steps:

[0096] Step 401: Receive the input data sequence from the learning object or teaching object.

[0097] In this embodiment, the learning object is the object that learns the teaching content of different courseware, which may include students and / or student terminals; the teaching object is the object that educates different learning objects, which may include teachers and / or teacher terminals, and the input data sequence is... Figure 1 The contents of the input data sequence described in the illustrated embodiment will not be repeated here.

[0098] In this embodiment, the execution entity (e.g., a central server or participating node) running on the teaching task processing method can obtain the input data sequence in various ways. For example, the execution entity can obtain the input data sequence stored in the database server through a wired or wireless connection. Alternatively, the execution entity can receive the input data sequence collected by a terminal or other device.

[0099] Step 402: Input the input data sequence into the final teaching model and output the target output sequence related to the teaching task.

[0100] In this embodiment, the final teaching model can be achieved through, for example... Figure 2 The teaching model training method shown is obtained through federated learning. For the detailed generation process of the final teaching model, please refer to [link / reference]. Figure 2 The relevant descriptions of the embodiments will not be repeated here.

[0101] It should be noted that the teaching task processing method in this embodiment can be used to test the final teaching model generated by the above embodiments. Furthermore, the final teaching model can be continuously optimized based on the conversion results. This method can also be a practical application of the final teaching model generated by the above embodiments.

[0102] In this embodiment, the input data sequence to be processed is preprocessed according to the same process as the training phase (including normalization, feature extraction, word segmentation or frame segmentation, length alignment and mask construction). After being encapsulated into batch tensors according to the model input signature, the global parameters and hyperparameters of the final teaching model obtained by federated learning are loaded. Forward computation is performed in the inference environment to obtain the time step probability distribution or intermediate semantic representation corresponding to the teaching task. Then, the target output sequence is generated according to the task decoding strategy (such as greedy or bundle search, CTC / attention decoding, threshold filtering and prior constraints), realizing the stable and traceable target sequence output of the input data sequence.

[0103] The teaching task processing method provided in this disclosure first receives an input data sequence from a learning subject or a teaching subject; then, it inputs the input data sequence into the final teaching model generated by the aforementioned federated learning teaching model training method, and outputs a target output sequence related to the teaching task. Thus, while protecting data privacy, it leverages federated learning to aggregate knowledge from multiple sources to quickly generate target output sequences highly matched to teaching tasks for different learning subjects, thereby significantly improving the accuracy and efficiency of teaching.

[0104] Further reference Figure 5 As an implementation of the methods shown in the above figures, this disclosure provides an embodiment of a federated learning-based instructional model training device. This federated learning-based instructional model training device is applied to each participating node in federated learning. This device embodiment is similar to... Figure 1 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.

[0105] like Figure 5As shown, the federated learning-based teaching model training device 500 provided in this embodiment includes: a model receiving unit 501, a training unit 502, an update unit 503, an acquisition unit 504, and a first sending unit 505. The model receiving unit 501 can be configured to receive an initial teaching model output by a central server, which is used to generate or execute teaching tasks. The training unit 502 can be configured to train the initial teaching model using a local data sample set and a composite loss function to obtain a trained teaching model. The composite loss function includes a task loss function for the teaching task and a graph constraint loss function to align the internal representation generated by the teaching model when processing text with the structured representation of the knowledge concepts involved in the text in the knowledge graph. The update unit 503 can be configured to obtain a model update amount based on the trained teaching model and the initial teaching model. The acquisition unit 504 can be configured to obtain an entity embedding matrix based on the knowledge graph. The first sending unit 505 can be configured to send the model update amount and the entity embedding matrix to the central server.

[0106] In this embodiment, in the federated learning-based teaching model training device 500: the specific processing of the model receiving unit 501, training unit 502, update unit 503, obtaining unit 504, and first sending unit 505, and the resulting technical effects, can be found in the following references. Figure 1 The relevant descriptions of steps 101, 102, 103, 104, and 105 in the corresponding embodiments will not be repeated here.

[0107] In some embodiments of this disclosure, the task loss function includes a cross-entropy loss function, the graph constraint loss function includes an information noise contrast estimation function, and the training unit 502 is configured to: in the current iteration cycle, input local data samples selected from the local data sample set into the initial teaching model to obtain the target output sequence output by the initial teaching model; calculate the task loss value of the cross-entropy loss function based on the local data samples and the target output sequence; calculate the contrast loss value of the information noise contrast estimation function based on the local data samples, the knowledge graph, and the context representation output by the encoder of the initial teaching model; calculate the total loss value based on the task loss value and the contrast loss value; and obtain the trained teaching model in response to detecting that the initial teaching model meets the training completion condition based on the total loss value.

[0108] Further reference Figure 6 As an implementation of the methods shown in the above figures, this disclosure provides another embodiment of a federated learning-based instructional model training device. This federated learning-based instructional model training device is applied to a central server for federated learning. This device embodiment is similar to... Figure 3Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.

[0109] like Figure 6 As shown, the federated learning-based teaching model training device 600 provided in this embodiment includes: a graph receiving unit 601, a matrix calculation unit 602, a construction unit 603, a model calculation unit 604, a fine-tuning unit 605, and a second sending unit 606. The graph receiving unit 601 can be configured to receive the entity embedding matrix and model update amount of the knowledge graph sent by each participating node after sending the initial teaching model to all participating nodes. The matrix calculation unit 602 can be configured to calculate the target transmission matrix of any two participating nodes based on their entity embedding matrices. The construction unit 603 can be configured to construct a global alignment mapping library of equivalent concepts under different cultures based on the target transmission matrices of all participating nodes. The model calculation unit 604 can be configured to calculate the intermediate teaching model based on the model update amount and the initial teaching model of all participating nodes. The aforementioned fine-tuning unit 605 can be configured to fine-tune the intermediate teaching model based on a global alignment mapping library and a preset alignment loss function to obtain the final teaching model. The alignment loss function is used to ensure that the intermediate teaching model produces similar internal representations for semantically equivalent concepts from different cultures in the global alignment mapping library. The aforementioned second sending unit 606 can be configured to send the final teaching model to each participating node.

[0110] In this embodiment, in the federated learning-based teaching model training device 600: the specific processing of the graph receiving unit 601, matrix calculation unit 602, construction unit 603, model calculation unit 604, fine-tuning unit 605, and second sending unit 606, and the resulting technical effects, can be found in the following references: Figure 3 The relevant descriptions of steps 301, 302, 303, 304, 305, and 306 in the corresponding embodiments will not be repeated here.

[0111] In some embodiments of this disclosure, the aforementioned global alignment mapping library stores the equivalent entities of each entity in the knowledge graph and the confidence level of the entity and its equivalent entity. The aforementioned construction unit 603 is configured to: detect whether there are multiple entities from different cultural regions pointing to the same equivalent concept based on the target transmission matrix of all participating nodes; in response to detecting multiple entities from different regions pointing to the same equivalent concept, detect whether the confidence level of each entity among the multiple entities is greater than a confidence level threshold; in response to detecting that the confidence level of an entity among the multiple entities is greater than the confidence level threshold, store the entity with the confidence level greater than the confidence level threshold into the global alignment mapping library.

[0112] Further reference Figure 7 As an implementation of the methods shown in the above figures, this disclosure provides an embodiment of a teaching task processing device, which is similar to... Figure 4 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.

[0113] like Figure 7 As shown, the teaching task processing device 700 provided in this embodiment includes: a data receiving unit 701 and a processing unit 702. The data receiving unit 701 can be configured to receive an input data sequence from a learning object or a teaching object. The processing unit 702 can be configured to input the input data sequence into a final teaching model and output a target output sequence related to the teaching task. The final teaching model is generated using the aforementioned federated learning-based teaching model training device.

[0114] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0115] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0116] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers. The components shown herein, their connections and relationships, and their patterns are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0117] like Figure 8 As shown, device 800 includes a computing unit 801, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 802 or a computer program loaded from storage unit 808 into random access memory (RAM) 803. RAM 803 may also store various programs and data required for the operation of device 800. The computing unit 801, ROM 802, and RAM 803 are interconnected via bus 804. Input / output (I / O) interface 805 is also connected to bus 804.

[0118] Multiple components in device 800 are connected to I / O interface 805, including: input unit 806, such as keyboard, mouse, etc.; output unit 807, such as various types of monitors, speakers, etc.; storage unit 808, such as disk, optical disk, etc.; and communication unit 809, such as network card, modem, wireless transceiver, etc. Communication unit 809 allows device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0119] The computing unit 801 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as federated learning-based instructional model training methods or instructional task processing methods. For example, in some embodiments, the federated learning-based instructional model training method or instructional task processing method can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the federated learning-based instructional model training method or instructional task processing method described above can be performed. Alternatively, in other embodiments, computing unit 801 may be configured by any other suitable means (e.g., by means of firmware) to perform federated learning-based instructional model training methods or instructional task processing methods.

[0120] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0121] The program code used to implement the methods of this disclosure can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable federated learning-based instructional model training device or instructional task processing device, such that when executed by the processor or controller, the program code causes the patterns / operations specified in the flowcharts and / or block diagrams to be implemented. The program code can be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0122] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0123] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0124] The foregoing description of specific exemplary embodiments of this disclosure is for illustrative and explanatory purposes. These descriptions are not intended to limit this disclosure to the precise forms disclosed, and it will be apparent that many changes and variations can be made in accordance with the foregoing teachings. The exemplary embodiments were chosen and described in order to explain the specific principles of this disclosure and their practical application, thereby enabling those skilled in the art to implement and utilize various different exemplary embodiments of this disclosure, as well as various different choices and variations. The scope of this disclosure is intended to be defined by the claims and their equivalents.

Claims

1. A method for training a teaching model based on federated learning, applied to each participating node in federated learning, the method comprising: Receive the initial teaching model output by the central server, which is used to generate or execute teaching tasks; The initial teaching model is trained using a local data sample set and a composite loss function to obtain a trained teaching model. The composite loss function includes: a task loss function for the teaching task and a graph constraint loss function for aligning the internal representation generated by the teaching model when processing text with the structured representation of the knowledge concepts involved in the text in the knowledge graph. Based on the trained teaching model and the initial teaching model, the model update quantity is obtained; Based on the knowledge graph, an entity embedding matrix is ​​obtained; The model update amount and the entity embedding matrix are sent to the central server; The task loss function includes a cross-entropy loss function, and the graph constraint loss function includes an information-noise contrast estimation function. The initial teaching model is trained using a local data sample set and a composite loss function to obtain a trained teaching model, which includes: In the current iteration cycle, local data samples selected from the local data sample set are input into the initial teaching model to obtain the target output sequence output by the initial teaching model; Based on the local data sample and the target output sequence, calculate the task loss value of the cross-entropy loss function; Based on the local data samples, the knowledge graph, and the contextual representation of the encoder output of the initial teaching model, the contrastive loss value of the information noise contrastive estimation function is calculated; Based on the task loss value and the comparison loss value, the total loss value is calculated; In response to the detection that the initial teaching model meets the training completion condition based on the total loss value, a training completed teaching model is obtained.

2. A method for training a teaching model based on federated learning, applied to a central server for federated learning, the method comprising: After sending the initial teaching model to all participating nodes, the entity embedding matrix and model update amount of the knowledge graph sent by each participating node are received; wherein, the model update amount is obtained by the participating nodes training the initial teaching model using the composite loss function in the teaching model training method based on federated learning as described in claim 1, and the entity embedding matrix is ​​used to characterize the structured representation of the knowledge concepts involved in the graph constraint loss function in the composite loss function; For any two participating nodes among all participating nodes, calculate the target transmission matrix of the two participating nodes based on the entity embedding matrix of the two participating nodes; Based on the target transmission matrix of all participating nodes, a global alignment mapping library of equivalent concepts under different cultures is constructed. Based on the model update amounts of all participating nodes and the initial teaching model, calculate the intermediate teaching model; Based on the global alignment mapping library and the preset alignment loss function, the intermediate teaching model is fine-tuned to obtain the final teaching model. The alignment loss function is used to enable the intermediate teaching model to generate similar internal representations of semantically equivalent concepts from different cultures in the global alignment mapping library. The final teaching model is then sent to each participating node.

3. The method according to claim 2, wherein, The global alignment mapping library stores the equivalent entities of each entity in the knowledge graph and the confidence level of the entity's equivalence to its equivalent entities. Based on the target transfer matrix of all participating nodes, the global alignment mapping library for equivalent concepts under different cultures is constructed as follows: Based on the target transmission matrix of all participating nodes, detect whether there are multiple entities from different cultural regions pointing to the same equivalent concept; In response to the detection that multiple entities from different regions point to the same equivalent concept, it checks whether the confidence of each of these multiple entities is greater than a confidence threshold. In response to the detection that an entity among the multiple entities has a confidence level greater than a confidence threshold, the entity with a confidence level greater than the threshold is stored in the global alignment mapping library.

4. A method for processing teaching tasks, the method comprising: Receives a sequence of input data from the learner or the student. The input data sequence is input into the final teaching model generated by the method described in claim 2 or 3, and the target output sequence related to the teaching task is output.

5. A training device for a teaching model based on federated learning, applied to various participating nodes in federated learning, the device comprising: The model receiving unit is configured to receive an initial teaching model output by a central server, the initial teaching model being used to generate or execute teaching tasks; A training unit is configured to train the initial teaching model using a local data sample set and a composite loss function to obtain a trained teaching model. The composite loss function includes a task loss function for the teaching task and a graph constraint loss function for aligning the internal representation generated by the teaching model when processing text with the structured representation of the knowledge concepts involved in the text in the knowledge graph. The task loss function includes a cross-entropy loss function, and the graph constraint loss function includes an information noise contrast estimation function. The training unit is further configured to: input local data samples selected from the local data sample set into the initial teaching model in the current iteration cycle to obtain a target output sequence output by the initial teaching model; calculate the task loss value of the cross-entropy loss function based on the local data samples and the target output sequence; calculate the contrast loss value of the information noise contrast estimation function based on the local data samples, the knowledge graph, and the context representation output by the encoder of the initial teaching model; calculate the total loss value based on the task loss value and the contrast loss value; and obtain a trained teaching model in response to detecting that the initial teaching model meets the training completion condition based on the total loss value. The update unit is configured to obtain the model update amount based on the trained teaching model and the initial teaching model; The obtained unit is configured to obtain an entity embedding matrix based on the knowledge graph; The first sending unit is configured to send the model update amount and the entity embedding matrix to the central server.

6. A training device for a teaching model based on federated learning, applied to a central server for federated learning, the device comprising: The graph receiving unit is configured to receive, after sending the initial teaching model to all participating nodes, the entity embedding matrix and model update amount of the knowledge graph sent by each participating node; wherein, the model update amount is obtained by the participating nodes training the initial teaching model using the composite loss function in the federated learning-based teaching model training device of claim 5, and the entity embedding matrix is ​​used to characterize the structured representation of the knowledge concepts involved in the graph constraint loss function in the composite loss function; The matrix calculation unit is configured to calculate the target transmission matrix of any two participating nodes based on the entity embedding matrix of the two participating nodes. The building unit is configured to construct a global alignment mapping library of equivalent concepts under different cultures based on the target transmission matrix of all participating nodes; The model calculation unit is configured to calculate the intermediate teaching model based on the model update amount of all participating nodes and the initial teaching model; The fine-tuning unit is configured to fine-tune the intermediate teaching model based on the global alignment mapping library and a preset alignment loss function to obtain the final teaching model. The alignment loss function is used to enable the intermediate teaching model to generate similar internal representations of semantically equivalent concepts in different cultures in the global alignment mapping library. The second sending unit is configured to send the final teaching model to each participating node.

7. A teaching task processing device, the device comprising: The data receiving unit is configured to receive a sequence of input data from the learning object or the teaching object; The processing unit is configured to input the input data sequence into the final teaching model generated by the device of claim 6, and output a target output sequence related to the teaching task.

8. An electronic device, characterized in that, include: At least one processor; and a memory communicatively connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method of any one of claims 1-4.

9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-4.

Citation Information

Patent Citations

  • Knowledge graph processing method based on optimal transmission

    CN115934960A

  • Federal knowledge graph representation learning method, system, device and medium

    CN119623606A