Federal learning method, system and device and storage medium

By performing low-rank adaptive LoRA training in federated learning and incorporating random information processing, and combining parameter aggregation with the proportion of client data volume, the problems of insufficient client data privacy protection and limited model accuracy are solved, achieving efficient and secure model training.

CN121119035APending Publication Date: 2025-12-12HANGZHOU XINGUANG SEMICONDUCTOR CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511183547.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-22
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

In existing federated learning frameworks, the privacy of local data on the client side is not adequately protected, making it vulnerable to member inference attacks. Furthermore, the heterogeneity of client data is not effectively utilized during the model parameter aggregation process, resulting in limited model accuracy.

Method used

After low-rank adaptive LoRA training on the client side, random information processing is added to update the parameters of the local model, and the data is aggregated in the central server according to the proportion of client data volume. This, combined with low-rank adaptive training, reduces computational overhead.

Benefits of technology

It effectively prevents member inference attacks, enhances the privacy protection of local data, and improves the accuracy and training efficiency of the model, making it suitable for application scenarios with limited resources and high privacy requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121119035A_ABST
    Figure CN121119035A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a federal learning method, system and device and a storage medium. The method comprises the steps of receiving a first target sub-matrix and a second target sub-matrix sent by each client in a tth round of iteration; according to a scale factor corresponding to each client, each first target sub-matrix and each second target sub-matrix are aggregated to obtain a first target matrix and a second target matrix, and the scale factor is a ratio of the data volume of the local data of the client to the sum of the data volumes of the local data of all clients; according to the first target matrix and the second target matrix, obtaining global update parameters of the tth round; and sending the global update parameter of the tth round to each client, so that the client obtains a global model of the tth round according to the global update parameter of the tth round and the global model of the (t-1) th round. According to the method, member reasoning attacks can be effectively prevented, and the privacy protection strength of the local data of the client is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of big data, and in particular to a federated learning method, system, device and storage medium. BACKGROUND

[0002] With the rapid development of information technology, artificial intelligence models have received widespread attention. For example, large language models (LLM) have attracted much attention due to their outstanding performance in natural language processing tasks. LLMs are usually based on deep learning techniques and trained on massive amounts of text data, enabling complex language understanding and generation tasks. However, traditional large-scale model training methods face two major challenges: one is the demand for a large amount of computing resources, and the other is how to effectively protect user data privacy. In particular, in application scenarios involving sensitive information, directly sharing and centrally processing user data is neither practical nor secure. Therefore, there is an urgent need for a technical solution that can utilize distributed data while protecting privacy.

[0003] Federated learning (FL) as a new machine learning paradigm provides a possible way to solve the above problems. Federated learning allows multiple participants (such as edge devices or organizations, hereinafter referred to as clients) to jointly train a shared machine learning model without directly exchanging local data. This not only ensures data privacy, but also enables each participant to utilize their unique data resources to improve model performance.

[0004] In this context, applying the training process of artificial intelligence models to a federated learning environment is of great significance. First, this approach can greatly reduce the risk of sensitive information leakage, as most of the computation is performed locally on the client side, and only necessary parameter updates are sent to the central server. Second, it can fully leverage the advantages of distributed data sources, allowing clients in different geographic locations to contribute their unique data samples, which helps to build artificial intelligence models with greater generalization ability and adaptability.

[0005] In the federated learning framework of the related art, the client directly uploads the locally determined model update parameters to the central server. Attack devices may infer the private training data of the client by analyzing these model update parameters, forming a membership inference attack (MIA). Therefore, the current federated learning framework is insufficient in protecting the privacy of the client's local data. SUMMARY

[0006] The application provides a federated learning method, system, device and storage medium to solve the technical problem of insufficient privacy protection of local data in the related art federated learning method.

[0007] According to an aspect of the application, a federated learning method is provided, applied to a center server, the method comprising:

[0008] In the tth iteration, the first target sub-matrix and the second target sub-matrix sent by each client are received; wherein the first target sub-matrix is a matrix determined according to the first initial sub-matrix and the first random information, the second target sub-matrix is a matrix determined according to the second initial sub-matrix and the second random information, the first initial sub-matrix and the second initial sub-matrix are obtained by the corresponding client performing low-rank adaptive LoRA training on the global model of the (t-1)th iteration according to the local data, and t is an integer greater than 1;

[0009] According to the proportion factor corresponding to each client, the first target sub-matrix and the second target sub-matrix are aggregated respectively to obtain the first target matrix and the second target matrix; wherein the proportion factor is the ratio of the data amount of the local data of the client to the sum of the data amounts of the local data of all clients;

[0010] According to the first target matrix and the second target matrix, the global update parameter of the tth iteration is obtained;

[0011] The global update parameter of the tth iteration is sent to each client, so that the client obtains the global model of the tth iteration according to the global update parameter of the tth iteration and the global model of the (t-1)th iteration.

[0012] According to another aspect of the application, a federated learning method is provided, applied to a client, the method comprising:

[0013] In the tth iteration, the first initial sub-matrix and the second initial sub-matrix are obtained by performing low-rank adaptive LoRA training on the global model of the (t-1)th iteration according to the local data; wherein t is an integer greater than 1;

[0014] The first target sub-matrix is determined according to the first initial sub-matrix and the first random information, and the second target sub-matrix is determined according to the second initial sub-matrix and the second random information;

[0015] The first target sub-matrix and the second target sub-matrix are sent to the center server;

[0016] The global update parameter of the tth iteration sent by the center server is received, and the global model of the tth iteration is obtained according to the global update parameter of the tth iteration and the global model of the (t-1)th iteration.

[0017] According to another aspect of the present application, there is provided a federated learning system, comprising: a center server and at least two clients; the center server is configured to perform the steps performed by the center server in the federated learning method according to any of the embodiments of the present application; and the at least two clients are configured to perform the steps performed by the clients in the federated learning method according to any of the embodiments of the present application.

[0018] According to another aspect of the present application, there is provided an electronic device, comprising:

[0019] at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the federated learning method according to any of the embodiments of the present application.

[0020] According to another aspect of the present application, there is provided a computer readable storage medium storing a computer program, the computer program being configured to enable a processor to implement the federated learning method according to any of the embodiments of the present application when executed by the processor.

[0021] According to another aspect of the present application, there is provided a computer program product comprising a computer program, the computer program being configured to implement the federated learning method according to any of the embodiments of the present application when executed by a processor.

