A deep learning model training method, device, equipment and storage medium

By optimizing the training process of deep learning models through gradient compression and preset adjustment strategies, the problem of high GPU memory consumption is solved, achieving efficient and low-cost model training and updating, and improving the model's adaptability and generalization performance.

CN118627600BActive Publication Date: 2024-11-26OPENBAYES (TIANJIN) IT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411060726.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-05
Publication Date
2024-11-26
Estimated Expiration
2044-08-05

AI Technical Summary

Technical Problem

In a distributed computing environment, deep learning models have high training costs and high memory usage, which affects training efficiency and scalability. Furthermore, the storage and processing of intermediate variables increases computational complexity and cost.

Method used

By determining the gradient compression strategy based on the initial large language model, preset hyperparameters, and GPU memory, the model's adaptability to training data is gradually improved. The model is then optimized through iterative training and parameter updates to reduce GPU memory requirements and computational resource consumption.

Benefits of technology

Efficiently training models with limited hardware resources reduces training time and energy consumption, improves the model's adaptability and generalization ability, and lowers training costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118627600B_ABST
    Figure CN118627600B_ABST
Patent Text Reader

Abstract

The present application relates to the field of artificial intelligence technology, and in particular to a deep learning model training method, device, equipment and storage medium. The method determines a suitable gradient compression strategy based on the initial large language model, preset hyperparameters and video memory, reduces the video memory space occupied by gradient data during training, enables training to be carried out efficiently under limited hardware resources, and ensures efficient allocation and utilization of resources throughout the training process; in the iterative training process, a preset adjustment strategy is used to gradually optimize the model so that it better adapts to the training data, reduces the number of unnecessary iterations, thereby shortening the training time, reducing energy consumption and computing costs; based on the compression strategy and the target large language model parameters obtained by the preset data training, the initial large language model is updated, the iterative evolution of the model is realized, the adaptability of the model to the data is improved, and the training cost is reduced while ensuring the performance of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a deep learning model training method, apparatus, device and storage medium. Background Art

[0002] With the development of deep learning technology, large-scale deep learning models represented by large language models have been widely used in different scenario tasks. At present, efficient training of deep learning models through distributed training has become the mainstream method of model training. However, in a distributed computing environment, the calculation process of the optimizer requires a large amount of video memory, especially when processing and updating the parameters of large models. This demand for video memory forces researchers and developers to rely on high-performance computing clusters, where each iteration requires a large amount of data to be synchronized between hundreds or thousands of processors. These data occupy a large amount of memory space, resulting in high video memory occupancy, which in turn affects training efficiency and scalability. In addition, the storage and processing of these intermediate variables increases the computational complexity, slows down the iteration cycle, and increases the training cost.

[0003] Therefore, how to reduce the training cost and memory usage of deep learning models is an urgent problem that needs to be solved.

[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of this application is to provide a deep learning model training method, device, equipment and storage medium, aiming to solve the technical problem of how to reduce the training cost and video memory occupancy of the deep learning model.

[0006] To achieve the above objectives, the present application provides a deep learning model training method, which is applied to a large language model, and the method comprises the following steps:

[0007] Determine the gradient compression strategy based on the initial large language model, preset hyperparameters, and video memory;

[0008] Iteratively training the initial large language model based on the gradient compression strategy and preset training data to obtain target large language model parameters, wherein during the training process, based on a preset adjustment strategy, the adaptability of the initial large language model to the training data is gradually improved;

[0009] The initial large language model is updated based on the target large language model parameters to obtain a target large language model.

[0010] In one embodiment, the step of iteratively training the initial large language model based on the gradient compression strategy and preset training data to obtain target large language model parameters includes:

[0011] Determining a loss function based on the gradient compression strategy and the initial large language model;

[0012] Determining a gradient value of the loss function based on a training set in the preset training data;

[0013] Based on the gradient value, construct a target matrix;

[0014] Performing diagonal estimation on the target matrix to obtain parameter increments;

[0015] The target large language model parameters are obtained according to the initial parameters of the initial large language model and the parameter increment.

[0016] In one embodiment, the step of determining the loss function based on the gradient compression strategy and the initial large language model includes:

[0017] Constructing a low-rank parameter matrix based on the gradient compression strategy and the parameters of the initial large language model;

[0018] Splitting the low-rank parameter matrix;

[0019] Perform singular value decomposition on the split low-rank parameter submatrix to obtain spatial data.

[0020] Based on the spatial data, determining a tensor;

[0021] Based on the tensor, a loss function is determined.

[0022] In one embodiment, the step of determining the gradient value of the loss function based on the training set in the preset training data includes:

[0023] Based on the neural network model, forward calculation is performed on the training sample to obtain a gradient prediction value;

[0024] Based on the training sample, performing a differential operation on the loss function to obtain a true value of the gradient;

[0025] Determine a gradient loss value based on the gradient prediction value and the gradient true value;

[0026] A gradient value with respect to the loss function is obtained based on the gradient loss value.

[0027] In one embodiment, the step of performing diagonal estimation on the target matrix to obtain parameter increments includes:

[0028] Extracting diagonal elements of the target matrix;

[0029] constructing an intermediate matrix based on the diagonal elements;

[0030] The parameter increment is obtained based on the intermediate matrix.

[0031] In one embodiment, after the step of obtaining the target large language model parameters according to the initial parameters of the initial large language model and the parameter increment, the method further includes:

[0032] Decomposing the parameter increment to obtain a plurality of factors;

[0033] Iteratively training the multiple factors to obtain adjustment values ​​of the parameter increments;

[0034] The target large language model parameter is adjusted based on the adjustment value.

[0035] In one embodiment, the step of updating the initial large language model based on the target large language model parameters to obtain the target large language model includes:

[0036] Splitting the target large language model parameters into multiple sub-datasets;

[0037] Decoupling parameters of the initial large language model according to the multiple sub-datasets;

[0038] Based on the decoupling result, the initial large language model is updated to obtain the target large language model.

[0039] In addition, to achieve the above objectives, the present application also proposes a deep learning model training device, the deep learning model training device comprising:

[0040] An acquisition module is used to determine a gradient compression strategy based on an initial large language model, preset hyperparameters, and video memory;

[0041] A training module, configured to iteratively train the initial large language model based on the gradient compression strategy and preset training data to obtain target large language model parameters;

[0042] The loading module is used to update the initial large language model based on the target large language model parameters to obtain a target large language model.

[0043] In addition, to achieve the above-mentioned purpose, the present application also proposes a deep learning model training device, which includes: a memory, a processor, and a deep learning model training program stored on the memory and executable on the processor, wherein the deep learning model training program is configured to implement the steps of the deep learning model training method described above.

[0044] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, on which a deep learning model training program is stored. When the deep learning model training program is executed by a processor, the steps of the deep learning model training method described above are implemented.

[0045] The present application determines a suitable gradient compression strategy according to an initial large language model, preset hyperparameters and video memory, reduces the video memory space occupied by gradient data during training, enables training to be carried out efficiently with limited hardware resources, and ensures efficient allocation and utilization of resources throughout the training process; during iterative training, a preset adjustment strategy is used to gradually optimize the model so that it better adapts to training data, reduces the number of unnecessary iterations, thereby shortening training time, reducing energy consumption and computing costs; based on the compression strategy and the target large language model parameters obtained through preset data training, the initial large language model is updated, the iterative evolution of the model is realized, the adaptability of the model to data is improved, and the training cost is reduced while ensuring model performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 This is a flowchart of the first embodiment of the deep learning model training method of the present application;

[0047] Figure 2 This is a schematic diagram of a sub-process in the second embodiment of the deep learning model training method of this application;

[0048] Figure 3 This is another sub-process diagram in the second embodiment of the deep learning model training method of the present application;

[0049] Figure 4 This is a schematic diagram of a sub-process in the third embodiment of the deep learning model training method of this application;

[0050] Figure 5 This is another sub-process diagram in the third embodiment of the deep learning model training method of the present application;

[0051] Figure 6 This is a schematic diagram of the module structure of the deep learning model training device according to an embodiment of the present application;

[0052] Figure 7 This is a schematic diagram of the device structure of the hardware operating environment involved in the deep learning model training method in the embodiment of the present application.

[0053] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0054] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0055] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0056] It should be noted that with the development of deep learning technology, large-scale deep learning models represented by large language models have been widely used in different scenario tasks. At present, efficient training of deep learning models through distributed training has become the mainstream method of model training. However, in a distributed computing environment, the calculation process of the optimizer requires a large amount of video memory, especially when processing and updating the parameters of large models. This demand for video memory forces researchers and developers to rely on high-performance computing clusters, where each iteration requires a large amount of data to be synchronized between hundreds or thousands of processors. These data occupy a large amount of memory space, resulting in high video memory occupancy, which in turn affects training efficiency and scalability. In addition, the storage and processing of these intermediate variables increases the computational complexity, slows down the iteration cycle, and increases the training cost. Therefore, how to reduce the training cost of deep learning models is a problem that needs to be solved urgently.

