Model training method

By introducing noise during the model training process and conducting multiple iteration training, the problem of decreased accuracy when the model weight is written into the non -easy -to -see memory equipment, and realized the high -precision model training when there is hardware noise and uncertain factors. Essence

CN119358699AActive Publication Date: 2025-01-24SOUTHERN UNIVERSITY OF SCIENCE AND TECHNOLOGY
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411315860.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2025-01-24
Estimated Expiration
2044-09-20

AI Technical Summary

Technical Problem

Existing model training methods lead to a decrease in model accuracy when writing model weights from the GPU to a nonvolatile memory device.

Method used

Pre -training of the original model through the GPU, generate the preset noise corresponding to the non -easy -to -sex memory device, and add it to the pre -training weight matrix to obtain the pre -training noise right weight matrix, and then continue the training model until the model convergence , Get the training right weight matrix and write into a non -easy -to -lose -sex memory device.

Benefits of technology

By introducing noise during the training process, the model learns to be insensitive to weight changes, thereby improving model accuracy in the presence of hardware noise and other uncertain factors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119358699A_ABST
    Figure CN119358699A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of deep learning models, in particular to a model training method. According to the method, firstly, an original model is pre-trained on a GPU to obtain a pre-trained weight matrix, then noise is added to the pre-trained weight matrix, then the model continues to be trained to update the weight matrix until the model converges to obtain a trained weight matrix, and finally the trained weight matrix is written into a nonvolatile memory device. Due to the fact that noise is introduced in the model training process, the model learns insensitivity to weight changes. When the trained weight matrix is written into the nonvolatile memory device from the GPU, although the trained weight matrix is changed due to the characteristics of the nonvolatile memory device, the model of the invention has learned insensitivity to the weight change, so that the model located in the nonvolatile memory device still has very high prediction precision. According to the invention, the LoRA fine tuning technology is adopted, and the efficiency of anti-noise training is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of deep learning models, and in particular to a model training method. Background Art

[0002] The deep learning model is trained on the GPU, and the weights of the trained model are written from the GPU to some non-volatile memory devices (such as resistive random access memory). The structure of the non-volatile memory device (including several resistors) is as follows: Figure 2 As shown, the weights are written to the non-volatile memory device, that is, the conductance value of the resistor is adjusted to a value that matches the weight. When the trained model needs to be used for inference application, the non-volatile memory device uses the model weights written in advance for inference calculation. Since the non-volatile memory device sets the model weight storage and inference calculation in the same physical location, the transmission time of the model weights between the memory and the processor is avoided, thereby saving the time required for model inference calculation. However, in the process of writing the model weights from the GPU to the non-volatile memory device, due to the inherent properties of the non-volatile memory device, the model weights on the GPU cannot be written to the non-volatile memory device indiscriminately, thereby reducing the accuracy of the model on the non-volatile memory device.

[0003] In summary, existing model training methods reduce model accuracy.

[0004] Therefore, the prior art still needs to be improved and enhanced. Summary of the invention

[0005] In order to solve the above technical problems, the present invention provides a model training method, which solves the problem that the existing model training method reduces the model accuracy.

[0006] To achieve the above object, the present invention adopts the following technical solutions:

[0007] In a first aspect, the present invention provides a model training method, which comprises:

[0008] Pre-training the original model through the GPU to obtain a pre-trained model, and obtaining a pre-trained weight matrix of the pre-trained model;

[0009] Generate a preset noise corresponding to the non-volatile memory device, and add the preset noise into the pre-trained weight matrix to obtain a pre-trained noise weight matrix;

[0010] Based on the pre-trained noise weight matrix, the pre-trained model is continuously trained by the GPU to obtain a trained weight matrix corresponding to the trained model, and the trained weight matrix is ​​written into a non-volatile memory device.

[0011] In one implementation, pre-training the original model by using a GPU to obtain a pre-trained model includes:

[0012] Construct a noise-free training dataset;

[0013] Based on the training data set, the original model is pre-trained by the GPU until the model converges to obtain a pre-trained model.

[0014] In one implementation, generating a preset noise corresponding to the non-volatile memory device and adding the preset noise into the pre-trained weight matrix to obtain a pre-trained noise weight matrix includes:

