Model-based task processing
By using Hadamar product and parameter aggregation technology under PEFT strategy, the update parameter rank of the large language model is improved, and the limitations of the existing PEFT methods in terms of expression capabilities and performance are solved, and more efficient and high-performance model fine-tuning is achieved.
Patent Information
- Application Number
- CN202480003591.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2025-04-08
AI Technical Summary
The huge amount of parameters of large language models complicates comprehensive fine-tuning under limited computing resources, and existing PEFT methods such as LoRA have limitations in improving expression capabilities.
By adopting Hadamar product under the PEFT strategy, the basic parameter set of the pre-trained basic machine learning model and the parameter set of the trained low-rank machine learning model for the first task are obtained, and the Hadamar operation and parameter aggregation are performed. The basic parameter set is fine-tuned by using the updated parameter metrics to form a target machine learning model with a higher rank.
While maintaining the equivalent number of trainable parameters, the rank of the update parameters is improved, the model capacity and performance is enhanced, and additional computational overhead and inference delay are avoided.
Smart Images

Figure CN119790405A_ABST
Abstract
Description
Technical Field
[0001] The disclosed embodiments relate generally to machine learning, and more particularly to methods, apparatus, devices, and computer-readable storage media for model-based task processing. Background Art
[0002] Machine learning models, such as language models (LMs), are able to perform a wide range of natural language processing (NLP) tasks, including but not limited to question answering, text generation, summarization, translation, and sentiment analysis. Recent advances in large language models (LLMs) have improved the performance of various natural language processing (NLP) tasks. However, the huge number of parameters of LLMs complicates comprehensive fine-tuning under limited computing resources. Therefore, parameter efficient fine-tuning (PEFT) methods such as low-rank adaptation (LoRA) have become popular to reduce resource requirements. There are still some aspects of LoRA that need to be improved. Summary of the invention
[0003] In the first aspect of the present disclosure, a method for model-based task processing is provided. The method includes: obtaining a basic parameter set of a pre-trained basic machine learning model and a first parameter set and a second parameter set of a trained low-rank machine learning model for a first task, the basic parameter set, the first parameter set and the second parameter set being in the form of matrices with the same dimension; applying the Hadamard operator to the basic parameter set and the first parameter set to obtain an intermediate parameter set; aggregating the second parameter set and the intermediate parameter set to obtain an updated parameter set; fine-tuning the basic parameter set using the updated parameter metric to obtain a fine-tuned parameter set for a target machine learning model corresponding to the first task; and applying the target machine learning model to perform model inference for the first task using the fine-tuned parameter set.
[0004] In a second aspect of the present disclosure, a device for model-based task processing is provided. The device includes: an acquisition module configured to acquire a basic parameter set of a pre-trained basic machine learning model and a first parameter set and a second parameter set of a trained low-rank machine learning model for a first task, wherein the basic parameter set, the first parameter set and the second parameter set are in the form of matrices with the same dimensions; a first application module configured to apply a Hadamard operator to the basic parameter set and the first parameter set to obtain an intermediate parameter set; an aggregation module configured to aggregate the second parameter set with the intermediate parameter set to obtain an updated parameter set; a fine-tuning module configured to fine-tune the basic parameter set using the updated parameter metric to obtain a fine-tuned parameter set for a target machine learning model corresponding to the first task; and a second application module configured to apply the target machine learning model to perform model inference for the first task using the fine-tuned parameter set.
[0005] In a third aspect of the present disclosure, an electronic device is provided. The device includes: at least one processing unit; and at least one memory, the at least one memory is coupled to the at least one processing unit and stores instructions executable by the at least one processing unit. After the instructions are executed by the at least one processing unit, the device executes the method of the first aspect.
[0006] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein the medium stores a computer program, and when the computer program is executed by a processor, the method of the first aspect is implemented.
[0007] In a fifth aspect of the present disclosure, a computer program product is provided, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the method of the first aspect is implemented.
[0008] It should be understood that the contents described in the summary of the invention are neither intended to identify the key or essential features of the embodiments of the present disclosure, nor intended to limit the scope of the present disclosure. Other features of the present disclosure will be easily conceived through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals refer to the same or similar elements, wherein:
[0010] Figure 1 A schematic diagram illustrating an example environment in which embodiments of the present disclosure may be implemented;
[0011] Figure 2 An example diagram showing a LoRA-based process and a High Rank Adaptation (HiRA)-based process according to some embodiments of the present disclosure;
[0012] Figure 3 A flowchart showing a process for model-based task processing according to some embodiments of the present disclosure is shown;
[0013] Figure 4 A block diagram showing an apparatus for model-based task processing according to some embodiments of the present disclosure; and
[0014] Figure 5 A block diagram of an electronic device is shown in which one or more embodiments of the present invention may be implemented. DETAILED DESCRIPTION
[0015] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for illustrative purposes and are not intended to limit the scope of protection of the present disclosure.
[0016] In the description of the embodiments of the present disclosure, the term "including" and similar terms will be understood as open inclusion, i.e., "including but not limited to". The term "based on" will be understood as "based at least in part on". The term "one embodiment" or "the embodiment" will be understood as "at least one embodiment". The term "some embodiments" will be understood as "at least some embodiments". Other explicit and implicit definitions may also be included below. As used herein, the term "model" may represent the degree of matching between various data. For example, the above-mentioned degree of matching may be obtained based on various technical solutions currently available and / or developed in the future.
[0017] It should be understood that the data involved in this technical solution (including but not limited to the data itself, data collection or use) should comply with the requirements of relevant laws, regulations and relevant provisions.
[0018] It is understandable that before using the technical solutions disclosed in the embodiments of the present invention, the type, scope of use, usage scenarios, etc. of the personal information involved in the present invention should be notified to the user in an appropriate manner in accordance with relevant laws and regulations, and the user's authorization should be obtained.
[0019] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested by the user requires obtaining and using the user's personal information. Therefore, the user can choose whether to provide personal information to software or hardware such as an electronic device, application, server or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0020] As an optional but non-limiting implementation, in response to receiving an active request from the user, the method of sending the prompt information to the user may be, for example, a pop-up window presenting the prompt information in text form. In addition, the pop-up window may also include a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0021] It is understandable that the above notification and user authorization process is merely illustrative and does not limit the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0022] As used herein, the term "model" can learn the correlation between the corresponding input and the output from the training data, so that the corresponding output can be generated for a given input after the training is completed. The generation of the model can be based on machine learning techniques. Deep learning is a machine learning algorithm that processes inputs and provides corresponding outputs by using multiple layers of processing units. A neural network model is an example of a model based on deep learning. As used herein, a "model" may also be referred to as a "machine learning model", "learning model", "machine learning network" or "learning network", and these terms are used interchangeably herein.
[0023] A "neural network" is a machine learning network based on deep learning. A neural network is capable of processing an input and providing a corresponding output, and typically includes an input and output layer and one or more hidden layers between the input and output layers. Neural networks used in deep learning applications typically include many hidden layers, thereby increasing the depth of the network. The layers of a neural network are connected sequentially so that the output of a previous layer is provided as input to a subsequent layer, where the input layer receives the input of the neural network and the output of the output layer serves as the final output of the neural network. Each layer of a neural network includes one or more nodes (also called processing nodes or neurons), each of which processes the input from the previous layer.
[0024] Generally, machine learning can be roughly divided into three stages, namely the training stage, the testing stage, and the application stage (also known as the reasoning stage). During the training stage, a given model can be trained using large-scale training data, and the parameter values are iteratively updated until the model can obtain consistent reasoning from the training data that meets the expected goals. Through training, the model can be considered to learn the correlation between input and output from the training data (also known as input-to-output mapping). The parameter values of the trained model are determined. In the testing stage, the test input is applied to the trained model to test whether the model can provide the correct output, thereby determining the performance of the model. In the application stage, the model can be used to process actual inputs and determine the corresponding outputs based on the parameter values obtained through training.
[0025] Figure 1 1 shows a block diagram of an example environment 100 in which various embodiments of the present disclosure may be implemented. Figure 1 In the environment of FIG. 1 , three different stages are shown, including a pre-training stage 102, a fine-tuning stage 104, and an application (inference) stage 106. Both the pre-training stage 102 and the fine-tuning stage 104 can be regarded as the training stage of the model. It should be noted that after the pre-training stage or the fine-tuning stage is completed, there can also be a testing stage (not shown).
[0026] In the pre-training stage 102, the pre-training system 110 is configured to pre-train a machine learning model (i.e., model 120), which can be configured to learn an accurate representation of the input data (also referred to as a feature representation or feature of the input data) from the training data 108. Prior to pre-training, the parameter values of the model 120 may be randomly initialized. The model 120 is pre-trained using the training data 108, and during the pre-training process, the parameter values of the model 120 are updated and adjusted. After the pre-training is completed, a pre-trained model 120' can be obtained, at which point the parameter values of the pre-trained model 120' have been updated to the pre-trained parameter values. In some embodiments, the pre-trained model 120' can be used as a feature extraction model to extract feature representations of the input data.
[0027] After the pre-training stage 102, the model 120 can learn strong generalization capabilities from the large-scale training data 108. The pre-trained model 120' can be provided to the model fine-tuning system 112, in which the pre-trained model 120' can be fine-tuned for one or more downstream tasks. In some example embodiments, for different downstream tasks, the pre-trained model 120' can be connected to different specific task layers 132-1,...,132-J (collectively or individually referred to as specific task layers 132) to construct different downstream task models 130-1,...,130-J (collectively or individually referred to as downstream task models 132). This is because different downstream tasks require different outputs, and the pre-trained model 120' can extract feature representations of the model input and provide them to the specific task layer 132 to generate the output of the corresponding task.
[0028] In the fine-tuning stage 104, according to the requirements of the specific downstream task, the corresponding training data 134-1, ..., 134-J can be selected to fine-tune the constructed downstream task models 130-1, ..., 130-J respectively. The corresponding model training algorithm is also used to update and adjust the parameters of the entire model. Since the pre-trained model 120' has learned a lot of knowledge from the training data in the pre-training stage, only a small amount of training data is needed in the fine-tuning stage 104 to obtain a downstream task model that meets the expectations.
[0029] In some example embodiments, during the pre-training stage 102, one or more specific task layers may have been constructed so as to pre-train the model 120 for multiple downstream tasks according to the requirements of the pre-training objectives. In this case, if the specific task layer used for a downstream task is the same as the specific task layer constructed for pre-training, the pre-trained model 120' and the specific task layer may be directly used to form the corresponding downstream task model. In this case, the downstream task model may not need fine-tuning, or may only need fine-tuning with a small amount of training data.
[0030] In the application phase 106, the obtained downstream task models may be provided to one or more model application systems 114. In the application phase 106, each downstream task model may be used to process corresponding inputs in actual scenarios and provide corresponding outputs.
[0031] exist Figure 1 In the present invention, the model pre-training system 110, the model fine-tuning system 112 and the model application system 116 may include any computing system or device with computing capabilities, such as various computing devices / systems, terminal devices, servers, etc. The terminal device may include any type of mobile terminal, fixed terminal or portable terminal, including a mobile phone, a desktop computer, a laptop computer, a netbook computer, a tablet computer, a media computer, a multimedia tablet computer, or any combination thereof, including accessories and peripherals of these devices or any combination thereof. The server includes but is not limited to a mainframe, an edge computing node, a computing device in a cloud environment, etc.
[0032] It should be understood that Figure 1 The components and layouts in the illustrated environment 100 are merely examples, and a computing system suitable for implementing an example embodiment of the present disclosure may include one or more different components, other components, and / or different layouts. For example, although the model pre-training system 110, the model fine-tuning system 112, and the model application system 116 are shown as independent systems, they may also be integrated into the same system or device. The embodiments of the present disclosure are not limited in this respect. Example embodiments of model training and model application will be further described with reference to the accompanying drawings.
[0033] As mentioned above, recent advances in pre-trained large language models (LLMs) have improved their performance in various natural language processing tasks. Traditionally, adapting these large language models to specific tasks requires full fine-tuning, i.e., updating all parameters. However, due to the huge number of parameters of these large language models, full fine-tuning becomes computationally prohibitive, especially in resource-constrained situations.
[0034] To address this challenge, it is crucial to adapt LLMs through PEFT, which aims to improve the performance of downstream tasks with minimal parameter updates. PEFT methods aim to reduce the need for large computational resources when adapting large language models to downstream tasks or language domains. Based on these methods, parameter updates are introduced in the large language model to keep the integrity of the original architecture by freezing its core components. These methods involve training a small number of additional parameters as model weights for downstream tasks.
[0035] Current PEFT methods can be mainly divided into three categories. The first category includes adapter-based methods. These methods insert trainable modules, such as adapter layers, into the original frozen large language model. This type of method may add linear layers to the large language model. To improve performance, adapters can be integrated in parallel. These methods modify the architecture of the original model during training and inference, which may add additional overhead compared to the original large language model.
[0036] The second category includes hint-based methods, which integrate additional trainable virtual markers into the input of a large language model and train exclusively on these markers. Such methods may introduce a series of virtual markers for task-specific adaptation in the initial layers, or add virtual markers in every layer except the initial layer. Although hint-based methods add a negligible number of trainable parameters in the input, they are sensitive to initialization. In addition, due to the quadratic computational complexity of the Transformer architecture, the computational cost of hint-based methods during inference may increase proportionally with the hint length.
[0037] The third category includes methods based on low-rank adaptation. Taking LoRA as an example, this method uses the product of two low-rank matrices to approximate the updated weights during fine-tuning. This product can be seamlessly merged into the original weights, without changing the model architecture at inference time and without incurring additional computational overhead. Compared with updating the full-rank parameter matrix W, this technique reduces the required computational cost. An extension method, such as weight decomposition low-rank adaptation (DoRA), decomposes the original weights into magnitude and direction components, and then updates the direction component using LoRA. Another extension method, such as matrix rank adaptation (MoRA), compresses the input through some predefined function, then transforms the compressed input through a square "higher rank" matrix, and finally decompresses the matrix to achieve higher rank adaptation for large language models.
[0038] However, the inherent low-rank nature of the update parameters in LoRA may limit its expressiveness required to adapt to new subtasks. Due to resource constraints, the PEFT strategy still needs to be followed, so it is difficult to increase the rank of the update parameter matrix to enhance its capabilities.
[0039] In some embodiments of the present disclosure, a model-based task processing solution is provided. In this solution, a basic parameter set of a pre-trained basic machine learning model and a first parameter set and a second parameter set of a trained low-rank machine learning model for a first task are obtained. The first task can be any type of task, such as question answering, text generation, summarization, translation, and sentiment analysis. The basic parameter set, the first parameter set, and the second parameter set are in the form of matrices with the same dimensions. Apply the Hadamard operator to the basic parameter set and the first parameter set to obtain an intermediate parameter set. Aggregate the second parameter set with the intermediate parameter set to obtain an updated parameter set. Fine-tune the basic parameter set using the updated parameter metric to obtain a fine-tuned parameter set for the target machine learning model corresponding to the first task. Apply the target machine learning model to perform model inference for the first task using the fine-tuned parameter set.
[0040] With this solution, a higher rank adaptation of a large language model can be achieved under the PEFT strategy using the Hadamard product, aiming to enhance the expressiveness of the trainable parameters by increasing the rank of the updated weights. The proposed solution will also be referred to herein as Hadamard High Rank Adaptation (HiRA) or the HiRA method, which maintains the updated parameters with high rank, thereby enhancing the model capacity. This solution can easily merge the updated weights into the large language model without the need for complex static compression and decompression functions that would complicate the process of merging the weights into the original large language model.
[0041] Figure 2 An example diagram of a LoRA-based process 200A and a HiRA-based process 200B according to some embodiments of the present disclosure is shown.
[0042] A limitation of LoRA and its variants, which rely on the product of two low-rank matrices, is that the maximum rank that can be achieved by updating the parameters is inherently limited. Figure 2 As shown, in the LoRA-based process 200A, Denotes the original parameter matrix, whose rank is denoted by r0, where r0≤min(d,k). LoRA exemplifies PEFT by integrating low-rank matrix decomposition into the update parameter set, for example, the update parameter matrix (also called update matrix) ΔW, assuming it is and The product of, that is, ΔW = L1L2. L2 and L2 are low-rank matrices, and where r l Much smaller than d and k, represents a set of real numbers. However, due to the multiplication of low-rank matrices (i.e., L2 and L2) in LoRA, as well as The resulting update matrix ΔW is constrained to a maximum rank r l Therefore, although ΔW is a d×k matrix, it cannot achieve a value greater than r l Larger ranks may limit the expressiveness of LoRA and thus the task adaptability of LLM.
[0043] Therefore, the low-rank nature of ΔW may limit its ability to capture high-rank updates. As a result, such low-rank update parameters may limit the rank of the final tuned (or fine-tuned) parameter set (or parameters) W′ (i.e., W′=W0+ΔW) because Rank(W0 + ΔW) ≤ Rank(W0) + Rank(ΔW) ≤ r0 + r l (1) The first equality is due to the properties of the rank function. Therefore, the maximum rank of W′ is min(min(d,k),r0+r l ). Therefore, the low-rank property of ΔW may limit the expressive power of W′.
[0044] To solve this problem, Figure 2 The HiRA-based process 200B shown can learn ΔW with a higher rank under the PEFT strategy, which can enhance expressiveness and performance. In the HiRA-based process 200B, a basic parameter set of a pre-trained basic machine learning model is obtained, for example, W0 of rank r0, which can be obtained by the pre-trained basic machine learning model during pre-training. In some embodiments, the basic machine learning model can be built based on a language model. An updated parameter set (or updated parameter), such as ΔW, can be used to fine-tune the basic parameter set for a specific task. The updated parameter set, such as ΔW, may include two components, a Hadamard component based on a Hadamard product and an offset component with a low-rank structure.
[0045] Based on the Hadamard product, the example formula for updating the parameter matrix is ΔW = R ⊙ W h + W o (2) Where ⊙ represents the Hadamard product, W h and W o are two trainable parameter matrices with ranks r h and r o , R is a matrix that does not require training. In formula (2), R⊙W h is called the Hadamard component based on the Hadamard product, W o is called the offset component.
[0046] In general, the Hadamard product of two matrices P and Q of equal size yields a matrix O that satisfies ij =p ij q ij , where p ij ,q ij and ij denote the (i,j)th element in P, Q, and O respectively. The Hadamard product is also called the element-wise product between two matrices. A good property of the Hadamard product is Rank(P ⊙ Q) ≤ Rank(P) × Rank(Q) (3)
[0047] From inequality (3), we can see that the maximum rank that the Hadamard product of two matrices can achieve is bounded by the upper bound of the product of their ranks. When P and Q have appropriate sizes to make matrix multiplication feasible, Rank(PQ) ≤ min(Rank(P), Rank(Q)) (4)
[0048] Comparing inequalities (3) and (4), it can be seen that even if P or Q or both of them have low rank, the rank upper limit of the Hadamard product is much larger than the rank upper limit of matrix multiplication. It should be noted that the update parameter set in LoRA, such as ΔW, relies on the matrix multiplication of two low-rank matrices, and inequality (4) means that the update parameter set in LoRA has low rank. From the perspective of the upper limit of rank, the Hadamard product may help improve the low rank situation of ΔW in LoRA, because a larger rank upper limit may enable the Hadamard product to obtain a larger maximum rank.
[0049] According to inequality (3), the rank of ΔW in formula (2) is Rank(ΔW) ≤ Rank(R)Rank(W h ) + Rank(W o ) (5)
[0050] When R has a larger rank, according to inequality (5), since the upper limit of Rank(ΔW) is even greater than min(d,k), ΔW is expected to have a larger rank.
[0051] For the selection of R in formula (2), it is possible to consider using the basic parameter set (e.g., W0) of the pre-trained basic machine learning model as a parameter, because W0 may contain useful information about the parameters in the large language model. Figure 2 As shown, during fine-tuning, the update parameter set (eg, ΔW) is decomposed into Hadamard components 210 (eg, W) based on the Hadamard product. h ⊙W0) and the offset component 220 (eg, W o ).
[0052] To obtain such an updated parameter set, a first parameter set (e.g., W ) of a trained low-rank machine learning model is obtained for the first task. h ) and a second parameter set (e.g. W o ). The first task can be any type of task, such as question answering, text generation, summarization, translation, and sentiment analysis. The basic parameter set (e.g., W0), the first parameter set (e.g., W h ) and a second parameter set (e.g. W o ) are all in matrix form with the same dimensions.
[0053] Then, the Hadamard operator is applied to the basis parameter set and the first parameter set, such as W h ⊙W0, to obtain the intermediate parameter set. Aggregate the second parameter set (e.g. W o ) and intermediate parameter sets (such as W h ⊙W0) to obtain an updated parameter set (e.g., ΔW). Fine-tune the base parameter set (e.g., W0) using the updated parameter metric (e.g., ΔW) to obtain a fine-tuned parameter set (e.g., W′) corresponding to the target machine learning model of the first task. Apply the target machine learning model to perform model inference for the first task using the fine-tuned parameter set.
[0054] In some embodiments, the rank upper limit of the update parameter set is the sum of the rank of the base parameter set multiplied by the rank of the first parameter set plus the rank of the second parameter set. h +r o , where r0, r h and r o Respectively represent W0, W h and W o As mentioned above, the upper limit of the rank of ΔW = L1L2 in LoRA is given by r l Define, r l represents the rank of L1 or L2. Compared with LoRA, the proposed HiRA method has a larger maximum rank.
[0055] By combining these two components, namely the Hadamard component 210 and the offset component 220, in an additive manner, the HiRA method can learn high-rank update parameters with little computational overhead. The proposed HiRA method may have advantages in various downstream tasks such as commonsense reasoning and dialogue tasks.
[0056] In some embodiments, the low-rank machine learning model for obtaining the first parameter set and the second parameter set may include multiple low-rank machine learning sub-models, one of which has a first parameter set (e.g., h ) (referred to as the first low-rank machine learning submodel), and a low-rank machine learning submodel with a second parameter set (e.g., W o)’s low-rank machine learning sub-model (the second low-rank machine learning sub-model).
[0057] The first low-rank machine learning submodel and / or the second low-rank machine learning submodel may be further divided into different parts. Accordingly, the first parameter set and / or the second parameter set may include multiple subsets corresponding to different parts of the low-rank machine learning submodel. For example, the first parameter set may include a first parameter matrix (e.g., Figure 2 A in ), and a second parameter matrix for the second part of the first low-rank machine learning sub-model (e.g. Figure 2 The rank of the first parameter matrix and the rank of the second parameter matrix are lower than the rank of the base parameter set. The second parameter set may include a third parameter matrix (e.g. Figure 2 C in ), and a fourth parameter matrix for the second part of the second low-rank machine learning sub-model (e.g. Figure 2 The rank of the third parameter matrix and the rank of the fourth parameter matrix are lower than the rank of the basic parameter set.
[0058] For example, to implement the PEFT strategy, W can be restricted h and W o has low rank, as shown below: W h = AB, W o = CD (6) in and r h and r o is much smaller than min(d,k). The two components 210 and 220 may have different ranks, so r h Possibly with r o different.
[0059] According to the decomposition in formula (6), it can be seen that W h The maximum rank is r h , W o The maximum rank is r o , which makes them all have low rank. Taking all the above considerations into account, the update parameters of the proposed HiRA method can be expressed as ΔW = W0 ⊙ (AB) + CD (7)
[0060] According to inequality (5), for ΔW defined in formula (7), its rank is given by r0r h +r o This may make its rank larger, such as Figure 2 shown.
[0061] In some embodiments, the number of trainable parameters in HiRA may be equal to the number of trainable parameters in LoRA for a fair comparison with LoRA. Figure 2 In the example, LoRA has r l (d+k) trainable parameters, while in HiRA, the number of trainable parameters in A, B, C, and D is equal to (r h +r o )(d+k). In this case, let r l (d+k) is equal to (r h +r o )(d+k) will affect r h and r o Generate constraints: c HiRA = r h + r o = r l (8) where c HiRA =r h +r o Defined as the capacity of HiRA.
[0062] During production deployment, HiRA facilitates efficient inference by pre-computing and merging the update parameter set (or update parameters) into W0 to form the fine-tuning parameter set W′ (e.g., W′=W0+W0⊙(AB)+CD). Integrating the update parameters directly into W0 eliminates the computational overhead during inference.
[0063] For example, during training, in HiRA, we calculate W h and W o The O(dr h k) and O(dr o k), resulting in a total complexity of O(dk(r h +r o )), due to formula (8), the complexity is equal to O(dkr l ). In addition, the Hadamard product in HiRA introduces a computational overhead of O(dk) and can be accelerated by parallel computing techniques. Therefore, the computational complexity of HiRA is at most O(dkr l + dk) = O(dkr l ), which is the same computational complexity as LoRA, where the update parameters are matrix multiplications of two low-rank matrices. Therefore, HiRA introduces very little computational overhead compared to LoRA, and during inference, this overhead can be effectively offset by incorporating the update parameters into the large language model.
[0064] In addition, some other PEFT techniques, such as MoRA, introduce complex mapping functions to compress the input to a relatively high dimension and then decompress it back. Only when the function mapping in compression and decompression can be represented by a transformation matrix can it be easily incorporated into the parameters of the original large language model, and it will incur additional computational overhead. HiRA is more advantageous.
[0065] Additionally, this integrated operation in HiRA also avoids the additional delays typically introduced by other PEFT techniques such as Prompt Tuning and P-Tuning.
[0066] In some embodiments, during the training of the low-rank machine learning model, the first set of parameters (e.g., W0) can be fixed. For example, during the training process, W0 remains frozen, while A, B, C, and D serve as trainable parameters to facilitate model updates. For a linear layer h=W0x, the forward pass of the layer can be modified to h = W0x + (W0 ⊙ (AB))x + CDx (9)
[0067] According to formula (7), it can be seen that when A or B is fixed to zero matrix and r o Set to r l , the ΔW in HiRA becomes the ΔW in LoRA. From this point of view, the proposed HiRA can be regarded as a generalization of LoRA.
[0068] In some embodiments, to obtain the first parameter set (eg, W h ) and a second parameter set (e.g. W o ), a training process may be performed on the low-rank machine learning model to obtain a first parameter set and a second parameter set. In some embodiments, it may be required that the initial value of the updated parameter set is a zero matrix to ensure that the initial value of the updated parameter set does not modify the original large language model. To achieve this, W h and W o The initial value of can be a zero matrix. Under this requirement, for example, the first parameter matrix (e.g., A) and the third parameter matrix (e.g., C) can be initialized to zero matrices, and then the second parameter matrix (e.g., B) and the fourth parameter matrix (e.g., D) can be initialized. It is also possible to initialize B and D (or B and C) to zero matrices and initialize A and C (or A and D).
[0069] For example, Kaiming initialization may be used. Kaiming initialization, also known as He initialization, is a neural network initialization process that takes into account the nonlinearity of activation functions (such as rectified linear unit (ReLU) activation functions). Any other initialization method may also be used, and the present disclosure is not limited in this respect.
[0070] In some embodiments, a base parameter set (e.g., W0) can be recovered from a fine-tuned parameter set (e.g., W′) based on the first parameter set and the second parameter set. For example, in the case of W′=W0+W0⊙(AB)+CD, the original parameter set W0 in the large language model can be recovered by subtracting CD and then dividing each element by AB+1. HiRA can then be used to adapt the large language model to the new task, thereby enabling the large language model to quickly switch between tasks.
[0071] In some embodiments, after restoring the base parameter set, a third parameter set and a fourth parameter set of another trained low-rank machine learning model for the second task can be obtained for a different second task. The second task can be any type of task, such as question answering, text generation, summarization, translation, and sentiment analysis. The restored base parameter set, the third parameter set, and the fourth parameter set are in the form of matrices with the same dimensions. The Hadamard operator is applied to the restored base parameter set and the third parameter set to obtain an intermediate parameter set. The fourth parameter set is aggregated with the intermediate parameter set to obtain another updated parameter set. The restored base parameter set is fine-tuned using another updated parameter metric to obtain another fine-tuned parameter set for another target machine learning model corresponding to the second task. Apply another target machine learning model to perform model reasoning for the second task using another fine-tuned parameter set. In this way, efficient reasoning model adaptation can be achieved.
[0072] Experiments using the common sense reasoning dataset show that HiRA improves the accuracy and performance of common sense reasoning tasks. Table 1 shows the accuracy comparison between various PEFT methods on the common sense reasoning dataset for Llama-2-7B, Llama-3-8B models, and ChatGPT. The best performance within the same LLM is underlined, and the best performance across all configurations is in bold. Table 1
[0073] As shown in Table 1, HiRA consistently outperforms all baseline methods in terms of accuracy for Llama-2-7B and Llama-3-8B models. For Llama-2-7B, HiRA improves on average 3.91% accuracy over the best baseline method (i.e., DoRA). For Llama-3-8B, HiRA improves on average 2.70% performance over DoRA. This highlights that HiRA is able to effectively leverage the Hadamard product to improve model capacity and performance. Note that HiRA has a lower capacity, c HiRA=16, the number of trainable parameters is only half of that of the LoRA-based baseline, but it achieves better performance than LoRA and DoRA with rank 32, which proves the effectiveness of HiRA.
[0074] Table 2 shows the results on the CONVAI2 dataset, where BERT F1, BERT-R, and BERT-P represent the F1 value, precision, and recall from the BERT score, respectively. Table 2
[0075] As shown in Table 2, HiRA outperforms the baseline methods in all comparison metrics. DoRA and LoRA show similar performance, while MoRA, although not as strong as LoRA in this task, still outperforms P-Tuning and Prompt-Tuning methods. These results further confirm that HiRA is effective not only in common sense reasoning tasks, but also in open domain generation tasks.
[0076] In order to verify the importance of the two components in HiRA, common sense reasoning task experiments were carried out on the Llama-3-8B model. h or o Set to 0 for testing. Table 3 shows the performance of HiRA in common sense reasoning tasks. h and r o Performance comparison between different configurations when taking different values. Table 3
[0077] As shown in Table 3, the inclusion of the Hadamard component has an impact on the performance, r h Configurations that are not zero always outperform r h = 0. Specifically, r h =32 and r o = 0 can produce a good performance of 85.37, which is much higher than r h =0,r o =32 (i.e. 79.78). h The value is only 4, and the score can be improved to 81.26, which is significantly better than r h =0,r o = 77.59 at 28. Impressively, r h =4 and r o The configuration with =28 achieves the best performance of 87.50, which proves the effectiveness of integrating the Hadamard component with the offset component. These results emphasize the key role of the Hadamard component in improving the model performance, especially when combined with a suitable offset component.
[0078] By fixing the capacity of HiRA to 32 (i.e., r h +r o =32), studied h and r o The impact of the rank of on the performance of common sense reasoning tasks. h Compared with the value, HiRA h A smaller rank can achieve better performance. One possible reason is that due to the properties of the Hadamard product (i.e., inequality (3)), W with a larger rank h This may lead to rank saturation of W′. Another possible reason is that as r h Increase, W o The rank of will be reduced, which will weaken the expressive power of the offset component. Therefore, in experiments, it is usually h (e.g. 2 or 4) is used as the default setting. h With some changes, HiRA consistently outperforms the strongest baseline method, DoRA, and surpasses LoRA.
[0079] In addition, we explore the impact of different choices of R in formula (2) on the performance of commonsense reasoning tasks. Specifically, we compare HiRA with a variant of HiRA (denoted as HiRArand) that randomly generates R from a uniform distribution [0,1] before training and then fixes it. Both methods follow the same training protocol, using the same optimizer, learning rate, and number of training rounds.
[0080] Table 4 shows the performance comparison between different choices of R defined in equation (2). HiRArand denotes the variant using randomly initialized R instead of W0. Table 4
[0081] Furthermore, using W0 for R can facilitate recovering W from the combined parameters W′ when A, B, C, and D are given. 0。 HiRArand then needs to additionally store R to implement this, which may result in additional storage cost.
[0082] In addition, the average rank of the updated parameter set ΔW of each layer is compared for HiRA, LoRA, and MoRA with similar number of trainable parameters. The rank of ΔW of HiRA is much higher than that of LoRA and MoRA, which indicates that HiRA is able to achieve high-rank adaptation under the PEFT strategy through Hadamard product. It should be noted that as the number of layers deepens, the rank of ΔW first increases and then fluctuates, which means that deeper layers may require higher-rank ΔW to adapt to new tasks. Overall, HiRA can achieve higher-rank ΔW on all layers, which is related to the performance improvement detailed in Table 1.
[0083] To determine the amount of work required to optimize the model, we tracked HiRA(r h =4,r o =28) and LoRA(r l =32) The L2 norm of the gradient during the whole training process. The gradient norm of HiRA is almost lower than that of LoRA, which shows that HiRA requires less parameter adjustment work when the number of trainable parameters is the same. This reflects the efficiency of HiRA in model training, and a lower gradient norm may mean better generalization ability.
[0084] According to some embodiments of the present disclosure, as a high-rank adaptation method, HiRA improves the rank of updated parameters while maintaining a comparable number of trainable parameters. HiRA divides weights into Hadamard components and offset components. In addition, HiRA provides a more cost-effective alternative to LoRA, which can bring similar benefits without incurring additional reasoning overhead. A large number of experiments have demonstrated the effectiveness of the HiRA method.
[0085] Figure 3 A flow chart of a process 300 for model-based task processing is shown, according to some embodiments of the present disclosure.
[0086] Step 310, obtain a basic parameter set of a pre-trained basic machine learning model and a first parameter set and a second parameter set of a trained low-rank machine learning model for a first task, wherein the basic parameter set, the first parameter set and the second parameter set are in the form of matrices with the same dimension.
[0087] Step 320: Apply the Hadamard operator to the basic parameter set and the first parameter set to obtain an intermediate parameter set.
[0088] Step 330: Aggregate the second parameter set and the intermediate parameter set to obtain an updated parameter set.
[0089] At box 340, the base parameter set is fine-tuned using the updated parameter metric to obtain a fine-tuned parameter set for the target machine learning model corresponding to the first task.
[0090] At box 350, the target machine learning model is applied to perform model inference for the first task using the tuned parameter set.
[0091] In some embodiments, the rank cap of the update parameter set is the sum of the rank of the base parameter set multiplied by the rank of the first parameter set plus the rank of the second parameter set.
[0092] In some embodiments, the low-rank machine learning model includes a first low-rank machine learning sub-model having a first parameter set and a second low-rank machine learning sub-model having a second parameter set, wherein the first parameter set includes a first parameter matrix for a first part of the first low-rank machine learning sub-model and a second parameter matrix for a second part of the first low-rank machine learning sub-model, and the rank of the first parameter matrix and the rank of the second parameter matrix are lower than the rank of the basic parameter set; and wherein the second parameter set includes a third parameter matrix and a fourth parameter matrix, the third parameter matrix is used for the first part of the second low-rank machine learning sub-model, and the fourth parameter matrix is used for the second part of the second low-rank machine learning sub-model, and the rank of the third parameter matrix and the rank of the fourth parameter matrix are lower than the rank of the basic parameter set.
[0093] In some embodiments, obtaining the first parameter set and the second parameter set includes: performing a training process on the low-rank machine learning model to obtain the first parameter set and the second parameter set by: initializing the first parameter matrix and the third parameter matrix to zero matrices; and performing an initialization process on the second parameter matrix and the fourth parameter matrix.
[0094] In some embodiments, the first set of parameters is fixed during the training process of the low-rank machine learning model.
[0095] In some embodiments, process 300 may also include: recovering a base parameter set from the fine-tuned parameter set based on the first parameter set and the second parameter set.
[0096] In some embodiments, process 300 may also include: obtaining a third parameter set and a fourth parameter set of another trained low-rank machine learning model for a second task, the recovered basic parameter set, the third parameter set and the fourth parameter set being in the form of matrices with the same dimension; applying the Hadamard operator to the recovered basic parameter set and the third parameter set to obtain an intermediate parameter set; aggregating the fourth parameter set with the intermediate parameter set to obtain an additional updated parameter set; fine-tuning the recovered basic parameter set using the additional updated parameter metric to obtain an additional fine-tuned parameter set for an additional target machine learning model corresponding to the second task; and applying the additional target machine learning model to perform model inference for the second task using the additional fine-tuned parameter set.
[0097] In some embodiments, the base machine learning model can be built based on a language model.
[0098] Figure 4 A block diagram of an apparatus 400 for model-based task processing according to some embodiments of the present disclosure is shown. Various modules / components in the apparatus 400 may be implemented by hardware, software, firmware, or any combination thereof.
[0099] like Figure 4 As shown, the device 400 includes an acquisition module 410, which is configured to acquire a basic parameter set of a pre-trained basic machine learning model and a first parameter set and a second parameter set of a trained low-rank machine learning model for a first task, and the basic parameter set, the first parameter set and the second parameter set are in the form of matrices with the same dimension.
[0100] The device 400 also includes: a first application module 420, configured to apply the Hadamard operator to the basic parameter set and the first parameter set to obtain an intermediate parameter set; an aggregation module 430, configured to aggregate the second parameter set and the intermediate parameter set to obtain an updated parameter set; a fine-tuning module 440, configured to fine-tune the basic parameter set using the updated parameter metric to obtain a fine-tuned parameter set for a target machine learning model corresponding to the first task; and a second application module 450, configured to apply the target machine learning model to perform model inference for the first task using the fine-tuned parameter set.
[0101] In some embodiments, the rank cap of the update parameter set is the sum of the rank of the base parameter set multiplied by the rank of the first parameter set plus the rank of the second parameter set.
[0102] In some embodiments, the low-rank machine learning model includes a first low-rank machine learning sub-model having a first parameter set and a second low-rank machine learning sub-model having a second parameter set, wherein the first parameter set includes a first parameter matrix for a first part of the first low-rank machine learning sub-model and a second parameter matrix for a second part of the first low-rank machine learning sub-model, and the rank of the first parameter matrix and the rank of the second parameter matrix are lower than the rank of the basic parameter set; and wherein the second parameter set includes a third parameter matrix and a fourth parameter matrix, the third parameter matrix is used for the first part of the second low-rank machine learning sub-model, and the fourth parameter matrix is used for the second part of the second low-rank machine learning sub-model, and the rank of the third parameter matrix and the rank of the fourth parameter matrix are lower than the rank of the basic parameter set.
[0103] In some embodiments, the acquisition module 410 can be used to perform a training process on the low-rank machine learning model to obtain a first parameter set and a second parameter set in the following manner: initializing the first parameter matrix and the third parameter matrix to zero matrices; and performing an initialization process on the second parameter matrix and the fourth parameter matrix.
[0104] In some embodiments, the first set of parameters is fixed during the training process of the low-rank machine learning model.
[0105] In some embodiments, the apparatus 400 may further include: a recovery module configured to recover the basic parameter set from the fine-tuned parameter set based on the first parameter set and the second parameter set.
[0106] In some embodiments, the acquisition module 410 can also be configured to acquire a third parameter set and a fourth parameter set of another trained low-rank machine learning model for a second task, the recovered basic parameter set, the third parameter set and the fourth parameter set being in the form of matrices with the same dimension; applying the Hadamard operator to the recovered basic parameter set and the third parameter set to obtain an intermediate parameter set; aggregating the fourth parameter set with the intermediate parameter set to obtain an additional updated parameter set; fine-tuning the recovered basic parameter set using an additional updated parameter metric to obtain an additional fine-tuned parameter set for an additional target machine learning model corresponding to the second task; and applying the additional target machine learning model to perform model inference for the second task using the additional fine-tuned parameter set.
[0107] In some embodiments, the base machine learning model can be built based on a language model.
[0108] Figure 5 A block diagram illustrating an electronic device 500 in which one or more embodiments of the present invention may be implemented. It should be understood that Figure 5 The electronic device 500 shown is only an example and should not constitute any limitation on the functionality and scope of the embodiments described herein. The electronic device 500 can be used to implement, for example Figure 3 The electronic device 500 can also be used to implement the process 300 in Figure 4 Device 400.
[0109] like Figure 5 As shown, the electronic device 500 is in the form of a general-purpose computing device. The components of the electronic device 500 may include, but are not limited to, one or more processors or processing units 510, a memory 520, a storage device 530, one or more communication units 540, one or more input devices 550, and one or more output devices 560. The processing unit 510 may be an actual or virtual processor and may perform various processes according to a program stored in the memory 520. In a multi-processor system, multiple processing units execute computer executable instructions in parallel to improve the parallel processing capabilities of the electronic device 500.
[0110] The electronic device 500 typically includes various computer storage media. Such media can be any available media accessible to the electronic device 500, including but not limited to volatile and non-volatile media, removable and non-removable media. The memory 520 can be a volatile memory (e.g., a register, a cache, a random access memory (RAM)), a non-volatile memory (e.g., a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), flash memory) or any combination thereof. The storage device 530 can be any removable or non-removable medium, and can include a machine-readable medium, such as a flash drive, a disk, or any other medium, which can be used to store information and / or data (such as training data for training) and can be accessed within the electronic device 500.
[0111] The electronic device 500 may also include additional removable / non-removable, volatile / non-volatile storage media. Figure 5 520 may include a computer program product 525 having one or more program modules configured to perform various methods or actions of various embodiments of the present disclosure.
[0112] The communication unit 540 communicates with another computing device via a communication medium. In addition, the functions of the components in the electronic device 500 can be implemented by a single computing cluster or multiple computing machines, which can communicate via a communication connection. Therefore, the electronic device 500 can operate in a networked environment using a logical connection with one or more other servers, a network personal computer (PC), or another network node.
[0113] The input device 550 may be one or more input devices, such as a mouse, a keyboard, a trackball, etc. The output device 560 may be one or more output devices, such as a display, a speaker, a printer, etc. The electronic device 500 may also communicate with one or more external devices (not shown) through the communication unit 540 as needed. The external devices (such as storage devices, display devices, etc.) communicate with one or more devices that enable a user to interact with the electronic device 500, or communicate with any device (e.g., a network card, a modem, etc.) that enables the electronic device 500 to communicate with one or more other computing devices. Such communication may be performed via an input / output (I / O) interface (not shown).
[0114] According to an exemplary implementation of the present disclosure, a computer-readable storage medium is provided, on which a computer-executable instruction or a computer program is stored, and the computer-executable instruction or the computer program is executed by a processor to implement the above method. According to an exemplary implementation of the present disclosure, a computer program product is also provided. The computer program product is physically stored on a non-transitory computer-readable medium and includes a computer-executable instruction, and the computer-executable instruction is executed by a processor to implement the above method.
[0115] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices, equipment, and computer program products implemented according to the present disclosure. It should be understood that each frame of the flowchart and / or block diagram and the combination of each frame in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0116] These computer-readable program instructions can be provided to the processing unit of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine, and this machine generation device is to realize the function / action specified in one or more boxes in the flow chart and / or block diagram when these instructions are executed by the processing unit of a computer or other programmable data processing device. These computer-readable program instructions can also be stored in a computer-readable storage medium. These instructions enable a computer, a programmable data processing device and / or other equipment to work in an ad hoc manner. Therefore, the computer-readable medium comprising instructions includes a product, and the product includes instructions for realizing the various aspects of the function / action specified in one or more boxes in the flow chart and / or block diagram.
[0117] Computer-readable program instructions can be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps can be executed on the computer, other programmable data processing apparatus, or other device to generate a computer-implemented process, so that the instructions executed on the computer, other programmable data processing apparatus, or other device implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0118] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product implemented according to the present disclosure. In this regard, each frame in the flow chart or block diagram can represent a part of a module, a program segment or an instruction, which contains one or more executable instructions for implementing a specified logical function. In some alternative embodiments, the function marked in the frame can also occur in an order different from the order marked in the accompanying drawings. For example, two continuous blocks can actually be executed in parallel, and sometimes can also be executed in reverse order, depending on the functions involved. It should also be noted that each frame in the block diagram and / or flow chart and the combination of frames in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system or by a combination of dedicated hardware and computer instructions that performs a specified function or action.
[0119] Various embodiments of the present disclosure have been described above. The above description is exemplary rather than exhaustive and is not limited to the disclosed implementations. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles, practical applications, or technical improvements in the market for each embodiment, or to enable other persons of ordinary skill in the art to understand the various embodiments disclosed herein.
Claims
1. A method for model-based task processing, comprising: Obtain a basic parameter set of a pre-trained basic machine learning model and a first parameter set and a second parameter set of a trained low-rank machine learning model for a first task, wherein the basic parameter set, the first parameter set, and the second parameter set are in the form of matrices having the same dimension; Applying a Hadamard operator to the basic parameter set and the first parameter set to obtain an intermediate parameter set; Aggregating the second parameter set and the intermediate parameter set to obtain an updated parameter set; fine-tuning the base parameter set using the updated parameter metric to obtain a fine-tuned parameter set for a target machine learning model corresponding to the first task; as well as Apply the target machine learning model to perform model inference for the first task utilizing the tuned parameter set.
2. The method according to claim 1, wherein the rank upper limit of the updated parameter set is the sum of the rank of the base parameter set multiplied by the rank of the first parameter set plus the rank of the second parameter set.
3. The method of claim 1, wherein the low-rank machine learning model comprises a first low-rank machine learning sub-model having the first parameter set and a second low-rank machine learning sub-model having the second parameter set, wherein the first parameter set includes a first parameter matrix for a first part of the first low-rank machine learning sub-model and a second parameter matrix for a second part of the first low-rank machine learning sub-model, the rank of the first parameter matrix and the rank of the second parameter matrix being lower than the rank of the base parameter set; and The second parameter set includes a third parameter matrix and a fourth parameter matrix, the third parameter matrix is used for the first part of the second low-rank machine learning sub-model, and the fourth parameter matrix is used for the second part of the second low-rank machine learning sub-model, and the rank of the third parameter matrix and the rank of the fourth parameter matrix are lower than the rank of the basic parameter set.
4. The method according to claim 3, wherein acquiring the first parameter set and the second parameter set comprises: Performing a training process on the low-rank machine learning model to obtain the first parameter set and the second parameter set is performed in the following manner: Initializing the first parameter matrix and the third parameter matrix to zero matrices; as well as An initialization process is performed on the second parameter matrix and the fourth parameter matrix.
5. A method according to claim 4, wherein the first parameter set is fixed during the training process of the low-rank machine learning model.
6. The method according to claim 1, further comprising: The base parameter set is recovered from the fine-tuned parameter set based on the first parameter set and the second parameter set.
7. The method according to claim 6, further comprising: Obtaining a third parameter set and a fourth parameter set of another trained low-rank machine learning model for a second task, wherein the restored base parameter set, the third parameter set, and the fourth parameter set are in the form of matrices having the same dimension; Applying a Hadamard operator to the restored base parameter set and the third parameter set to obtain an intermediate parameter set; aggregating the fourth parameter set and the intermediate parameter set to obtain another updated parameter set; fine-tuning the recovered base parameter set using the additional updated parameter metric to obtain an additional fine-tuned parameter set for an additional target machine learning model corresponding to the second task; and Applying the additional target machine learning model to perform model inference for the second task utilizing the additional set of fine-tuned parameters.
8. The method of claim 1, wherein the base machine learning model is built based on a language model.
9. An apparatus for model-based task processing, comprising: An acquisition module is configured to acquire a basic parameter set of a pre-trained basic machine learning model and a first parameter set and a second parameter set of a trained low-rank machine learning model for a first task, wherein the basic parameter set, the first parameter set, and the second parameter set are in the form of matrices having the same dimension; A first application module is configured to apply a Hadamard operator to the basic parameter set and the first parameter set to obtain an intermediate parameter set; an aggregation module, configured to aggregate the second parameter set and the intermediate parameter set to obtain an updated parameter set; a fine-tuning module configured to fine-tune the base parameter set using the updated parameter metric to obtain a fine-tuned parameter set for a target machine learning model corresponding to the first task; as well as A second application module is configured to apply the target machine learning model to perform model inference for the first task using the fine-tuned parameter set.
10. An electronic device comprising: at least one processing unit; as well as At least one memory, the at least one memory being coupled to the at least one processing unit and storing instructions executable by the at least one processing unit, the instructions, after being executed by the at least one processing unit, causing the device to perform the method according to any one of claims 1 to 8.
11. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, after being executed by a device, causes the device to perform the method according to any one of claims 1 to 8.
12. A computer program product embodied on a computer readable medium and comprising computer executable instructions which, when executed by a processor, perform the method according to any one of claims 1 to 8.
Citation Information
Cited By
General information extraction method based on continuous low-rank adaptation
CN120338087A