[0057] The main solution of the present application is: determine the gradient compression strategy based on the initial large language model, preset hyperparameters and video memory; iteratively train the initial large language model based on the gradient compression strategy and preset training data to obtain target large language model parameters; wherein, during the training process, based on the preset adjustment strategy, gradually improve the adaptability of the initial large language model to the training data; based on the target large language model parameters, update the initial large language model to obtain the target large language model.

[0058] The present application determines a suitable gradient compression strategy according to the initial large language model, preset hyperparameters and available video memory, significantly reduces the video memory space occupied by gradient data during training, enables training to be carried out efficiently under limited hardware resources, and ensures efficient allocation and utilization of resources throughout the training process; during the iterative training process, a preset adjustment strategy is used to gradually optimize the model so that it better adapts to the training data, reduces the number of unnecessary iterations, thereby shortening the training time, reducing energy consumption and computing costs; based on the compression strategy and the parameters of the target large language model obtained by the preset data training, the initial large language model is updated, the iterative evolution of the model is realized, the adaptability of the model to the data is iteratively improved instead of blindly pursuing the most complex model structure, while ensuring the model performance, the training cost is reduced.

[0059] It should be noted that the execution subject of the method of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a mobile phone, a tablet computer, a personal computer, etc.; it can also be the above-mentioned deep learning model training device with the same or similar functions. This embodiment and the following embodiments will be described by taking the deep learning model training device as an example.

[0060] Based on this, the first embodiment of the deep learning model training method of this application is proposed, please refer to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the deep learning model training method implemented in this application.

[0061] In this embodiment, the deep learning model training includes the following steps:

[0062] S1: Determine the gradient compression strategy based on the initial large language model, preset hyperparameters, and video memory;

[0063] Specifically, determining the gradient compression strategy based on the current hardware configuration and model characteristics can reduce the demand for video memory for model training, so that model training can be performed on hardware with lower configurations. Gradient compression can reduce the amount of communication data, thereby reducing network latency and accelerating the training process. It reduces communication and I / O waiting time during training, speeds up the iteration of model training, shortens the training time required to reach the expected performance level, and thus improves overall training efficiency.

[0064] It should be noted that the preset hyperparameters include: learning rate, batch size, regularization strength, number of hidden layers, activation function type, and size and number of convolution kernels. Selecting appropriate hyperparameters enables the model to converge to a better solution faster and reduce training time and computing resource consumption. The gradient compression strategy is a technical means to reduce the transmission and storage overhead of gradient information during deep learning model training. It achieves efficient communication and memory usage by reducing redundant information in gradient vectors. The initial large language model refers to the model state at the beginning of the deep learning model training process. The initial large language model determines the basic structure of the neural network, including the number of layers, the type of each layer, the number of neurons, the activation function, etc. These constitute the skeleton of the model and determine the complexity of the model's learning and expression. In the iterative training and optimization process, the initial large language model is used as the starting point to approach a better solution by continuously adjusting the model parameters. The preset adjustment strategy refers to the dynamic learning rate adjustment mechanism, which optimizes the learning rate according to the performance of the model during training, which not only reduces the demand for video memory, but also improves training efficiency.

[0065] Through the above steps, based on the structure of the initial large language model, preset hyperparameters and video memory resources, the appropriate gradient compression strategy can be dynamically determined, thereby effectively reducing the use of communication bandwidth and video memory occupancy, thereby significantly improving the model training efficiency and optimizing the utilization of hardware resources.

[0066] S2: iteratively training the initial large language model based on the gradient compression strategy and preset training data to obtain target large language model parameters; wherein, during the training process, based on a preset adjustment strategy, gradually improving the adaptability of the initial large language model to the training data;