[0022] The technical scheme of the embodiments of the present application, on the one hand, the first target sub-matrix received by the center server is a matrix determined according to the first initial sub-matrix and the first random information, and the second target sub-matrix received is a matrix determined according to the second initial sub-matrix and the second random information, which is equivalent to adding random information to the local model update parameters trained by the client, so as to confuse the line of sight of the attack device, making it difficult to infer the local data of the client by analyzing the local model update parameters uploaded by the client, thereby effectively preventing member inference attacks and improving the privacy protection of the local data of the client. On the other hand, the center server can aggregate each first target sub-matrix and each second target sub-matrix according to the ratio of the data amount of the local data of the client to the sum of the data amounts of the local data of all clients, to obtain the first target matrix and the second target matrix. In the model parameter aggregation process, the heterogeneity of the local data of different clients is considered, thereby improving the accuracy of the finally trained model. On the other hand, the client performs Low-Rank Adaptation (LoRA for short) training on the global model during local training, which reduces the additional computational overhead in the training process and improves the training efficiency. BRIEF DESCRIPTION OF DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and all other drawings obtained by those of ordinary skill in the art without creative efforts based on these drawings should be within the protection scope of the present application.

[0024] Figure 1 is a structural schematic diagram of a federated learning system provided by an embodiment of the present application;

[0025] Figure 2 is a flowchart of a federated learning method provided by an embodiment of the present application;

[0026] Figure 3 is a schematic diagram of a first target matrix and a second target matrix in an embodiment of the present application;

[0027] Figure 4 is a schematic diagram of an implementation manner of a first target sub-matrix and a second target sub-matrix in an embodiment of the present application;

[0028] Figure 5 is a flowchart of another federated learning method provided by an embodiment of the present application;

[0029] Figure 6 is a structural schematic diagram of a federated learning device provided by an embodiment of the present application;

[0030] Figure 7 is a structural schematic diagram of another federated learning device provided by an embodiment of the present application;

[0031] Figure 8 is a structural schematic diagram of an electronic device implementing the federated learning method of an embodiment of the present application. DETAILED DESCRIPTION

[0032] In order to make the person in the art better understand the present application scheme, the technical solutions in the embodiments of the present application will be described clearly and completely in the following by combining the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts should be within the protection scope of the present application.

[0033] It should be noted that the terms "initial", "target" and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances so that the embodiments of the application described herein can be implemented in an order other than those illustrated or described herein. In addition, the term "comprising" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device comprising a series of steps or units does not necessarily limit to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices. The acquisition, storage, use, processing and the like of data in the embodiments of the present application comply with the relevant provisions of national laws and regulations.

[0034] In order to better understand the scheme, the key terms involved in the present embodiment are explained as follows.

[0035] Federated learning: a distributed machine learning method designed to train models without directly exchanging data. This method is particularly suitable for scenarios sensitive to data privacy, such as finance and Internet of Things. In traditional centralized machine learning, all data needs to be uploaded to a central server for processing and training, while federated learning is different. It allows multiple clients (such as smartphones, sensors, etc.) to jointly train a shared global model while maintaining local data storage and privacy protection.

[0036] Client: a distributed device or system participating in federated learning, responsible for training the model based on local data.

[0037] The core process of federated learning is shown as follows.

[0038] 1. Model initialization: The central server initializes a global model and sends it to all participating clients. 2. Local training: Each client trains the model locally using local data. The client computes the gradient or model update locally without uploading local data to the central server. 3. Model update and aggregation: Each client node sends the locally computed model update parameters (such as gradients, weights, etc.) to the central server. The central server combines the local model update parameters of each client through an aggregation algorithm (such as weighted average) to obtain an improved version of the global model, i.e., the updated global model, or obtain global update parameters. 4. Model synchronization: The central server sends the updated global model or global update parameters back to the clients, and the clients continue to use the updated global model for the next round of local training, or determine the updated global model according to the global update parameters and then perform the next round of local training. 5. Repeat the process: This process usually lasts for several rounds until the updated global model converges or reaches the predetermined training target.

[0039] Parameter-Efficient Fine-Tuning (PEFT): A method of fine-tuning pre-trained models that only updates a small part of the model's parameters or adds a small number of new parameters, rather than updating all parameters of the entire model, to reduce the demand for computing resources.

[0040] Adapter: A small trainable module is inserted in each Transformer block while freezing the pre-trained model parameters, thereby reducing the number of trainable parameters.

[0041] LoRA: Optimizes dense layer changes through low-rank decomposition matrices and inserts fine-tuning modules in a parallel manner, further reducing additional computational overhead.

[0042] Member inference attack: An attack method in which an attacker attempts to infer whether a certain data sample has been used to train a machine learning model, which may threaten the privacy of data.

[0043] In recent years, pre-trained models have been widely used. Pre-trained models learn general feature representations through large-scale data (such as text, images) through unsupervised or self-supervised learning, and then adapt to specific tasks through fine-tuning. Pre-trained large language models can be more flexible to adapt to various downstream tasks while maintaining relatively low computational overhead and communication cost. Although traditional full-parameter fine-tuning methods are effective, they have high computational cost and high hardware resource requirements. Therefore, PEFT technology has emerged as an important means to balance computational efficiency and model performance.

[0044] Among existing PEFT methods, Adapter and LoRA are two mainstream techniques. Adapter inserts small trainable modules into each Transformer block while freezing pre-trained model parameters, thereby reducing the number of trainable parameters; LoRA optimizes dense layer changes through low-rank decomposition matrices and inserts fine-tuning modules in a parallel manner, further reducing additional computational overhead. In particular, LoRA has become a popular choice for fine-tuning pre-trained models due to its efficient training method and good performance.

[0045] Although PEFT techniques significantly improve fine-tuning efficiency, traditional centralized fine-tuning mode faces serious privacy risks when dealing with privacy-sensitive data such as medical records and personal text. Federated learning, as a distributed machine learning framework, allows clients to train models on local private data and upload parameters to the central server for aggregation, avoiding direct sharing of raw data and providing a potential solution to privacy issues. However, the FL framework itself is not completely secure: an attacking device may infer the private training data of the client by intercepting the model parameters uploaded by the client, forming a membership inference attack. This problem is particularly prominent in the LLM fine-tuning scenario, as the high capacity of LLM makes it more likely to memorize private data, thereby amplifying the risk of privacy leakage.

[0046] Currently, research combining PEFT techniques with the FL paradigm is gradually emerging, aiming to balance fine-tuning efficiency and privacy protection. For example, by modeling different client LoRA adapters, quantifying the importance of weights using singular value decomposition, and configuring heterogeneous LoRA adapters based on weight importance. In addition, by quantizing pre-trained models and only performing high-precision dequantization when performing matrix multiplication, these methods attempt to reduce communication and computational costs while improving model performance.

