Personalized federal relationship classification method under limited resource condition

By employing an entity and relation representation alignment method within a federated learning environment, combined with efficient parameter fine-tuning techniques, the problems of resource constraints and heterogeneous text were addressed, enabling efficient and personalized federated relation classification and improving model performance.

CN121327646APending Publication Date: 2026-01-13PLA AIR FORCE AVIATION UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511220321.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-29
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

In a federated learning environment, resource-constrained clients struggle to efficiently fine-tune pre-trained language models for relation classification, and heterogeneous texts lead to poor model performance. Existing methods have failed to effectively address the challenges of personalized federated relation classification.

Method used

By aligning entity and relation representations, employing efficient parameter fine-tuning techniques, deploying entity and relation memories on the client side, optimizing the local model by combining cross-entropy loss and alignment loss, and performing efficient parameter aggregation on the server, a personalized federated relation classification framework, FedAER, is achieved.

Benefits of technology

It significantly reduces communication and computing resource consumption, improves the model's personalized performance in heterogeneous text environments, and outperforms competing methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure QLYQS_3
    Figure QLYQS_3
Patent Text Reader

Abstract

The invention discloses a personalized federal relationship classification method under a limited resource condition, and belongs to the technical field of distributed machine learning and artificial intelligence. According to the personalized federal relationship classification method under the limited resource condition, entity and relationship representation are aligned with local memory, and each instance can'review 'memory knowledge by forcing the instance to be embedded into the corresponding relationship representation as much as possible. According to the method, an efficient parameter fine tuning method is applied to learning of a federated RC model, a personalized federated relationship classification method is provided, and an entity library and a relationship library are deployed at each client and used for storing local entities and relationship representations as memory knowledge. The FEDAER method provided by the invention is superior to a competition method under various settings, and meanwhile, the heavy communication and computing resource consumption is remarkably reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of distributed machine learning and artificial intelligence. BACKGROUND

[0002] With the advent of the big data era, knowledge discovery technology has been widely applied in various fields. As a key task in natural language processing (NLP) and information retrieval, relation classification (RC) aims to identify the semantic relationships between annotated entities in pure text, which is of great significance for knowledge graph construction, intelligent question answering systems, etc.

[0003] The development of pre-trained language models (PLMs) has made them widely used as backbone models for RC and have achieved outstanding performance. Fine-tuning these pre-trained language models requires collecting a large amount of labeled data to enhance their representation capabilities and customize them to the specific details of the RC task. However, due to privacy issues and the emergence of data protection laws, organizations are now prohibited from collecting data from end devices to central servers. Therefore, there has been a recent trend of federated training of RC models. This federated learning (FL) approach involves training models on local devices (i.e., clients) and aggregating local model parameters, thereby achieving the goal of collaborative training while protecting data privacy.

[0004] As a pioneering work, the document studies federated relation classification based on the FEDAVG [8] framework, aiming to develop a robust server-side relation classification model that can generalize on all client data. FEDAVG requires aggregating all the parameters of the pre-trained language models of all participating clients, resulting in significant communication costs, for example, uploading a BERT-large model can take about 1,260 seconds in a single round of communication. To address this challenge, communication-efficient methods are proposed. They deploy a publicly available dataset on the server, which each client can access for prediction. The prediction results of all clients, rather than the locally trained pre-trained language models for relation classification, are subsequently aggregated to refine the server or client pre-trained language models. However, it is worth noting that such non-private datasets are not always readily available.

[0005] Although pre-trained language model fine-tuning for RC has been successfully attempted in a federated learning environment, there are still two major challenges to be addressed: Challenge 1: Resource-constrained. Fine-tuning a pre-trained language model for relation classification in a federated setting requires frequent exchange of parameters (or gradients) between servers and clients, leading to significant communication cost. For example, a Bert-large model has 340 million parameters, and a Bert-base model has 110 million parameters. In this case, the limited bandwidth of the FL system (in most cases, the upload bandwidth is usually limited to 1 MB / s or less (en.wikipedia.org / wiki / ADSL)) can cause significant delay in the parameter exchange process. On the other hand, fine-tuning the entire parameters of a pre-trained language model for different RC tasks is extremely memory-consuming. The limited computing resources on the client side make it difficult to support the fine-tuning of the entire pre-trained language model. Therefore, how to train a pre-trained language model on a resource-constrained (i.e., limited communication bandwidth and computing memory) federated system is a challenging problem.

