Large language model fine tuning parameter optimization method based on crow search algorithm

By using the Crow Search algorithm during the fine-tuning of large language models, the hyperparameters are dynamically adjusted, and the limitations of relying on expert experience and trial and error adjustment are solved, optimization efficiency and flexibility are improved, cost is reduced, and model performance is significantly improved.

CN119180324APending Publication Date: 2024-12-24BEIJING BIG DATA ADVANCED TECH RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411403454.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2024-12-24

AI Technical Summary

Technical Problem

The fine-tuning process of large language models depends on expert experience or trial and error adjustment, which is insufficient flexibility and high cost, making it difficult to effectively optimize hyperparameters.

Method used

Using a method based on the crow search algorithm, the hyperparameter set is updated by assigning memory hyperparameters and adaptive evaluation values ​​to each hyperparameter, and using the global search ability of the crow search algorithm to dynamically adjust the hyperparameters to approximate the optimal solution.

Benefits of technology

It significantly improves the flexibility and efficiency of parameter optimization, reduces costs, avoids repeated calculations, and achieves more accurate parameter adjustment and model performance improvement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119180324A_ABST
    Figure CN119180324A_ABST
Patent Text Reader

Abstract

The invention discloses a large language model fine tuning parameter optimization method based on a crow search algorithm, a storage medium, equipment and a computer program product, and belongs to the field of large language model debugge.The method comprises the steps that a first target hyper-parameter is determined for each target hyper-parameter in a hyper-parameter set; according to each target hyper-parameter and a position parameter of the corresponding first target hyper-parameter, updating the hyper-parameter set, and determining an adaptive evaluation value of the updated hyper-parameter set; updating a memory hyper-parameter of the target hyper-parameter under the condition that the adaptive evaluation values before and after updating meet a preset relationship, and circulating the iteration step; and in response to a loop suspension command, updating the large language model by using the memory hyper-parameter of the target hyper-parameter in the hyper-parameter set, and training the updated large language model. According to the method, the limitation of depending on expert experience and trial and error adjustment in the prior art is solved, the flexibility and efficiency of parameter optimization are remarkably improved, the cost is reduced, and the technical problems mentioned in the background technology are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of large language model debugging, and specifically relates to a large language model fine-tuning parameter optimization method based on a crow search algorithm, a storage medium, a device, and a computer program product. Background Art

[0002] Large Language Model (LLM) has demonstrated powerful data processing and analysis capabilities in many fields such as natural language processing, healthcare, financial technology, education and entertainment. Through pre-training and fine-tuning, LLM can adapt to different vertical tasks, such as sentiment analysis, machine translation, question-answering system, text classification and named entity recognition.

[0003] In the existing technology, the fine-tuning of LLM usually relies on expert experience or trial and error to adjust hyperparameters such as learning rate, batch size, number of training rounds, weight decay and temperature parameters, etc. These parameters have a key impact on the learning behavior and final performance of the model.

[0004] Although existing technologies provide a variety of optimization strategies, these methods mainly rely on expert experience or trial and error adjustment, which lack flexibility and are costly. Summary of the invention

[0005] The present application aims to provide a large language model fine-tuning parameter optimization method, storage medium, device and computer program product based on the crow search algorithm, which at least solves the problem that the large language model debugging process relies on expert experience or trial and error adjustment, which is insufficient in flexibility and high in cost.

[0006] In a first aspect, the embodiment of the present application discloses a method for optimizing fine-tuning parameters of a large language model based on a crow search algorithm, comprising: For each target hyperparameter in the hyperparameter set of the large language model, a first target hyperparameter is determined; each of the target hyperparameters has a corresponding memory hyperparameter in the large language model; the hyperparameter set has a corresponding adaptation evaluation value; According to the position parameter of each target hyperparameter in the hyperparameter set and the position parameter of the memory hyperparameter corresponding to the first target hyperparameter corresponding to the target hyperparameter, each target hyperparameter in the hyperparameter set is updated, and an adaptation evaluation value of the hyperparameter set is determined after all the target hyperparameters are updated; When the adaptive evaluation value of the updated hyperparameter set satisfies a preset quantitative relationship with respect to the adaptive evaluation value of the hyperparameter set before the update, updating the position parameter of the target hyperparameter in the updated hyperparameter set to a new memory hyperparameter of the target hyperparameter in the updated hyperparameter set, and returning to each target hyperparameter in the hyperparameter set for the large language model to determine a first target hyperparameter; In response to a loop termination command, the value of the hyperparameter corresponding to the target hyperparameter in the large language model is updated using the value of the memory hyperparameter of each target hyperparameter in the hyperparameter set, and the updated large language model is trained to obtain the trained large language model.

[0007] In a second aspect, the embodiment of the present application further discloses a large language model fine-tuning parameter optimization device based on a crow search algorithm, which is characterized by comprising: A selection module is used to determine a first target hyperparameter for each target hyperparameter in a hyperparameter set of a large language model; each of the target hyperparameters has a corresponding memory hyperparameter in the large language model; and the hyperparameter set has a corresponding adaptation evaluation value; A position updating module, configured to update each of the target hyperparameters in the hyperparameter set according to the position parameter of each of the target hyperparameters in the hyperparameter set and the position parameter of the memory hyperparameter corresponding to the first target hyperparameter corresponding to the target hyperparameter, and determine an adaptation evaluation value of the hyperparameter set after all the target hyperparameters are updated; A memory update module, configured to update the position parameter of the target hyperparameter in the updated hyperparameter set to a new memory hyperparameter of the target hyperparameter in the updated hyperparameter set when the adaptive evaluation value of the updated hyperparameter set satisfies a preset quantitative relationship with respect to the adaptive evaluation value of the hyperparameter set before the update, and return to the step of determining a first target hyperparameter for each target hyperparameter in the hyperparameter set of the large language model; A tuning training module is used to respond to a loop termination command, use the value of the memory hyperparameter of each target hyperparameter in the hyperparameter set to update the value of the hyperparameter corresponding to the target hyperparameter in the large language model, and train the updated large language model to obtain the trained large language model.

[0008] In a third aspect, an embodiment of the present application further discloses a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps described in the first aspect are implemented.

[0009] In a fourth aspect, an embodiment of the present application further discloses an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps described in the first aspect when executed by the processor.

[0010] In a fifth aspect, an embodiment of the present application further discloses a computer program product, on which a computer program is stored, and when the computer program is executed by a processor, the steps described in the first aspect are implemented.