[0047] Although the above techniques have made some progress in improving fine-tuning efficiency and partial privacy protection, there are still the following key problems and technical defects.

[0048] Insufficient privacy protection: In existing federated learning frameworks, clients typically upload local LoRA adapter parameters directly to the central server. Attackers may infer the private training data of the client by analyzing these parameters, forming a membership inference attack.

[0049] Limited model accuracy: During the parameter aggregation phase of federated learning, existing simple parameter averaging methods may lead to a decrease in model performance, especially in cases where client data distribution is uneven or highly heterogeneous. This limits the accuracy of the model in real-world applications.

[0050] To address the aforementioned issues, embodiments of the present invention provide a federated learning method and system, aiming to overcome the shortcomings of related technologies and offer an innovative solution that can both efficiently utilize distributed data and effectively protect privacy, especially suitable for application scenarios with limited resources and high privacy requirements.

[0051] Figure 1 This is a schematic diagram of the structure of a federated learning system provided in an embodiment of the present invention. Figure 1 As shown, the federated learning system includes a client and a central server. The central server performs the operations described in the embodiments below. The client performs the operations described in the embodiments below. This federated learning system, on the one hand, effectively prevents member inference attacks and improves the privacy protection of the client's local data. On the other hand, it considers the heterogeneity of local data from different clients during model parameter aggregation, thereby improving the accuracy of the final trained model. Furthermore, when the client performs local training, it performs LoRA training on the global model, reducing additional computational overhead during training and improving training efficiency.

[0052] The federated learning method provided in this embodiment will be described in detail from the perspectives of the central server and the client, respectively.

[0053] Figure 2 This is a flowchart illustrating a federated learning method provided in an embodiment of the present invention. This embodiment is applicable to scenarios where federated learning is used to fine-tune a pre-trained artificial intelligence model. The method can be executed by a federated learning device, which can be implemented in hardware and / or software. This federated learning device can be configured in... Figure 1 In the central server. For example Figure 2 As shown, the method includes the following steps 201 to 204.

[0054] Step 201: In the t-th iteration, receive the first target submatrix and the second target submatrix sent by each client.

[0055] The first target sub-matrix is ​​determined based on the first initial sub-matrix and the first random information. The second target sub-matrix is ​​determined based on the second initial sub-matrix and the second random information. The first and second initial sub-matrixes are obtained by the corresponding client after performing low-rank adaptive LoRA training on the global model in the (t-1)th round using local data. t is an integer greater than 1.

[0056] The federated learning in this embodiment can be applied to the Internet of Things field, for example, in a smart factory Internet of Things scenario, and can also be applied to a financial scenario. The global model in this embodiment can be a model in the Internet of Things field or a model in the financial field. In the Internet of Things field, the global model can be a model for implementing dynamic optimization control, such as a model for implementing robot path planning, or a model for implementing adaptive energy management, such as a model for adjusting the energy consumption of a production line in real time. In the financial scenario, the global model can be a model for identifying abnormal transactions, or a model for implementing an optimized transaction strategy.

[0057] The global model of the t-1th round in this embodiment is obtained by the client according to the global update parameters of the t-1th round and the global model of the t-2th round. When t is equal to 2, the global model of the t-2th round is the base model issued by the center server to the client.

[0058] Optionally, the base model in this embodiment can be a pre-trained model W0. This pre-trained model has been trained on a large amount of data and has good initial performance, which can provide a solid foundation for subsequent fine-tuning. It should be noted that the base model in this embodiment should have good generalization ability and adaptability to facilitate effective fine-tuning in different client environments.

[0059] Optionally, in the first iteration process, for each client k in the federated learning system, the LoRA adapter can be initialized as: and where l represents the lth row or column, r represents the rank of the adapter, and the subscript 1 represents the first iteration. The LoRA adapter in this embodiment refers to the two submatrices A and B obtained after decomposing the model update parameters. The center server can initialize the LoRA adapter of each client and distribute it to each client.

[0060] It should be noted that each client can adjust the size of the adapter according to its own device situation and computing power to further match the computing resources required in the model training process with the computing power of the client and improve the model training efficiency. For example, if a client has limited computing resources, the model training parameters can be reduced, that is, the rank r of the adapter is reduced.

[0061] Each client needs to prepare a local data set D k These local data sets will be used for model fine-tuning in the training process. The local data set may contain sensitive information, so it must be processed locally to ensure that the data does not leave the client.

[0062] The client performs LoRA training on the global model of the t-1th round according to its local data in the tth round of iteration, to obtain a first initial sub-matrix and a second initial sub-matrix. In the fine-tuning process, only the parameters A0(referred to as the first initial sub-matrix) and B0(referred to as the second initial sub-matrix) of the LoRA adapter are updated, and the pre-training model parameters W remain frozen. In the fine-tuning process, because only the low-rank matrix participates in the calculation, the calculation resource consumption and the memory consumption can be significantly reduced.

[0063] In each client, the parameters of the LoRA adapter are updated using the gradient descent method: wherein, is the loss function based on the local data set D k . represents the gradient of the loss function L with respect to the parameters θ. The loss function measures the difference between the predicted value of the model and the true value, and the gradient indicates the direction in which the parameters should be updated to minimize this loss. refers to the global model parameters of the kth client after the t-1th round of iteration, that is, it represents the global model of the t-1th round. These parameters are updated in each iteration by the gradient descent method. η is the learning rate, which controls the size of the update step. represents the local model update parameters of the kth client in the tth round of iteration. may be the first initial sub-matrix or the second initial sub-matrix. Alternatively, the first initial sub-matrix or the second initial sub-matrix can be determined according to

[0064] In traditional federated learning, all clients need to upload their local model update parameters to the center server for aggregation. However, this method has the risk of privacy leakage, especially in the face of member inference attacks.

[0065] In this embodiment, to protect the data privacy of the clients and prevent member inference attacks, after the first initial sub-matrix or the second initial sub-matrix is determined, the client in this embodiment does not directly upload the first initial sub-matrix and the second initial sub-matrix to the center server. Instead, the first target sub-matrix is determined according to the first initial sub-matrix and the first random information, and the second target sub-matrix is determined according to the second initial sub-matrix and the second random information. Each client sends the determined first target sub-matrix and second target sub-matrix to the center server. That is, the client randomly selects part of the parameters or randomly processes the parameters according to a certain strategy before transmission.

[0066] ​In an implementation, the first random information in the embodiment can be a first random matrix with the same dimension as the first initial sub-matrix. The element values in the first random matrix are randomly generated. In the process of determining the first target sub-matrix, whether to reset or replace the element at the corresponding position in the first initial sub-matrix is determined according to the element value in the first random matrix and a processing rule.