[0006] Challenge 2: Heterogeneous text. In reality, the data owned by different clients is non-IID, which is referred to as the heterogeneous text problem in federated RC. When clients own heterogeneous text, the distance between different client models is greater, and sharing a single server model will lead to poor performance. This is because the data distribution learned by the server model is significantly different from the data distribution of a particular client. However, existing literature has almost ignored the personalization problem of federated RC. Although the literature published by Pang et al. proposes to explore personalized federated RC, their focus is still on the order-of-magnitude non-IID setting, rather than the more challenging class-level non-IID setting. SUMMARY

[0007] The purpose of the present invention is to align entity and relation representations with local memories, enabling each instance to "review" its memory knowledge under the condition of limited resources by forcing its instance embedding to be as close as possible to its corresponding relation representation.

[0008] The steps of the present invention are: S1, review the standard relation classification task Given a labeled dataset , |D| represents the cardinality of D, i.e., the number of samples in the dataset, and the data distribution is assumed to be , where is the input space, is the output space with predefined relations, each contains a text about a pair of entities , , where is the head entity, is the tail entity, and a labeled relation ; Relation classification definition: with model parameters initialized relation classification model: (1) where is the cross-entropy loss function of the given RC model , is the labeled relation label of ; Personalized federated relation classification definition: personalized local RC model: (2) where denotes the set of all client models, ; S2, efficient fine-tuning of pre-trained language model parameters for relation classification: Personalized federated relation classification method proposed by entity and relation representation alignment: Given and text , add four entity tags: (3) where [E1] and [ / E1] represent the start and end positions of , [E2] and [ / E2] represent the start and end positions of ; input into a PLM to generate hidden vectors for [E1] and [E2] tags: (4) Let and be regarded as entity representations of and , that is = and = , where is the hidden dimension; add an additional softmax classifier on top of the PLM , obtain the instance representation of by concatenating the entity representations and inputting the concatenated result into a fully connected layer: (5) where is a trainable projection matrix; The relation representation is used for classification: (6) where and are adjustable parameters in the classifier ; Given a pre-trained weight matrix there are: (7) where is the weight update matrix, and are two low-rank matrices with rank ; S3, A personalized federated relation classification framework FedAER is implemented by entity and relation representation alignment: S31, Entity and relation memory banks: At the th client, there is an entity memory bank and a relation memory bank , where is the total number of global entities, the th row in is the memory representation of the th entity; (8) where comes from equation (4); is composed of all occurrences of entity in the dataset : (9) Relation representation: The representation of a relation is defined as the average of all instance embeddings it belongs to (10) where is generated according to equation (5), is a subset of , composed of all instances of relation ; S32, Client local training: For a local instance ( , ) ∈ , its prediction probability is obtained from equation (6) and the cross-entropy loss is calculated (11) Entity representation alignment: Given an instance , generate entity representations and according to equation (4), and define the entity alignment loss as: (12) where denotes the Euclidean norm of a vector; Relation representation alignment: For an instance x with a relation r, the relation alignment loss is as follows: (13) where f(⋅) consists of two fully connected neural networks followed by a normalization function, f(⋅) is a dimensionality reduction operation; Combining entity and relation representation alignment, the local personalized optimization loss is defined as follows: (14) where β and γ are two hyperparameters; S33, Server global aggregation: After all active clients complete local training, the server collects efficient parameters , entity representations and relation representations from the clients and aggregates them: (15) (16) (17) where ⊙ is the element-wise product, is the entity, relation mask Boolean vector, where 0 represents the absence of the corresponding entity (relation), and 1 represents its existence.

[0009] The FEDAER method proposed by the present application is superior to the competing methods under various settings, while significantly reducing the heavy communication and computing resource consumption. BRIEF DESCRIPTION OF DRAWINGS