[0011] In summary, in the embodiment of the present application, by determining the first target hyperparameter as a reference point for each target hyperparameter in the hyperparameter set, assigning a corresponding memory hyperparameter to each target hyperparameter, and determining the corresponding adaptation evaluation value for the hyperparameter set, historical information can be retained during the optimization process to perform more accurate parameter adjustments in subsequent steps, avoid repeated calculations, and improve the efficiency and accuracy of the optimization process. Then, according to the position parameters of each target hyperparameter and the position parameters of its corresponding memory hyperparameter, each target hyperparameter in the hyperparameter set is updated, and its updated adaptation evaluation value is determined, so that each hyperparameter is dynamically adjusted by combining the position parameters of the hyperparameter and the memory hyperparameter to make it closer to the optimal solution, that is, the global search capability of the crow search algorithm is utilized to ensure the comprehensiveness and efficiency of parameter optimization. Then, when the adaptation evaluation value of the updated hyperparameter set satisfies the preset quantitative relationship relative to the adaptation evaluation value before the update, the memory hyperparameter is updated, thereby gradually approaching the optimal solution, and finally the hyperparameters of the large language model are replaced by the optimized hyperparameter set, and then the large language model is trained, which significantly improves the performance of the model. Therefore, the method based on the embodiment of the present application overcomes the limitations of the prior art of relying on expert experience and trial and error adjustment, significantly improves the flexibility and efficiency of parameter optimization, reduces costs, and solves the technical problems mentioned in the background technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings: Figure 1 It is a flowchart of the steps of a large language model fine-tuning parameter optimization method based on the crow search algorithm provided in an embodiment of the present application; Figure 2 It is a flowchart of another method for optimizing parameters of a large language model based on a crow search algorithm provided in an embodiment of the present application; Figure 3It is a proxy model fitting evaluation cycle process under the embodiment of the present application; Figure 4 It is a flowchart of the steps of another method for fine-tuning parameters of a large language model based on the crow search algorithm provided in an embodiment of the present application; Figure 5 It is a structural schematic diagram of a large language model fine-tuning parameter optimization device based on a crow search algorithm provided in an embodiment of the present application; Figure 6 is a block diagram of an electronic device provided in an embodiment of the present application; Figure 7 It is a block diagram of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0013] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.

[0014] Figure 1 A large language model fine-tuning parameter optimization method based on a crow search algorithm is provided in an embodiment of the present application. The method may include the following steps: In some embodiments of the present application, Step 101: For each target hyperparameter in the hyperparameter set of the large language model, a first target hyperparameter is determined.

[0015] Among them, each target hyperparameter has a corresponding memory hyperparameter in the large language model; the hyperparameter set has a corresponding adaptation evaluation value.

[0016] In some embodiments of the present application, a first target hyperparameter is determined for each target hyperparameter in the hyperparameter set of the large language model. The hyperparameter set consists of multiple target hyperparameters, each of which has a corresponding memory hyperparameter in the large language model, and each target hyperparameter has an adaptation evaluation value. The adaptation evaluation value is used to measure the performance of the hyperparameter in the current state. By determining a first target hyperparameter, a reference point can be provided for subsequent optimization steps, thereby more effectively adjusting and optimizing parameters.

[0017] For example, in a hyperparameter set containing 200 target hyperparameters, assume that each target hyperparameter has a fitness evaluation value. At this time, a hyperparameter can be randomly selected as the first target hyperparameter. Assuming that the hyperparameter is selected as hyperparameter A, then hyperparameter A will be determined as the first target hyperparameter. In this way, by selecting the hyperparameter with the highest fitness evaluation value as the first target hyperparameter, a reference point with better performance can be provided for the subsequent optimization process.

[0018] Step 102, based on the position parameters of each target hyperparameter in the hyperparameter set and the position parameters of the memory hyperparameter corresponding to the first target hyperparameter corresponding to the target hyperparameter, each target hyperparameter in the hyperparameter set is updated, and the adaptation evaluation value of the hyperparameter set is determined after all the target hyperparameters are updated.

[0019] In some embodiments of the present application, each target hyperparameter in the hyperparameter set will be updated according to the position parameter of each target hyperparameter in the hyperparameter set, and the position parameter of the memory hyperparameter corresponding to the first target hyperparameter corresponding to the target hyperparameter, and the adaptive evaluation value of the hyperparameter set will be determined after all target hyperparameters are updated. The position parameter refers to the specific position of the hyperparameter in the search space, and the current state of the hyperparameter can be determined by these parameters. The position parameter of the memory hyperparameter refers to the position where the hyperparameter performs best in historical iterations. By combining the current position parameter and the memory position parameter, the hyperparameter can be updated to be closer to the optimal solution. The updated adaptive evaluation value is used to measure the performance of the hyperparameter in the new position.

[0020] For example, in a hyperparameter set containing 200 target hyperparameters, assume that each hyperparameter has a current position parameter and a memory position parameter. Assume that the first target hyperparameter is hyperparameter A, and its memory position parameter is (0.5, 0.6). For each hyperparameter in the hyperparameter set, update it according to its current position parameter and the memory position parameter of hyperparameter A. Assume that the current position parameter of hyperparameter B is (0.3, 0.4), and through calculation, the new position parameter of hyperparameter B may be updated to (0.4, 0.5). Then, calculate the fitness evaluation value of hyperparameter B at the new position, and assume that its updated fitness evaluation value is 0.85. In this way, the position of the hyperparameter can be gradually optimized to make it closer to the optimal solution.

[0021] Step 103, when the adaptive evaluation value of the updated hyperparameter set satisfies a preset quantitative relationship with respect to the adaptive evaluation value of the hyperparameter set before the update, the position parameter of the target hyperparameter in the updated hyperparameter set is updated to a new memory hyperparameter of the target hyperparameter in the updated hyperparameter set, and the process returns to the step of determining a first target hyperparameter for each target hyperparameter in the hyperparameter set of the large language model.

[0022] In some embodiments of the present application, when the adaptive evaluation values ​​of the hyperparameters before and after the update satisfy the preset quantitative relationship, the updated hyperparameters are updated to new memory hyperparameters, and the step of determining a first target hyperparameter in the hyperparameter set of the large language model is returned. The adaptive evaluation value is used to measure the performance of the hyperparameter in the current state. The preset quantitative relationship can be one of greater than, equal to, less than, greater than or equal to, and less than or equal to. By comparing the adaptive evaluation values ​​before and after the update, it can be determined whether the hyperparameter performs better in the new position. If the updated adaptive evaluation value is higher or equal, the position is used as the new memory position to retain the best state in the optimization process.

[0023] For example, in a hyperparameter set containing 200 target hyperparameters, suppose the fitness evaluation value of hyperparameter B before the update is 0.85, the updated position parameter is (0.4, 0.5), and the fitness evaluation value is 0.88. Since the updated fitness evaluation value 0.88 is greater than 0.85 before the update, the memory position of hyperparameter B is updated to (0.4, 0.5). Then, return to the initial step of the iterative process, that is, determine a new first target hyperparameter in the hyperparameter set, and continue the optimization process. In this way, the position of the hyperparameter can be gradually optimized to make it closer to the optimal solution, and the best state in each iteration can be retained.