[0067] For example, the processing rule can be: if a certain element value in the first random matrix is a first numerical value (for example, 0), the element at the corresponding position in the first initial sub-matrix is reset to 0 or replaced with an arbitrary value; if a certain element value in the first random matrix is not the first numerical value (for example, 0), the element at the corresponding position in the first initial sub-matrix is retained. The first initial sub-matrix processed according to the above processing rule is determined as the first target sub-matrix.

[0068] In this implementation, the second random information can be a second random matrix with the same dimension as the second initial sub-matrix. The element values in the second random matrix are randomly generated. In the process of determining the second target sub-matrix, whether to reset or replace the element at the corresponding position in the second initial sub-matrix is determined according to the element value in the second random matrix and a processing rule.

[0069] In another implementation, in order to improve the efficiency of random processing of the initial sub-matrix, the first random information is a first random vector. The elements in the first random vector correspond to the rows or columns in the first target sub-matrix one by one. The elements in the first random vector are a first numerical value or a second numerical value, and the first numerical value is different from the second numerical value. This implementation will be described in detail in subsequent embodiments.

[0070] It should be noted that when t is equal to 1, step 201 can also be implemented. At this time, the global model in the t-1 round refers to the base model issued by the center server to the client.

[0071] Please continue to refer to Figure 1 When each client performs model training, the fixed frozen parameter W is obtained. The local model update parameter, i.e., the first initial sub-matrix A0 and the second initial sub-matrix B0, is obtained. Then, the random information is added to the local model update parameter to obtain the local model update parameter with random information, i.e., the first target sub-matrix A and the second target sub-matrix B. Then, the client sends the first target sub-matrix A and the second target sub-matrix B to the center server. The center server performs step 201 to receive each first target sub-matrix and second target sub-matrix.

[0072] Step 202: According to the proportion factor corresponding to each client, each first target sub-matrix and each second target sub-matrix are aggregated respectively to obtain a first target matrix and a second target matrix.

[0073] wherein the proportion factor is a ratio of a data amount of the local data of the client to a sum of data amounts of the local data of all clients.

[0074] In practical applications, client devices in a federated learning system often exhibit high heterogeneity. This heterogeneity is reflected in computing resources, network conditions, and data distribution, and so on. For example, the sizes of data sets of each client are different.

[0075] In the related art, in the parameter aggregation stage, the adapters of the updates from different clients are simply weighted and averaged, and then multiplied to calculate the weight. However, this method has certain calculation error, which destroys the accuracy of global aggregation and cannot fully capture the unique characteristics of the data of each client.

[0076] To solve this problem, in step 202, each first target sub-matrix is aggregated according to a ratio of a data amount of the local data of each client to a sum of data amounts of the local data of all clients, that is, a proportion factor corresponding to the client, to obtain a first target matrix, and each second target sub-matrix is aggregated to obtain a second target matrix.

[0077] In an implementation manner, the implementation process of step 202 includes steps 2021a to 2023a.

[0078] Step 2021a: the ratio of the data amount of the local data of each client to the sum of the data amounts of the local data of all clients is determined as the proportion factor of the client.

[0079] The proportion factor of the kth client is p k It can be determined by the following formula: wherein len(D k ) represents the data amount of the local data of the kth client. represents the sum of the data amounts of the local data of K clients, that is, all clients. The proportion factor in this embodiment is used to balance the contributions of different clients in the aggregation process.

[0080] Step 2022a: the first target matrix is determined according to formula A stack =p1A1⊕p2A2⊕…⊕p K A K .

[0081] wherein p i represents the proportion factor of the ith client. A i represents the first target sub-matrix sent by the ith client. i is an integer greater than or equal to 1 and less than or equal to K. K represents the number of clients.

[0082] Step 2023a: according to formula B stack = p1B1 ⊕ p2B2 ⊕ … ⊕ p K B K , determine the second target matrix.

[0083] Wherein, B i represents the second target sub-matrix sent by the i-th client.

[0084] The symbol ⊕ in step 2022a and step 2023a represents element-wise addition, or represents that each p i A i is stacked into a larger matrix.

[0085] Figure 3 is a schematic diagram of the first target matrix and the second target matrix in the embodiment of the application. Figure 3 In the following, the number of clients is taken as 3 for exemplary illustration. As shown in the figure, the first target matrix is the matrix obtained by horizontally stacking p1A1, p2A2 and p3A3. The second target matrix is the matrix obtained by vertically stacking p1B1, p2B2 and p3B3. Figure 3

[0086] In another implementation manner, the data volume of the local data of the client is dynamically changed. In this scenario, the implementation manner of step 202 can be: determining a target client corresponding to a proportion factor greater than a preset proportion factor threshold; aggregating the first target sub-matrix of each target client to obtain the first target matrix, and aggregating the second target sub-matrix of each target client to obtain the second target matrix, according to the proportion factor corresponding to the target client. This implementation manner can filter out the first target sub-matrix and the second target sub-matrix of a part of clients with a small proportion of local data volume, so as to improve the efficiency of the aggregation stage.

[0087] In this step 202, in the parameter aggregation stage, the local model update parameters from each client are allowed to be more flexibly integrated, not only relying on a simple average operation, but also considering the heterogeneity of the data distribution of different clients, so as to further improve the accuracy of the final model.

[0088] Step 203: obtaining the global update parameter of the t-th round according to the first target matrix and the second target matrix.

[0089] Optionally, in step 203, the center server performs multiplication operation on the first target matrix A stack and the second target matrix B stack to obtain the global update parameter of the t-th round: △W = A stack B stack .

[0090] ​Step 204: Send the global update parameters of the t-th round to each client, so that the client obtains the global model of the t-th round according to the global update parameters of the t-th round and the global model of the t-1-th round.

[0091] Please continue to refer to Figure 1 In step 204, the center server sends the global update parameters of the t-th round back to each client. After receiving the global update parameters of the t-th round, each client decomposes the parameters according to the rank of its own adapter, updates the values of the local adapters A0 and B0 to the matrices decomposed from the parameters, and uses the updated A0 and B0 to update the global model of the t-1-th round, thereby obtaining the global model of the t-th round and completing a round of training process.

[0092] If the training is not completed, t++ and the next round of training process is entered.

[0093] If after step 203 and before step 204, the center server can further perform the following steps: after obtaining the global model of the t-th round according to the global update parameters of the t-th round and the global model of the t-1-th round, it is judged whether the iteration termination condition is met at this time, and if so, the training is stopped.