[0010] Figure 1 is a federated relation classification system that uses parameter efficient fine-tuning, where only a small number of parameters are exchanged between the client and the server. denotes the local frozen PLM for relation classification, denotes a small number of globally trainable parameters at the th communication round; Figure 2In the proposed framework, each client first conducts local training by optimizing its local model with both classification loss and alignment loss. Subsequently, the updated model is used to generate representations of all entities and relations present in the local text, which are then stored in entity and relation banks, respectively. The updated efficient parameters, entity bank, and relation bank are uploaded to the server for aggregation. After aggregation, the model parameters, entity representations, and relation representations are broadcast to all clients for the next round of training. DETAILED DESCRIPTION

[0011] The parameter-efficient fine-tuning methods of pre-trained language models, such as adapter fine-tuning, prefix fine-tuning, BitFit, and LoRA, provide a viable approach to address the resource-constrained challenge in FL systems. When adapting pre-trained language models to downstream tasks, these methods optimize only a small number of parameters while keeping the majority of parameters frozen. This lightweight parameter fine-tuning feature effectively addresses the limited computational resources on the client side, thereby alleviating bandwidth constraints, as only a small number of parameters are updated and transmitted. Some previous studies discuss federated parameter-efficient fine-tuning, and we are among the first researchers to extend it to the federated relation classification task. More importantly, in this study, we explore solutions to the personalization challenge in federated parameter-efficient fine-tuning for relation classification, which is largely overlooked in existing work.

[0012] In the face of heterogeneous text distributed across different clients, a personalized FL mechanism is employed to train a customized model for each client to adapt to the unique data distribution of the client. Existing model-based personalized FL methods mainly include regularization, parameter decoupling, and meta-learning. Although these methods inherently have the advantage of personalized FL, they struggle to capture the distribution of local entity and relation features, resulting in insufficient personalization when dealing with federated relation classification with heterogeneous text.

[0013] We propose a novel personalized federated relation classification method by aligning entity and relation representations with local memories, namely FedAER. (1) For entity representation alignment, we design an entity memory bank at each client to store the representation of all unique entities involved in the local private text. An entity may appear multiple times within a client or across multiple clients. Considering that different occurrences of the same entity should have consistent representations, in each communication round, the memory representation of each unique entity is obtained by averaging the feature vectors of all its mentions, which are extracted by a local pre-trained language model. Due to privacy protection, when aggregating entity representations across clients, the client anonymizes the entity and sends it to the server. Then the server averages the representations of entities with the same ID and distributes them back to the clients. In the next round of local training, the entity representations should remain as consistent as possible with their respective memories, which is crucial for maintaining their local personalized features. (2) For relation representation alignment, we deploy a relation memory bank at each client to store the representations of all relations as a repository of memory knowledge. The representation of each relation is obtained by averaging the embeddings of all its instances. To adapt to the personalized relation distribution of each client during local training, we enable each instance to "review" its memory knowledge by forcing its instance embedding to be as close as possible to its corresponding relation representation. During fine-tuning, in addition to using a neural classifier head, the classification of an instance is also determined by identifying its nearest memory relation representation.

[0014] In this invention, we study the task of personalized federated relation classification under resource-constrained conditions, and contribute at least three aspects: To address the resource-constrained challenge, we implement a federated parameter-efficient fine-tuning method and pioneeringly integrate it into the training of the federated relation classification model; In the face of heterogeneous text, we propose to adapt to the personalized data distribution by aligning entity and relation representations with local memory knowledge; Extensive experiments on real-world datasets and comparisons with current personalized FL methods demonstrate the superiority of FedAER.

[0015] The research results demonstrate the potential of parameter-efficient fine-tuning of pre-trained language models for relation classification tasks in a federated environment, laying the foundation for federated training of task-specific large language models.

[0016] This invention will introduce related work from the following three aspects: personalized federated learning, federated relation classification, and federated parameter-efficient fine-tuning.

