Model training method and device, equipment, storage medium and program product

CN121745339APending Publication Date: 2026-03-27CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-15
Publication Date
2026-03-27

Smart Images

  • Figure CN121745339A_ABST
    Figure CN121745339A_ABST
Patent Text Reader

Abstract

The invention provides a model training method and device, equipment, a storage medium and a program product, and relates to the field of machine learning, and the method comprises the steps: carrying out the multi-round iteration training of a machine learning model through training data, and obtaining a trained machine learning model, the training data comprises at least one or more of text data, image data, audio data and video data; wherein any round of iterative training in the multiple rounds of iterative training comprises the following steps: determining initial model parameters of the next round based on training data of the current round; according to the state characteristics of the loss function of the current round, determining tail parameters required by model parameter optimization; generating a random disturbance obeying heavy tail distribution according to the tail parameter; and determining a target model parameter of the next round according to the initial model parameter and the random disturbance. According to the scheme, the convergence speed, generalization ability and robustness of the model can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of machine learning, and particularly relates to a model training method and device, equipment, a storage medium and a program product. BACKGROUND

[0002] With the continuous development of artificial intelligence technology, machine learning models are widely used in computer vision, natural language processing, speech recognition and other fields. The performance of a model depends on the optimal solution found by the model parameters during the training process. Model training is essentially a high-dimensional non-convex optimization problem, and the goal is to find a set of model parameters so that the loss function reaches a global optimum or a sufficiently good local minimum.

[0003] In related technologies, Stochastic Gradient Descent (SGD) and its variants are the most widely used model parameter optimization algorithm. The basic idea is to iteratively update the parameters in the direction opposite to the gradient of the loss function with respect to the current model parameters, in order to converge to a local minimum or global minimum of the loss function.

[0004] However, in practical applications, due to the extremely complex topography of the loss function of the machine learning model, there are a large number of local minimum points and saddle points. When updating the model parameters using SGD, it is easy to fall into some sharp local minima. Although the loss is very low in these regions, the loss value around them rises sharply, resulting in a model that is very sensitive to small perturbations in the input data, and thus poor generalization ability.

[0005] It should be noted that the information disclosed in the above background section is only used to strengthen the understanding of the background of the present disclosure, and therefore can include information that does not constitute prior art known to those of ordinary skill in the art. SUMMARY

[0006] The present disclosure provides a model training method, device, equipment, storage medium and program product, which at least partially overcomes the technical problem of poor generalization ability of a model trained by using the SGD algorithm in related technologies, which is very sensitive to small perturbations in the input data.

[0007] Other characteristics and advantages of the present disclosure will become apparent from the following detailed description, or will be learned by practice of the present disclosure.

[0008] According to one aspect of this disclosure, a model training method is provided, comprising: performing multiple rounds of iterative training on a machine learning model using training data to obtain a trained machine learning model, wherein the training data includes at least one or more of the following: text data, image data, audio data, and video data; wherein, the iterative training of any round in the multiple rounds of iterative training includes: determining the initial model parameters for the next round based on the training data of the current round; determining the tail parameters required for model parameter optimization based on the state characteristics of the loss function of the current round; generating a random perturbation following a heavy-tailed distribution based on the tail parameters; and determining the target model parameters for the next round based on the initial model parameters and the random perturbation.

[0009] In some embodiments, determining the target model parameters for the next round based on the initial model parameters and random perturbations includes: generating a scaling factor based on the tail parameters and the learning rate of the current round, wherein the scaling factor is exponentially related to the learning rate of the current round, and the exponent of the learning rate is the reciprocal of the tail parameters; and determining the target model parameters for the next round based on the initial model parameters and the product of the random perturbations and the scaling factor.

[0010] In some embodiments, the target model parameters for the next round are determined by the following formula:

[0011] in, The target model parameters for the next round, These are the model parameters for the current round. The learning rate for the current round. The gradient of the loss function for the current round. For the training data of the current round, This represents the prediction result for the current round; The tail parameters required to update the model parameters For random perturbations that follow a heavy-tailed distribution, This indicates the initial model parameters for the next round.

[0012] In some embodiments, the heavy-tailed distribution includes a Lévy α-stable distribution, and the tail parameter is a hyperparameter of the Lévy α-stable distribution; generating a random perturbation that follows a heavy-tailed distribution based on the tail parameter includes: sampling from the Lévy α-stable distribution to obtain a random perturbation that follows a heavy-tailed distribution based on the tail parameter.

[0013] In some embodiments, the state characteristics of the loss function include the sharpness of the loss function; determining the tail parameters required for model parameter optimization based on the state characteristics of the loss function in the current round includes: performing nonlinear processing on the sharpness of the loss function in the current round; increasing the sharpness of the nonlinearly processed loss function by a set value to obtain an estimate of the tail parameters required for model parameter optimization; and smoothly updating the estimate of the tail parameters to obtain the tail parameters required for model parameter optimization.

[0014] In some embodiments, the method further includes: calculating the largest eigenvalue of the Hessian matrix of the loss function for the current round; and smoothing the largest eigenvalue using an exponential moving average algorithm to obtain the sharpness of the loss function for the current round.

[0015] In some embodiments, the largest eigenvalue of the Hessian matrix is ​​obtained by estimating the trace of the Hessian matrix.

[0016] In some embodiments, the state characteristics of the loss function include the largest eigenvalue of the Hessian matrix of the loss function; when the largest eigenvalue of the Hessian matrix is ​​in the rising phase, the tail parameter is a first value; when the largest eigenvalue of the Hessian matrix is ​​in the stable phase, the tail parameter is a second value, wherein the first value is less than the second value.