[0024] Step 104, in response to the loop abort command, uses the value of the memorized hyperparameter of each target hyperparameter in the hyperparameter set to update the value of the hyperparameter corresponding to the target hyperparameter in the large language model, and trains the updated large language model to obtain a trained large language model.

[0025] In some embodiments of the present application, the value of the memory hyperparameter of each target hyperparameter in the hyperparameter set is used to update the value of the hyperparameter corresponding to the target hyperparameter in the large language model, and the updated large language model is trained to obtain the trained large language model. The target hyperparameter input to the large language model is the target hyperparameter in the hyperparameter set obtained by iterative optimization of the previous steps. Through the previous iterative steps, the hyperparameter set at this time already has a higher adaptation evaluation value and can already show better performance. By using this training hyperparameter set, the performance of the large language model can be quickly adjusted, reducing the debugging of the target hyperparameters one by one, and then training based on the large model with adjusted hyperparameters, the final large language model can be better obtained.

[0026] For example, in a hyperparameter set containing 200 target hyperparameters, suppose that after the previous optimization steps, a loop abort command is generated. At this time, the specific values ​​of these 200 target hyperparameters will be replaced into the corresponding hyperparameter positions in the large language model. Then, these training hyperparameter sets are used to train the large language model, and finally the trained large language model is obtained. In this way, by selecting a high-performance training hyperparameter set, the overall performance of the model can be effectively improved.

[0027] In summary, in the embodiment of the present application, by determining the first target hyperparameter as a reference point for each target hyperparameter in the hyperparameter set, assigning a corresponding memory hyperparameter to each target hyperparameter, and determining the corresponding adaptation evaluation value for the hyperparameter set, historical information can be retained during the optimization process to perform more accurate parameter adjustments in subsequent steps, avoid repeated calculations, and improve the efficiency and accuracy of the optimization process. Then, according to the position parameters of each target hyperparameter and the position parameters of its corresponding memory hyperparameter, each target hyperparameter in the hyperparameter set is updated, and its updated adaptation evaluation value is determined, so that each hyperparameter is dynamically adjusted by combining the position parameters of the hyperparameter and the memory hyperparameter to make it closer to the optimal solution, that is, the global search capability of the crow search algorithm is utilized to ensure the comprehensiveness and efficiency of parameter optimization. Then, when the adaptation evaluation value of the updated hyperparameter set satisfies the preset quantitative relationship relative to the adaptation evaluation value before the update, the memory hyperparameter is updated, thereby gradually approaching the optimal solution, and finally the hyperparameters of the large language model are replaced by the optimized hyperparameter set, and then the large language model is trained, which significantly improves the performance of the model. Therefore, the method based on the embodiment of the present application overcomes the limitations of the prior art of relying on expert experience and trial and error adjustment, significantly improves the flexibility and efficiency of parameter optimization, reduces costs, and solves the technical problems mentioned in the background technology.

[0028] Figure 2 Another large language model fine-tuning parameter optimization method based on the crow search algorithm provided in an embodiment of the present application may include the following steps: Step 201 , using a preset initialization threshold as the sampling quantity of the target hyperparameter, and determining a plurality of target hyperparameters from all the hyperparameters of the large language model to obtain a hyperparameter set.

[0029] In some embodiments of the present application, multiple target hyperparameters are determined from all hyperparameters of the large language model to obtain a hyperparameter set. This step screens the hyperparameters by a preset initialization threshold to ensure that the selected target hyperparameters have a higher fitness evaluation value, thereby improving the efficiency and accuracy of the optimization process. The initialization threshold is a pre-set standard for determining which hyperparameters can be selected as target hyperparameters. Through this screening mechanism, the waste of computing resources can be effectively reduced, and hyperparameters with potential can be optimized intensively.

[0030] For example, in a large language model, suppose there are 1,000 hyperparameters. By setting the initialization threshold to 200, 200 hyperparameters are screened out, and these 200 hyperparameters will be determined as target hyperparameters to form a hyperparameter set. In this way, through the preset initialization threshold, hyperparameters with higher fitness evaluation values ​​can be effectively screened out, ensuring the efficiency and accuracy of the optimization process.

[0031] Step 202: For each target hyperparameter in the hyperparameter set of the large language model, determine a first target hyperparameter.

[0032] Among them, each target hyperparameter has a corresponding memory hyperparameter in the large language model; the hyperparameter set has a corresponding adaptation evaluation value.

[0033] The method shown in this step has been explained in step 101 and will not be repeated here.

[0034] Step 203, based on the position parameters of each target hyperparameter in the hyperparameter set and the position parameters of the memory hyperparameter corresponding to the first target hyperparameter corresponding to the target hyperparameter, each target hyperparameter in the hyperparameter set is updated, and the adaptation evaluation value of the hyperparameter set is determined after all the target hyperparameters are updated.

[0035] The method shown in this step has been explained in step 102 and will not be repeated here.

[0036] Optionally, in order to update each hyperparameter in the hyperparameter set according to the position parameter of each hyperparameter and the position parameter of the memory hyperparameter corresponding to the first target hyperparameter, step 203 includes the following sub-steps: Sub-step 2031, generating a random number according to uniform distribution.

[0037] In some embodiments of the present application, a random number is generated, which is generated according to a uniform distribution. Uniform distribution means that within a given range, the probability of each value appearing is equal. In this step, the generated random number will be used to determine the position update strategy of the hyperparameter in the subsequent steps. By generating a uniformly distributed random number, it can be ensured that each hyperparameter has the same probability of performing different update operations during the update process, thereby increasing the randomness and diversity of the algorithm.

[0038] For example, in a hyperparameter set containing 200 target hyperparameters, suppose you need to generate a random number between 0 and 1. Generate a random number through uniform distribution, assuming the result is 0.65. This random number will be used in subsequent steps to determine the position update strategy of the hyperparameter. By generating uniformly distributed random numbers, it can be ensured that each hyperparameter has the same probability of performing different update operations during the update process, thereby increasing the randomness and diversity of the algorithm.

[0039] Sub-step 2032, when the random number is greater than or equal to the preset perception threshold, calculate the difference between the position parameter of the memory hyperparameter and the position parameter of the target hyperparameter, and calculate the product of the difference, the preset flight distance parameter, and the random number, and use the sum of the calculated product and the position parameter of the target hyperparameter as the updated position parameter of the target hyperparameter.

[0040] In some embodiments of the present application, the position parameter of the hyperparameter will be updated when the random number is greater than or equal to the preset perception threshold. Specifically, the difference between the position parameter of the memory hyperparameter and the position parameter of the current hyperparameter is multiplied by the preset flight distance parameter and the random number, and then added to the position parameter of the current hyperparameter as the updated position parameter of the hyperparameter. The flight distance parameter is a preset constant used to control the size of the update step. In this way, the position of the hyperparameter can be adjusted within a certain range to make it closer to the position of the memory hyperparameter, thereby improving the optimization effect.