[0067] Specifically, the gradient compression strategy can reduce the video memory and communication bandwidth required during model training, especially in large-scale distributed training scenarios, significantly reducing the limitations of hardware resources, so that complex language models can be trained with limited resources; gradient compression reduces the amount of data transmission in each iteration, and combined with the adaptive adjustment strategy during the training process, it converges to better model parameters more quickly, thereby improving the overall training efficiency; at the same time, during the training process, the model's adaptability to the training data is gradually improved to avoid overfitting, balance generalization ability and fitting ability, and improve the generalization performance of the model.

[0068] Furthermore, through iterative training and gradual adjustment, the model can better fit the training data. At the same time, by preventing overfitting, it maintains a good generalization ability for new data, thereby improving the prediction accuracy and practicality of the model; the preset adjustment strategy automatically adjusts the learning parameters during training, which helps to maintain the stability of the training process and avoid drastic fluctuations during training, making model training smoother, reducing dependence on hardware resources, and allowing language model training to be performed on more diverse hardware configurations, expanding the application scenarios and feasibility of the technology.

[0069] It should be noted that the preset training data set is carefully constructed according to the model training requirements. It includes input data and corresponding output data. The preset training data set is usually divided into several parts, including training set, validation set and test set. The training set is used to learn and adjust model parameters; the validation set is used to adjust the model's hyperparameters and evaluate the model's performance on unseen data to avoid overfitting; the test set is used for independent evaluation of the final model performance;

[0070] Through the above steps, the gradient compression strategy is used to optimize the communication bandwidth and video memory usage, thereby improving the training efficiency. At the same time, during the iterative training process, the preset adjustment strategy is used to gradually enhance the model's adaptability to the training data, thereby optimizing the model's performance, which not only accelerates the model's training speed, but also improves the model's generalization ability and stability.

[0071] S3: updating the initial large language model based on the target large language model parameters to obtain a target large language model.

[0072] Specifically, the parameters of the target large language model obtained through iterative training represent the optimal solution or approximate optimal solution of the model on the current training data. It is essentially an optimization and upgrade of the initial large language model, which can significantly improve the prediction accuracy and generalization ability of the initial large language model on specific tasks. The strategy based on parameter update simplifies the complexity of model maintenance and version control, facilitates the deployment and update of the model, and reduces long-term operation and maintenance costs.

[0073] It should be noted that as training progresses, the update of model parameters allows the model to gradually adapt to the characteristics of the training data, improves the model's adaptability to specific fields or tasks, and enhances the model's performance in specific scenarios; by updating parameters rather than retraining, the time required for model training is shortened and the model development cycle is accelerated.

[0074] Through the above steps, the initial large language model is updated according to the target large language model parameters obtained through iterative training and optimization processes, so that the updated target large language model performs better on the training data and has better generalization ability.

[0075] Through steps S1 to S3, based on the structure of the initial large language model, preset hyperparameters and video memory resources, a suitable gradient compression strategy is determined, which reduces the use of communication bandwidth and video memory occupancy and improves the training efficiency of the model. At the same time, through iterative training and optimization processes, combined with preset adjustment strategies, the adaptability of the initial large language model to the training data is gradually improved, and finally a target large language model with better generalization ability is obtained.

[0076] Based on the above first embodiment, a second embodiment of the deep learning model training method of the present application is proposed. Figure 2 , Figure 2 This is a schematic diagram of a sub-process in the second embodiment of the deep learning model training method of the present application.

[0077] like Figure 2 As shown, in this embodiment, step S2 includes:

[0078] S21: Determine a loss function based on the gradient compression strategy and the initial large language model;

[0079] Specifically, the loss function provides a numerical evaluation indicator to measure the difference or error between the model's predicted output and the actual target. The loss function is not only used in the training process, but also used to evaluate the performance of the model on the validation set or test set. The gradient compression strategy significantly alleviates the pressure on network bandwidth and improves training efficiency by reducing the amount of data that needs to be transmitted. The gradient compression strategy significantly alleviates the pressure on network bandwidth and improves training efficiency by reducing the amount of data that needs to be transmitted.

[0080] It should be noted that the loss function combined with the gradient compression strategy can control the amplitude of gradient updates while maintaining the efficiency of model learning, prevent gradient explosion or disappearance, and thus ensure the stability and convergence of model training; gradient compression reduces unnecessary calculations, especially when the gradient is sparse, only non-zero gradients are involved in the update, reducing the overall computational burden and making more efficient use of limited computing resources.

[0081] Through the above steps, the technical solution based on gradient compression strategy and initial large language model to determine the loss function effectively solves the problems of communication bandwidth and video memory management in distributed deep learning training, improves training efficiency, optimizes resource utilization, and maintains the training stability and performance level of the model.

[0082] S22: Determine the gradient value of the loss function based on the training set in the preset training data;

[0083] Specifically, during the model training process, the direction of parameter update needs to be clear so that the model can gradually approach the optimal solution. By calculating the gradient value of the loss function to the model parameters, the direction of parameter update can be determined, that is, the parameters are updated in the direction of gradient descent. For complex models such as deep neural networks, it is very difficult to directly optimize the loss function due to the large number of parameters and their interdependence. By calculating the gradient value of the loss function and using optimization algorithms such as gradient descent, the model parameters can be gradually adjusted so that the model can gradually approach the optimal solution.

[0084] It should be noted that model training also needs to consider the learning rate, that is, the step size of each parameter update. The size of the gradient value can reflect the rate of change of the current position loss function, so it can be used as an important basis for adjusting the learning rate. By selecting an appropriate learning rate multiplied by the gradient value, the step size of each parameter update can be controlled to avoid too fast or too slow learning speed.

[0085] Through the above steps, the model can gradually optimize parameters along the gradient descent direction during the training process, thereby effectively reducing the prediction error and improving the model's fit and generalization ability on the training data.

[0086] Specifically, by updating parameters along the gradient direction, the model can converge to a better solution more quickly within a fewer number of iterations, saving computing resources and time. The model is continuously optimized based on the gradient, which accelerates the model training process and improves the quality of the final model.

[0087] S23: constructing a target matrix based on the gradient value;

[0088] Specifically, construct a target matrix (Hessian matrix, Jacobian matrix or cumulative form of gradient), and use the efficiency of matrix operations to converge to a certain value more quickly in high-dimensional parameter space; use the target matrix to find more accurate parameter estimates, reduce the number of iterations, and improve the generalization ability of the model; matrix expressions and operations can sometimes introduce additional regularization terms or constraints to help prevent overfitting and increase the stability and robustness of model training.