[0017] According to another aspect of this disclosure, a model training apparatus is also provided, comprising: a training module for performing multiple rounds of iterative training on a machine learning model using training data to obtain a trained machine learning model, wherein the training data includes at least one or more of the following: text data, image data, audio data, and video data; wherein the training module includes: an initial model parameter determination unit for determining the initial model parameters for the next round based on the training data of the current round; a tail parameter determination unit for determining the tail parameters required for model parameter optimization based on the state characteristics of the loss function of the current round; a random perturbation generation unit for generating a random perturbation following a heavy-tailed distribution based on the tail parameters; and a model parameter update unit for determining the target model parameters for the next round based on the initial model parameters and the random perturbation.

[0018] According to another aspect of this disclosure, an electronic device is also provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform a model training method of any of the above via executing the executable instructions.

[0019] According to another aspect of this disclosure, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed by a processor, implements the model training method described in any of the preceding claims.

[0020] According to another aspect of this disclosure, a computer program product is also provided, comprising: a computer program or instructions that, when executed by a processor, implement the model training method described in any of the preceding claims.

[0021] The model training methods, apparatus, devices, storage media, and program products provided in the embodiments of this disclosure obtain a trained machine learning model by performing multiple rounds of iterative training on a machine learning model using training data. The training data includes at least one or more of the following: text data, image data, audio data, and video data. Each round of iterative training includes: determining the initial model parameters for the next round based on the training data of the current round; determining the tail parameters required for updating the model parameters based on the state characteristics of the loss function of the current round; generating a random perturbation following a heavy-tailed distribution based on the tail parameters; and determining the target model parameters for the next round based on the initial model parameters and the random perturbation. This scheme injects heavy-tailed distribution noise when optimizing model parameters using the SGD algorithm and adaptively adjusts the tail parameters of the heavy-tailed distribution according to the state characteristics of the loss function to match the sharpness changes of the loss function landscape during training. This solves the problem that optimization algorithms such as SGD are prone to getting trapped in sharp local minima and have insufficient model generalization ability in the prior art, thereby improving the model's convergence speed, generalization ability, and robustness.

[0022] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0023] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0024] Figure 1 This diagram illustrates an application system architecture according to an embodiment of the present disclosure. Figure 2 This diagram illustrates a model training method flowchart according to an embodiment of the present disclosure; Figure 3 A flowchart illustrating the method for determining the target model parameters in the next round in an embodiment of this disclosure is shown. Figure 4 This diagram illustrates another model training method flowchart in an embodiment of the present disclosure; Figure 5 This diagram illustrates a flowchart of the loss function sharpness determination method in an embodiment of this disclosure. Figure 6This diagram illustrates a model training apparatus according to an embodiment of the present disclosure. Figure 7 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation

[0025] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided so that this disclosure will be more comprehensive and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0026] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0027] To facilitate understanding, before introducing the embodiments of this disclosure, the following explanations are provided for several terms involved in the embodiments of this disclosure: Lévy α-stable distribution: The Lévy stable distribution family is a class of stable distributions with heavy-tailed characteristics. Its most significant feature is that it has infinite variance, which means that its distribution tail decays more slowly than that of the Gaussian distribution, i.e., heavy-tailed characteristics. It can more effectively describe and predict extreme events. The characteristic function of the Lévy stable distribution family is shown in Equation (1).

[0028] (1)

[0029] in, , , , These are the stability index, skewness parameter, scale parameter, and location parameter. (Fixed) , , Only change The distribution of is called the Lévy α-stable distribution, where α takes values ​​in the range (0, 2). When α is 2, the distribution degenerates into a Gaussian distribution. t represents the variable and i represents the imaginary part.

[0030] The specific implementation methods of the embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.

[0031] Figure 1 A schematic diagram of an exemplary application system architecture to which the model training methods of the embodiments of this disclosure can be applied is shown. For example... Figure 1 As shown, the system architecture may include a terminal 101, a network 102, and a server 103.

[0032] Terminal 101 can be various electronic devices, including but not limited to smartphones, tablets, laptops, desktop computers, smart speakers, smartwatches, wearable devices, augmented reality devices, virtual reality devices, etc.

[0033] Optionally, the client of the application installed on different terminals 101 may be the same, or the client of the same type of application based on different operating systems. Depending on the terminal platform, the specific form of the application client may also be different; for example, the application client may be a mobile client, a PC client, etc.

[0034] Network 102 is a medium used to provide a communication link between terminal 101 and server 103, and can be a wired network or a wireless network.

[0035] Optionally, the aforementioned wireless or wired networks use standard communication technologies and / or protocols. The network is typically the Internet, but can also be any network, including but not limited to Local Area Networks (LANs), Metropolitan Area Networks (MANs), Wide Area Networks (WANs), mobile, wired or wireless networks, private networks, or any combination of virtual private networks. In some embodiments, technologies and / or formats including Hyper Text Markup Language (HTML), Extensible Markup Language (XML), etc., are used to represent data exchanged over the network. Furthermore, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Networks (VPNs), and Internet Protocol Security (IPSec) can be used to encrypt all or some links. In other embodiments, custom and / or dedicated data communication technologies can be used to replace or supplement the aforementioned data communication technologies.

[0036] Server 103 can be a server that provides various services, such as a backend management server that supports the device operated by the user using terminal 101. The backend management server can analyze and process received requests and other data, and then feed the processing results back to the terminal.

[0037] Optionally, the server can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0038] Those skilled in the art will know that Figure 1 The number of terminals, networks, and servers shown is merely illustrative; any number of terminals, networks, and servers can be used as needed. This disclosure does not limit the scope of the embodiments.

[0039] Under the above system architecture, this disclosure provides a model training method that can be executed by any electronic device with computing power.