[0015] Acquire data loss between the GPU and the non-volatile memory device;

[0016] generating a preset noise corresponding to the data loss;

[0017] Determining a noise matrix corresponding to the preset noise;

[0018] A pre-trained noise weight matrix is ​​obtained according to the noise matrix and the pre-trained weight matrix.

[0019] In one implementation, the step of continuing to train the pre-trained model by the GPU based on the pre-trained noise weight matrix to obtain a trained weight matrix corresponding to the trained model includes:

[0020] Obtaining the number of rows and columns contained in the pre-trained noise weight matrix, and generating an auxiliary matrix according to the number of rows and columns of the pre-trained noise weight matrix;

[0021] Continue to train the pre-trained model through the GPU, and update the auxiliary matrix during each iterative training until the model converges again to obtain a final auxiliary update matrix;

[0022] A trained weight matrix is ​​obtained according to the pre-trained noise weight matrix and the final auxiliary update matrix.

[0023] In one implementation, generating an auxiliary matrix according to the number of rows and columns of the pre-trained noise weight matrix includes:

[0024] Generate a first matrix having the same number of columns as the pre-trained noise weight matrix;

[0025] Generate a second matrix having the same number of rows as the pre-trained noise weight matrix, wherein the second matrix and the first matrix are applicable to matrix multiplication rules;

[0026] Initializing the element values ​​of the first matrix randomly to obtain a first auxiliary matrix; initializing the element values ​​of the second matrix to zero to obtain a second auxiliary matrix;

[0027] Alternatively, the element values ​​of the first matrix are initialized to zero to obtain a first auxiliary matrix; and the element values ​​of the second matrix are randomly initialized to obtain a second auxiliary matrix.

[0028] In one implementation, the final auxiliary update matrix includes a first auxiliary update matrix corresponding to the first auxiliary matrix and a second auxiliary update matrix corresponding to the second auxiliary matrix, and the trained weight matrix is ​​obtained according to the pre-trained noise weight matrix and the final auxiliary update matrix, including:

[0029] Multiplying the second auxiliary update matrix by the first auxiliary update matrix to obtain a product matrix;

[0030] The pre-trained noise weight matrix is ​​added to the multiplication matrix to obtain a trained weight matrix.

[0031] In one implementation, the trained model includes a large language model or an image segmentation model.

[0032] In a second aspect, an embodiment of the present invention further provides a model training device, wherein the device comprises the following components:

[0033] A pre-training module is used to pre-train the original model through the GPU to obtain a pre-trained model and obtain a pre-trained weight matrix of the pre-trained model;

[0034] A noise adding module, used for generating a preset noise corresponding to the non-volatile memory device, and adding the preset noise into the pre-trained weight matrix to obtain a pre-trained noise weight matrix;

[0035] A weight matrix update module is used to continue training the pre-trained model through the GPU based on the pre-trained noise weight matrix, obtain a trained weight matrix corresponding to the trained model, and write the trained weight matrix into a non-volatile memory device.

[0036] In a third aspect, an embodiment of the present invention further provides a terminal device, wherein the terminal device comprises a memory, a processor, and a model training program stored in the memory and executable on the processor, and when the processor executes the model training program, the steps of the above-mentioned model training method are implemented.

[0037] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a model training program is stored. When the model training program is executed by a processor, the steps of the above-mentioned model training method are implemented.

[0038] Beneficial effect: The present invention first pre-trains the original model on the GPU to obtain a pre-trained model, and also obtains the pre-trained weight matrix of the model, then adds noise to the pre-trained weight matrix, and then continues to train the model to update the weight matrix during the iterative training process until the model converges. The weight matrix at this time is the final trained weight matrix, and finally the trained weight matrix is ​​written to the non-volatile memory device. Since the present invention introduces noise during the model training process, the model learns to be insensitive to weight changes, that is, even if the weights change, the model can still maintain a high prediction accuracy. When the trained weight matrix is ​​written from the GPU to the non-volatile memory device, although the trained weight matrix has changed due to the characteristics of the non-volatile memory device, it can be seen from the above analysis that the model of the present invention has learned to be insensitive to weight changes, so the model located in the non-volatile memory device still has a high prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 This is the overall process of the present invention.