[0089] It should be noted that constructing the target matrix converts the original optimization problem into a matrix operation problem, making the solution process more efficient and accurate, and utilizing the efficiency of matrix operations to process high-dimensional data, reduce computational complexity, and improve the efficiency of solving optimization problems.

[0090] Through the above steps, constructing the target matrix is ​​helpful to guide the update of model parameters. By adjusting the weights through the optimization algorithm, the model prediction is closer to the actual label, thereby improving the overall prediction performance and task solving ability.

[0091] S24: performing diagonal estimation on the target matrix to obtain parameter increments;

[0092] Specifically, by considering only diagonal elements, memory usage is significantly reduced; through diagonal estimation, parameter increments can be quickly obtained, which speeds up the calculation process of each iteration and makes model training more efficient. Diagonal estimation simplifies the matrix structure and helps to improve the numerical stability of the algorithm.

[0093] It should be noted that an unbiased estimator is used for diagonal estimation.

[0094] Specifically, the unbiased estimator is: ,in is a random vector drawn from a standard normal distribution, is the loss function About parameters The Hessian matrix of Represents element-wise product.

[0095] Through the above steps, the diagonal estimation of the target matrix is ​​performed and the parameter increment is obtained, the model parameters are optimized, and the model is promoted to converge quickly to the optimal solution, thereby improving the training efficiency and model accuracy.

[0096] S25, obtaining the target large language model parameters according to the initial parameters of the initial large language model and the parameter increment;

[0097] Specifically, the initial parameters are combined with parameter increments to calculate the target large language model parameters, thereby improving the accuracy of parameter updates. Parameter increments are accumulated and model parameters are updated to achieve precise adjustment of complex model parameters, which is conducive to solving the problem of difficult parameter adjustment that may arise in the training process of complex models and improving model performance.

[0098] It should be noted that by accumulating parameter increments and updating model parameters in each iteration step, the stability and convergence of the training process can be ensured; this helps to avoid oscillation and divergence during training and improve the training effect of the model.

[0099] Through the above steps, the target large language model parameters obtained by combining the initial large language model parameters with the parameter increment are upgraded from the initial state to a better state, which significantly improves the model's prediction ability and generalization performance on specific tasks.

[0100] Through steps S21 to S25, the loss function and gradient value are determined, and the parameter updating strategy is optimized to improve the training efficiency of the model; by adopting a precise parameter updating strategy, the model can learn the intrinsic laws of the data more accurately, thereby improving the performance of the model; constructing the target matrix and performing diagonal estimation can efficiently process a large amount of data with limited computing resources, so that the model can be trained on large-scale data sets and obtain good performance.

[0101] Based on the first embodiment, in this embodiment, after step S25, the following steps are further included:

[0102] S25A: decomposing the parameter increment to obtain a plurality of factors;

[0103] Specifically, it may be very difficult to directly optimize all model parameters because the mutual influence between parameters may cause the optimization process to fall into local optimality or overfitting. Therefore, decomposing parameter increments into multiple factors can refine the optimization objectives. In the case of limited resources, if it is not possible to effectively identify which parameters have the greatest impact on model performance, resources will be wasted on parameters that contribute less to the model. Decomposing model parameter increments helps identify key factors and optimize resource allocation.

[0104] It should be noted that by decomposing parameter increments into interpretable factors, the transparency and interpretability of the model can be enhanced. The high coupling between parameters causes the model to perform well on training data but poor generalization ability on new data. Decomposing increments can help identify and reduce this coupling and improve the generalization performance of the model.

[0105] Through the above steps, the parameter increments are refined into multiple independent or interrelated factors, which provides more fine-grained control for subsequent model adjustment or optimization and enhances the interpretability of the model and the flexibility of tuning.

[0106] S25B: Iteratively train the multiple factors to obtain adjustment values ​​of the parameter increments;

[0107] Specifically, iterative training of the decomposed multiple factors can more accurately determine the specific value that each parameter should be adjusted to improve the accuracy of optimization; iterative training of multiple factors to obtain the adjustment value of the parameter increment and achieve gradual adjustment of the model parameters can carefully monitor the changes in model performance and promptly stop further optimization of factors that begin to cause overfitting, thereby maintaining the generalization ability of the model.

[0108] It should be noted that decomposing the parameter increment into multiple factors for iterative training allows resources to be concentrated in each iteration to solve smaller-scale problems, accelerate the local convergence process, improve the stability of training, and avoid performance fluctuations caused by large parameter changes. Replacing training factors instead of the entire parameter set can reduce the computing resources required for each iteration to a certain extent, especially in distributed or parallel computing environments, and can more efficiently allocate computing tasks.

[0109] By iteratively training multiple factors through the above steps, the adjustment value of the parameter increment can be gradually optimized and accurately calculated, the accuracy and efficiency of the model parameter update can be improved, and the performance of the model can be enhanced.

[0110] S25C: Adjust the target large language model parameters based on the adjustment value.

[0111] Specifically, the parameter update based on the adjustment value solves the problem of inaccurate model parameter optimization, making the parameters closer to the optimal configuration; the adjustment value obtained by iterative training guides the parameter update, which can more efficiently drive the model to evolve to a state with better performance, saving computing resources and time.

[0112] It should be noted that parameter fine-tuning of adjustment values ​​can help balance the two and improve the model's generalization ability on training data and new data. Detailed adjustment steps and basis can enhance the transparency of the model, making the logic behind parameter changes clearer, which is conducive to improving the optimization efficiency of the model.

[0113] Through the above steps, accurate adjustment of the parameters of the target large language model is achieved by precisely applying the adjustment values, thereby improving the adaptability and optimization efficiency of the model.

[0114] Through steps S25A to S25C, the parameters of the target large language model are divided into multiple sub-datasets, making the parameter management more refined; since the parameters are divided into multiple sub-datasets, the parameters of each sub-dataset can be optimized in parallel, greatly speeding up the optimization process; through decoupling, the parameters of the initial large language model are updated to values ​​that are more suitable for specific tasks and data distribution, improving the accuracy and generalization ability of the model. Dividing the model parameters into multiple sub-datasets and decoupling them makes the model structure more flexible.

[0115] Based on the above first embodiment, in this embodiment, step S21 includes:

[0116] S211, constructing a low-rank parameter matrix based on the gradient compression strategy and the parameters of the initial large language model;