[0040] In some embodiments, the model training method provided in this disclosure can be executed by the terminal of the above-described system architecture; in other embodiments, the model training method provided in this disclosure can be implemented by the terminal and the server in the above-described system architecture through interaction.

[0041] Figure 2 This diagram illustrates a model training method flowchart according to an embodiment of the present disclosure, such as... Figure 2 As shown, the model training method provided in this embodiment includes step S200.

[0042] In step S200, the machine learning model is trained through multiple rounds of iteration using the training data to obtain a trained machine learning model. The training data includes at least one or more of the following: text data, image data, audio data, and video data.

[0043] Machine learning models can be understood as mathematical models that automatically learn patterns or rules from training data through algorithms, enabling them to predict, classify, identify, or perform other decision-making tasks on new input data. These machine learning models include, but are not limited to, neural networks, decision trees, support vector machines, and generative adversarial networks. This embodiment uses a deep neural network as an example for explanation.

[0044] A well-trained machine learning model refers to a final model whose parameters have been optimized after multiple rounds of iterative training, enabling it to achieve the expected performance level on a specified task and be used for actual inference or prediction. Multiple rounds of iterative training refer to the process of repeatedly training a machine learning model. In each epoch, the model typically traverses all or part of the training data, adjusting its internal parameters based on the error between the predicted results and the true labels.

[0045] Training data refers to a structured or unstructured collection of data used to train a machine learning model. In supervised training, training data includes input samples and their corresponding expected outputs. In self-supervised training, training data includes input samples, and in this training method, the model needs to automatically construct supervisory signals from unlabeled input samples.

[0046] In this scheme, the training data includes at least one of the following types: text data, image data, audio data, and video data.

[0047] Text data refers to sequential data composed of characters, words, sentences, etc., such as documents, conversation logs, and web page content. Image data consists of two-dimensional or three-dimensional digital images composed of pixels, such as photographs, scanned documents, and remote sensing images. Audio data refers to digital waveform or spectrum data representing sound signals, such as voice recordings, music, and ambient sounds. Video data refers to multimedia data composed of a continuous sequence of image frames, which may contain associated audio streams, such as surveillance footage, film and television content, and live streaming media.

[0048] In one possible implementation, machine learning models trained on video data can analyze the visual sequences and audio tracks of videos to perform complex event detection, sentiment analysis, or automatically generate video summaries; machine learning models trained on text data can automatically generate text summaries, high-fidelity images, etc.; and machine learning models trained on audio data can directly process raw audio waveforms to achieve speech recognition, speaker separation, speech synthesis, etc.

[0049] In one possible implementation, the training data can be multimodal data, such as machine learning models trained using image and radar fusion data, which can process fusion data from multiple cameras and LiDAR to perform high-level environmental perception tasks such as lane line detection, traffic sign recognition, and pedestrian and vehicle tracking in real time.

[0050] In one possible implementation, the deep neural network is trained through multiple rounds of iterative training using training data, which mainly includes four steps: data preparation, forward propagation and feature learning, back propagation and parameter optimization, and iterative convergence.

[0051] Data preparation: Convert the raw training data into a tensor format that can be processed by deep neural networks. For example, text embeddings are vector sequences, images are represented as pixel value matrices, and audio is converted into spectrograms.

[0052] Forward propagation and feature learning: In each training round, training data starts from the input layer and passes through the deep neural network layer by layer. Each layer automatically learns and extracts hierarchical features from the training data, such as: from the edges of an image to the local features of an object, and then to the overall semantics; or from the characters of a text to the words, and then to the meaning of the sentence.

[0053] Backpropagation and parameter optimization: The predicted results output by the deep neural network are compared with the true labels to calculate the loss function value. Then, this loss value is passed layer by layer from the output layer to the input layer through the backpropagation algorithm, and the weights and bias parameters of each neuron in each layer are updated using gradient descent to minimize the loss function.

[0054] Iterative convergence: The above process is repeated multiple times. As the iteration proceeds, the feature representations learned by the deep neural network are continuously refined, and the performance of the model on the training task gradually improves and tends to stabilize, ultimately obtaining a well-trained deep neural network model with good generalization ability.

[0055] In the process of backpropagation and parameter optimization, stochastic gradient descent and its variants are usually used to optimize the model parameters. However, the stochastic gradient descent algorithm has the following technical characteristics: 1) Prone to sharp local minima: The loss function landscape of deep learning is extremely complex, containing numerous local minima and saddle points. When using SGD to update model parameters, it is easy to get trapped in some sharp local minima. Although these regions have low loss on the training set, the loss value around them rises sharply, making the model very sensitive to small perturbations in the input data and resulting in poor performance when generalizing to unseen data. Converging to broad and flat local minima helps improve the model's generalization ability.

[0056] 2) Sensitive to initialization: The final performance of SGD depends heavily on the initial values ​​of the model parameters. Poor initialization (e.g., all-zero initialization) can lead to vanishing or exploding gradients, making the model unable to converge at all.

[0057] 3) The assumption about the gradient noise distribution is inaccurate: To help the optimizer escape local minima, Gaussian noise can be injected into the gradient updates. The theoretical basis for this approach is the central limit theorem, which assumes that the randomness of the gradient follows a Gaussian distribution. However, when training deep neural networks, the gradient noise of SGD actually exhibits heavy-tailed characteristics and is better described using a Lévy α-stable distribution. Compared to Gaussian noise, heavy-tailed noise allows for occasional large jumps, providing a greater ability to explore complex loss function terrains.

[0058] 4) The stability edge phenomenon is not being utilized: An important empirical observation during neural network training is the stability edge phenomenon. Specifically, the curvature of the loss function's terrain increases continuously in the early stages of training, and then reaches a dynamic equilibrium plateau near a threshold related to the learning rate (approximately 2 / η).