[0017] A. Personalized Federated Learning Federated Learning. Federated Learning (FL) aims to enable multiple participants (i.e., clients) to collaboratively learn a global model without exposing their data. The core idea of this decentralized learning paradigm is to require participating clients to share model parameters with a coordinator (i.e., server) instead of local private data. A typical FL method is FedAvg, which depicts the basic framework of federated learning. In this framework, the server first broadcasts the global model parameters to all clients for local training. After local training, all clients send their updated models to the server for aggregation. To improve the stability of FL, a variant of FedAvg, FedProx, is proposed, which adds a proximity term to force the client model to be close to the global model. To address the inconsistency between local and global optimization, FedAdam uses the ADAM optimizer at the server side, while MOON applies model contrastive learning. Shortly after, more efforts extend FL to a wider range of environments, including weakly supervised learning, continual learning, multi-task learning, etc. However, the above methods strive to provide a strong global model for all clients, which leads to poor accuracy disparity when the local data is non-IID.

[0018] Personalized Federated Learning. The goal of Personalized Federated Learning (PFL) is to train a customized model for each client in the federation, so that each client model can better adapt to its own data. Existing PFL methods employ a variety of techniques. Based on FedAvg, Fallah et al. proposed Per-FedAvg, which handles the non-IID challenge through meta-learning. Ditto and FedMe maintain the personalization of clients by regularizing the distance between the global model and the local model. In addition, some research decomposes the model into a base layer and a personalization layer, where the personalization layer is kept local to achieve personalization. Another class of methods suggests training multiple global models at the server side. According to the model similarity, the client models are divided into several groups, and each group of clients shares a global model. The idea behind this is to force similar clients to collaborate more closely with each other. Conversely, dissimilar clients are less likely to participate in collaboration. Other techniques, such as prototype learning, contrastive learning, and feature alignment, are also applied to PFL.

[0019] B. Federated Relationship Classification Relation classification. Relation classification (RC) is defined as selecting the semantic relation between entities from a predefined relation set to determine the semantic relation between entities. Early studies on relation classification adopted feature-based, kernel-based, and neural network-based methods. Since manually annotating training data is time-consuming and labor-intensive, distant supervision was proposed to align pure text with Freebase. Given the abundance of automatically annotated data, relation classification models themselves suffer from significant noise. To address this label noise, certain methods focus on denoising through multi-instance learning or constructing a clean dataset through reinforcement learning. The recent development of pre-trained language models (PLMs) has sparked interest in fine-tuning and prompt-tuning BERT-like models as the backbone of relation classification. These methods require collecting a moderate amount of data from multiple sources to a central server for training, which violates data protection laws.

[0020] Federated relation classification. Federated learning has been applied in the research community of relation classification. Since medical text is privacy-sensitive, Sui et al. proposed a knowledge distillation (KD)-based FL method, FedED, for relation classification in the medical domain. In this framework, they set a labeled dataset as public data for knowledge collaboration. Another work follows the FedAvg framework and proposes an algorithm called “lazy multi-instance learning” to address the noise problem in distant supervision relation classification. Both studies solve the relation classification problem under IID local data. The difference is that Pang et al. studied personalized federated relation classification with heterogeneous texts and proposed a method called pf-RC. However, similar to FedED, pf-RC relies on a public dataset for knowledge transfer, which limits its applicability in real-world scenarios.

[0021] C. Federated parameter-efficient fine-tuning Parameter-efficient fine-tuning involves keeping most of the parameters of the pre-trained language model fixed and fine-tuning only a small subset of parameters or lightweight additional parameters for downstream tasks. There are three main categories of parameter-efficient fine-tuning methods: addition-based methods, parameter-specific methods, and reparameterization-based methods. Addition-based methods integrate additional learnable parameters into the frozen pre-trained language model during the fine-tuning process. Adapter tuning injects two adapter layers into each original Transformer block of the pre-trained language model, where each adapter layer consists of a dimensionality reduction layer and an dimensionality increase layer. Another pioneering work in this research area is prefix tuning, which inserts learnable consecutive labels (i.e., prefixes) into the input and hidden states of each Transformer layer, with each prefix initialized as a trainable parameter matrix. Parameter-specific methods focus on fine-tuning a small subset of intrinsic parameters while keeping the rest of the parameters fixed. BitFit