[0117] Specifically, constructing a low-rank parameter matrix can significantly reduce the number of model parameters, thereby reducing computational complexity and accelerating the training and inference process. The low-rank representation reduces the required memory, making the model more suitable for embedded systems. The gradient compression strategy combined with the low-rank parameter representation can effectively reduce the volume of gradient information, making gradient synchronization in a distributed training environment more efficient and alleviating communication bottlenecks.

[0118] It should be noted that the low-rank matrix removes redundancy through dimensionality reduction, captures the core features of the model with fewer parameters, reduces over-parameterization, and reduces the size of the model, making gradient calculations faster, improving iteration speed, and improving model training efficiency; the low-rank matrix is ​​combined with the gradient compression strategy to reduce the amount of calculation, and the model training and reasoning process becomes faster.

[0119] Through the above steps, a low-rank parameter matrix is ​​constructed, the number of parameters is reduced, and the model complexity is reduced, thereby improving the computational efficiency and storage efficiency of the model. The model based on the low-rank parameter matrix can better adapt and generalize to unseen data, thereby improving the generalization ability of the model.

[0120] S212, splitting the low-rank parameter matrix;

[0121] Specifically, splitting the low-rank parameter matrix can split it into smaller blocks, which is convenient for parallel processing in multi-core CPUs, GPUs or distributed systems, reducing computing delays and communication costs. The split small matrix makes the optimization problem more localized, facilitates the use of more effective optimization algorithms, and increases the probability of finding excellent solutions. Different sub-matrices contain different importance and complexity information. After splitting, a more suitable optimization algorithm or processing strategy can be selected according to the characteristics of the sub-matrix; splitting the matrix makes it possible to more specifically select the sub-matrix that needs to be updated for iteration, rather than traversing the entire parameter matrix each time, thereby improving iteration efficiency.

[0122] It should be noted that splitting a large low-rank parameter matrix into multiple sub-matrices can make the processing tasks of each sub-matrix independent, shortening the time for model training and verification; the split small matrices can be loaded and processed separately, reducing the demand for memory resources, so that large models can be processed even in resource-constrained environments, and splitting the rank matrix can ensure that each sub-matrix is ​​suitable for processing in the memory of a single node, avoiding frequent disk swaps, improving the overall processing speed, and being able to carefully analyze the impact of each sub-matrix on the model output, thereby improving the interpretability and debugging efficiency of the model.

[0123] Through the above steps, splitting the low-rank parameter matrix can further decompose the model parameters into multiple smaller sub-matrices or components, which is conducive to more refined management and operation of the model parameters. Splitting the low-rank parameter matrix can decompose the originally complex computing task into multiple relatively simple sub-tasks. Parallel processing of these sub-tasks can significantly improve computing efficiency.

[0124] S213, performing singular value decomposition processing on the split low-rank parameter submatrix to obtain spatial data;

[0125] Specifically, singular value decomposition (SVD) is performed on the segmented sub-matrices to reduce computational complexity and storage requirements; singular value decomposition can extract the main features in the data, while removing noise and redundant information and improving data quality. The spatial data obtained through singular value decomposition is conducive to the model to better capture the complex structure and internal connections in the data and improve the representation ability of the model.

[0126] It should be noted that singular value decomposition (SVD) can decompose the split low-rank parameter submatrix into the product of left singular vectors, singular values ​​and right singular vectors, where the singular values ​​and the corresponding left and right singular vectors carry the main information of the matrix. Since the matrix after singular value decomposition is usually smaller than the original matrix, the storage space requirement can be significantly reduced.

[0127] Through the above steps, the low-rank parameter submatrix singular value decomposition (SVD) is performed to decompose the split low-rank parameter submatrix into three smaller matrices. By retaining only the larger singular values, the amount of calculation can be significantly reduced, the computational complexity can be reduced, and the accuracy and reliability of data processing can be improved.

[0128] S214, determining a tensor based on the spatial data;

[0129] Specifically, by determining tensors based on spatial data, complex data structures can be converted into simple tensor forms, thereby reducing computational complexity, speeding up data processing and improving the responsiveness of the system. Moreover, as a high-order data structure, tensors can capture and express deeper data features and patterns, enhancing the model's ability to learn complex data distributions and improving the model's accuracy and generalization performance.

[0130] It should be noted that tensors, as a natural representation of multidimensional data, can completely retain the structure and characteristics of spatial data. Determining tensors based on spatial data promotes the effective fusion of data of different modalities and improves the performance of cross-modal learning tasks.

[0131] Through the above steps, it is possible to achieve efficient representation of multidimensional data, effectively capture the complex structure and intrinsic connections in the data, and further enhance the representation ability of the model.

[0132] S215, determining a loss function based on the tensor.

[0133] Specifically, as a high-order data structure, tensors can select appropriate loss functions and optimization strategies to accelerate the convergence process of the model and reduce the training time and computing resource requirements.

[0134] It should be noted that the loss function quantifies the difference between the model's predicted value and the true value into a numerical value, so that the performance of the model can be objectively measured.

[0135] Through the above steps, the difference between the model prediction and the real data can be accurately measured, which provides a clear goal and direction for model optimization. By accurately quantifying and minimizing the prediction error, the model can fit the data more accurately.

[0136] Through steps S211 to S215, the parameter space is compressed to reduce the computing and storage requirements in the model training and inference process, thereby improving computing efficiency; the complex loss function is converted into a low-rank parameter matrix to reduce redundant information in the parameter space, reduce the risk of model overfitting, and make the optimization process more efficient and stable; by optimizing the representation of the parameter space, the model can more accurately capture the inherent laws and structures of the data, thereby improving its performance on the training set and the test set.

[0137] See also Figure 3 , Figure 3 This is another sub-process diagram in the second embodiment of the deep learning model training method of the present application.

[0138] like Figure 3 As shown, based on the above first embodiment, in this embodiment, step S22 includes:

[0139] S221, dividing the training set into multiple training samples;

[0140] Specifically, loading a large data set into memory at one time may exceed the system's memory capacity, resulting in a memory overflow error. Splitting the training set into multiple small batches or single samples for processing can significantly reduce memory usage and enable model training to be successful in an environment with limited resources. Processing data in batches is conducive to optimizing the model and improving the quality of model training.

[0141] It should be noted that the training set is divided into multiple training samples to achieve small batch processing of data. Small batch processing of data can better utilize computing resources. Each processor or computing node can independently process a small batch of data to achieve parallel computing, thereby accelerating the entire training process.