[0059] Based on the technical characteristics of the stochastic gradient descent algorithm, this scheme optimizes the stochastic gradient descent algorithm; in other words, it optimizes the backpropagation and parameter optimization process in the iterative training of the model.

[0060] It should be noted that the machine learning model needs to undergo multiple rounds of iterative training to obtain a well-trained machine learning model. Therefore, each round of iterative training process adopts the scheme described in steps S202-S208 for iterative processing. The following embodiments only describe the iterative training process of one round in detail, and will not discuss the iterative training process of multiple rounds in detail.

[0061] Specifically, any round of iterative training in the multi-round iterative training includes steps S202-S208.

[0062] In step S202, the initial model parameters for the next round are determined based on the training data of the current round.

[0063] In machine learning model training, the gradient is a vector whose components are the partial derivatives of the loss function with respect to each model parameter. The gradient indicates the direction and magnitude by which each model parameter should be adjusted to increase the loss given the current model parameters; therefore, the negative gradient direction usually points in the direction of the decrease in the loss function.

[0064] In one possible implementation, a batch of training data (e.g., a batch of images, a piece of text) sampled in the current iteration is input into the machine learning model. The training data flows through each layer of the machine learning model, undergoing a series of linear and non-linear transformations, and outputs a prediction result for that batch of training data. The model's prediction result is compared with the true label corresponding to that batch of data (in supervised learning) or a self-constructed supervisory signal (in self-supervised learning), and a loss value is calculated using a pre-defined loss function. Using a backpropagation algorithm, starting from the loss value, the partial derivative of the loss function with respect to each model parameter is calculated layer by layer along the model's computational graph. The partial derivatives of all model parameters are pooled together to form the current gradient vector for the current batch of training data. This gradient indicates how each model parameter should be adjusted to most effectively increase the loss of this batch under the current model parameters.

[0065] In one possible embodiment, the initial model parameters for the next round are calculated using stochastic gradient descent. The model parameters are iteratively updated by calculating the gradient of the loss function on the mini-batch data in order to find the minimum value of the loss function. The update method can be expressed as formula (2).

[0066] (2)

[0067] in, These are the model parameters for the t-th iteration, i.e., the target model parameters for the current round. It is the learning rate for the current round. It is the gradient of the loss function in the current round. For the training data of the current round, This is the prediction result for the current round. This indicates the initial model parameters for the next round.

[0068] In step S204, the tail parameters required for updating the model parameters are determined based on the state characteristics of the loss function in the current round.

[0069] The state characteristics of a loss function can be understood as a set of metrics calculated from the loss value, its historical trends, gradient information, etc., at the current round. In this embodiment, the sharpness of the loss function is taken as an example to illustrate the state characteristics of the loss function.

[0070] The sharpness of a loss function refers to the maximum possible increase of the loss function within a neighborhood of the current model parameters in the model parameter space. In other words, sharpness reflects the flatness of the local region where the current model parameters are located. A smaller sharpness value indicates that the local region is a wide, flat minimum, in which case the model has better generalization ability; a larger sharpness value indicates that the local region is a narrow, sharp minimum, which may lead to overfitting and poor generalization ability.

[0071] In one possible implementation, the sharpness of the loss function for the current round can be calculated based on the current model parameters and a given perturbation radius, combined with the definition of sharpness.

[0072] The sharpness of the loss function needs to be maximized within the hypersphere; therefore, an approximate estimation method can be used to determine the sharpness of the loss function. For a given perturbation radius, the local sharpness of the loss function is related to the largest eigenvalue λ of the Hessian matrix. max Proportional. In other words, the largest eigenvalue λ of the Hessian matrix is... max The sharpness is the dominant factor determining the sharpness; therefore, the largest eigenvalue λ of the Hessian matrix can be used as the key. max It is approximated as the local sharpness of the loss function.

[0073] Tail parameters These are hyperparameters of the Lévy α-stable distribution, dynamically adjusted with the number of iterations, and are tail parameters. The adjustment depends on the local sharpness of the loss function. Optionally, the local sharpness of the loss function is determined by the largest eigenvalue of the Hessian matrix of the loss function. Approximate representation.

[0074] In some embodiments, the state characteristics of the loss function include the largest eigenvalue of the Hessian matrix of the loss function; when the largest eigenvalue of the Hessian matrix is ​​in the rising phase, the tail parameter is a first value; when the largest eigenvalue of the Hessian matrix is ​​in the stable phase, the tail parameter is a second value, wherein the first value is less than the second value.

[0075] The largest eigenvalue of the Hessian matrix of the loss function The value will initially rise during training, and then stabilize around a value related to the learning rate, which is the largest eigenvalue of the Hessian matrix of the loss function. .

[0076] In the early stages of training, the largest eigenvalue of the Hessian matrix of the loss function is... During the ascending phase, the optimizer is optimizing the more acute and complex regions of the loss function landscape. It will be set to a small first value to generate a large heavy-tailed noise, so that the optimizer can effectively escape the local minimum trap, effectively avoid training collapse or violent oscillation caused by gradient explosion and curvature change, reduce the dependence on careful tuning of hyperparameters such as the initial learning rate, and improve the robustness of the training process.

[0077] When the largest eigenvalue of the Hessian matrix of the loss function When entering the steady-state period, the optimizer has entered a region with relatively flat gradients. The value will gradually increase to 2, approaching a Gaussian distribution, in order to reduce fluctuations in parameter updates and promote stable convergence of the optimizer within a flat minimum region.

[0078] Among them, tail parameters Determined by the sharpness of the loss function, .

[0079] In step S206, a random perturbation that follows a heavy-tailed distribution is generated based on the tail parameters.

