Decentralized federated learning method based on coded communication
Patent Information
- Application Number
- CN202611075519.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-20
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2046-07-20
AI Technical Summary
动态随机策略虽能通过时间维度上的连接变化提升网络整体连通性,但由于缺乏跨轮次间的协同机制,信息在不同轮次中的传播路径彼此割裂,无法形成累积性的扩散增益
[0016]Compared with existing technologies, the advantages of this application are as follows: By converting client IDs into encoded vectors, each client obtains a unique numerical representation in the network. Based on the numerical distribution of each encoded bit in the encoded vector, multiple communication subgraphs are constructed. Each subgraph restricts clients to establishing connections only with neighbors whose encoding differs at specified bits, thereby limiting the number of neighbors each client can connect to in a single round of communication. During training, different communication subgraphs are activated by switching between rounds, allowing communication relationships to change dynamically with the training process. Each client only exchanges model parameters with neighbor clients defined in the current subgraph and uses preset aggregation weights to complete local model updates. Thus, under the condition of a limited number of neighbors per round of communication, information can be gradually diffused throughout the network through the subgraph rotation mechanism defined by encoded bits, improving the efficiency of communication resource utilization in the decentralized federated learning system.
Smart Images

Figure CN122601144B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of distributed machine learning technology, specifically to a decentralized federated learning method based on coded communication. Background Technology
[0002] In existing decentralized federated learning systems, the communication network topology directly determines the range of objects each client can interact with in each round, thus fundamentally impacting model convergence efficiency. Current mainstream static topology schemes, such as ring, grid, and tree structures, can control the communication volume of a single node to a low level, but these pre-defined architectures are unrelated to the actual data distribution of the clients, resulting in fixed information propagation paths between nodes and an inability to flexibly adjust communication relationships based on data distribution characteristics. Another type of dynamic topology scheme employs a randomized communication strategy, achieving dynamic changes in network connectivity by randomly selecting communication objects in each round. However, this type of method lacks a structured design for information propagation paths during the selection of communication objects, and the efficiency of information diffusion across the entire network is limited by the blindness of the random strategy.
[0003] In real-world scenarios where the number of neighbors per communication round is limited, all the above-mentioned schemes face the problem of low information propagation efficiency. The fixed and sparse connection patterns in static topologies require multiple relays for information transmission between any two nodes, and global consensus depends on the accumulation of numerous communication rounds. While dynamic random strategies can improve overall network connectivity through temporal connection changes, the lack of cross-round coordination mechanisms means that information propagation paths in different rounds are fragmented, failing to generate cumulative diffusion gains. This implies that, under conditions of limited communication degrees per round, existing methods struggle to balance the overhead of single-round communication with the cumulative diffusion of information over multiple rounds, resulting in low communication resource utilization efficiency. Summary of the Invention
[0004] This application provides a decentralized federated learning method based on coded communication, which can improve the efficiency of communication resource utilization in decentralized federated learning systems.
[0005] Firstly, this application provides a decentralized federated learning method based on coded communication, including:
[0006] Each client is assigned a unique number, and the number is converted into an encoding vector according to a preset base. Multiple communication subgraphs are constructed based on the encoding vector; wherein each communication subgraph corresponds to an encoding bit in the encoding vector, and in any of the communication subgraphs, two clients have a communication connection if and only if the values of the encoding vectors of the two clients are different at the encoding bit and the values are the same at the other encoding bits; In each round of the training process, one communication subgraph is selected from the plurality of communication subgraphs as the current communication topology, so that each client only exchanges model parameters with neighboring clients in the current communication topology that have the communication connection relationship. Each client updates its local model according to its own model parameters and the model parameters received from the neighboring clients, based on a preset aggregation weight.
[0007] Optionally, converting the number into an encoding vector according to a preset base includes: The encoding length is determined based on the total number of clients, and the encoding length is the number of bits required for the maximum number represented in the preset base. For any client, its number is represented as a preset base vector with a length equal to the number of encoded bits, which serves as the client's encoding vector.
[0008] Optionally, constructing multiple communication subgraphs based on the encoding vector includes: Iterate through each bit of the encoding vector and generate a corresponding communication subgraph for each bit; For any given bit, in the communication subgraph corresponding to that bit, bidirectional communication is established between clients whose encoded vectors have different values at that bit and the same values at all other bits.
[0009] Optionally, the preset aggregation weight is determined based on the actual number of neighbors of the client in the current communication topology, wherein the actual number of neighbors is the number of neighbor clients with whom the client has a communication connection in the current communication topology, the aggregation weight between the client and each of its neighbor clients is equal, and the sum of the aggregation weight of the client and all its neighbor clients and its own weight is 1.
[0010] Optionally, the step of determining the actual number of neighbors of the client in the current communication topology includes: Determine the target coding bit corresponding to the current communication topology, clear the value of the client's coding vector at the target coding bit to obtain the reference value; Based on the reference base value and the power of the preset base, a set of candidate communication objects is determined. The set of candidate communication objects includes all theoretical coding values that are different from the client's value in the target coding bit but the same as the values of other coding bits. Invalid encoded values that exceed the range of client numbers are removed from the candidate communication object set, and the number of remaining valid encoded values is the actual number of neighbors.
[0011] Optionally, selecting one communication subgraph from the plurality of communication subgraphs as the current communication topology includes: In successive rounds of training, the communication subgraphs corresponding to each coding bit are activated in turn according to the order of the coding bits. Alternatively, the communication subgraph activated in each round of training can be determined according to a preset pseudo-random sequence.
[0012] Optionally, in each round of training, each client exchanges bidirectional model parameters with its neighboring clients only once based on the current communication topology. The model parameters include local model weights or gradient information.
[0013] Optionally, the maximum number of neighboring clients for each client in each round of training does not exceed a value equal to one less than the preset base.
[0014] Secondly, this application provides a decentralized federated learning system based on coded communication, comprising: The number allocation module is used to assign a unique number to each client and convert the number into an encoding vector according to a preset base. A communication subgraph construction module is used to construct multiple communication subgraphs based on the encoding vector; wherein each communication subgraph corresponds to a bit in the encoding vector, and in any communication subgraph, two clients have a communication connection if and only if the values of the encoding vectors of the two clients are different at the bit and the values are the same at the other bits; The training module is used to select one communication subgraph from the plurality of communication subgraphs as the current communication topology in each round of the training process, so that each client only exchanges model parameters with neighboring clients in the current communication topology that have the communication connection relationship. The update module is used to control each client to update its local model according to its own model parameters and the model parameters received from the neighboring clients, based on a preset aggregation weight.
[0015] Thirdly, this application provides a computer device, the computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the methods described above.
[0016] Compared with existing technologies, the advantages of this application are as follows: By converting client IDs into encoded vectors, each client obtains a unique numerical representation in the network. Based on the numerical distribution of each encoded bit in the encoded vector, multiple communication subgraphs are constructed. Each subgraph restricts clients to establishing connections only with neighbors whose encoding differs at specified bits, thereby limiting the number of neighbors each client can connect to in a single round of communication. During training, different communication subgraphs are activated by switching between rounds, allowing communication relationships to change dynamically with the training process. Each client only exchanges model parameters with neighbor clients defined in the current subgraph and uses preset aggregation weights to complete local model updates. Thus, under the condition of a limited number of neighbors per round of communication, information can be gradually diffused throughout the network through the subgraph rotation mechanism defined by encoded bits, improving the efficiency of communication resource utilization in the decentralized federated learning system. Attached Figure Description
[0017] Figure 1 A schematic diagram illustrating the steps of the decentralized federated learning method based on coded communication provided in this application embodiment.
[0018] Figure 2 This diagram illustrates the problem-solving process based on the divide-and-conquer approach in a system with 27 clients, each of which can communicate with two neighboring nodes per round.
[0019] Figure 3 This is a schematic diagram of the communication topology process based on the divide-and-conquer approach in a system with 27 clients, each of which can communicate with 2 neighboring nodes per round.
[0020] Figure 4 When the number of communication objects per round is limited to 2, the number of different clients The communication diagram below. Detailed Implementation
[0021] The present application will now be described in further detail with reference to experimental examples and specific embodiments. However, this should not be construed as limiting the scope of the subject matter of the present application to the following embodiments. All technologies implemented based on the content of the present application fall within the scope of protection of the present application.
[0022] In the description of the embodiments of this application, technical terms such as "first" and "second" only distinguish one entity or operation from another, and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary or secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.
[0023] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0024] Please refer to Figure 1 , Figure 1 This diagram illustrates the steps of a decentralized federated learning method based on coded communication provided in an embodiment of this application. The method may include: S1. Assign a unique number to each client and convert the number into an encoded vector according to a preset base.
[0025] S2. Construct multiple communication subgraphs based on the encoding vector.
[0026] Each communication subgraph corresponds to a bit in the encoding vector. In any communication subgraph, two clients have a communication connection if and only if the values of the two clients' encoding vectors differ at the bit positions and are the same at the other bits. S3. In each round of the training process, select one communication subgraph from multiple communication subgraphs as the current communication topology, so that each client only exchanges model parameters with neighboring clients with communication connections in the current communication topology.
[0027] S4. Control each client to update its local model according to its own model parameters and the model parameters received from neighboring clients, based on a preset aggregation weight.
[0028] In this embodiment, a client refers to a terminal device or computing node participating in a decentralized federated learning task, that is, an independent computing unit in the distributed system that holds local training data and participates in collaborative modeling. Each client has a unique identity identifier in the system, which is represented by a number. The number is used to assign a unique integer value to each client during the system initialization phase, serving as the client's identity index in the entire network.
[0029] A preset base refers to a pre-defined numerical base used for encoding conversion, that is, the number system used when converting the client number into an encoding vector. The preset base is a positive integer greater than or equal to 2. For example, when the preset base is 2, binary is used for encoding conversion; when the preset base is 3, ternary is used for encoding conversion. Based on this, the vector form obtained by representing the client number numerically according to the preset base is the encoding vector, which is a sequence of fixed length, where each element of the sequence is an integer from 0 to the preset base minus one. Each client generates a corresponding encoding vector based on its unique number, and the encoding vectors of different clients are different from each other. The number of elements contained in the encoding vector is defined as the encoding bit length, which is determined according to the total number of clients in the system. Specifically, the encoding bit length is the smallest positive integer that makes the power of the encoding bit length in the preset base greater than or equal to the total number of clients. The encoding bit refers to the position of each independent vector element that constitutes the encoding vector, that is, each bit in the encoding vector.
[0030] After constructing the encoding vectors, multiple communication subgraphs are built based on these vectors. A communication subgraph is a topological graph structure consisting of all clients as nodes, with communication edges established between nodes according to encoding bit difference rules. It defines the communication relationships between clients. Each communication subgraph uniquely corresponds to a single encoding bit in the encoding vector; different encoding bits correspond to different communication subgraphs. In any communication subgraph, whether a communication connection is established between any two clients depends on whether the values of the encoding vectors of the two clients differ at the corresponding encoding bit in the communication subgraph, and whether the values at all other encoding bits are identical. Specifically, a communication connection exists between two clients if and only if the values of their encoding vectors at the corresponding encoding bit are different and the values at all other encoding bits are identical; otherwise, no communication connection exists. The communication connection refers to a bidirectional information transmission channel between two clients in the communication subgraph, i.e., a network edge that allows two clients to directly exchange model parameters during training. This communication connection is undirected, and information and data can be transmitted equally in both directions between the two clients with this relationship.
[0031] During training, in each round, one communication subgraph is selected from the multiple communication subgraphs as the current communication topology. The current communication topology refers to the communication subgraph selected and activated in the current round; that is, the communication graph structure actually used to guide model parameter exchange between clients in the current round. Different communication subgraphs can be selected in different rounds to achieve periodic switching of the communication mode. In the current communication topology, other clients with communication connections to a particular client are defined as neighboring clients, that is, communication objects that the client can directly exchange model parameters with in the current round. Any client can have one or more neighboring clients in the current communication topology. Each neighboring client satisfies the condition that its encoding vector is different from the client's at corresponding encoding bits but the same at the remaining encoding bits. Each client exchanges model parameters only with its neighboring clients based on the current communication topology. The model parameter exchange refers to the process of clients and neighboring clients sending and receiving local model parameters or gradient information through the communication link; that is, each client sends its currently held model parameters to all its neighboring clients and simultaneously receives the model parameters currently held by each neighboring client.
[0032] After exchanging model parameters, each client updates its local model according to its own model parameters and those received from neighboring clients, using a preset aggregation weight. The preset aggregation weight is a weighting coefficient assigned by the client to its own model parameters and those of each neighboring client when updating its local model, controlling the proportion of model parameters from different sources in the local model update. For any given client, a set of weight values is assigned to all its neighboring clients and itself in the current round. The sum of these weight values equals 1, and the weight values assigned to each neighboring client are equal. The specific value of the preset aggregation weight is determined based on the actual number of neighboring clients in the current communication topology, where the actual number refers to the total number of neighboring clients with whom the client has a communication connection in the current communication topology.
[0033] For example, the solution provided in this application can be based on a containing This implementation uses a decentralized federated learning system with a maximum of [number] clients, where each client can interact with at most [number] clients per round. Point-to-point communication occurs between individual clients. In this case, the global target can be described as:
[0034] in, It is the first The local objective function at each client depends on following a distribution. Local data In real-world federated learning scenarios, The distribution across all clients is typically different and unknown.
[0035] In decentralized federated learning, the topology of the communication graph is a crucial factor affecting the model's training convergence efficiency. Assuming all clients communicate according to a given undirected topology graph, denoted as G, and using... This represents the set of nodes, specifically the set consisting of all client IDs. Define the weight matrix. This represents the edge relationships in the graph. Wherein... Represents a node To the node The weights of information flow are as follows:
[0036] Under this definition, the communication topology graph has the following characteristics: 1. Each node contains a self-loop. That is, the client does not completely discard the information it receives during training, but rather aggregates its own information with the information received from other nodes.
[0037] 2. No multiple edges exist. In each communication round, if the node... Needs and nodes If they communicate with each other, they can exchange the necessary information in one communication, without having to repeat the communication process multiple times.
[0038] 3. Since it is an undirected edge, it exists. .
[0039] 4. Weight matrix It satisfies the double randomness, that is, it satisfies and .
[0040] In the field of decentralized federated learning, a key metric for measuring the performance of a communication network topology is the consensus rate, which is the number of communication rounds required for the entire network to achieve information synchronization or global consensus. The global consensus process can be viewed as a process of "arc piecing together": assuming the total data information of all nodes in the network constitutes a complete circle, and each node initially holds only an isolated arc (local information) of that circle, then the global consensus problem is essentially about how to enable each node to continuously acquire arc fragments from other nodes through inter-node interactions, and gradually piece these fragments together until the complete circle is reconstructed.
[0041] This application uses a "divide and conquer" algorithm to rethink the optimization problem of achieving the most efficient merging under the constraint of a fixed number of neighbors k. The "divide and conquer" idea is divided into two parts: "divide" and "conquer", namely, "the process of dividing the problem into smaller parts" and "solving the smaller problems first, and then using the solutions of the smaller problems to piece together the solution of the parent problem".
[0042] First, consider the process of "dividing": We want to piece together a [structure / structure]... The complete circumference of a segment can be considered as being composed of... It consists of several larger "fan-shaped regions"; and each "fan-shaped region" is composed of a lower layer. It is composed of smaller arc segments; eventually, the entire system will be divided into... Each part is an independent, indivisible part, that is, each part represents independent information of the client.
[0043] In the process of "governance," the communication process can be designed as a hierarchical progression: at each level, a node only needs to communicate with nodes belonging to the same "sector group." The neighbors exchange information. For a clearer illustration of this design concept, please refer to... Figure 2 and Figure 3 . Figure 2 This diagram illustrates the problem-solving process based on the divide-and-conquer approach in a system with 27 clients, each of which can communicate with two neighboring nodes per round. The bottom layer consists of 27 independent arc segments, each representing local information from a single client. Moving upwards, every three adjacent segments are grouped into the same sector, ultimately converging at the top layer to form a complete circle. This illustrates the logic of how the global consensus problem is progressively decomposed into several sub-problems.
[0044] Figure 3 This diagram illustrates the communication topology process based on the divide-and-conquer approach in a system with 27 clients, each capable of communicating with two neighboring nodes per round. The diagram represents a top-down "conquer" process, showing how a complete circle is progressively broken down into several sector groups until it is restored to independent segments. Communication at each level requires only a limited number of nodes exchanging information with their finite number of neighbors within their group. This demonstrates that, under the condition of a limited number of communication objects per round, a hierarchical, progressive interaction method achieves the reconstruction and consensus of global information. Through this divide-and-conquer strategy, progressing from small to large, the system can achieve... With order-of-magnitude communication efficiency, it efficiently completes the reconstruction from "fragments" to "complete circle" and achieves global consensus.
[0045] The following describes in detail the specific implementation of the communication topology construction method proposed in this invention: First, the clients in the system need to be encoded. Converting the number into an encoding vector according to a preset base includes: determining the number of encoding bits based on the total number of clients, where the number of encoding bits is the number of bits required for the largest number represented in the preset base; for any client, its number is represented as a vector in the preset base with a length equal to the number of encoding bits, which serves as the encoding vector for the client.
[0046] In a containing In a decentralized federated learning system with 1 client, the client set is represented as: The system stipulates that each client can interact with a maximum of [number] clients per round of communication. Communicating with other clients, among which It is a preset number system, and .
[0047] For any client index Its unique counterpart Number systems can be represented as vectors The following equation is satisfied:
[0048] in, express corresponding The first base of the number The value of the digit; Indicates the number of bits in the encoding. (This is because it represents numerical values.) Required The number of digits in the base is strictly equal to Therefore, in order to identify all nodes The value of should be:
[0049] in, corresponding The number of digits in a number system is always determined by its maximum value. The default number system is . .when At times, the values corresponding to some high-order bits of the encoding exceed the actual client number range. These codes do not have corresponding physical nodes, and only the client nodes corresponding to the valid codes are retained in subsequent processing.
[0050] After the encoding vector is constructed, a communication subgraph is constructed based on the encoding vector. Multiple communication subgraphs are constructed according to the encoding vector, including: traversing each encoding bit of the encoding vector and generating a corresponding communication subgraph for each encoding bit; for any encoding bit, in the communication subgraph corresponding to the encoding bit, establishing bidirectional communication between clients whose encoding vector has different values at that encoding bit and the same values at all other encoding bits.
[0051] Specifically, using the above encoding method, a set of communication graphs can be defined. Among them, in the first Zhang Tongxun's diagram middle( ),node With nodes There exist edges if and only if their encoded vectors and The following conditions must be met:
[0052] That is, in the first In the diagram, two nodes are only considered to be in the [number]th [order]. Communication occurs only when two clients have different values at their respective coding bits, while all other coding bits are identical. Therefore, each communication subgraph corresponds to a coding bit in the coding vector. Any two clients have a communication connection in a given communication subgraph if and only if their coding vectors have different values at the corresponding coding bit in that subgraph, and the same values at all other coding bits. This "communication connection" refers to a bidirectional information transmission channel between two clients in the communication subgraph. This connection is undirected, allowing information and data to be transmitted equally in both directions between the two clients with this connection.
[0053] It can be proven that each graph in the above communication graph set satisfies the condition that any client... In any communication round Number of communication neighbors The maximum number of neighboring clients for each client in each round of training does not exceed the preset base minus one. Since the preset base is... Therefore, the upper limit value is The proof is as follows: According to the above construction rules, in the... Zhang Tongxun's diagram In the middle, the client Only with those in its The first base encoding The digits are different, but in the rest Clients whose units digit is exactly the same communicate directly. This is because the encoding uses... number system, so the first The value in the bit The range of values is For fixed clients , its first The value of the bit is .
[0054] While keeping other bits unchanged, Modified to For any value in the set, the encoding of a neighboring node can be obtained. Clearly, the set... The size is Therefore, the maximum possible number of neighbors is When the total number of system nodes At this time, some encodings may not have corresponding physical nodes, and in this case, the actual number of neighbors of some nodes may be less than [a certain number]. In summary, each of these graphs satisfies the initial assumption regarding the limit on the number of communication objects.
[0055] Any one of the communication diagrams All are from Unconnected A non-connected graph composed of clusters, but the union of all graphs. It is connected. To ensure consensus among clients, a communication graph set can be used. Each graph in the algorithm communicates independently. During training, in each round, one communication subgraph is selected from multiple communication subgraphs as the current communication topology, and different communication subgraphs are selected in different rounds.
[0056] Selecting a communication subgraph as the current communication topology from the plurality of communication subgraphs may include: sequentially activating the communication subgraphs corresponding to each coding bit in successive rounds of training according to the order of the coding bits; or determining the communication subgraph activated in each round of training according to a preset pseudo-random sequence.
[0057] When using a bit-by-bit rotation method, the first... Round training ( from The communication subgraph activated by (start counting) is That is, each client follows the procedure in turn. The communication mode is switched sequentially in a loop; when using a pseudo-random sequence method, a seed for a pseudo-random number generator is pre-synchronized on each client, so that each client independently calculates a pseudo-random number according to the current round, and then applies the pseudo-random number to... Modulo operation is used to determine the subgraph number activated in the current round, thus ensuring that all clients reach a consistent understanding of the currently activated subgraph without additional communication. In each round of communication, the client... It only needs to exchange information with its neighboring nodes that have communication connections in the currently active communication subgraph.
[0058] In each training round, each client performs only one bidirectional model parameter exchange with its neighboring clients based on the current communication topology. These model parameters include local model weights or gradient information. Specifically, each client sends its currently held model parameters to all its neighboring clients and simultaneously receives the model parameters held by each neighboring client. This bidirectional exchange completes the communication round without retransmission. This process is repeated. Round (i.e., communication round) from arrive ), all clients will eventually be able to To improve communication efficiency and achieve a consistent consensus on global model parameters.
[0059] To further illustrate the communication graph set Please refer to the construction results. Figure 4 , Figure 4 The number of clients during the experiment is given. , or At that time, the communication target in each round is A communication graph of neighboring nodes. Each subgraph is constructed according to the coding bit difference rule, and each subgraph has a sparse structure with complementary communication edges between different subgraphs. When n=27, the structure of this communication graph is similar to... Figure 3 The divide-and-conquer hierarchical structure shown is a perfect match, verifying the consistency between the coding construction method and the divide-and-conquer idea.
[0060] The following describes in detail the method for determining the preset aggregation weights and their specific calculation process in this invention.
[0061] Ideally, in the first In the first communication mode, the second Each client will have There are [number] communication objects, including their own information, totaling [number]. The gradient information needs to be integrated; therefore, the communication weights between the client and each of its communication objects are: However, in actual implementation, this setting cannot be done so simply. When the total number of clients is not... When it is an integer power, that is At that time, not all lengths are of The number system codes all correspond to the actual client machines; some codes exceed the range of available numbers. In this case, in a certain round... When the position changes, the first The client may not be found. The number of client codes that meet the conditions results in the number of actual communication objects for that client. satisfy .
[0062] Therefore, the preset aggregation weight is determined based on the actual number of neighbors of the client in the current communication topology, wherein the actual number of neighbors is the number of neighbor clients with whom the client has a communication connection in the current communication topology, the aggregation weight between the client and each of its neighbor clients is equal, and the sum of the aggregation weight of the client and all its neighbor clients and its own weight is 1.
[0063] If we directly refer to the theoretical upper limit Designing communication weights will result in a weight matrix. The failure to meet the double randomness condition negatively impacts the convergence performance of the entire training process. Therefore, it is necessary to dynamically determine the aggregation weights based on the actual number of neighbors of each client in the current communication topology.
[0064] The steps for determining the actual number of neighbors of the client in the current communication topology include: The target coding bit corresponding to the current communication topology is determined, and the value of the client's coding vector at the target coding bit is cleared to obtain a reference value. Based on the reference value and the power of the preset base, a candidate communication object set is determined. The candidate communication object set contains all theoretical coding values that are different from the client's value at the target coding bit but have the same values at other coding bits. Invalid coding values that are outside the range of client numbers are removed from the candidate communication object set, and the number of remaining valid coding values is the actual number of neighbors.
[0065] To further determine The value needs to be quantitatively described for the client. The conditions that the communication object must meet. For the client. First of all, The first base encoding Clear the bit to obtain the reference value. :
[0066] Then the client The set of communication objects can be represented as:
[0067] Therefore, the actual number of communication objects can be calculated as follows:
[0068] In the In this communication mode, the client There are a total of Since the gradient information needs to be integrated, the communication weights between it and each of its communication objects are: Therefore, we can obtain the first... Under this communication mode, the expression for the weight matrix is:
[0069] In this way, each client dynamically allocates aggregation weights based on the actual number of its neighbors in the current communication topology, so that the weight matrix always maintains double randomness, thereby ensuring the stable convergence of the decentralized training process.
[0070] From the perspective of system process, the decentralized federated learning method based on coded communication proposed in this application can be mainly divided into two key stages: initialization and dynamic training.
[0071] The initialization phase primarily involves topology construction. The main task in this phase is topology construction. Construction of number system encoding principle This stage involves constructing a sparse communication subgraph to establish the underlying communication pattern of the system. This phase only needs to be executed once during system startup, and subsequent training processes directly call the already constructed set of communication subgraphs.
[0072] The dynamic training phase primarily focuses on decentralized training. During training, each round selects a communication subgraph from the communication graph set as the current communication topology. Each client determines its neighboring clients based on this topology and performs only one bidirectional model parameter exchange with its neighbors. Subsequently, a preset aggregation weight is calculated based on the actual number of neighbors, and the local model is updated. By periodically switching these subgraphs, the local model parameters satisfy the sparse communication constraints while achieving efficient mixing and convergence of the entire network through multiple iterations. This phase is repeated in each training round until the model reaches the preset convergence condition or the upper limit of the training rounds.
[0073] The foregoing description fully outlines the specific implementation of the decentralized federated learning method based on coded communication proposed in this application. To further verify the effectiveness of the above method in terms of convergence performance from a theoretical perspective, this section introduces several basic assumptions from decentralized optimization theory and quantitatively analyzes the convergence efficiency of the proposed method, proving that it can maintain a relatively fast convergence rate even under the condition of limiting the number of neighbors in each round of communication.
[0074] In the above implementation process, by converting client IDs into encoded vectors, each client obtains a unique numerical representation in the network. Based on the numerical distribution of each encoded bit in the encoded vector, multiple communication subgraphs are constructed. Each subgraph restricts clients to establishing connections only with neighbors whose encodings differ at specified bits, thus limiting the number of neighbors each client can connect to in a single round of communication. During training, different communication subgraphs are activated in turn, causing communication relationships to change dynamically with the training process. Each client only exchanges model parameters with neighbor clients defined in the current subgraph and uses preset aggregation weights to complete local model updates. Thus, under the condition of a limited number of neighbors per round of communication, the subgraph rotation mechanism defined by encoded bits allows information to gradually spread throughout the network over multiple rounds, improving the efficiency of communication resource utilization in the decentralized federated learning system.
[0075] To facilitate further explanation later, the following basic assumptions are introduced: The objective function is bounded by the following assumption: There exists a lower bound, i.e., the following condition is met:
[0076] Smoothness assumption: for each local function yes That is, satisfying:
[0077] Gradient bounded assumption: The variance of the stochastic gradient has an upper bound, i.e., it satisfies:
[0078] The data heterogeneity bounded assumption states that the heterogeneity of the data distribution is bounded, which is manifested in the bounded difference between gradients at different nodes, i.e., it satisfies:
[0079] Based on the above assumptions, and following the unified convergence analysis framework of the decentralized stochastic gradient descent algorithm, using standardized theorem derivation methods, the following results can be obtained: A learning rate exists. Make After experiencing training rounds
[0080] Post-satisfaction
[0081] The convergence condition has been met. This represents the difference between the initial objective function value and the optimal value, i.e. .
[0082] The above convergence analysis shows that the decentralized federated learning method based on coded communication proposed in this invention can achieve [the desired results]. The communication complexity converges while ensuring that the number of neighbors communicated by each client in each round does not exceed a preset limit. Under the premise of [previous conditions], it still has convergence performance comparable to that of a fully connected topology. This theoretical result is corroborated by the specific implementation methods described in the preceding sections, such as encoding construction, topology switching, and weight allocation, fully demonstrating that the method provided in this application achieves an effective balance between communication efficiency and convergence speed.
[0083] The following is a verification of the effectiveness of the decentralized federated learning method based on coded communication provided in this application.
[0084] To further illustrate the effectiveness of the decentralized federated learning method (RadixTopology method) based on encoded communication provided in this application, this application conducts experimental verification using the general-purpose datasets CIFAR-10, MNIST, and FashionMNIST, with fixed topology schemes full and ring and variable topology schemes BaseGraph and TGC as comparisons.
[0085] Please refer to Table 1, which shows the experimental results on different datasets. ComR(x) represents the number of communication rounds required to achieve the target accuracy x%, and acc(t) represents the model's accuracy after t training rounds.
[0086] Table 1
[0087] Table 1 shows the results. Under heterogeneous settings, the performance of the RadixTopology method and the comparison scheme is compared under different datasets and network structures. Analysis of the experimental data leads to the following conclusions: The RadixTopology method demonstrates superior performance across multiple mainstream datasets and network sizes. Specifically, on the relatively simple MNIST and FashionMNIST datasets, RadixTopology unlocks the model's maximum performance, achieving top accuracies of 99.12% and 95.03%, respectively. On the more challenging CIFAR-10 dataset, RadixTopology's advantage is more pronounced with simpler models. Under CNN architectures, the method achieves a 1.25% higher accuracy than the second-best approach; under ResNet architectures, it only surpasses the second-best approach by 0.01%; and under VGG architectures, it slightly underperforms the BaseGraph method. This indicates that RadixTopology is more effectively optimized for shallow networks with distributed architectures; and when applied to deep networks such as VGG and ResNet, it still effectively improves the model's final performance, demonstrating strong generalization ability.
[0088] Meanwhile, RadixTopology also demonstrates a significant advantage in convergence speed. Under the same target accuracy requirements, it requires significantly fewer communication rounds than other methods. Taking MNIST as an example, Radix achieves 98% accuracy in just 83 rounds, saving approximately 22% of communication rounds compared to the second-best performing BaseGraph method. This fast convergence not only helps reduce communication latency and resource consumption but also further improves overall training efficiency, making it particularly suitable for large-scale, heterogeneous distributed federated learning scenarios.
[0089] Furthermore, the experimental results revealed a counterintuitive phenomenon: the full method, theoretically possessing the smallest spectral gap and the best connectivity, actually performs the worst in heterogeneous scenarios. Data shows that the full method generally lags behind the sparse topology in accuracy on CIFAR-10 and converges extremely slowly. This strongly refutes the traditional view that "the denser the communication, the better the results." The reason for this phenomenon may be that in scenarios with similar data distributions, a small spectral gap means high information synchronization efficiency, which translates to faster training and better results; however, in heterogeneous scenarios, clients should communicate as selectively as possible, and blindly communicating with as many other clients as possible may even slow down their own training progress and results.
[0090] Since BaseGraph outperforms the benchmark methods in multiple metrics, and BaseGraph and RadixTopology are the only two methods applicable to all scenarios with limited communication volume, the subsequent experimental analysis in this chapter will focus on a deep comparison between RadixTopology and BaseGraph to further validate the advantages of the proposed method. Furthermore, unless otherwise specified, subsequent experiments will maintain a ResNet-based network structure and use the CIFAR-10 dataset.
[0091] Table 2
[0092] Table 2 shows the experimental results based on different communication object constraints. The experiments in Table 2 verify the performance of the RadixTopology method under different communication scenarios. Analysis of the experimental data leads to the following conclusions: RadixTopology outperforms the BaseGraph method in accuracy and convergence speed across different neighbor counts. Especially... Under the given conditions, RadixTopology demonstrates the most significant advantage, achieving an accuracy of 83.32%, which is nearly 16% higher than the BaseGraph method under the same conditions. This indicates that the communication topology constructed by RadixTopology has higher graph connectivity quality, enabling more efficient mixing and propagation of information across the entire network with the same communication overhead.
[0093] Comparing the cases with 2 and 3 neighbors reveals that RadixTopology better integrates the advantages of multiple neighbors, achieving better convergence results. BaseGraph's performance actually declines as the number of neighbors increases; while RadixTopology successfully utilizes the increased communication bandwidth, significantly improving accuracy from 77.10% to 83.32%. This phenomenon may be because RadixTopology, through its radix encoding strategy, allocates newly added neighbor connections to positions in the network that contribute most to information flow, effectively integrating the gains from multiple neighbors. In contrast, BaseGraph may have introduced redundant connections in this scenario, failing to translate the increased communication resources into effective improvements in model accuracy.
[0094] Simply increasing the number of neighbors does not lead to linear optimization of the model. Due to client heterogeneity, some clients that are significantly different from the local client participate in the model generation process, which can seriously harm the local model. This further confirms the conclusion in the previous section regarding "full connection failure": in Non-IID scenarios, aggregating too many neighbors is a double-edged sword. Although increasing... While theoretically increasing the rate of information exchange improves performance, the severe heterogeneity of client data distribution and communication with too many disparate neighbors introduce significant model noise. When this negative interference outweighs the gain from information synchronization, the model's convergence performance suffers. Nevertheless, RadixTopology still demonstrates strong robustness against interference.
[0095] In summary, RadixTopology not only demonstrates superior efficiency under low bandwidth conditions, but also achieves a better balance between information gain and heterogeneous noise than benchmark methods when broadband resources increase, proving its effectiveness as a flexible topology construction scheme.
[0096] Table 3
[0097] Table 3 illustrates the experimental results under different data heterogeneity conditions. The experiments in Table 3 verify the performance of the RadixTopology and BaseGraph methods under different Dirichlet distributions. Analysis of the experimental data leads to the following conclusions: RadixTopology outperforms base methods in accuracy and convergence speed in most severely heterogeneous scenarios. Especially... Under this extreme Non-IID setting, RadixTopology can achieve an accuracy of 72.62% after 100 training epochs, which is nearly 0.9% higher than BaseGraph after 200 training epochs. This shows that the topology of RadixTopology can more effectively promote the integration of global information, thereby mitigating the negative impact of severe local data skew on the final model.
[0098] In areas with extremely severe heterogeneity and In scenarios with heterogeneity, the RadixTopology method still maintains an accuracy of over 72%, demonstrating strong adaptability to heterogeneous environments. The heterogeneity condition stems from... Change to The accuracy of both topology construction methods declined, but the accuracy change of the RadixTopology method was smaller than that of the BaseGraph method, indicating that the RadixTopology method has stronger stability under heterogeneous conditions.
[0099] Table 4
[0100] Table 4 illustrates the experimental results based on different attack scenarios, comparing and analyzing the performance of the RadixTopology and BaseGraph methods under various attack scenarios. Analysis of the experimental data reveals that the BaseGraph method exhibits higher stability than the RadixTopology method in both LF and MINIC scenarios. Particularly in the LF scenario, the accuracy variation of the BaseGraph method is more than 3% greater than that of the RadixTopology method, demonstrating relatively poor robustness. However, in the IPM attack scenario where RadixTopology performs better, BaseGraph's performance is only slightly worse by less than 0.1%. The underlying reason for this phenomenon may lie in the duality of "information propagation efficiency": while RadixTopology successfully accelerates convergence during normal training, it may also accelerate the spread of malicious noise or incorrectly labeled information in the network under attack scenarios. In contrast, BaseGraph, to some extent, limits the rapid global penetration of malicious information, thus exhibiting a certain degree of laziness advantage under highly destructive attacks like LF.
[0101] Based on the same concept, embodiments of this application also provide a decentralized federated learning system based on coded communication, which may include: The number allocation module is used to assign a unique number to each client and convert the number into an encoding vector according to a preset base. A communication subgraph construction module is used to construct multiple communication subgraphs based on the encoding vector; wherein each communication subgraph corresponds to a bit in the encoding vector, and in any communication subgraph, two clients have a communication connection if and only if the values of the encoding vectors of the two clients are different at the bit and the values are the same at the other bits; The training module is used to select one communication subgraph from the plurality of communication subgraphs as the current communication topology in each round of the training process, so that each client only exchanges model parameters with neighboring clients in the current communication topology that have the communication connection relationship. The update module is used to control each client to update its local model according to its own model parameters and the model parameters received from the neighboring clients, based on a preset aggregation weight.
[0102] It should be understood that when the various modules of the system provided in the above embodiments are working, the division of each functional module in the above description is only used as an example. In actual applications, the above functions can be assigned to different functional modules as needed. That is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0103] The functional modules in the above embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of the embodiments of this application.
[0104] Based on the same concept, embodiments of this application also provide a computer device, which may include a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the methods described above.
[0105] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A decentralized federated learning method based on coded communication, characterized in that, include: Each client is assigned a unique number, and the number is converted into an encoding vector according to a preset base. Multiple communication subgraphs are constructed based on the encoding vector; wherein each communication subgraph corresponds to an encoding bit in the encoding vector, and in any of the communication subgraphs, two clients have a communication connection if and only if the values of the encoding vectors of the two clients are different at the encoding bit and the values are the same at the other encoding bits; In each round of the training process, one communication subgraph is selected from the plurality of communication subgraphs as the current communication topology, so that each client only exchanges model parameters with neighboring clients in the current communication topology that have the communication connection relationship. Each client updates its local model according to its own model parameters and the model parameters received from the neighboring clients, based on a preset aggregation weight. The preset aggregation weight is determined based on the actual number of neighbors of the client in the current communication topology, wherein the actual number of neighbors is the number of neighbor clients with which the client has a communication connection in the current communication topology, the aggregation weight between the client and each of its neighbor clients is equal, and the sum of the aggregation weight of the client and all its neighbor clients and its own weight is 1. The steps for determining the actual number of neighbors of the client in the current communication topology include: The target coding bit corresponding to the current communication topology is determined, and the value of the client's coding vector at the target coding bit is cleared to obtain a reference value. Based on the reference value and the power of the preset base, a candidate communication object set is determined. The candidate communication object set contains all theoretical coding values that are different from the client's value at the target coding bit but have the same values at other coding bits. Invalid coding values that are outside the range of client numbers are removed from the candidate communication object set, and the number of remaining valid coding values is the actual number of neighbors. For the client By The first base encoding Clear the bit to obtain the reference value. : Client Collection of communication objects for: Client The actual number of communication objects for: In the In this communication mode, the client The communication weight between each of its communication objects is The weight matrix is then: in, Here, x is the communication mode index, m is a non-negative integer variable, n is the upper limit of the enumeration, k is the total number of clients, and k is the upper limit of the number of neighbors in a single round of communication. This represents the aggregate weight value assigned by client i to client j.
2. The decentralized federated learning method based on coded communication according to claim 1, characterized in that, The step of converting the number into an encoding vector according to a preset base includes: The encoding length is determined based on the total number of clients, and the encoding length is the number of bits required for the maximum number represented in the preset base. For any client, its number is represented as a preset base vector with a length equal to the number of encoded bits, which serves as the client's encoding vector.
3. The decentralized federated learning method based on coded communication according to claim 1, characterized in that, The construction of multiple communication subgraphs based on the encoding vector includes: Iterate through each bit of the encoding vector and generate a corresponding communication subgraph for each bit; For any given bit, in the communication subgraph corresponding to that bit, bidirectional communication is established between clients whose encoded vectors have different values at that bit and the same values at all other bits.
4. The decentralized federated learning method based on coded communication according to claim 1, characterized in that, Selecting a communication subgraph from the plurality of communication subgraphs as the current communication topology includes: In successive rounds of training, the communication subgraphs corresponding to each coding bit are activated in turn according to the order of the coding bits. Alternatively, the communication subgraph activated in each round of training can be determined according to a preset pseudo-random sequence.
5. The decentralized federated learning method based on coded communication according to claim 1, characterized in that, In each round of training, each client exchanges bidirectional model parameters with its neighboring clients only once based on the current communication topology. The model parameters include local model weights or gradient information.
6. The decentralized federated learning method based on coded communication according to claim 1, characterized in that, The maximum number of neighboring clients for each client in each round of training does not exceed a value equal to one less than the preset base.
Citation Information
Patent Citations
Model parameter updating method and system based on graph federal learning
CN119623580A
Sub-graph federated learning method based on supervised comparative learning and graph encoder
CN121660031A