[0094] Through the above steps 201 to 204, the center server can effectively integrate the updates from different clients to form a new global model, which not only considers the data of all clients, but also protects data privacy and adapts to the heterogeneity of clients. Through these steps, the client can effectively participate in the fine-tuning process of the model while protecting data privacy. This not only improves the adaptability and performance of the model, but also reduces the cost of calculation and communication, which is suitable for resource-constrained environments. This federated learning framework provides an efficient, secure and flexible solution for distributed training of pre-trained models.

[0095] In the scheme provided by the embodiment of the application, on the one hand, the first target sub-matrix received by the center server is a matrix determined according to the first initial sub-matrix and the first random information, and the second target sub-matrix received by the center server is a matrix determined according to the second initial sub-matrix and the second random information, which is equivalent to adding random information to the local model update parameters trained by the client, so that the line of sight of the attack device can be confused, and it is difficult for the attack device to infer the local data of the client by analyzing the local model update parameters uploaded by the client, thereby effectively preventing member reasoning attacks and improving the privacy protection of the local data of the client. On the other hand, the center server can aggregate each first target sub-matrix and each second target sub-matrix respectively according to the ratio of the data amount of the local data of the client to the sum of the data amounts of the local data of all clients, to obtain the first target matrix and the second target matrix, which takes into account the heterogeneity of the local data of different clients in the model parameter aggregation process, thereby improving the accuracy of the finally trained model. On the other hand, the client performs LoRA training on the global model when performing local training, which reduces the additional computational overhead in the training process and improves the training efficiency.

[0096] In an embodiment, the first random information is a first random vector, and the elements in the first random vector correspond to the rows or columns in the first target sub-matrix one by one. The elements in the first random vector are a first value or a second value, and the first value is different from the second value.

[0097] The first target sub-matrix includes first type row vectors and second type row vectors, or first type column vectors and second type column vectors.

[0098] The first type row vector is a row vector at a corresponding position in the first initial sub-matrix, and the corresponding element of the first type row vector in the first random vector is the first value; the second type row vector is a row vector at a corresponding position in the first global sub-matrix obtained by performing LoRA decomposition on the global update parameters of the t-1th round, and the corresponding element of the second type row vector in the first random vector is the second value.

[0099] The first type column vector is a column vector at a corresponding position in the first initial sub-matrix, and the corresponding element of the first type column vector in the first random vector is the first value; the second type column vector is a column vector at a corresponding position in the first global sub-matrix obtained by performing LoRA decomposition on the global update parameters of the t-1th round, and the corresponding element of the second type column vector in the first random vector is the second value.

[0100] The above process can be expressed by the following formula: In the formula, the first value is a value other than 1, and the second value is 1. represents the lth row or the lth column in the first target sub-matrix of the tth round. represents the lth row or the lth column in the first global sub-matrix obtained by performing LoRA decomposition on the global updated parameters of the t-1th round. represents the lth row or the lth column in the first initial sub-matrix. t,l represents the lth number in the first random vector, which is a random number used to determine whether the lth row (or column) performs replacement in the tth round of training.

[0101] Since this implementation adds the vector at the corresponding position in the first global sub-matrix to the first target sub-matrix, compared with other ways of adding random information to the first initial sub-matrix, it can avoid the problem of reducing the accuracy of the first target sub-matrix due to random processing.

[0102] In another embodiment, the second random information is a second random vector, the elements in the second random vector correspond to the rows or columns in the second target sub-matrix one by one, the elements in the second random vector are third values or fourth values, and the third values are different from the fourth values.

[0103] The second target sub-matrix includes third type row vectors and fourth type row vectors, or third type column vectors and fourth type column vectors.

[0104] The third type row vector is a row vector at a corresponding position in the second initial sub-matrix, and the element corresponding to the third type row vector in the second random vector is a third value; the fourth type row vector is a row vector at a corresponding position in the second global sub-matrix obtained by performing LoRA decomposition on the global updated parameters of the t-1th round, and the element corresponding to the fourth type row vector in the second random vector is a fourth value.

[0105] The third type column vector is a column vector at a corresponding position in the second initial sub-matrix, and the element corresponding to the third type column vector in the second random vector is a third value; the fourth type column vector is a column vector at a corresponding position in the second global sub-matrix obtained by performing LoRA decomposition on the global updated parameters of the t-1th round, and the element corresponding to the fourth type column vector in the second random vector is a fourth value.

[0106] The above process can be expressed by the following formula: In this formula, the third value is a value other than 1, and the fourth value is 1. represents the lth row or the lth column in the second global sub-matrix obtained by performing LoRA decomposition on the global updated parameters of the t-1th round. represents the lth row or the lth column in the second initial sub-matrix.b t,l represents the lth number in the second random vector.

[0107] Since this implementation adds the vector at the corresponding position in the second global sub-matrix to the second target sub-matrix, compared with other ways of adding random information to the second initial sub-matrix, the problem of reducing the accuracy of the second target sub-matrix due to random processing can be avoided.

[0108] It should be noted that in the above two embodiments, the elements in the first random vector can correspond to the columns in the first target sub-matrix, and the elements in the second random vector can correspond to the rows in the second target sub-matrix. Alternatively, the elements in the first random vector can correspond to the rows in the first target sub-matrix, and the elements in the second random vector can correspond to the columns in the second target sub-matrix. Alternatively, the elements in the first random vector can correspond to the columns in the first target sub-matrix, and the elements in the second random vector can correspond to the columns in the second target sub-matrix. Alternatively, the elements in the first random vector can correspond to the rows in the first target sub-matrix, and the elements in the second random vector can correspond to the rows in the second target sub-matrix.

[0109] Figure 4 is a schematic diagram of the implementation of the first target sub-matrix and the second target sub-matrix in the embodiments of the present application. As shown in Figure 4 , the elements in the first random vector correspond to the columns in the first target sub-matrix. The first target sub-matrix A is a matrix obtained by replacing part of the column vectors in the first initial sub-matrix A0 with the column vectors at the corresponding positions in the first global sub-matrix A w . The elements in the second random vector can correspond to the rows in the second target sub-matrix. The second target sub-matrix B is a matrix obtained by replacing part of the row vectors in the second initial sub-matrix B0 with the row vectors at the corresponding positions in the second global sub-matrix B w .

[0110] In the above two implementation modes, the client randomly replaces part of the row (column) values in the first target sub-matrix and the second target sub-matrix with the values at the corresponding positions of the global model parameters of the last round of training when submitting the first target sub-matrix and the second target sub-matrix. This random replacement technique can effectively confuse the data and prevent attackers from inferring sensitive information by analyzing model updates.