[11] is a typical work in this branch of research, advocating selective fine-tuning of bias terms in the pre-trained language model. The reparameterization approach posits that the adaptation of a pre-trained language model to downstream tasks can be reparameterized within a low-dimensional subspace. LoRA suggests optimizing the modification of the original parameter matrix in the self-attention block using low-rank decomposition.

[0022] Efficient Fine-Tuning of Federated Parameters. In the context of efficient fine-tuning of parameters in relational classification (FL), Zhao et al. first investigated federated cue fine-tuning to reduce communication costs. Zhang et al. proposed a model decomposition method in FL to construct a privacy-preserving vocabulary. Cai et al. explored the impact of adapters on various NLP tasks in the FL environment. Subsequently, a more systematic evaluation of the application of efficient fine-tuning methods for federated parameters on NLP tasks was conducted. However, research on efficient fine-tuning of federated parameters for relational classification tasks remains largely unexplored. In this paper, we design a personalized federated relational classification framework tailored to the characteristics of relational classification tasks, providing insights for future relational classification research within this paradigm.

[0023] Task definition This invention provides a definition of the task under study, starting with the Relation Classification (RC) task of examining the standards.

[0024] Given a labeled dataset |D| represents the cardinality of D, i.e., the number of samples in the dataset. We assume its data distribution is as follows: ,in It is the input space. It has The output space of a predefined relation. Each instance in the list contains a paragraph about a pair of entities. text where is a head entity, is a tail entity, and a labeled relation .

[0025] Definition 1 (Relation Classification): Given a text and a pair of involved entities , the task of a relation classification model initialized with model parameters is to minimize the empirical loss of predicting the target relation: (1) where is the cross-entropy loss function for a given relation classification model , and is the labeled relation label of .

[0026] For personalized federated relation classification, we consider a setting where there are clients who own the same type of model but different private training data . These training datasets have heterogeneous texts, i.e., non-IID data. For any pair of clients and , their data distributions and are different. With the help of a central server, these clients can collaboratively train personalized models through communication without exposing their private data.

[0027] Definition 2 (Personalized Federated Relation Classification): The goal of personalized federated relation classification is to minimize the global loss and obtain reasonable personalized local relation classification models: (2) where denotes the set of all client models, .

[0028] The framework proposed by the present invention how to fine-tune the relation classification (RC) model using the parameter-efficient method, and then introduce the personalized federated relation classification method proposed by aligning entity and relation representations. The overview of the proposed framework is shown in Figure 2 .

[0029] A. Parameter-efficient fine-tuning of pre-trained language models for relation classification The present invention is given a text about and ​, by adding four entity markers to enhance it, enabling the PLM to perceive head-tail entities: (3) where [E1] and [ / E1] (respectively [E2] and [ / E2]) denote the start and end positions of respectively.

[0030] The enhanced sequence is input into a PLM to generate the hidden vectors of [E1] and [E2] markers (4) Let and be treated as entity representations of and , i.e. = and = where is the hidden dimension.

[0031] To perform classification, an additional softmax classifier is added on top of the PLM . Based on and , the instance representation of is obtained by concatenating the entity representations and inputting the concatenation into a fully connected layer (5) where is a trainable projection matrix.

[0032] After that, the relation representation is used to classify (6) where and are adjustable parameters in the classifier .

[0033] Parameter-efficient fine-tuning. In standard fine-tuning, the parameters in both the pre-trained language model and the classifier need to be trained, which is challenging for clients with limited computing resources. Moreover, exchanging these parameters between clients and servers in a federated process would bring significant communication pressure. Therefore, a parameter-efficient fine-tuning method is adopted to train the PLM-based relation classification model. In parameter-efficient fine-tuning, most of the parameters in the pre-trained language model are frozen, and only a small number of parameters or light additional parameters are updated.