[0040] Figure 2 is a structural diagram of a non-volatile memory device in an embodiment of the present invention;

[0041] Figure 3 is a flow chart of model training in an embodiment of the present invention;

[0042] Figure 4 Schematic diagram of weight matrix splitting in an embodiment of the present invention;

[0043] Figure 5 is a schematic diagram of an additional training layer in an embodiment of the present invention;

[0044] Figure 6 A structural diagram of the model training device provided by the present invention;

[0045] Figure 7 This is a block diagram of the internal structure principle of the terminal device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0046] The following is a clear and complete description of the technical solution of the present invention in combination with the embodiments and the accompanying drawings. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0047] It has been found that when training a deep learning model on a GPU, the weights of the trained model are written from the GPU to a non-volatile memory device. The structure of the non-volatile memory device (including several resistors) is as follows: Figure 2 As shown, the weights are written to the non-volatile memory device, that is, the conductance value of the resistor is adjusted to a value that matches the weight. When the trained model needs to be used for inference application, the non-volatile memory device uses the model weights written in advance for inference calculation. Since the non-volatile memory device sets the model weight storage and inference calculation in the same physical location, the transmission time of the model weights between the memory and the processor is avoided, thereby saving the time required for model inference calculation. However, in the process of writing the model weights from the GPU to the non-volatile memory device, due to the inherent properties of the non-volatile memory device, the model weights on the GPU cannot be written to the non-volatile memory device indiscriminately, thereby reducing the accuracy of the model on the non-volatile memory device.

[0048] In order to solve the above technical problems, the present invention provides a model training method, which solves the problem that the existing model training method reduces the model accuracy. In the specific implementation, the original model is first pre-trained by the GPU to obtain the pre-trained model, and the pre-trained weight matrix of the pre-trained model is obtained; then a preset noise corresponding to the non-volatile memory device is generated, and the preset noise is added to the pre-trained weight matrix to obtain the pre-trained noise weight matrix; finally, based on the pre-trained noise weight matrix, the pre-trained model is continued to be trained by the GPU to obtain the trained weight matrix corresponding to the trained model, and the trained weight matrix is ​​written into the non-volatile memory device. The present invention trains the model under the premise of noise, so that the model with the trained weight matrix learns to be insensitive to weight changes, so that the model on the non-volatile memory device can still maintain a high accuracy based on the trained weight matrix with write errors.

[0049] For example, first train the original model on the GPU until the model's accuracy reaches the set accuracy, then stop training. The model at this time is the pre-trained model, and the weight values ​​of the pre-trained model are saved in the form of a pre-trained weight matrix. For example, the pre-trained model has nine weights, and the values ​​of the nine weights are a1, a2, a3, a4, a5, a6, a7, a8, and a9, respectively. Then the pre-trained weight matrix is Then, according to the characteristics of the non-volatile memory device (including RRAM or PCM), the corresponding noise is generated and introduced into the pre-trained weight matrix, that is, the nine weight values ​​a1, a2, a3, a4, a5, a6, a7, a8, and a9 in the pre-trained weight matrix are respectively added or subtracted by a number to simulate the phenomenon that the pre-trained weight matrix cannot be accurately written into the non-volatile memory device, that is, to simulate the change of the pre-trained weight matrix caused by writing the pre-trained weight matrix into the non-volatile memory device. On the basis of the pre-trained weight matrix with noise introduced (that is, the pre-trained noise weight matrix), the model is continued to be trained on the GPU until the accuracy of the model reaches the set accuracy again or the model converges to obtain the trained model, and the trained weight matrix of the trained model is written into the non-volatile memory device. Although the trained weight matrix changes due to the characteristics of the non-volatile memory device during the writing process, since the model has learned the insensitivity to weight changes, although the weight matrix has changed, the accuracy of the model on the non-volatile memory device will not decrease.

[0050] The model training method of this embodiment can be applied to a terminal device, which can be a terminal product with a data processing function, such as a computer. Figure 1 As shown in , the model training method specifically includes the following steps:

[0051] S100, pre-training the original model through a GPU to obtain a pre-trained model, and obtaining a pre-trained weight matrix of the pre-trained model;

[0052] S200, generating a preset noise corresponding to a non-volatile memory device, and adding the preset noise to the pre-trained weight matrix to obtain a pre-trained noise weight matrix;