[0080] Heavy-tailed distributions refer to a class of probability distributions whose probability density function decays at a slower rate than that of exponential distributions (such as the normal distribution). In heavy-tailed distributions, the probability of extreme values ​​occurring is higher than in the normal distribution. Heavy-tailed distributions include, but are not limited to: Student's t-distribution, Cauchy distribution, Pareto distribution, and stable distribution.

[0081] Random perturbations can be understood as random noise added during the optimization of model parameters. In this embodiment, heavy-tailed noise is used, which significantly increases the probability of occasional large perturbations, enhances the optimizer's ability to escape local minima, and guides the model to converge to a flat region with better generalization performance, thereby improving the robustness and generalization ability of the model.

[0082] In one possible implementation, the tail parameter is determined. It is a characteristic index, and the skewness parameter Scale parameters Location parameters The Lévy α-stable distribution, i.e. (0,1,0). Distributed from the tail. Random sampling is performed in (0,1,0) to obtain random perturbations. .

[0083] In a preferred embodiment, sampling is performed using the Chambers-Mallows-Stuck algorithm, which is based on two independent uniformly distributed and exponentially distributed random numbers, and incorporates... The deterministic transformation formula generates random perturbations .

[0084] In step S208, the target model parameters for the next round are determined based on the initial model parameters and random perturbations.

[0085] In this embodiment, the initial model parameters are combined with random perturbations. The sum of these values ​​will be used as the target model parameters for the next round.

[0086] This scheme injects heavy-tailed distribution noise when updating model parameters using the SGD algorithm, and adaptively adjusts the tail parameters of the heavy-tailed distribution according to the state characteristics of the loss function, so as to match the sharpness changes of the loss function terrain during training. This solves the problem that optimization algorithms such as SGD are prone to getting stuck in sharp local minima and have insufficient model generalization ability in existing technologies, thereby improving the convergence speed, generalization ability and robustness of the model.

[0087] Based on the above embodiments, this embodiment optimizes the specific implementation of "determining the model parameters for the next round based on the current gradient and random perturbation in step S208", such as... Figure 3As shown, the optimized steps include S302-S304.

[0088] In step S302, a scaling factor is generated based on the tail parameters and the learning rate of the current round. The scaling factor is exponentially related to the learning rate of the current round, and the exponent of the learning rate is the reciprocal of the tail parameters.

[0089] The scaling factor is used to scale random perturbations sampled from a heavy-tailed distribution. The amplitude is adjusted so that the perturbation intensity can effectively promote exploration and match the local curvature of the loss surface, thereby achieving a balance between escaping sharp regions and stable convergence.

[0090] Scaling factor and learning rate of The power is proportional to the power, indicating that the tail parameter is proportional. Located at the exponential position, it acts as a dynamic regulator, non-linearly altering the sensitivity of random perturbations to changes in the learning rate.

[0091] In step S304, the target model parameters for the next round are determined based on the initial model parameters and the product of the random perturbation and the scaling factor.

[0092] In some specific implementations, the target model parameters for the next round are determined by formula (3): (3) in, The target model parameters for the next round, These are the model parameters for the current round. The learning rate for the current round. The gradient of the loss function for the current round. The input data for the current round, This represents the prediction result for the current round; The tail parameters required to update the model parameters For random perturbations that follow a heavy-tailed distribution, Scaling factor These serve as the initial model parameters for the next round.

[0093] In this embodiment, the scaling factor is related to the learning rate and has an exponential relationship, so that the overall magnitude of the random perturbation matches the deterministic step size of the gradient descent, avoiding imbalance in parameter updates caused by one being too large or too small.