[0034] The application mainly introduces four kinds of parameter efficient fine-tuning methods, including adapter fine-tuning, prefix fine-tuning, BitFit and LoRA: Adapter fine-tuning: Inject small-scale adapter modules into the Transformer layers of the pre-trained language model, and only optimize these adapters when adapting to the relationship classification task. Each adapter module consists of a dimension reduction layer and a dimension increase layer. For example, given a hidden vector , the dimension reduction layer uses a parameter matrix to project it into a k-dimensional space (k < d), and then a nonlinear function. The dimension increase layer maps the representation back to the original dimension . In each Transformer block, the adapter is added after the multi-head self-attention and feed-forward network sublayers, respectively.

[0035] Prefix fine-tuning: Add a learnable soft label, i.e., prefix, in front of the input hidden state of each Transformer layer. The prefix of each layer comes from a trainable parameter matrix , where the prefix length is much smaller than . During adaptation, only the prefix is updated, while all parameters in the pre-trained language model remain unchanged.

[0036] BitFit: Fine-tune a small part of the parameters in the pre-trained language model while keeping most of the parameters fixed. Specifically, only fine-tuning the bias term has been proven to achieve comparable performance to full parameter fine-tuning.

[0037] LoRA: Adapt the pre-trained language model to a low-rank space and optimize the low-rank decomposition of the weight update matrix.

[0038] Given a pre-trained weight matrix , there are (7) where is the weight update matrix, and are two low-rank matrices with rank . During the adaptation of PLM to relationship classification, only the low-rank matrices A and B are adjustable.

[0039] B. Personalized federated relationship classification through representation alignment Following previous federated learning approaches, a server is deployed to manage local training and knowledge collaboration. By leveraging the parameter-efficient fine-tuning method introduced in S2, pre-trained language models can be adapted to perform relation classification tasks and federation on resource-constrained devices due to the updating and transfer of only lightweight parameters. Although experiments have demonstrated that using pre-trained language models in FL can mitigate the adverse effects of non-IID, bridging the performance gap between federated and centralized learning remains a key challenge in the context of heterogeneous texts. Therefore, this invention proposes FedAER, a personalized federated relation classification framework that aligns entity and relation representations.

[0040] Prior to FedAER, an efficient fine-tuning method for initializing parameters was developed, and trainable, efficient parameters in the bone intervention training language model M and classifier C were determined. Furthermore, FedAER deploys an entity representation memory and a relation representation memory on each client. Subsequently, local training on active clients and global aggregation on the server are performed alternately.

[0041] a) Entity and relation memory: in the first Each client has a physical memory repository. and a relational memory ,in ) represents the total number of global entities (relationships). ( The first in ) The line is the first A memory representation of an entity (relationship).

[0042] Entity representation. For an entity e, its memory representation is obtained by averaging the embeddings of all its references: (8) in From formula (4).

[0043] From the dataset medium entity All occurrences of constitute , which is defined as: (9)

[0044] Relational representation. Relations The representation of is defined as the mean of the embeddings of all its instances: (10) in Generated according to formula (5), yes A subset of, by relation It consists of all instances.

[0045] If a client does not own a particular entity or relationship, the corresponding row in its memory representation is filled with a zero vector.

[0046] b) Client-side local training: In each round of communication, upon receiving trainable parameters... Afterwards, active clients use And locally frozen pre-trained language model parameters Assemble a complete relation classification model For a local instance ( , )∈ The predicted probability can be obtained from formula (6). And calculate the cross-entropy loss. (11).

[0047] However, simply optimizing a local relation classification model using cross-entropy loss is insufficient for achieving personalization. Therefore, we propose an entity and relation representation alignment loss to further adapt the model to local personalized data distributions.

[0048] Entity representation alignment. The purpose of entity representation alignment is to ensure that, in each new training iteration, the new entity representations generated by the model remain consistent with its memory. Given an instance Entity representation is generated according to formula (4). and And the entity alignment loss is defined as: (12) in This represents the Euclidean norm of a vector.

[0049] Relational representation alignment. Relational representation alignment aims to ensure that the representation of an instance is tightly aligned with its corresponding memorized relation representation. For an instance x with relation r, the relation alignment loss is calculated as follows: (13) Here, f(⋅) consists of two fully connected neural network layers followed by a normalization function. f(⋅) is a dimensionality reduction operation used to map the relational representation to a denser space for alignment.