[0111] Figure 5 is a flowchart of another federated learning method provided by the embodiments of the present application. The present embodiment is applicable to the scene of fine-tuning a pre-trained artificial intelligence model using federated learning. The method can be executed by a federated learning device, which can be realized in the form of hardware and / or software. The federated learning device can be configured in Figure 1 a client. As shown in Figure 5 , the federated learning method provided by the present embodiment includes the following steps 501 to 504.

[0112] Step 501: In the tthiteration, the LoRA training is performed on the global model of the (t-1) thiteration according to the local data, to obtain a first initial sub-matrix and a second initial sub-matrix.

[0113] wherein t is an integer greater than 1.

[0114] In each client, the gradient descent method is used to update the parameters of the LoRA adapter, i.e., to obtain the first initial sub-matrix and the second initial sub-matrix. The specific process has been described in step 201, which will not be repeated here.

[0115] Step 502: determining a first target sub-matrix according to the first initial sub-matrix and first random information, and determining a second target sub-matrix according to the second initial sub-matrix and second random information.

[0116] In an implementation manner, the first random information can be a first random matrix with the same dimension as the first initial sub-matrix. The element values in the first random matrix are randomly generated. In the process of determining the first target sub-matrix, it is determined whether to reset or replace the element at the corresponding position in the first initial sub-matrix according to the element value in the first random matrix and the processing rule. The second random information can be a second random matrix with the same dimension as the second initial sub-matrix. The element values in the second random matrix are randomly generated. In the process of determining the second target sub-matrix, it is determined whether to reset or replace the element at the corresponding position in the second initial sub-matrix according to the element value in the second random matrix and the processing rule.

[0117] In another implementation manner, in order to improve the efficiency of random processing on the initial sub-matrix, the first random information is a first random vector. The elements in the first random vector correspond to the rows or columns in the first target sub-matrix one by one. The elements in the first random vector are a first value or a second value, and the first value is different from the second value. This implementation manner will be described in detail in subsequent embodiments.

[0118] Step 503: sending the first target sub-matrix and the second target sub-matrix to the center server.

[0119] Step 503 corresponds to step 201, which will not be repeated here.

[0120] Step 504: receiving the global update parameters of the tthiteration sent by the center server, and obtaining the global model of the tthiteration according to the global update parameters of the tthiteration and the global model of the (t-1) thiteration.

[0121] After each client receives the global update parameter △W of the tth round, the client decomposes △W according to the rank of the adapter of the client, updates the values of the local adapters A0 and B0 to the matrices decomposed from △W, and uses the updated A0 and B0 to update the global model of the (t-1)th round, thereby obtaining the global model of the tth round, and completing a round of training.

[0122] The federated learning method provided by the embodiment of the application can add random information to the local model update parameter trained by the client, so that the line of sight of the attack device is confused, and it is difficult for the attack device to infer the local data of the client by analyzing the local model update parameter uploaded by the client, thereby effectively preventing member inference attacks and improving the privacy protection of the local data of the client.

[0123] In one embodiment, the first random information is a first random vector, the elements in the first random vector correspond to the rows or columns in the first target submatrix one by one, the elements in the first random vector are first values or second values, and the first values are different from the second values; and the first target submatrix includes first type row vectors and second type row vectors, or first type column vectors and second type column vectors. In step 502, the implementation process of determining the first target submatrix according to the first initial submatrix and the first random information includes any one of the following two implementation manners.

[0124] In the first implementation manner, the implementation process of determining the first target submatrix according to the first initial submatrix and the first random information includes: for each element in the first random vector, if the element is the first value, the first type row vector corresponding to the element in the first target submatrix is determined as the row vector at the corresponding position in the first initial submatrix, and if the element is the second value, the second type row vector corresponding to the element in the first target submatrix is determined as the row vector at the corresponding position in the first global submatrix obtained by performing LoRA decomposition on the global update parameter of the (t-1)th round.

[0125] In the second implementation, the implementation process of determining the first target sub-matrix according to the first initial sub-matrix and the first random information includes: for each element in the first random vector, if the element is the first numerical value, determining a first type column vector corresponding to the element in the first target sub-matrix as a column vector at a corresponding position in the first initial sub-matrix, and if the element is the second numerical value, determining a second type column vector corresponding to the element in the first target sub-matrix as a column vector at a corresponding position in a first global sub-matrix obtained by performing LoRA decomposition on the global update parameter of the t-1th round.

[0126] The process of this embodiment can be expressed by a formula as follows: The meanings of various parameters have been described in the above embodiments, and will not be repeated here.

[0127] In another embodiment, the second random information is a second random vector, elements in the second random vector correspond to rows or columns in the second target sub-matrix one by one, the elements in the second random vector are third numerical values or fourth numerical values, and the third numerical values are different from the fourth numerical values; and the second target sub-matrix includes third type row vectors and fourth type row vectors, or third type column vectors and fourth type column vectors. In step 502, the implementation process of determining the second target sub-matrix according to the second initial sub-matrix and the second random information includes any one of the following two implementation manners.

[0128] In the first implementation, for each element in the second random vector, if the element is the third numerical value, a third type row vector corresponding to the element in the second target sub-matrix is determined as a row vector at a corresponding position in the second initial sub-matrix, and if the element is the fourth numerical value, a fourth type row vector corresponding to the element in the second target sub-matrix is determined as a row vector at a corresponding position in a second global sub-matrix obtained by performing LoRA decomposition on the global update parameter of the t-1th round.

[0129] In the second implementation, for each element in the second random vector, if the element is the third numerical value, a third type column vector corresponding to the element in the second target sub-matrix is determined as a column vector at a corresponding position in the second initial sub-matrix, and if the element is the fourth numerical value, a fourth type column vector corresponding to the element in the second target sub-matrix is determined as a column vector at a corresponding position in a second global sub-matrix obtained by performing LoRA decomposition on the global update parameter of the t-1th round.

[0130] The process of this embodiment can be expressed by a formula as follows: The meanings of various parameters have been described in the above embodiments, and will not be repeated here.

[0131] In the above two embodiments, in order to protect the data privacy of the client and prevent member inference attacks, each client randomly replaces part of the row (column) values in the first initial sub-matrix and the second initial sub-matrix with the global model parameters of the previous round of training. This random replacement technique can effectively confuse the data and prevent attackers from inferring sensitive information by analyzing the model updates.