[0094] In addition, the reciprocal of the tail parameter (1 / As a dynamic index, it adaptively adjusts the scaling factor. Specifically, the learning rate index (1 / The tail parameter is a variable that changes with the sharpness of the loss function, rather than a fixed value. When the value is small (e.g., close to 1, corresponding to a sharp loss surface), the exponent (1 / A large value for the scaling factor (e.g., close to 1) makes it infinitely close to the learning rate, and the scaling factor decays slowly with the learning rate, helping the model escape sharp local minima. When the tail parameter... When the value is large (e.g., close to 2, corresponding to a flat loss surface), the exponent (1 / As the value of the scaling factor decreases (e.g., approaches 0.5), it approaches a power of 1 / 2 of the learning rate, and the scaling factor decays rapidly with the learning rate. Later in training, the magnitude of the random perturbation decreases rapidly to a very low level to facilitate stable convergence within flat regions.

[0095] In this embodiment, a local steepest descent point is first found using the gradient descent method, which is the initial model parameters for the next round calculated by the gradient descent algorithm. Then, based on these initial model parameters, an adjustable random perturbation is applied according to the sharpness of the loss function surface at that point. This is equivalent to performing a random fine-tuning around the new model parameters after each gradient descent, so that the final target model parameters actively deviate from any potentially sharp minimum values ​​and explore towards a flatter region.

[0096] The intensity of random perturbations can both decay overall following the macro-level scheduling of the learning rate and be dynamically adjusted according to the sharpness of the loss function. In sharp regions, the exploratory force is maintained, while in flat regions, fine-grained convergence is achieved, thus finding flat minima more accurately.

[0097] Based on the above embodiments, this embodiment optimizes the iterative training process for any round, such as... Figure 4 As shown, the optimized iterative training process includes S402-S412.

[0098] In step S402, the initial model parameters for the next round are determined based on the training data of the current round.

[0099] The implementation method of step S402 is the same as that of step S202 in the above embodiments. For details, please refer to the description in the above embodiments. In this embodiment, it will not be described in detail again.

[0100] In step S404, the sharpness of the loss function in the current round is processed nonlinearly.

[0101] In one possible implementation, the sharpness of the loss function for the current round can be calculated based on the current model parameters and a given perturbation radius, combined with the definition of sharpness.

[0102] In another possible implementation, the sharpness of the loss function is estimated using the largest eigenvalue of the Hessian matrix, such as... Figure 5 As shown, the specific steps include S502-S504.

[0103] In step S502, the largest eigenvalue of the Hessian matrix of the loss function for the current round is calculated.

[0104] In machine learning optimization, the Hessian matrix of the loss function is a second-order derivative matrix that describes the local curvature information of the loss function at the model parameter points. The eigenvalues ​​of the Hessian matrix characterize the degree of curvature of the loss surface in different eigenvector directions; positive eigenvalues ​​indicate that the surface bends upwards (in a bowl shape) in that direction, while negative eigenvalues ​​indicate that it bends downwards (in a saddle point). The absolute value of the eigenvalue indicates the severity of the curvature.

[0105] For the Hessian matrix, all its eigenvalues ​​can be obtained through eigenvalue decomposition, and the largest eigenvalue is selected as the largest eigenvalue. This characterizes the curvature of the loss function in the direction of its steepest point at the current parameter point. Maximum eigenvalue The larger the value, the more likely it is that there exists at least one direction in which the loss function is very steep, indicating the presence of sharp local geometry.

[0106] In one possible implementation, the loss value and gradient vector are calculated based on the current model parameters and the current batch of training data. For small to medium-sized models, the second-order derivative of the loss function with respect to the parameters is calculated using the second-order differentiation function of the automatic differentiation framework. For large-scale models, the largest eigenvalue of the matrix and its corresponding eigenvector are estimated using an iterative algorithm. Alternatively, the largest eigenvalue can be estimated using the relationship between the covariance matrix of the gradient noise and the Hessian matrix.

[0107] In one specific implementation, the largest eigenvalue of the Hessian matrix is ​​obtained by estimating the trace of the Hessian matrix.

[0108] Because current deep neural networks have a massive number of parameters, it is difficult to directly calculate the largest eigenvalue of the Hessian matrix of the loss function. Therefore, the method of estimating the trace of the Hessian matrix is ​​used to approximate the largest eigenvalue. Since the largest eigenvalue accounts for a large proportion of all eigenvalues ​​for most matrices, and not only does the largest eigenvalue increase when the optimizer enters a sharp region, other eigenvalues ​​also increase significantly, the trend of the largest eigenvalue and the trace is the same. Therefore, the trace is a reasonable estimate of the largest eigenvalue.

[0109] One method for estimating the trace of a Hessian matrix is ​​the Hutchinson traceestimator, which is a method that uses Monte Carlo methods to efficiently estimate the trace of large-scale matrices.

[0110] The Hutchinson trace estimation method is used to estimate the trace *tr* of the Hessian matrix of the loss function, which is then used as an effective estimate of the largest eigenvalue and as the current sharpness. The measurement.

[0111] In step S504, the maximum eigenvalue is smoothed using the exponential moving average algorithm to obtain the sharpness of the loss function for the current round.

[0112] To eliminate short-term noise in the sharpness calculation process, an exponential moving average method is used to smooth the estimated sharpness, resulting in a smoothed sharpness value. This refers to the sharpness of the loss function in the current round.

[0113] The calculation method of the exponential moving average method is shown in formula (4).

[0114] (4)

[0115] in, It is a value that takes on a range of [0.05, 0.1]. This represents the sharpness value before smoothing. This is the smoothed sharpness value from the previous round. A relatively small value can produce a smoothed sharpness trend, avoiding the algorithm from overreacting to short-term, random sharpness fluctuations. This smoothing method can reflect the latest data changes more quickly, and each calculation only needs to store the previous smoothed value and the current data point, making it computationally efficient.

[0116] The sharpness of the loss function in the current round is non-linearly processed, including: adjusting the sharpness of the loss function in the current round. Substitute a sigmoid function, as shown in formula (5), to standardize its value to the interval [0,1].

[0117] (5)

[0118] In step S406, the sharpness of the loss function after nonlinear processing is increased by a set value to obtain the estimated values ​​of the tail parameters required for training the target model.

[0119] For example, the value is set to 1.

[0120] The sharpness of the loss function after nonlinear processing Increment the value by 1 to obtain the tail parameter. initial estimate

[0121] In step S408, the estimated values ​​of the tail parameters are smoothly updated to obtain the tail parameters required for the next round of model training.

[0122] To avoid tail parameters Severe fluctuations, use smooth updates The method is to use formula (6) for smooth updates.

[0123] = (6)

[0124] in It is the smoothing coefficient, a hyperparameter, which is generally set between [0.2, 0.3] and can be adjusted according to the training effect.

[0125] This scheme effectively suppresses estimation noise and outliers through a dual mechanism of nonlinear processing and smoothing, avoiding convergence failure or performance regression caused by oscillations and improving the stability of the training process.

[0126] In step S410, random perturbations following a heavy-tailed distribution are sampled from the α-stable distribution based on the tail parameters.

[0127] The characteristic function of the Lévy stable distribution family is shown in Equation (1). The skewness parameter in Equation (1) is... Set to 0, scale parameter Set to 1, position parameter Setting it to 0 yields the Lévy α-stable distribution function. (0,1,0).

[0128] Lévy α-Stability Distribution Function (0,1,0) is shown in formula (7).

[0129] (7)

[0130] in, Let Lévy represent the α-stable distribution function.

[0131] In a preferred embodiment, sampling is performed using the Chambers-Mallows-Stuck algorithm, which is based on two independent uniformly distributed and exponentially distributed random numbers, and incorporates... The deterministic transformation formula generates random perturbations .

[0132] When training deep neural networks, the gradient noise of SGD actually exhibits heavy-tailed characteristics and is more suitable for being described by the Lévy α-stable distribution. Its heavy-tailed noise allows for occasional large jumps, providing a stronger ability to explore complex loss function landscapes.

[0133] In step S412, the target model parameters for the next round are determined based on the current gradient and random perturbation.

[0134] The implementation method of step S402 is the same as that of step S202 in the above embodiments. For details, please refer to the description in the above embodiments. In this embodiment, it will not be described in detail again.

[0135] The model training method provided in this embodiment is used for neural network training. Experimental results on multiple benchmark datasets show that, compared with the standard gradient descent method, this method can improve the convergence speed of the model, reduce the difficulty of model training initialization, and reduce the need for tedious learning rate tuning.

[0136] Based on the same inventive concept, this disclosure also provides a model update apparatus, as described in the following embodiments. Since the principle by which this apparatus solves the problem is similar to that of the method embodiments described above, the implementation of this apparatus embodiment can refer to the implementation of the method embodiments described above, and repeated details will not be repeated.

[0137] Figure 6 This diagram illustrates a model training apparatus according to an embodiment of the present disclosure, such as... Figure 6 As shown, the device includes: a training module 600, used to perform multiple rounds of iterative training on a machine learning model using training data to obtain a trained machine learning model. The training data includes at least one or more of the following: text data, image data, audio data, and video data. The training module 600 includes: an initial model parameter determination unit 610, used to determine the initial model parameters for the next round based on the training data of the current round; a tail parameter determination unit 620, used to determine the tail parameters required for model parameter optimization based on the state characteristics of the loss function of the current round; a random perturbation generation unit 630, used to generate a random perturbation following a heavy-tailed distribution based on the tail parameters; and a model parameter update unit 640, used to determine the target model parameters for the next round based on the initial model parameters and the random perturbation.

[0138] In some embodiments, the model parameter update unit 640 is specifically used to generate a scaling factor based on the tail parameters and the learning rate of the current round, wherein the scaling factor is exponentially related to the learning rate of the current round, and the exponent of the learning rate is the reciprocal of the tail parameters; and to determine the target model parameters for the next round based on the initial model parameters and the product of the random perturbation and the scaling factor.

[0139] In some embodiments, the target model parameters for the next round are determined by the following formula:

[0140] in, The target model parameters for the next round, These are the model parameters for the current round. The learning rate for the current round. The gradient of the loss function for the current round. For the training data of the current round, This represents the prediction result for the current round; The tail parameters required to update the model parameters For random perturbations that follow a heavy-tailed distribution, This indicates the initial model parameters for the next round.

[0141] In some embodiments, the heavy-tailed distribution includes a Lévy α-stable distribution, and the tail parameter is a hyperparameter of the Lévy α-stable distribution; the random perturbation generation unit 630 is specifically used to sample from the Lévy α-stable distribution according to the tail parameter to obtain a random perturbation that follows a heavy-tailed distribution.

[0142] In some embodiments, the state characteristics of the loss function include the sharpness of the loss function; the tail parameter determination unit 720 includes: a nonlinear processing subunit, used to perform nonlinear processing on the sharpness of the loss function in the current round; an estimation value determination subunit, used to increase the sharpness of the nonlinearly processed loss function by a set value to obtain the estimated value of the tail parameters required for model parameter optimization; and an estimation value smoothing subunit, used to smooth and update the estimated value of the tail parameters to obtain the tail parameters required for model parameter optimization.

[0143] In some embodiments, the tail parameter determination unit 620 further includes: an eigenvalue calculation subunit for calculating the maximum eigenvalue of the Hessian matrix of the loss function in the current round; and a current sharpness calculation unit for smoothing the maximum eigenvalue using an exponential moving average algorithm to obtain the sharpness of the loss function in the current round.

[0144] In some embodiments, the largest eigenvalue of the Hessian matrix is ​​obtained by estimating the trace of the Hessian matrix.

[0145] In some embodiments, the state characteristics of the loss function include the largest eigenvalue of the Hessian matrix of the loss function; when the largest eigenvalue of the Hessian matrix is ​​in the rising phase, the tail parameter is a first value; when the largest eigenvalue of the Hessian matrix is ​​in the stable phase, the tail parameter is a second value, wherein the first value is less than the second value.

[0146] It should be noted that the examples and application scenarios implemented by the modules in the above device embodiments and the corresponding steps in the method embodiments are the same, but are not limited to the content disclosed in the above method embodiments. It should also be noted that the above modules, as part of the device, can be executed in a computer system such as a set of computer-executable instructions.

[0147] Those skilled in the art will understand that various aspects of this disclosure can be implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which can be collectively referred to herein as a "circuit", "module" or "system".

[0148] Based on the same inventive concept, this disclosure also provides an electronic device, which includes: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the model training method of any of the above-described methods by executing the executable instructions. Since the principle by which this electronic device solves the problem is similar to that of the above-described method embodiments, the implementation of this electronic device embodiment can refer to the implementation of the above-described method embodiments, and repeated details will not be elaborated further.

[0149] The following reference Figure 7 To describe an electronic device 700 according to such an embodiment of the present disclosure. Figure 7 The electronic device 700 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.

[0150] like Figure 7 As shown, the electronic device 700 is manifested in the form of a general-purpose computing device. The components of the electronic device 700 may include, but are not limited to: at least one processing unit 710, at least one storage unit 720, and a bus 730 connecting different system components (including storage unit 720 and processing unit 710).

[0151] The storage unit stores program code that can be executed by the processing unit 710, causing the processing unit 710 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure. The processing unit 710 can perform the following steps of the above method embodiments: performing multiple rounds of iterative training on a machine learning model using training data to obtain a trained machine learning model. The training data includes at least one or more of the following: text data, image data, audio data, and video data. The iterative training in any round of the multiple rounds includes: determining the initial model parameters for the next round based on the training data of the current round; determining the tail parameters required for the initial model training based on the state characteristics of the loss function of the current round; generating a random perturbation following a heavy-tailed distribution based on the tail parameters; and determining the target model parameters for the next round based on the initial model parameters and the random perturbation.

[0152] Storage unit 720 may include readable media in the form of volatile storage units, such as random access memory (RAM) 7201 and / or cache memory 7202, and may further include read-only memory (ROM) 7203.

[0153] The storage unit 720 may also include a program / utility 7204 having a set (at least one) program module 7205, such program module 7205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.

[0154] Bus 730 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.

[0155] Electronic device 700 can also communicate with one or more external devices 740 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 700, and / or with any device that enables electronic device 700 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 750. Furthermore, electronic device 700 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 760. As shown, network adapter 760 communicates with other modules of electronic device 700 via bus 730. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0156] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.

[0157] Based on the same inventive concept, this disclosure also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the model training method described above. Since the principle by which this computer-readable storage medium embodiment solves the problem is similar to that of the above method embodiments, the implementation of this computer-readable storage medium embodiment can refer to the implementation of the above method embodiments, and repeated details will not be elaborated further.

[0158] More specific examples of computer-readable storage media in this disclosure may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0159] In this disclosure, a computer-readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of transmitting, propagating, or transmitting a program for use by or in connection with an instruction execution system, apparatus, or device.

[0160] Optionally, the program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0161] In practical implementation, program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0162] Based on the same inventive concept, this disclosure also provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the model training method of any one of the above method embodiments. Since the principle by which this computer program product embodiment solves the problem is similar to that of the above method embodiments, the implementation of this computer program product embodiment can refer to the implementation of the above method embodiments, and repeated details will not be elaborated further.