[0142] Through the above steps, the randomness of small batch training helps the model learn the overall characteristics of the data, reduce overfitting on specific data subsets, and enhance the model's generalization ability on new data.

[0143] S222, performing forward calculation on the training sample based on the neural network model to obtain a gradient prediction value;

[0144] Specifically, forward calculation enables the model to process input data based on current parameters and generate predicted outputs. This is the basis for evaluating the current performance of the model, that is, by comparing the predicted gradient value with the true gradient value, the model error can be quantified to guide subsequent parameter adjustments; the difference between the predicted gradient value and the true gradient value is the basis for back propagation and weight update. Without forward calculation, the loss function cannot be calculated and the model learning cannot be driven.

[0145] It should be noted that forward propagation is the starting point of the model learning process. It transforms the input data into output predictions through layers of transformation, activating the entire learning mechanism. The comparison between the predicted gradient value obtained by forward calculation and the true gradient value forms a closed-loop feedback system, which enables the model to continuously receive signals about its prediction accuracy. The difference between the predicted gradient value and the true gradient value quantifies the current performance of the model. This quantified error is used to monitor the training process and help researchers or engineers understand the progress of model learning and existing problems. Based on the feedback of the predicted gradient value, the learning rate, optimizer settings, etc. can be dynamically adjusted to deal with different learning problems, such as gradient disappearance, overfitting or underfitting problems, to ensure that the model iterates in the optimization direction.

[0146] Through the above steps, the predicted output of the training samples is calculated, which establishes the basis for model performance evaluation and drives subsequent error optimization, thereby promoting the model's accurate fitting of the data and improving its generalization capabilities.

[0147] S223, performing a differential operation on the loss function based on the training sample to obtain a true value of the gradient;

[0148] Specifically, by calculating the gradient of the loss function with respect to the model parameters, that is, the partial derivative of the loss function with respect to each parameter, we can clearly point out the direction and magnitude of the adjustment of the model parameters. Automatic gradient calculation avoids the complexity and inefficiency of manually setting parameter update rules and speeds up the gradient calculation process.

[0149] It should be noted that accurate gradient information helps the optimization algorithm to quickly descend along the slope of the loss function, find local or global minima, and accelerate the convergence of the model. Gradient-guided parameter updates ensure that model parameters are adjusted in the direction of reducing prediction errors, which helps to improve the model's fit on training data and its generalization ability on test data. The automatic differentiation mechanism makes the design of models and loss functions more flexible, making it easy to try complex structures and loss forms without having to worry about gradient calculation problems, facilitating model innovation and optimization. Automatic differentiation simplifies the process of discovering and correcting gradient calculation errors and improves the optimization efficiency of the model.

[0150] Through the above steps, the loss function is differentiated on the training samples to obtain the true value of the gradient, so that the model can accurately adjust the parameters according to the change of the loss and optimize the model training.

[0151] S224, determining a gradient loss value based on the gradient prediction value and the gradient true value;

[0152] Specifically, the gradient loss value can quantify the difference between the gradient prediction value and the true value, thereby evaluating the accuracy of the gradient calculation of the model during training. When the gradient loss value is large, there is a large deviation between the gradient prediction value and the true value. At this time, this deviation can be reduced by adjusting the model structure, optimizing the algorithm and other strategies, thereby improving the accuracy of model training. The gradient loss value can be used as a monitoring indicator in the model training process to guide the adjustment of the training strategy. At the same time, by continuously reducing the gradient loss value, the model parameters can be updated more accurately, thereby improving the training effect of the model.

[0153] It should be noted that due to the introduction of the gradient loss value, the model can pay more attention to the accuracy of the gradient during the training process, thereby reducing the model training deviation caused by inaccurate gradients. This helps the model learn more accurate feature representations and improves the performance of the model on the test set; it enables the model to maintain good performance on unseen data, thereby enhancing the generalization ability of the model.

[0154] Through the above steps, by comparing the difference between the gradient prediction value and the true value, the error of the model in gradient prediction can be quantified, thereby guiding model optimization and improving the accuracy of training.

[0155] S225: Determine a gradient value of the loss function based on the gradient loss value.

[0156] Specifically, in deep learning model training, gradient is an important information for updating model parameters. However, the original gradient prediction value may not be accurate enough due to various factors. Using inaccurate gradients for parameter updates will lead to poor model training results. By adjusting the gradient based on the gradient loss value, the deviation between the gradient prediction value and the true value can be reduced, thereby improving the stability of model training.

[0157] It should be noted that the gradient of the training sample is determined by the gradient loss value, so that the model can converge to the optimal solution faster during the training process, further improve the performance of the model, reduce the training time and computing resource consumption, and adjust the gradient based on the gradient loss value. The model can reduce the deviation caused by inaccurate gradient during the training process, thereby improving the performance of the model on the test set.

[0158] Through the above steps, the gradient loss value is back-propagated to adjust the model parameters to achieve more accurate gradient updates, thereby optimizing the model training process and improving the model's performance and generalization ability.

[0159] Through steps S221 to S225, the training efficiency is effectively improved by dividing the training set into multiple training samples and using the neural network model to perform forward calculations on the training samples; at the same time, the gradient loss value is determined by comparing the gradient prediction value predicted by the neural network model and the gradient true value obtained by differential operation, which accurately reflects the performance of the model during the training process. Based on the gradient loss value, the gradient value of the loss function is calculated to guide the parameter update and optimization process of the model, which improves the accuracy and stability of the gradient calculation, and also helps to optimize the training process of the model so that the model can converge to the optimal solution faster.

[0160] See also Figure 4 , Figure 4 This is a schematic diagram of a sub-process in the third embodiment of the deep learning model training method of the present application.

[0161] like Figure 4 As shown, in this embodiment, step S24 includes:

[0162] S241: extracting diagonal elements of the target matrix;

[0163] Specifically, extracting diagonal elements greatly reduces the amount of computation and storage requirements, especially when performing gradient updates or second-order optimization, which can speed up the execution of the algorithm; processing diagonal elements can reduce memory usage, allowing the algorithm to run in an environment with limited memory.

[0164] It should be noted that diagonal elements often contain key information about gradients or curvatures, while ignoring non-diagonal elements can simplify the complexity of the problem, making the algorithm easier to implement and understand; and non-diagonal elements may introduce noise or redundant information. Especially when the data is sparse, focusing on diagonal elements helps to focus on the most important parameter updates, eliminate interference, and improve model optimization efficiency.