[0132] In summary, the present embodiment proposes a federated learning framework that uses a LoRA adapter to efficiently fine-tune pre-trained model parameters. This scheme is specifically designed to support the heterogeneity of clients, allowing each client to independently train and optimize the model adapter based on its own hardware capabilities and data characteristics. At the same time, in order to strengthen data privacy protection, the scheme introduces random noise addition and parameter replacement mechanisms to ensure that sensitive information is not leaked during model updates. The center server is responsible for collecting the adapter parameters from each client, aggregating these parameters by calculating the scaling factor and stacking operation to generate global model update parameters, and then distributing them back to the clients for local model updates. This design not only improves the efficiency and security of model training, but also adapts to resource-constrained environments, providing an innovative solution for distributed training of pre-trained models.

[0133] Figure 6 is a structural schematic diagram of a federated learning device provided by an embodiment of the present application. The device is arranged at a center server. As shown in the figure, the device comprises a first receiving module 61, an aggregation module 62, a first determination module 63, and a first sending module 64. Figure 6

[0134] The first receiving module 61 is configured to receive the first target sub-matrix and the second target sub-matrix sent by each client in the tth iteration.

[0135] The first target sub-matrix is a matrix determined according to the first initial sub-matrix and the first random information. The second target sub-matrix is a matrix determined according to the second initial sub-matrix and the second random information. The first initial sub-matrix and the second initial sub-matrix are obtained by performing low LoRA training on the global model of the (t-1)th iteration according to the local data of the corresponding client. t is an integer greater than 1.

[0136] The aggregation module 62 is configured to aggregate each first target sub-matrix and each second target sub-matrix according to the scaling factor corresponding to each client, to obtain a first target matrix and a second target matrix.

[0137] The scaling factor is the ratio of the data amount of the local data of the client to the sum of the data amounts of the local data of all clients.

[0138] ​The first determining module 63 is configured to obtain the global update parameter of the tth round according to the first target matrix and the second target matrix.

[0139] The first sending module 64 is configured to send the global update parameter of the tth round to each client, so that the client obtains the global model of the tth round according to the global update parameter of the tth round and the global model of the (t-1) th round.

[0140] The specific implementation of the first target sub-matrix and the second target sub-matrix will not be repeated here. The specific implementation of the aggregation module 62 can refer to step 202, which will not be repeated here.

[0141] The federated learning device provided in the embodiments of the present application can perform the steps performed by the center server in the federated learning method provided in any embodiment of the present application, has the corresponding function modules and beneficial effects of the execution method.

[0142] Figure 7 FIG. 6 is a structural schematic diagram of another federated learning device provided in the embodiments of the present application. The device is arranged in a client. As shown in the figure, the device comprises a training module 71, a second determining module 72, a second sending module 73 and a second receiving module 74. Figure 7

[0143] The training module 71 is configured to perform LoRA training on the global model of the (t-1) th round according to local data in the tth round of iteration, to obtain a first initial sub-matrix and a second initial sub-matrix.

[0144] Wherein, t is an integer greater than 1.

[0145] The second determining module 72 is configured to determine the first target sub-matrix according to the first initial sub-matrix and first random information, and determine the second target sub-matrix according to the second initial sub-matrix and second random information.

[0146] The specific implementation process of the second determining module 72 can refer to the above embodiments, which will not be repeated here.

[0147] The second sending module 73 is configured to send the first target sub-matrix and the second target sub-matrix to the center server.

[0148] The second receiving module 74 is configured to receive the global update parameter of the tth round sent by the center server, and obtain the global model of the tth round according to the global update parameter of the tth round and the global model of the (t-1) th round.

[0149] The federated learning device provided in the embodiments of the present application can perform the steps performed by the client in the federated learning method provided in any embodiment of the present application, has the corresponding function modules and beneficial effects of the execution method.​

[0150] Figure 8 This is a schematic diagram of an electronic device implementing the federated learning method of embodiments of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described herein and / or the device claims.

[0151] like Figure 8 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or a computer program loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0152] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0153] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 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 processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as federated learning methods.

[0154] In some embodiments, the federated learning method can be implemented as a computer program tangibly embodied in a computer readable storage medium, e.g., storage unit 18. In some embodiments, portions of the computer program or device as a whole can be loaded onto the electronic device 10 via, e.g., ROM 12 and / or communication unit 19. When the computer program is loaded onto RAM 13 and executed by processor 11, one or more steps of the federated learning method described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured, by any suitable means (e.g., by means of firmware), to perform the federated learning method.

[0155] The various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (PLD), a computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0156] Computer programs used to implement the methods of the present application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the computer program, when executed by the processor of the computer or other programmable data processing apparatus, enables the systems and methods as claimed in the claims to be implemented. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine as part of a standalone software package and partially on a remote machine or entirely on a remote machine or server.

[0157] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer-readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of a machine-readable storage medium will include one or more lines of a program of instructions in a transitory signal, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0158] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or device LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or device trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or device tactile feedback); and input from the user can be received in any form, including acoustic, speech, or device tactile input.

[0159] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or device that includes middleware component (e.g., an application server), or device that includes a front end component (e.g., a user computer having a graphical user interface or device web browser through which a user can interact with an implementation of the systems and techniques described here), or device any combination of such back end, middleware, or device front end components. The components of the system can be interconnected by any form or device digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0160] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.

[0161] The embodiment of the present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the federated learning method provided by any of the embodiments of the present application.

[0162] The computer program product can be written in any combination of one or more programming languages, including object-oriented programming languages, conventional procedural programming languages, and can be executed on one computer or on multiple computers in a distributed computing environment. The computer program code can be executed on a single computer, on multiple computers, or as an independent software package, partially on the user's computer and partially on a remote computer or server, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer or device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, through the Internet using an Internet service provider).

[0163] It should be understood that the various forms of flow shown above can be reordered, added or deleted steps. For example, the steps described in the present application can be executed in parallel, sequentially or in different order, as long as the desired results of the technical solutions of the present application can be achieved, which are not limited herein.

[0164] The above specific embodiments do not constitute a limitation on the scope of protection of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A federated learning method applied to a central server, characterized in that, The method includes: In the t-th iteration, the first target sub-matrix and the second target sub-matrix sent by each client are received; wherein, the first target sub-matrix is ​​a matrix determined based on the first initial sub-matrix and the first random information, and the second target sub-matrix is ​​a matrix determined based on the second initial sub-matrix and the second random information. The first initial sub-matrix and the second initial sub-matrix are obtained by the corresponding client after performing low-rank adaptive LoRA training on the global model in the (t-1)-th round based on local data, where t is an integer greater than 1; Based on the scaling factor corresponding to each client, each first target sub-matrix and each second target sub-matrix are aggregated to obtain the first target matrix and the second target matrix; wherein, the scaling factor is the ratio of the amount of local data of the client to the sum of the amount of local data of all clients; Based on the first target matrix and the second target matrix, the global update parameters for the t-th round are obtained; Send the global update parameters for round t to each client so that the client can obtain the global model for round t based on the global update parameters for round t and the global model for round (t-1).