[0053] S300, based on the pre-trained noise weight matrix, continue to train the pre-trained model through the GPU to obtain a trained weight matrix corresponding to the trained model, and write the trained weight matrix into a non-volatile memory device.

[0054] Embodiment 1, in this embodiment, step S100 includes the following specific steps: constructing a noise-free training data set; based on the training data set, pre-training the original model through the GPU until the model converges to obtain a pre-trained model.

[0055] The weight value of the pre-trained model expressed in matrix form is the pre-trained weight matrix W0∈R d×d .

[0056] The training data set in this embodiment has no noise, that is, the model is trained with actual samples, so that the model has the ability to learn from real samples.

[0057] In this embodiment, the original model is a deep learning model, the training data set includes multiple medical diagnosis sample texts and the real classification results corresponding to each medical diagnosis sample text, the real classification results include whether the disease is present and the degree of the disease, the medical diagnosis sample texts are input into the deep learning model located on the GPU, and the predicted classification results output by the deep learning model are obtained, the difference between the predicted classification results and the real classification results is calculated (that is, the loss function), and the various weight values ​​of the deep learning model are adjusted according to the difference. After the adjustment, the medical diagnosis sample texts are input into the deep learning model again until the difference is less than the set value, that is, the model accuracy reaches the set accuracy, or the number of iterative training reaches the set number, or the model converges, and a pre-trained large language model (that is, a pre-trained model) is obtained, and the matrix composed of the various weight values ​​on the pre-trained large language model is the pre-trained weight matrix.

[0058] Embodiment 2, based on embodiment 1, in this embodiment, step S200 includes the following specific steps S201, S202, S203, S204:

[0059] S201: Acquire data loss between the GPU and the non-volatile memory device.

[0060] The data loss is how much a piece of data will be reduced when it is written from the GPU to the non-volatile memory device. For example, if the data is 5, after writing it to the non-volatile memory device, the data becomes 4.9, then the data loss is 0.1.

[0061] S202: Generate preset noise corresponding to the data loss.

[0062] Different noises are selected according to the size of data loss, including Gaussian noise, Bernoulli noise, uniform noise, and random inactivation.

[0063] S203, determining a noise matrix W corresponding to the preset noise noise .

[0064] That is, the preset noise is expressed in the form of a matrix.

[0065] S204: Obtain a pre-trained noise weight matrix W′ according to the noise matrix and the pre-trained weight matrix.

[0066] like Figure 3 As shown, the expression of the pre-trained noise weight matrix W′ is as follows:

[0067] W′=W0+Wnoise

[0068] Embodiment 3, based on embodiment 1 or embodiment 2, in this embodiment, step S300 includes the following specific steps S301, S302, S303, S304:

[0069] S301, obtaining the number of rows and columns contained in the pre-trained noise weight matrix, generating a first matrix having the same number of columns as the pre-trained noise weight matrix; generating a second matrix having the same number of rows as the pre-trained noise weight matrix, and the second matrix and the first matrix are applicable to matrix multiplication rules.

[0070] S302: Randomly initialize the element values ​​of the first matrix to obtain a first auxiliary matrix W A ; Initialize the element values ​​of the second matrix to zero to obtain the second auxiliary matrix W B .

[0071] Alternatively, the element values ​​of the first matrix are initialized to zero to obtain the first auxiliary matrix W A ; Randomly initialize the element values ​​of the second matrix to obtain the second auxiliary matrix W B .

[0072] The first auxiliary matrix W A and the second auxiliary matrix W B The element values ​​of one of the two matrices are all zero to ensure that W B W A The value of is zero, which will not affect the value of W' at the beginning of training, and the first auxiliary matrix W A and the second auxiliary matrix W B Only one of the two matrices has zero element values, which can also ensure the training efficiency of the model.

[0073] W0∈R d×d ,W A ∈R r×d ,W B ∈R d×r , that is, W A has the same number of columns d as W0, W B It has the same number of rows d as W0. The value of r includes 1, 2, or 4, and d is 4096, which is W A and W B The dimension of W is much smaller than that of W0. B W A The number of elements of is equal to the number of elements of W0.