[0163] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0164] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.

[0165] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, mobile terminal, or network device, etc.) to execute the methods according to the embodiments of this disclosure.

[0166] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the appended claims.

Claims

1. A model training method, characterized in that, include: The machine learning model is trained through multiple rounds of iterative training using training data to obtain a trained machine learning model. The training data includes at least one or more of the following: text data, image data, audio data, and video data. The iterative training in any one of the multiple rounds of iterative training includes: Determine the initial model parameters for the next round based on the training data from the current round; Based on the state characteristics of the loss function in the current round, determine the tail parameters required for model parameter optimization; A random perturbation following a heavy-tailed distribution is generated based on the tail parameters; Based on the initial model parameters and the random perturbation, the target model parameters for the next round are determined.

2. The model training method according to claim 1, characterized in that, The step of determining the target model parameters for the next round based on the initial model parameters and the random perturbation includes: A scaling factor is generated based on the tail parameter and the learning rate of the current round, wherein the scaling factor is exponentially related to the learning rate of the current round, and the exponent of the learning rate is the reciprocal of the tail parameter. The target model parameters for the next round are determined based on the initial model parameters and the product of the random perturbation and the scaling factor.

3. The model training method according to claim 1, characterized in that, The heavy-tailed distribution includes the Lévy α-stable distribution, and the tail parameters are the hyperparameters of the Lévy α-stable distribution; The step of generating a random perturbation following a heavy-tailed distribution based on the tail parameters includes: The random perturbation following the heavy-tailed distribution is obtained by sampling from the Lévy α-stable distribution based on the tail parameters.