[0050] Combining entity and relation representation alignment, the local personalization optimization loss is defined as follows: (14) β and γ are two hyperparameters used to balance the importance of different losses.

[0051] Before local training, each client's entity and relation memory bank is initialized with the globally aggregated memory bank. After local training is completed, each client updates its local entity and relation bank using Equations (8) and (10).

[0052] c) Server global aggregation: After all active clients complete local training, the server collects efficient parameters , entity representations and relation representations from clients and performs aggregation: (15) (16) (17) where ⊙ is the element-wise product. (resp. ) is the entity (resp. relation) mask Boolean vector, where 0 indicates the absence of the corresponding entity (resp. relation) and 1 indicates its presence.

[0053] The above training process will continue to iterate until a certain criterion is met, such as reaching a maximum number of communication rounds.

Claims

1.A personalized federated relationship classification method under a limited resource condition, characterized in that: The steps are: S1, review the standard relationship classification task Given a labeled dataset |D| represents the cardinality of D, i.e., the number of samples in the dataset, assuming its data distribution is as follows: ,in It is the input space. It has The output space of a predefined relation, each Each contains a passage about a pair of entities text ,in It is a head entity. It is a tail entity and a label relationship. ; Relationship classification definition: with model parameters Initialized relationship classification model: (1) wherein is a cross-entropy loss function for a given relation classification model is a labeled relation label for​ Personalized federated relationship classification definition: personalized local relationship classification model: (2) wherein denotes a set of all client models, ; S2, efficient fine-tuning of pre-trained language model parameters for relationship classification: Personalized federated relationship classification method proposed through entity and relationship representation alignment: Given and the text , add four entity tags: (3) wherein [E1] and [ / E1] represent the start and end positions of [E1] and [ / E1] represent the start and end positions of [E2] and [ / E2] represent the start and end positions of Input to a PLM to generate the hidden vectors labeled [E1] and [E2]: (4) Let and be considered as and representations of entities, i.e. = and = where is a hidden dimension; Adding an additional softmax classifier on top of pre-trained language models Instance representations are obtained by concatenating entity representations and inputting the concatenation into a fully connected layer ​​ (5) wherein is a trainable projection matrix, and RELU is a rectified linear unit. Relationship representation is used for classification: (6) wherein and are adjustable parameters in the classifier ; Given a pre-trained weight matrix There are: (7) wherein is a weight update matrix, and are two low-rank matrices, rank ; S3, personalized federated relationship classification framework FedAER is realized through entity and relationship representation alignment: S31. Entity and Relational Memory: In the first... Each client has a physical memory repository. and a relational memory ,in It is the total number of global entities. The first in The line is the first The memory representation of an entity; Entity representation: obtained by averaging all its mentions' embeddings (8) wherein from equation (4); from the dataset entities all occurrences of the entity Composition: (9) Representation of relations: Define the representation of a relation as the mean of all instances it is embedded in (10) wherein is generated according to equation (5), is is a subset of the set of all instances of consisting of all instances of S32, client local training: For a local instance ( , ) ∈ , its prediction probability is obtained from equation (6) and the cross-entropy loss is calculated (11) Entity representation alignment: Given instance , the entity representation is generated according to formula (4) and and the entity alignment loss is defined as: (12) wherein denotes the Euclidean norm of a vector; Relationship representation alignment: for an instance x of a relationship r, the relationship alignment loss is as follows: (13) Where f(⋅) consists of two fully connected neural networks followed by a normalization function, f(⋅) is a dimensionality reduction operation; Combined with entity and relationship representation alignment, the local personalized optimization loss is defined as follows: (14) Where β and γ are two hyperparameters; S33, server global aggregation: after all active clients complete local training, the server collects efficient parameters from clients entity representations and relationship representations and performs aggregation: (15) (16) (17) where ⊙ is the element-wise multiplication, is a Boolean vector of entity, relation masks, where 0 indicates the absence of the corresponding entity (relation) and 1 indicates its presence.