[0041] For example, in a hyperparameter set containing 200 target hyperparameters, assume that the preset perception threshold is 0.5 and the flight distance parameter is 0.1. The generated random number is 0.65, which is greater than the perception threshold of 0.5, so the position parameters of the hyperparameters need to be updated. Assume that the position parameters of the current hyperparameters are (0.3, 0.4) and the position parameters of the memory hyperparameters are (0.5, 0.6). According to the formula, the position parameters of the updated hyperparameters are: [ (0.3, 0.4) + 0.65×0.1×((0.5, 0.6) - (0.3, 0.4)) = (0.3, 0.4) + 0.065×(0.2, 0.2) = (0.3, 0.4) + (0.013, 0.013) = (0.313, 0.413) ] , In this way, the position of the hyperparameters can be gradually adjusted to be closer to the position of the memorized hyperparameters, thereby improving the optimization effect.

[0042] Sub-step 2033, when the random number is less than the perception threshold, randomly generate a target hyperparameter value to serve as the updated target hyperparameter value.

[0043] In some embodiments of the present application, when the random number is less than the perception threshold, a target hyperparameter value is randomly generated as the updated target hyperparameter value. The perception threshold is a preset standard used to determine whether a random selection is required. When the generated random number is less than the perception threshold, the position parameter of the memorized hyperparameter is no longer used for updating. Instead, the position parameter of a hyperparameter is randomly selected from the hyperparameter set in the large language model as the position parameter of the updated hyperparameter. Through this random selection, the algorithm diversity can be increased to avoid falling into a local optimal solution.

[0044] For example, in a hyperparameter set containing 200 target hyperparameters, assuming that the preset perception threshold is 0.5, the generated random number is 0.3, which is less than the perception threshold 0.5. Therefore, a hyperparameter needs to be randomly selected as the updated hyperparameter. Assume that the randomly selected hyperparameter is hyperparameter C, and its position parameter is (0.7, 0.8). Therefore, the position parameter of hyperparameter C will be used as the position parameter of the updated hyperparameter. Through this random selection, the diversity of the algorithm can be increased, avoiding falling into the local optimal solution, thereby improving the optimization effect.

[0045] The above sub-steps 2032 and 2033 can be expressed by the following formula: ; Among them, x i,t+1 represents the updated hyperparameter position parameter, x i,t represents the location parameter of the hyperparameter before update, r i represents a random number, fl represents the flight distance parameter, m j,t Represents the location parameter of the memory hyperparameter, AP j,t represents the perception threshold, and random position represents a random coordinate, that is, the hyperparameter at this time is a random hyperparameter of the large language model.

[0046] Step 204, when the adaptive evaluation value of the updated hyperparameter satisfies a preset quantitative relationship with the adaptive evaluation value of the hyperparameter before the update, the updated hyperparameter is updated to a new memory hyperparameter of the updated hyperparameter, and the process returns to the step of determining a first target hyperparameter in the hyperparameter set of the large language model.

[0047] The method shown in this step has been explained in step 103 and will not be repeated here.

[0048] Step 205 , determining the proxy model evaluation value of the large language model according to the hyperparameter set with the updated memory hyperparameter.

[0049] In some embodiments of the present application, the proxy model evaluation value of the large language model is determined based on the hyperparameter set with updated memory hyperparameters. The proxy model is a technique for approximating the true model evaluation function, which can significantly reduce the computational cost. By using the proxy model, the performance of the hyperparameters can be quickly estimated without performing a full model evaluation.

[0050] like Figure 3 As shown in the figure, since LLM fine-tuning requires the use of large data sets for training, the cost is high. If the complete LLM fine-tuning process is performed on all parameters searched by individuals in the crow search algorithm, the cost is unacceptable. In this regard, the surrogate model technology is introduced to fit the evaluation function through the surrogate model, thereby significantly reducing the individual evaluation cost. The surrogate model technology is shown in the figure below.

[0051] The specific process is as follows: S1: Generate an initial population using the initialization step of the evolutionary algorithm, evaluate the true objective function value for several individuals in the initial population; construct a proxy model, and use the evaluated individual data to train the proxy model; S2: Use a surrogate model to predict the objective function value of unevaluated individuals; perform search and selection operations on the population based on the prediction of the surrogate model instead of directly using the true objective function; S3: Generate new individuals through algorithmic operations, select some new individuals to evaluate the true objective function; add the newly evaluated individual data to the training set, and retrain or update the proxy model based on the new data.

[0052] In the above process, the hyperparameter set can be stored in a dedicated storage code, wherein the storage code is divided into two parts, the first part includes multiple first storage bits, each of which is used to store the memory hyperparameter corresponding to the target hyperparameter, and the second part includes multiple second storage bits, each of which is used to store the integrated weight of a sub-model of each proxy model. In each iteration process, the position of each hyperparameter in the hyperparameter set is updated on the one hand, and the integrated weight of the proxy model is also updated accordingly on the other hand.

[0053] For example, assuming there are 200 target hyperparameters in the hyperparameter set, then in this storage code, the first storage position has 200, and there are three proxy models, so three positions are reserved in the second storage position.

[0054] According to the above process, the steps of searching, selecting, and updating the population are repeated until the stopping condition is met (such as reaching a predetermined number of iterations or an objective function value).

[0055] The updated memorized hyperparameter set contains the hyperparameter positions that performed best in the previous optimization steps. These positions will be used as input to calculate the evaluation value of the surrogate model, thereby guiding subsequent optimization steps.

[0056] It should be emphasized that the proxy model in the above process is required to be a truly evaluated individual, that is, the dimension values ​​of the truly evaluated individuals and the true fitness of the individuals are required to be used as training sets. Therefore, for the proxy evaluated individuals, the dimension values ​​of the proxy evaluated individuals need to be input into the proxy model to obtain the proxy evaluated fitness.

[0057] For example, in a hyperparameter set containing 200 target hyperparameters, suppose that after the optimization in the previous steps, the memory locations of the hyperparameters are updated. Use these updated memory locations as input to build a proxy model, such as a polynomial regression model or a support vector machine (SVM) model. Through the proxy model, calculate the evaluation value of each hyperparameter, assuming that the proxy model evaluation value of hyperparameter B is 0.87. This evaluation value will be used to judge the performance of hyperparameter B in its current state and guide subsequent optimization steps. In this way, the computational cost can be effectively reduced while maintaining a high evaluation accuracy.

[0058] Optionally, step 205 includes the following sub-steps: Sub-step 2051, inputting the hyperparameter set into a plurality of preset sub-agent models respectively to obtain a plurality of sub-evaluation values ​​of the agent model.

[0059] In some embodiments of the present application, the hyperparameter set is respectively input into a plurality of preset sub-agent models to obtain a plurality of proxy model sub-evaluation values. By inputting the hyperparameter set into these sub-agent models, the evaluation value of each sub-agent model for the hyperparameter set can be obtained, and these evaluation values ​​will be used for subsequent normalization and comprehensive evaluation.