[0165] Through the above steps, the diagonal elements of the target matrix are extracted to ensure the model performance while optimizing the use of computing resources and improving the transportation efficiency of the algorithm.

[0166] S242: constructing an intermediate matrix based on the diagonal elements;

[0167] Specifically, using diagonal elements to construct the intermediate matrix can significantly reduce the amount of calculation while retaining key information, reducing the amount of calculation, thereby improving the execution efficiency of the algorithm. The parameter increment obtained based on the intermediate matrix can accurately adjust the parameters of the model, so that the model better fits the training data and improves the performance of the model.

[0168] It should be noted that the diagonal elements contain important information of the matrix, such as eigenvalues, variance, etc. Constructing an intermediate matrix based on the diagonal elements provides a basis for subsequent parameter updates or optimizations.

[0169] Through the above steps, we focus on the key information in the matrix, simplify the complexity of data processing, and retain important feature information, providing an accurate and efficient basis for subsequent model parameter updates and optimization.

[0170] S243: Obtain the parameter increment based on the intermediate matrix.

[0171] Specifically, in deep learning or optimization algorithms, the accuracy of parameter updates is crucial to the performance of the model. By obtaining parameter increments based on the intermediate matrix, the update direction and step size of the parameters can be determined more accurately, reducing the oscillation of the model during training, accelerating the convergence of the model, and improving the performance of the model; as the accuracy of parameter updates and the efficiency of the optimization algorithm are improved, the performance of the model will also be improved accordingly, so that the model can better fit the training data and reduce overfitting or underfitting.

[0172] It should be noted that obtaining parameter increments based on the intermediate matrix can greatly simplify the calculation process, improve the efficiency of the optimization algorithm, and enable the model to adapt to data changes more quickly during training, thereby accelerating the model training process. The method of obtaining parameter increments based on the intermediate matrix has a certain degree of robustness against noise and outliers. Even if there are some noise or outliers in the original data, relatively accurate parameter increments can be obtained through calculation of the intermediate matrix, thereby ensuring the stability of the model.

[0173] Through steps S241 to S243, the intermediate matrix is ​​operated to obtain the model parameters, i.e., the parameter increment, so as to achieve accurate optimization of the model parameters and improve the training effect and performance of the model. The key information of the target matrix is ​​accurately captured and effectively utilized, so as to efficiently calculate and update the parameter increment of the model, enhance the adjustment and optimization capabilities of the model, and improve the execution efficiency and performance of the algorithm.

[0174] See also Figure 5 , Figure 5 This is another sub-process diagram in the third embodiment of the deep learning model training method of the present application.

[0175] like Figure 5 As shown, in this embodiment, step S3 includes:

[0176] S31: dividing the target large language model parameters into multiple sub-datasets;

[0177] Specifically, the target large language model parameters are divided into multiple sub-datasets so that different sub-datasets can be processed in parallel on different computing units, significantly shortening the training time. The segmentation of the target large language model parameters provides a basis for the algorithm to be customized according to the different characteristics or optimization requirements of the parameters, thereby improving the efficiency of model optimization.

[0178] It should be noted that by splitting the target large language model parameters into multiple sub-datasets, only part of the parameters need to be loaded into the memory each time, which reduces the peak memory usage and enables the model to run in a memory-constrained environment. The target large language model parameter segmentation treats the model as multiple modules, and each sub-dataset corresponds to a part of the model, which facilitates separate debugging and optimization of the model.

[0179] Through the above steps, the model parameters are subdivided to achieve independent management and optimization of different parts of the model, which improves the flexibility and efficiency of model training.

[0180] S32: Decoupling parameters of the initial large language model according to the multiple sub-datasets;

[0181] Specifically, the parameters of the initial large language model are decoupled based on the sub-datasets to reduce the mutual dependence between the parameters of the initial large language model, so that each parameter or parameter group can independently affect a part of the model, thereby improving the model training efficiency and the effective use of parameters. After the parameters of the initial large language model are decoupled, the parameters of each sub-dataset can be optimized more independently, reducing communication requirements and improving the efficiency of parallel and distributed training.

[0182] Furthermore, after the parameters of the initial large language model are decoupled, the optimization process can more easily find a global or better solution, because each sub-problem is relatively simple and independent, reducing obstacles in the optimization path; decoupling the parameters of the initial large language model helps the model learn simpler and more generalized feature representations, reduce the risk of overfitting, and improve the performance of the model on new data.

[0183] It should be noted that decoupling the parameters of the initial large language model refers to reducing the dependency between the internal parameters of the model during model training or optimization. Decoupling is to divide the parameter space into several subspaces. The parameters in each subspace work together on a specific function or feature of the model, while the impact between subspaces is minimized.

[0184] Through the above steps, the independent processing of sub-data sets realizes the decoupling of model parameters, decomposing the originally tightly coupled model parameters into relatively independent sub-parts, improving the accuracy and specificity of model parameter updates, and thus enhancing the performance and training efficiency of the model.

[0185] S33: Based on the decoupling result, updating the initial large language model to obtain the target large language model.

[0186] Specifically, the initial large language model is updated based on the decoupling results, the dependencies between parameters are reduced to a minimum, each parameter or parameter group is focused on the model, parameter redundancy and optimization are resolved, the clarity of the internal structure of the model is improved, and the role of each part is made clearer, thereby enhancing the interpretability of the model.

[0187] It should be noted that after decoupling, the features learned by the model are more general and independent, reducing the risk of overfitting and improving generalization performance; decoupling simplifies the interaction between parameters, making calculations more efficient, especially in parallel computing environments, where computing resources can be more fully utilized.

[0188] Through the above steps, the decoupling results are used to accurately update the parameters of the initial large language model, which effectively improves the performance of the target large language model and makes it more suitable for specific tasks and data distribution.

[0189] Through steps S31 to S33, the target large language model parameters are divided into multiple sub-datasets, and the parameters of the initial large language model are decoupled based on these sub-datasets, thereby achieving refined management and updating of the model parameters, thereby improving the training efficiency and accuracy of the target large language model.

[0190] The present application also provides a deep learning model training device, please refer to Figure 6 , Figure 6 This is a schematic diagram of the module structure of the deep learning model training device according to an embodiment of the present application, and the deep learning model training device includes:

[0191] A determination module 601 is used to determine a gradient compression strategy based on an initial large language model, preset hyperparameters, and video memory;