[0074] S303, continue to train the pre-trained model through the GPU, and update the auxiliary matrix in each iterative training until the model converges again to obtain a final auxiliary update matrix.

[0075] like Figure 4 As shown, W A and W B Located in the extra training layer. Fine-tuning for specific tasks is achieved by adding low-dimensional matrices to the model without the need for large-scale parameter updates to the entire model. This can effectively reduce the required data and computing resources while maintaining or improving the performance of the model.

[0076] In each iteration of training, only the first auxiliary matrix W is updated A and the second auxiliary matrix W B , the pre-trained noise weight matrix W′ is not updated. When the iteration is completed until the model converges, the final first auxiliary matrix W is obtained. A ′ and the final second auxiliary matrix W B ′.

[0077] After training is complete, the additional training layers do not participate in the model's predictions.

[0078] like Figure 5 As shown, when the model (which can be GPT or BERT) structure includes an input layer, a convolution layer 1, a convolution layer 2, a linear layer, and an output layer. Convolution layer 1 is connected in parallel with an additional training layer 1, and convolution layer 1 and additional training layer 1 have the same structure. During training, the weights on convolution layer 1 are not updated, and only the weights on additional training layer 1 are updated. Convolution layer 2 is connected in parallel with an additional training layer 2, and convolution layer 2 and additional training layer 2 have the same structure. During training, the weights on convolution layer 2 are not updated, and only the weights on additional training layer 2 are updated. The linear layer is connected in parallel with an additional training layer 3, and the linear layer and additional training layer 3 have the same structure. During training, the weights on the linear layer are not updated, and only the weights on the additional training layer 3 are updated.

[0079] S304: The final auxiliary update matrix includes a first auxiliary update matrix corresponding to the first auxiliary matrix and a second auxiliary update matrix corresponding to the second auxiliary matrix. The final second auxiliary update matrix is ​​multiplied by the final first auxiliary update matrix to obtain a multiplied matrix W. B 'W A '; Add the pre-trained noise weight matrix W' to the multiplication matrix W B 'W A ′, get the trained weight matrix W new :

[0080] W new =W′+W B 'W A ′.

[0081] Get W new Afterwards, W new Each element value in is written to the non-volatile memory device, that is, the non-volatile memory device (the structure of the non-volatile memory device is as follows Figure 2 The conductance value of each resistor is set to W new The corresponding element value in . Then the non-volatile memory device has the function of the trained model.

[0082] In summary, the present invention introduces noise during the training process, and the model learns to be insensitive to changes in weights, thereby significantly improving the performance in the presence of hardware noise and other uncertain factors. The present invention introduces low-rank matrices for training, which greatly reduces the required computing resources and storage space, and reduces the training cost. A and W B The number of parameters of is much smaller than that of W0, the training process is more efficient, and the model can be fine-tuned in a short time.

[0083] This embodiment also provides a model training device, such as Figure 6 As shown, the device comprises the following components:

[0084] The pre-training module 01 is used to pre-train the original model through the GPU to obtain a pre-trained model and obtain a pre-trained weight matrix of the pre-trained model;

[0085] A noise adding module 02, used for generating a preset noise corresponding to the non-volatile memory device, and adding the preset noise into the pre-trained weight matrix to obtain a pre-trained noise weight matrix;

[0086] The weight matrix update module 03 is used to continue training the pre-trained model through the GPU based on the pre-trained noise weight matrix, obtain the trained weight matrix corresponding to the trained model, and write the trained weight matrix into a non-volatile memory device.

[0087] Based on the above embodiments, the present invention further provides a terminal device, whose principle block diagram can be shown as follows: Figure 7As shown. The terminal device includes a processor, a memory, a network interface, and a display screen connected via a system bus. Among them, the processor of the terminal device is used to provide computing and control capabilities. The memory of the terminal device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the terminal device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a model training method is implemented. The display screen of the terminal device can be a liquid crystal display screen or an electronic ink display screen.

[0088] Those skilled in the art will understand that Figure 7 The principle block diagram shown in the figure is only a block diagram of a partial structure related to the scheme of the present invention, and does not constitute a limitation on the terminal device to which the scheme of the present invention is applied. The specific terminal device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0089] In one embodiment, a terminal device is provided. The terminal device includes a memory, a processor, and a model training program stored in the memory and executable on the processor. When the processor executes the model training program, the following operation instructions are implemented:

[0090] Pre-training the original model through the GPU to obtain a pre-trained model, and obtaining a pre-trained weight matrix of the pre-trained model;

[0091] Generate a preset noise corresponding to the non-volatile memory device, and add the preset noise into the pre-trained weight matrix to obtain a pre-trained noise weight matrix;

[0092] Based on the pre-trained noise weight matrix, the pre-trained model is continuously trained by the GPU to obtain a trained weight matrix corresponding to the trained model, and the trained weight matrix is ​​written into a non-volatile memory device.

[0093] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0094] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A model training method, characterized in that: include: Pre-training the original model through the GPU to obtain a pre-trained model, and obtaining a pre-trained weight matrix of the pre-trained model; Generate a preset noise corresponding to the non-volatile memory device, and add the preset noise into the pre-trained weight matrix to obtain a pre-trained noise weight matrix; Based on the pre-trained noise weight matrix, the pre-trained model is continuously trained by the GPU to obtain a trained weight matrix corresponding to the trained model, and the trained weight matrix is ​​written into a non-volatile memory device.

2. The model training method according to claim 1, characterized in that: The pre-training of the original model by GPU to obtain the pre-trained model includes: Construct a noise-free training dataset; Based on the training data set, the original model is pre-trained by the GPU until the model converges to obtain a pre-trained model.

3. The model training method according to claim 1, characterized in that: The generating of preset noise corresponding to the non-volatile memory device and adding the preset noise into the pre-trained weight matrix to obtain the pre-trained noise weight matrix includes: Acquire data loss between the GPU and the non-volatile memory device; generating a preset noise corresponding to the data loss; Determining a noise matrix corresponding to the preset noise; A pre-trained noise weight matrix is ​​obtained according to the noise matrix and the pre-trained weight matrix.

4. The model training method according to claim 1, characterized in that: The step of continuing to train the pre-trained model by the GPU based on the pre-trained noise weight matrix to obtain a trained weight matrix corresponding to the trained model includes: Obtaining the number of rows and columns contained in the pre-trained noise weight matrix, and generating an auxiliary matrix according to the number of rows and columns of the pre-trained noise weight matrix; Continue to train the pre-trained model through the GPU, and update the auxiliary matrix during each iterative training until the model converges again to obtain a final auxiliary update matrix; A trained weight matrix is ​​obtained according to the pre-trained noise weight matrix and the final auxiliary update matrix.

5. The model training method according to claim 4, characterized in that: The generating an auxiliary matrix according to the number of rows and columns of the pre-trained noise weight matrix comprises: Generate a first matrix having the same number of columns as the pre-trained noise weight matrix; Generate a second matrix having the same number of rows as the pre-trained noise weight matrix, wherein the second matrix and the first matrix are applicable to matrix multiplication rules; Initializing the element values ​​of the first matrix randomly to obtain a first auxiliary matrix; initializing the element values ​​of the second matrix to zero to obtain a second auxiliary matrix; Alternatively, the element values ​​of the first matrix are initialized to zero to obtain a first auxiliary matrix; and the element values ​​of the second matrix are randomly initialized to obtain a second auxiliary matrix.

6. The model training method according to claim 5, characterized in that: The final auxiliary update matrix includes a first auxiliary update matrix corresponding to the first auxiliary matrix and a second auxiliary update matrix corresponding to the second auxiliary matrix, and the trained weight matrix is ​​obtained according to the pre-trained noise weight matrix and the final auxiliary update matrix, including: Multiplying the second auxiliary update matrix by the first auxiliary update matrix to obtain a product matrix; The pre-trained noise weight matrix is ​​added to the multiplication matrix to obtain a trained weight matrix.

7. The model training method according to any one of claims 1 to 6, characterized in that: The trained model includes a large language model or an image segmentation model.

Citation Information

Patent Citations

  • Neural network model training method and device, and neural network model application method and device

    CN113610220A

  • Apparatus for compensating for training operation variation of computation-in-memory based artificial neural network

    US20240211756A1

  • Vertical federated learning methods, apparatuses, system and device, and storage medium

    WO2023174018A1