[0060] Second paragraph: For example, in a hyperparameter set containing 200 target hyperparameters, suppose three sub-proxy models are used: polynomial regression model, radial basis function (RBF) model, and support vector machine (SVM) model. The hyperparameter set is input into these three sub-proxy models respectively, assuming that the evaluation value of the polynomial regression model is 0.85, the evaluation value of the RBF model is 0.88, and the evaluation value of the SVM model is 0.87. In this way, multiple proxy model sub-evaluation values ​​can be obtained, providing a basis for subsequent normalization and comprehensive evaluation.

[0061] Optionally, during sub-step 2051, the sub-agent model includes one or more of polynomial regression, radial basis function, and support vector machine.

[0062] In some embodiments of the present application, sub-agent models are different model types used to approximate the true model evaluation function. After experiments, in the embodiments of the present application, the polynomial regression model, the radial basis function model and the support vector machine model can all be used as a good choice.

[0063] Sub-step 2052, normalizing the obtained proxy model sub-evaluation value to obtain a normalized evaluation value of the proxy model sub-evaluation value.

[0064] In some embodiments of the present application, the obtained proxy model sub-evaluation values ​​are normalized to obtain normalized evaluation values ​​of the proxy model sub-evaluation values. Normalization refers to converting values ​​of different ranges into a unified range. Through normalization, the dimensional differences between different sub-proxy model evaluation values ​​can be eliminated so that they can be compared and integrated on the same scale. The normalization method can adopt minimum-maximum normalization, that is, subtracting the minimum value from each evaluation value, and then dividing it by the difference between the maximum value and the minimum value.

[0065] For example, in a hyperparameter set containing 200 target hyperparameters, suppose the evaluation value of the polynomial regression model is 0.85, the evaluation value of the RBF model is 0.88, and the evaluation value of the SVM model is 0.87. First, find the minimum value 0.85 and the maximum value 0.88 among these three evaluation values. Then, normalize each evaluation value: Normalized estimate of the polynomial regression model: ((0.85 - 0.85) / (0.88 - 0.85) = 0 / 0.03 = 0); The normalized evaluation value of the RBF model is ((0.88 - 0.85) / (0.88 - 0.85) = 0.03 / 0.03 = 1); The normalized evaluation value of the SVM model is ((0.87-0.85) / (0.88-0.85) = 0.02 / 0.03≈0.67); In this way, the evaluation values ​​of different sub-agent models can be converted to the same scale, which is convenient for subsequent comprehensive evaluation.

[0066] Sub-step 2053, taking the arithmetic mean of the normalized evaluation values ​​of the multiple proxy models as the proxy model evaluation value.

[0067] In some embodiments of the present application, the arithmetic mean of the normalized evaluation values ​​of multiple proxy models is used as the proxy model evaluation value. The arithmetic mean refers to adding all the normalized evaluation values ​​and then dividing by the number of evaluation values. By calculating the arithmetic mean, the evaluation results of multiple sub-proxy models can be combined to obtain a unified proxy model evaluation value. This evaluation value will be used to judge the overall performance of the hyperparameter set and guide subsequent optimization steps.

[0068] For example, in a hyperparameter set containing 200 target hyperparameters, assuming that after the normalization process in the previous step, the normalized evaluation value of the polynomial regression model is 0, the normalized evaluation value of the RBF model is 1, and the normalized evaluation value of the SVM model is 0.67. Add these three normalized evaluation values ​​and divide them by 3 to get the proxy model evaluation value: [ (0 + 1 + 0.67) / 3 = 1.67 / 3 ≈ 0.56 ], In this way, the evaluation results of multiple sub-agent models can be integrated to obtain a unified agent model evaluation value for subsequent optimization and decision-making.

[0069] Step 206: When the proxy model evaluation value is greater than a preset proxy model evaluation threshold, a loop termination command is generated.

[0070] In some embodiments of the present application, a loop abort command is generated when the proxy model evaluation value is greater than a preset proxy model evaluation threshold. The proxy model evaluation value is used to measure the overall performance of the current hyperparameter set. The preset proxy model evaluation threshold is a set standard used to determine whether the optimization goal has been achieved. When the proxy model evaluation value exceeds this threshold, it means that the hyperparameter set has achieved the expected optimization effect. At this time, a loop abort command is generated to stop further iterations and save computing resources.

[0071] For example, in a hyperparameter set containing 200 target hyperparameters, assume that the preset proxy model evaluation threshold is 0.9. The evaluation value of the current hyperparameter set is calculated by the proxy model, and the result is assumed to be 0.92. Since 0.92 is greater than the preset threshold of 0.9, a loop abort command is generated to stop further iterative optimization process. In this way, by setting a reasonable evaluation threshold, the termination condition of the optimization process can be effectively controlled to ensure that it stops in time when the expected effect is achieved, avoiding unnecessary computational overhead.

[0072] Step 207, in response to the loop termination command, uses the value of the memorized hyperparameter of each target hyperparameter in the hyperparameter set to update the value of the hyperparameter corresponding to the target hyperparameter in the large language model, and trains the updated large language model to obtain a trained large language model.

[0073] The method shown in this step has been described in step 104 and will not be repeated here.

[0074] Figure 4 Another large language model fine-tuning parameter optimization method based on the crow search algorithm provided in an embodiment of the present application may include the following steps: In some embodiments of the present application, The method shown in this step has been described in step 104 and will not be repeated here.

[0075] Step 301 , using a preset initialization threshold as the sampling quantity of the target hyperparameter, and determining a plurality of target hyperparameters from all the hyperparameters of the large language model to obtain a hyperparameter set.

[0076] The method shown in this step has been described in step 201 and will not be repeated here.

[0077] Step 302: For each target hyperparameter in the hyperparameter set of the large language model, determine a first target hyperparameter.

[0078] Among them, each target hyperparameter has a corresponding memory hyperparameter in the large language model; the hyperparameter set has a corresponding adaptation evaluation value.

[0079] The method shown in this step has been explained in step 101 and will not be repeated here.

[0080] Step 303, based on the position parameters of each target hyperparameter in the hyperparameter set and the position parameters of the memory hyperparameter corresponding to the first target hyperparameter corresponding to the target hyperparameter, each target hyperparameter in the hyperparameter set is updated, and the adaptation evaluation value of the hyperparameter set is determined after all the target hyperparameters are updated.

[0081] The method shown in this step has been explained in step 102 and will not be repeated here.

[0082] Optionally, in order to update each hyperparameter in the hyperparameter set according to the position parameter of each hyperparameter and the position parameter of the memory hyperparameter corresponding to the first target hyperparameter, step 303 includes the following sub-steps: Step 3031, generate a random number.

[0083] Among them, the random numbers are uniformly distributed.

[0084] The method shown in this step has been explained in step 2031 and will not be repeated here.