4. The model training method according to claim 1, characterized in that, The state characteristics of the loss function include the sharpness of the loss function; The step of determining the tail parameters required for model parameter optimization based on the state characteristics of the loss function in the current round includes: The sharpness of the loss function in the current round is processed non-linearly; By increasing the sharpness of the loss function after nonlinear processing by a set value, we obtain the estimated values ​​of the tail parameters required for model parameter optimization. The estimated values ​​of the tail parameters are smoothed to obtain the tail parameters required for optimizing the model parameters.

5. The model training method according to claim 4, characterized in that, Also includes: Calculate the largest eigenvalue of the Hessian matrix of the loss function for the current round; The sharpness of the loss function for the current round is obtained by smoothing the largest feature value using the exponential moving average algorithm.

6. The model training method according to claim 5, characterized in that, The largest eigenvalue of the Hessian matrix is ​​obtained by estimating the trace of the Hessian matrix.

7. The model training method according to claim 1, characterized in that, The state features of the loss function include the largest eigenvalue of the Hessian matrix of the loss function; When the largest eigenvalue of the Hessian matrix is ​​in the rising phase, the tail parameter is the first value; When the largest eigenvalue of the Hessian matrix is ​​in a stable phase, the tail parameter is a second value, wherein the first value is less than the second value.

8. A model training device, characterized in that, include: The training module is used to perform multiple rounds of iterative training on the machine learning model using training data to obtain a trained machine learning model. The training data includes at least one or more of the following: text data, image data, audio data, and video data. The training module includes: An initial model parameter determination unit is used to determine the initial model parameters for the next round based on the training data of the current round. The tail parameter determination unit is used to determine the tail parameters required for model parameter optimization based on the state characteristics of the loss function in the current round. A random perturbation generation unit is used to generate a random perturbation that follows a heavy-tailed distribution based on the tail parameters. The model parameter determination unit is used to determine the target model parameters for the next round based on the initial model parameters and the random perturbation.

9. An electronic device, characterized in that, include: processor; Memory for storing the executable instructions of the processor; The processor is configured to execute the model training method of any one of claims 1 to 8 by executing the executable instructions.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the model training method according to any one of claims 1 to 7.

11. A computer program product, comprising: A computer program or instruction, characterized in that, when executed by a processor, the computer program or instruction implements the model training method according to any one of claims 1 to 7.