2. The method according to claim 1, characterized in that, The first random information is a first random vector, and the elements in the first random vector correspond one-to-one with the rows or columns in the first target sub-matrix. The elements in the first random vector are a first value or a second value, and the first value and the second value are different. The first target submatrix includes: a first type of row vector and a second type of row vector, or a first type of column vector and a second type of column vector; The first type of row vector is the row vector at the corresponding position in the first initial submatrix, and the element corresponding to the first type of row vector in the first random vector is the first value; the second type of row vector is the row vector at the corresponding position in the first global submatrix obtained after performing LoRA decomposition on the global update parameters of the (t-1)th round, and the element corresponding to the second type of row vector in the first random vector is the second value. The first type of column vector is the column vector at the corresponding position in the first initial submatrix, and the element corresponding to the first type of column vector in the first random vector is the first value; the second type of column vector is the column vector at the corresponding position in the first global submatrix obtained after performing LoRA decomposition on the global update parameters of the (t-1)th round, and the element corresponding to the second type of column vector in the first random vector is the second value.

3. The method according to claim 1, characterized in that, The second random information is a second random vector, and the elements in the second random vector correspond one-to-one with the rows or columns in the second target sub-matrix. The elements in the second random vector are a third value or a fourth value, and the third value and the fourth value are different. The second target submatrix includes: third-type row vectors and fourth-type row vectors, or third-type column vectors and fourth-type column vectors; The third type of row vector is the row vector at the corresponding position in the second initial sub-matrix, and the element corresponding to the third type of row vector in the second random vector is the third value; the fourth type of row vector is the row vector at the corresponding position in the second global sub-matrix obtained after performing LoRA decomposition on the global update parameters of the (t-1)th round, and the element corresponding to the fourth type of row vector in the second random vector is the fourth value. The third type of column vector is the column vector at the corresponding position in the second initial sub-matrix, and the element corresponding to the third type of column vector in the second random vector is the third value; the fourth type of column vector is the column vector at the corresponding position in the second global sub-matrix obtained after performing LoRA decomposition on the global update parameters of the (t-1)th round, and the element corresponding to the fourth type of column vector in the second random vector is the fourth value.

4. The method according to any one of claims 1 to 3, characterized in that, The step of aggregating each first target sub-matrix and each second target sub-matrix according to the scaling factor corresponding to each client to obtain the first target matrix and the second target matrix includes: The ratio of the amount of local data of each client to the sum of the amount of local data of all clients is determined as the scaling factor of the client. According to formula A stack =p1A1⊕p2A2⊕…⊕p K A K Determine the first target matrix; where p i A represents the scaling factor for the i-th client. i This represents the first target submatrix sent by the i-th client, where i is an integer greater than or equal to 1 and less than or equal to K, and K represents the number of clients. According to formula B stack =p1B1⊕p2B2⊕…⊕p K B K Determine the second target matrix; where B i This represents the second target submatrix sent by the i-th client.

5. A federated learning method applied to a client, characterized in that, The method includes: In the t-th iteration, the global model in the (t-1)-th iteration is trained using low-rank adaptive LoRA based on local data to obtain the first initial submatrix and the second initial submatrix; where t is an integer greater than 1; The first target submatrix is ​​determined based on the first initial submatrix and the first random information, and the second target submatrix is ​​determined based on the second initial submatrix and the second random information; Send the first target sub-matrix and the second target sub-matrix to the central server; Receive the global update parameters for round t sent by the central server, and obtain the global model for round t based on the global update parameters for round t and the global model for round (t-1).

6. The method according to claim 5, characterized in that, The first random information is a first random vector, and the elements in the first random vector correspond one-to-one with the rows or columns in the first target sub-matrix. The elements in the first random vector are a first value or a second value, and the first value and the second value are different. The first target submatrix includes: a first type of row vector and a second type of row vector, or a first type of column vector and a second type of column vector; The step of determining the first target sub-matrix based on the first initial sub-matrix and the first random information includes: For each element in the first random vector, if the element is a first value, then the first type of row vector corresponding to the element in the first target submatrix is ​​determined as the row vector at the corresponding position in the first initial submatrix; if the element is a second value, then the second type of row vector corresponding to the element in the first target submatrix is ​​determined as the row vector at the corresponding position in the first global submatrix obtained after performing LoRA decomposition on the global update parameters of round t-1; or, For each element in the first random vector, if the element is a first value, then the first type of column vector corresponding to the element in the first target submatrix is ​​determined as the column vector at the corresponding position in the first initial submatrix; if the element is a second value, then the second type of column vector corresponding to the element in the first target submatrix is ​​determined as the column vector at the corresponding position in the first global submatrix obtained after performing LoRA decomposition on the global update parameters of the (t-1)th round.

7. The method according to claim 5, characterized in that, The second random information is a second random vector, and the elements in the second random vector correspond one-to-one with the rows or columns in the second target sub-matrix. The elements in the second random vector are a third value or a fourth value, and the third value and the fourth value are different. The second target submatrix includes: third-type row vectors and fourth-type row vectors, or third-type column vectors and fourth-type column vectors; The step of determining the second target sub-matrix based on the second initial sub-matrix and the second random information includes: For each element in the second random vector, if the element is a third value, then the third type row vector corresponding to the element in the second target submatrix is ​​determined as the row vector at the corresponding position in the second initial submatrix; if the element is a fourth value, then the fourth type row vector corresponding to the element in the second target submatrix is ​​determined as the row vector at the corresponding position in the second global submatrix obtained after performing LoRA decomposition on the global update parameters of round t-1; or, For each element in the second random vector, if the element is a third value, then the third type column vector corresponding to the element in the second target submatrix is ​​determined as the column vector at the corresponding position in the second initial submatrix; if the element is a fourth value, then the fourth type column vector corresponding to the element in the second target submatrix is ​​determined as the column vector at the corresponding position in the second global submatrix obtained after performing LoRA decomposition on the global update parameters of the (t-1)th round.

8. A federated learning system, characterized in that, The system includes: a central server and at least two clients; The central server is used to execute the federated learning method as described in any one of claims 1 to 4; The client is used to execute the federated learning method as described in any one of claims 5 to 7.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor to enable the at least one processor to perform the federated learning method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that enables a processor to implement the federated learning method of any one of claims 1 to 7 when executed.