[0085] Step 3032, when the random number is greater than or equal to the preset perception threshold, calculate the difference between the position parameter of the memory hyperparameter and the position parameter of the target hyperparameter, and calculate the product of the difference and the preset flight distance parameter and the random number, and use the sum of the calculated product and the position parameter of the target hyperparameter as the updated position parameter of the target hyperparameter.

[0086] The method shown in this step has been explained in step 2032 and will not be repeated here.

[0087] Step 3033, when the random number is less than the perception threshold, randomly generate a target hyperparameter value as the updated target hyperparameter value.

[0088] The method shown in this step has been explained in step 2033 and will not be repeated here.

[0089] Step 304, when the adaptive evaluation value of the updated hyperparameter set satisfies a preset quantitative relationship with respect to the adaptive evaluation value of the hyperparameter set before the update, the position parameter of the target hyperparameter in the updated hyperparameter set is updated to a new memory hyperparameter of the target hyperparameter in the updated hyperparameter set, and the process returns to the step of determining a first target hyperparameter for each target hyperparameter in the hyperparameter set of the large language model.

[0090] The method shown in this step has been explained in step 103 and will not be repeated here.

[0091] In step 305, the number of executions of the step of returning to each target hyperparameter in the hyperparameter set of the large language model and determining a first target hyperparameter is recorded as a loop period.

[0092] In some embodiments of the present application, the number of executions of the step of returning to determine a first target hyperparameter in the hyperparameter set of the large language model is recorded as a loop period. A loop period refers to the number of times a specific step is repeated during the optimization process. By recording the loop period, the progress of the optimization process can be monitored, and when a preset loop period threshold is reached, it is decided whether to continue iterating or generate a loop abort command. This helps to control the time and resource consumption of the optimization process and ensure that the optimization task is completed within a reasonable range.

[0093] For example, in a hyperparameter set containing 200 target hyperparameters, assume that each time you return to the initial step of the iteration, that is, when you determine a first target hyperparameter, you record a cycle. After multiple iterations, assume that 50 cycles have been recorded. By monitoring this number of cycles, you can determine the progress of the optimization process. If the preset cycle threshold is 100, when the recorded cycle reaches or exceeds 100, a loop abort command can be generated to stop further iterative optimization. In this way, by recording and monitoring the cycle, you can effectively manage the time and resources of the optimization process.

[0094] Step 306: When the cycle period is greater than a preset cycle period threshold, a cycle stop command is generated.

[0095] In some embodiments of the present application, a loop abort command is generated when the cycle period is greater than a preset cycle period threshold. The cycle period threshold is a preset standard for determining whether the optimization process needs to continue. When the number of recorded cycle periods exceeds this threshold, it indicates that the optimization process has been iterated enough, and a loop abort command is generated to stop further iterative optimization. This can avoid unnecessary computational overhead and ensure that the optimization process is completed within a reasonable time and resource range.

[0096] For example, in a hyperparameter set containing 200 target hyperparameters, assume that the preset cycle threshold is 100. When the number of recorded cycle cycles reaches or exceeds 100, a loop abort command is generated. Assuming that the number of currently recorded cycle cycles is 100, which exceeds the preset threshold of 100, a loop abort command is generated to stop further iterative optimization. By setting a reasonable cycle threshold, the termination condition of the optimization process can be effectively controlled to ensure that it stops in time when the expected effect is achieved, avoiding unnecessary computational overhead.

[0097] Step 307, in response to the loop abort command, uses the value of the memorized hyperparameter of each target hyperparameter in the hyperparameter set to update the value of the hyperparameter corresponding to the target hyperparameter in the large language model, and trains the updated large language model to obtain a trained large language model.

[0098] The method shown in this step has been described in step 104 and will not be repeated here.

[0099] In summary, in the embodiment of the present application, by determining the first target hyperparameter as a reference point for each target hyperparameter in the hyperparameter set, assigning a corresponding memory hyperparameter to each target hyperparameter, and determining the corresponding adaptation evaluation value for the hyperparameter set, historical information can be retained during the optimization process to perform more accurate parameter adjustments in subsequent steps, avoid repeated calculations, and improve the efficiency and accuracy of the optimization process. Then, according to the position parameters of each target hyperparameter and the position parameters of its corresponding memory hyperparameter, each target hyperparameter in the hyperparameter set is updated, and its updated adaptation evaluation value is determined, so that each hyperparameter is dynamically adjusted by combining the position parameters of the hyperparameter and the memory hyperparameter to make it closer to the optimal solution, that is, the global search capability of the crow search algorithm is utilized to ensure the comprehensiveness and efficiency of parameter optimization. Then, when the adaptation evaluation value of the updated hyperparameter set satisfies the preset quantitative relationship relative to the adaptation evaluation value before the update, the memory hyperparameter is updated, thereby gradually approaching the optimal solution, and finally the hyperparameters of the large language model are replaced by the optimized hyperparameter set, and then the large language model is trained, which significantly improves the performance of the model. Therefore, the method based on the embodiment of the present application overcomes the limitations of the prior art of relying on expert experience and trial and error adjustment, significantly improves the flexibility and efficiency of parameter optimization, reduces costs, and solves the technical problems mentioned in the background technology.

[0100] like Figure 5 As shown, the embodiment of the present application also discloses a large language model fine-tuning parameter optimization device 40 based on the crow search algorithm, comprising: A selection module 401 is used to determine a first target hyperparameter for each target hyperparameter in the hyperparameter set of the large language model; each target hyperparameter has a corresponding memory hyperparameter in the large language model; and the hyperparameter set has a corresponding adaptation evaluation value; A position updating module 402 is used to update each target hyperparameter in the hyperparameter set according to the position parameter of each target hyperparameter in the hyperparameter set and the position parameter of the memory hyperparameter corresponding to the first target hyperparameter corresponding to the target hyperparameter, and determine the adaptation evaluation value of the hyperparameter set after all the target hyperparameters are updated; A memory update module 403 is used for updating the position parameter of the target hyperparameter in the updated hyperparameter set to a new memory hyperparameter of the target hyperparameter in the updated hyperparameter set when the adaptive evaluation value of the updated hyperparameter set satisfies a preset quantitative relationship with the adaptive evaluation value of the hyperparameter set before the update, and returning to the step of determining a first target hyperparameter for each target hyperparameter in the hyperparameter set of the large language model; The tuning training module 404 is used to respond to the loop termination command, use the value of the memorized hyperparameter of each target hyperparameter in the hyperparameter set to update the value of the hyperparameter corresponding to the target hyperparameter in the large language model, and train the updated large language model to obtain a trained large language model.

[0101] Optionally, the location updating module 402 includes: The random submodule is used to generate a random number according to a uniform distribution; A first updating submodule is used to calculate the difference between the position parameter of the memory hyperparameter and the position parameter of the target hyperparameter when the random number is greater than or equal to a preset perception threshold, and calculate the product of the difference, a preset flight distance parameter, and the random number, and use the sum of the calculated product and the position parameter of the target hyperparameter as the updated position parameter of the target hyperparameter; The second updating submodule is used to randomly generate a target hyperparameter value as the updated target hyperparameter value when the random number is less than the perception threshold.