[0192] A training module 602 is used to iteratively train the initial large language model based on the gradient compression strategy and preset training data to obtain target large language model parameters;

[0193] The loading module 603 is used to update the initial large language model based on the target large language model parameters to obtain a target large language model.

[0194] The deep learning model training device provided by the present application adopts the deep learning model training method in the above embodiment, which can solve the technical problem of how to reduce the training cost and video memory occupancy of the deep learning model. Compared with the prior art, the beneficial effects of the deep learning model training device provided by the present application are the same as the beneficial effects of the deep learning model training method provided by the above embodiment, and the other technical features in the deep learning model training device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0195] The present application provides a deep learning model training device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the deep learning model training method in the above-mentioned embodiment one.

[0196] Reference below Figure 7, which shows a schematic diagram of the structure of a deep learning model training device suitable for implementing the embodiment of the present application. The deep learning model training device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The deep learning model training device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0197] like Figure 7 As shown, the deep learning model training device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the deep learning model training device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the deep learning model training device to communicate wirelessly or wired with other devices to exchange data. Although the figure shows a deep learning model training device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.

[0198] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0199] The deep learning model training device provided by the present application adopts the deep learning model training method in the above embodiment, which can solve the technical problem of how to reduce the training cost and video memory occupancy of the deep learning model. Compared with the prior art, the beneficial effects of the deep learning model training device provided by the present application are the same as the beneficial effects of the deep learning model training method provided by the above embodiment, and the other technical features in the deep learning model training device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0200] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0201] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0202] The present application provides a computer-readable storage medium having computer-readable program instructions (i.e., computer programs) stored thereon, and the computer-readable program instructions are used to execute the deep learning model training method in the above-mentioned embodiment.

[0203] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0204] The above-mentioned computer-readable storage medium may be included in the deep learning model training device; or it may exist independently without being assembled into the deep learning model training device.

[0205] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by a deep learning model training device, the deep learning model training device: determines a gradient compression strategy based on an initial large language model, preset hyperparameters and video memory; iteratively trains the initial large language model based on the gradient compression strategy and preset training data to obtain target large language model parameters, wherein, during the training process, based on a preset adjustment strategy, the adaptability of the initial large language model to the training data is gradually improved; and the initial large language model is updated based on the target large language model parameters to obtain a target large language model.

[0206] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0207] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0208] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0209] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned deep learning model training method, and can solve the technical problem of how to reduce the training cost and video memory occupancy of the deep learning model. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the deep learning model training method provided in the above-mentioned embodiment, and will not be repeated here.

[0210] The present application also provides a computer program product, including a computer program, which implements the steps of the deep learning model training method as described above when executed by a processor.

[0211] The computer program product provided in this application can solve the technical problem of how to reduce the training cost and video memory occupancy of deep learning models. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as the beneficial effects of the deep learning model training method provided in the above embodiment, which will not be repeated here.

[0212] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A deep learning model training method, applied to a large language model, characterized in that: include: Determine the gradient compression strategy based on the initial large language model, preset hyperparameters, and video memory; Constructing a low-rank parameter matrix based on the gradient compression strategy and the parameters of the initial large language model; Splitting the low-rank parameter matrix; Perform singular value decomposition on the split low-rank parameter submatrix to obtain spatial data; Based on the spatial data, determining a tensor; Based on the tensor, determining a loss function; Split the training set into multiple training samples; Based on the neural network model, forward calculation is performed on the training sample to obtain a gradient prediction value; Based on the training sample, performing a differential operation on the loss function to obtain a true value of the gradient; Determine a gradient loss value according to the gradient prediction value and the gradient true value; Determining a gradient value of the loss function according to the gradient loss value; Based on the gradient value, construct a target matrix; Extracting diagonal elements of the target matrix based on an unbiased estimator; constructing an intermediate matrix based on the diagonal elements; Obtaining the parameter increment based on the intermediate matrix; Obtaining target large language model parameters according to the initial parameters of the initial large language model and the parameter increment, wherein during the training process, based on a preset adjustment strategy, the adaptability of the initial large language model to the training data is gradually improved; Decomposing the parameter increment to obtain a plurality of factors; Iteratively training the multiple factors to obtain adjustment values ​​of the parameter increments; Adjusting the target large language model parameter based on the adjustment value; Splitting the target large language model parameters into multiple sub-datasets; Decoupling parameters of the initial large language model according to the multiple sub-datasets; Based on the decoupling result, the initial large language model is updated to obtain a target large language model.

2. A deep learning model training device, characterized in that: include: A determination module, used to determine a gradient compression strategy based on an initial large language model, preset hyperparameters, and video memory; A training module, used for constructing a low-rank parameter matrix based on the gradient compression strategy and the parameters of the initial large language model; segmenting the low-rank parameter matrix; performing singular value decomposition processing on the segmented low-rank parameter submatrix to obtain spatial data; Based on the spatial data, determine a tensor; based on the tensor, determine a loss function; divide the training set into multiple training samples; Based on the neural network model, forward calculation is performed on the training sample to obtain a gradient prediction value; based on the training sample, a differential operation is performed on the loss function to obtain a gradient true value; a gradient loss value is determined according to the gradient prediction value and the gradient true value; and a gradient value of the loss function is determined according to the gradient loss value; Based on the gradient value, construct a target matrix; Extracting diagonal elements of the target matrix based on an unbiased estimator; constructing an intermediate matrix based on the diagonal elements; obtaining the parameter increment based on the intermediate matrix; According to the initial parameters of the initial large language model and the parameter increment, the target large language model parameters are obtained, wherein during the training process, based on a preset adjustment strategy, the fitness of the initial large language model to the training data is gradually improved; the parameter increment is decomposed to obtain a plurality of factors; the plurality of factors are iteratively trained to obtain an adjustment value of the parameter increment; and the target large language model parameters are adjusted based on the adjustment value; A loading module is used to divide the target large language model parameters into multiple sub-data sets; decouple the parameters of the initial large language model according to the multiple sub-data sets; and update the initial large language model based on the decoupling result to obtain the target large language model.

3. A computer device, characterized in that: The device includes: a memory, a processor, and a deep learning model training program stored in the memory and executable on the processor, wherein the deep learning model training program is configured to implement the steps of the deep learning model training method as described in claim 1.

4. A storage medium, characterized in that: The storage medium stores a deep learning model training program, and when the deep learning model training program is executed by the processor, the steps of the deep learning model training method according to claim 1 are implemented.