[0102] Optionally, the device 40 further includes: A proxy evaluation module, for determining a proxy model evaluation value of a large language model according to a hyperparameter set having updated memory hyperparameters; The evaluation termination module is used to generate a loop termination command when the proxy model evaluation value is greater than a preset proxy model evaluation threshold.

[0103] Optional, proxy assessment modules include: A sub-model evaluation sub-module, used to input the hyperparameter set into a plurality of preset sub-proxy models respectively to obtain a plurality of proxy model sub-evaluation values; A normalization submodule, used for normalizing the obtained proxy model sub-evaluation value to obtain a normalized evaluation value of the proxy model sub-evaluation value; The mean submodule is used to take the arithmetic mean of the normalized evaluation values ​​of multiple proxy models as the proxy model evaluation value.

[0104] Optionally, the device 40 further includes: A loop counting module, used for recording the number of executions of the step of returning to each target hyperparameter in the hyperparameter set of the large language model and determining a first target hyperparameter as a loop period; The cycle abort module is used to generate a cycle abort command when the cycle period is greater than a preset cycle period threshold.

[0105] Optionally, the device 40 further includes: The initialization module is used to use a preset initialization threshold as the sampling quantity of the target hyperparameter, and determine multiple target hyperparameters from all hyperparameters of the large language model to obtain a hyperparameter set.

[0106] In summary, in the embodiment of the present application, by determining the first target hyperparameter as a reference point for each target hyperparameter in the hyperparameter set, assigning a corresponding memory hyperparameter to each target hyperparameter, and determining the corresponding adaptation evaluation value for the hyperparameter set, historical information can be retained during the optimization process to perform more accurate parameter adjustments in subsequent steps, avoid repeated calculations, and improve the efficiency and accuracy of the optimization process. Then, according to the position parameters of each target hyperparameter and the position parameters of its corresponding memory hyperparameter, each target hyperparameter in the hyperparameter set is updated, and its updated adaptation evaluation value is determined, so that each hyperparameter is dynamically adjusted by combining the position parameters of the hyperparameter and the memory hyperparameter to make it closer to the optimal solution, that is, the global search capability of the crow search algorithm is utilized to ensure the comprehensiveness and efficiency of parameter optimization. Then, when the adaptation evaluation value of the updated hyperparameter set satisfies the preset quantitative relationship relative to the adaptation evaluation value before the update, the memory hyperparameter is updated, thereby gradually approaching the optimal solution, and finally the hyperparameters of the large language model are replaced by the optimized hyperparameter set, and then the large language model is trained, which significantly improves the performance of the model. Therefore, the method based on the embodiment of the present application overcomes the limitations of the prior art of relying on expert experience and trial and error adjustment, significantly improves the flexibility and efficiency of parameter optimization, reduces costs, and solves the technical problems mentioned in the background technology.

[0107] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the embodiment of the large language model fine-tuning parameter optimization method based on the crow search algorithm is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0108] Figure 6700 is a block diagram of an electronic device 700 provided in an embodiment of the present application. For example, the electronic device 700 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0109] Reference Figure 6 , the electronic device 700 may include one or more of the following components: a processing component 702 , a memory 704 , a power component 706 , a multimedia component 708 , an audio component 710 , an input / output (I / O) interface 712 , a sensor component 714 , and a communication component 716 .

[0110] The processing component 702 generally controls the overall operation of the electronic device 700, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 702 may include one or more processors 720 to execute instructions to complete all or part of the steps of the above-mentioned large language model fine-tuning parameter optimization method based on the crow search algorithm. In addition, the processing component 702 may include one or more modules to facilitate the interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate the interaction between the multimedia component 708 and the processing component 702.

[0111] The memory 704 is used to store various types of data to support the operation of the electronic device 700. Examples of such data include instructions for any application or method operating on the electronic device 700, contact data, phone book data, messages, pictures, multimedia, etc. The memory 704 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0112] The power supply component 706 provides power to the various components of the electronic device 700. The power supply component 706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 700.

[0113] The multimedia component 708 includes a screen that provides an output interface between the electronic device 700 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the demarcation of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 708 includes a front camera and / or a rear camera. When the electronic device 700 is in an operating mode, such as a shooting mode or a multimedia mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0114] The audio component 710 is used to output and / or input audio signals. For example, the audio component 710 includes a microphone (MIC), and when the electronic device 700 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is used to receive an external audio signal. The received audio signal can be further stored in the memory 704 or sent via the communication component 716. In some embodiments, the audio component 710 also includes a speaker for outputting audio signals.

[0115] I / O interface 712 provides an interface between processing component 702 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0116] The sensor assembly 714 includes one or more sensors for providing various aspects of status assessment for the electronic device 700. For example, the sensor assembly 714 can detect the open / closed state of the electronic device 700, the relative positioning of components, such as the display and keypad of the electronic device 700, and the sensor assembly 714 can also detect the position change of the electronic device 700 or a component of the electronic device 700, the presence or absence of user contact with the electronic device 700, the orientation or acceleration / deceleration of the electronic device 700, and the temperature change of the electronic device 700. The sensor assembly 714 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 714 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 714 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0117] The communication component 716 is used to facilitate wired or wireless communication between the electronic device 700 and other devices. The electronic device 700 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 7G), or a combination thereof. In an exemplary embodiment, the communication component 716 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0118] In an exemplary embodiment, the electronic device 700 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to implement the large language model fine-tuning parameter optimization method based on the crow search algorithm provided in an embodiment of the present application.

[0119] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 704 including instructions, and the instructions can be executed by a processor 720 of an electronic device 700 to complete the above-mentioned large language model fine-tuning parameter optimization method based on the crow search algorithm. For example, the non-transitory storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.

[0120] Figure 7 8 is a block diagram of an electronic device 800 according to an exemplary embodiment. For example, the electronic device 800 may be provided as a server. Figure 7 The electronic device 800 includes a processing component 822, which further includes one or more processors, and a memory resource represented by a memory 832 for storing instructions executable by the processing component 822, such as an application. The application stored in the memory 832 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 822 is configured to execute instructions to perform the large language model fine-tuning parameter optimization method based on the crow search algorithm provided in an embodiment of the present application.

[0121] The electronic device 800 may also include a power supply component 826 configured to perform power management of the electronic device 800, a wired or wireless network interface 850 configured to connect the electronic device 800 to a network, and an input / output (I / O) interface 858. The electronic device 800 may operate based on an operating system stored in the memory 832, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.

[0122] An embodiment of the present application also provides a computer program product, including a computer program, which implements a large language model fine-tuning parameter optimization method based on a crow search algorithm when the computer program is executed by a processor.

[0123] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the application disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0124] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

[0125] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0126] It is easy for a person skilled in the art to think that any combination of the above embodiments is feasible, so any combination of the above embodiments is an implementation scheme of the present application. However, due to space limitations, this specification will not describe them in detail here.

[0127] The large language model fine-tuning parameter optimization method based on the crow search algorithm provided herein is not inherently related to any specific computer, virtual system or other device. Various general systems can also be used together with the teachings based on this. According to the above description, it is obvious to construct the structure required for the system with the solution of the present application. In addition, the present application is not directed to any specific programming language. It should be understood that the content of the present application described herein can be implemented using various programming languages, and the above description of specific languages ​​is to disclose the best implementation mode of the present application.

[0128] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0129] Similarly, it should be understood that in order to streamline the present application and aid in understanding one or more of the various application aspects, in the above description of the exemplary embodiments of the present application, the various features of the present application are sometimes grouped together into a single embodiment, figure, or description thereof. However, the disclosed method should not be interpreted as reflecting the following intention: the claimed application requires more features than the features explicitly recited in each claim. More specifically, as reflected in the claims, the application aspects lie in less than all the features of the single embodiment disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present application.

[0130] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and further may be divided into a plurality of submodules or subunits or subcomponents. All features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device so disclosed may be combined in any combination, except that at least some of such features and / or processes or units are mutually exclusive. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature that provides the same, equivalent or similar purpose.

[0131] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present application and form different embodiments. For example, in the claims, any one of the claimed embodiments can be used in any combination.

[0132] The various component embodiments of the present application may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the large language model fine-tuning parameter optimization method based on the crow search algorithm according to the embodiment of the present application. The present application may also be implemented as a device or apparatus program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program implementing the present application may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0133] It should be noted that the above embodiments illustrate the present application rather than limit the present application, and that those skilled in the art may design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets should not be constructed as a limitation to the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of multiple such elements. The present application may be implemented by means of hardware including several different elements and by means of a suitably programmed computer. In a unit claim that lists several devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names.

Claims

1. A large language model fine-tuning parameter optimization method based on the crow search algorithm, characterized in that: include: For each target hyperparameter in the hyperparameter set of the large language model, determine a first target hyperparameter; Each of the target hyperparameters has a corresponding memory hyperparameter in the large language model; the hyperparameter set has a corresponding adaptation evaluation value; According to the position parameter of each target hyperparameter in the hyperparameter set and the position parameter of the memory hyperparameter corresponding to the first target hyperparameter corresponding to the target hyperparameter, each target hyperparameter in the hyperparameter set is updated, and an adaptation evaluation value of the hyperparameter set is determined after all the target hyperparameters are updated; When the adaptive evaluation value of the updated hyperparameter set satisfies a preset quantitative relationship with respect to the adaptive evaluation value of the hyperparameter set before the update, updating the position parameter of the target hyperparameter in the updated hyperparameter set to a new memory hyperparameter of the target hyperparameter in the updated hyperparameter set, and returning to each target hyperparameter in the hyperparameter set for the large language model to determine a first target hyperparameter; In response to a loop termination command, the value of the hyperparameter corresponding to the target hyperparameter in the large language model is updated using the value of the memory hyperparameter of each target hyperparameter in the hyperparameter set, and the updated large language model is trained to obtain the trained large language model.

2. The method according to claim 1, characterized in that The updating of each target hyperparameter in the hyperparameter set according to the position parameter of each target hyperparameter in the hyperparameter set and the position parameter of the memory hyperparameter corresponding to the first target hyperparameter corresponding to the target hyperparameter comprises: Generate a random number according to uniform distribution; When the random number is greater than or equal to a preset perception threshold, a difference between the position parameter of the memory hyperparameter and the position parameter of the target hyperparameter is calculated, and a product of the difference, a preset flight distance parameter, and the random number is calculated, and a sum of the calculated product and the position parameter of the target hyperparameter is used as the updated position parameter of the target hyperparameter; When the random number is smaller than the perception threshold, a target hyperparameter value is randomly generated to serve as the updated target hyperparameter value.

3. The method according to claim 1, characterized in that The method further comprises: Determining a proxy model evaluation value of the large language model according to the hyperparameter set with updated memory hyperparameters; When the proxy model evaluation value is greater than a preset proxy model evaluation threshold, the loop termination command is generated.

4. The method according to claim 3, characterized in that The step of determining the proxy model evaluation value of the large language model according to the hyperparameter set with updated memory hyperparameters includes: Inputting the hyperparameter set into a plurality of preset sub-proxy models respectively to obtain a plurality of proxy model sub-evaluation values; Normalizing the obtained proxy model sub-evaluation value to obtain a normalized evaluation value of the proxy model sub-evaluation value; The arithmetic mean of the normalized evaluation values ​​of the multiple proxy models is used as the proxy model evaluation value.

5. The method according to claim 1, characterized in that The method further comprises: The number of executions of returning to each target hyperparameter in the hyperparameter set of the large language model to determine a first target hyperparameter is recorded as a loop period; When the cycle period is greater than a preset cycle period threshold, the cycle abort command is generated.

6. The method according to claim 1, characterized in that The method further comprises: A preset initialization threshold is used as the sampling quantity of the target hyperparameter, and a plurality of target hyperparameters are determined from all the hyperparameters of the large language model to obtain the hyperparameter set.

7. A large language model fine-tuning parameter optimization device based on the crow search algorithm, characterized in that: include: A selection module, for determining a first target hyperparameter for each target hyperparameter in the hyperparameter set of the large language model; Each of the target hyperparameters has a corresponding memory hyperparameter in the large language model; the hyperparameter set has a corresponding adaptation evaluation value; A position updating module, configured to update each of the target hyperparameters in the hyperparameter set according to the position parameter of each of the target hyperparameters in the hyperparameter set and the position parameter of the memory hyperparameter corresponding to the first target hyperparameter corresponding to the target hyperparameter, and determine an adaptation evaluation value of the hyperparameter set after all the target hyperparameters are updated; A memory update module, configured to update the position parameter of the target hyperparameter in the updated hyperparameter set to a new memory hyperparameter of the target hyperparameter in the updated hyperparameter set when the adaptive evaluation value of the updated hyperparameter set satisfies a preset quantitative relationship with respect to the adaptive evaluation value of the hyperparameter set before the update, and return to the step of determining a first target hyperparameter for each target hyperparameter in the hyperparameter set of the large language model; A tuning training module is used to respond to a loop termination command, use the value of the memory hyperparameter of each target hyperparameter in the hyperparameter set to update the value of the hyperparameter corresponding to the target hyperparameter in the large language model, and train the updated large language model to obtain the trained large language model.

8. An electronic device, characterized in that: include: A processor, a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the method as claimed in any one of claims 1 to 6.

10. A computer program product, characterized in that The computer program product stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.