Large language model version iteration method and device based on learning rate path switching
By adopting the learning rate path switching method in the update iteration of large language model versions, the problems of high training costs and degradation of performance are solved, and an effective balance between model performance and training costs are achieved.
Patent Information
- Application Number
- CN202411342985.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-02-28
AI Technical Summary
The iterative method for the update of existing large language model versions is difficult to balance between training cost and pre-training performance, resulting in high training costs or reduced performance.
The learning rate path switching method is adopted to manage the adjustment of learning rate through the main path and multiple branch paths. Pre-training is performed using the maximum learning rate on the main path, providing an initial checkpoint for subsequent version updates; when it is necessary to update the model, switch to the branch path for continued pre-training, and the learning rate goes through a complete fast decay process.
It effectively balances the model performance and total training cost, reduces the training cost, and maintains or improves the pre-training performance of the model.
Smart Images

Figure CN119539115A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a large language model version iteration method based on learning rate path switching, a computer readable storage medium, a computer device, and a large language model version iteration device based on learning rate path switching. Background Art
[0002] In the related art, due to the continuous emergence of new data, version update iteration has become an indispensable requirement for large language models (LLMs); the existing pre-training paradigms for version update iteration of large language models include pre-training from scratch (PTFS) and continuous pre-training (CPT), where pre-training from scratch is to retrain a new version of the language model on new and old data, which means that each time the model is updated, it will be trained from scratch, including the data of the previous version and the newly added data; this method can usually achieve good pre-training performance, but the training cost is high because it needs to retrain the model on all data; while continuous pre-training only further pre-trains the new version of the model based on the checkpoint of the old version on the new data; this method is usually used in resource-constrained situations, such as when computing resources are limited or old data is unavailable, the training cost of continuous pre-training is low because it does not need to retrain on the entire data set, but it may encounter the problem of poor pre-training performance, especially with multiple version updates, the performance may gradually decline; for this reason, how to provide a pre-training paradigm so that the updated model version can achieve better performance while controlling the training cost has become a technical problem that needs to be solved urgently. Summary of the invention
[0003] The present invention aims to solve at least one of the technical problems in the above-mentioned technology to a certain extent. To this end, one purpose of the present invention is to propose a large language model version iteration method based on learning rate path switching, by using a main path and multiple branch paths to manage the adjustment of the learning rate. On the main path, the model is pre-trained using the maximum learning rate to provide an initialization checkpoint for subsequent version updates; when the model needs to be updated, the model training is switched from the main path to the branch path for continued pre-training, and the learning rate undergoes a complete rapid decay process, thereby better balancing the model performance and the total training cost.
[0004] A second object of the present invention is to provide a computer-readable storage medium.
[0005] A third object of the present invention is to provide a computer device.
[0006] The fourth object of the present invention is to propose a large language model version iteration device based on learning rate path switching.
[0007] To achieve the above-mentioned purpose, an embodiment of the first aspect of the present invention proposes a large language model version iteration method based on learning rate path switching, the method comprising the following steps: obtaining a large language model of a current version; continuing to pre-train the large language model of the current version according to a new data set and a checkpoint corresponding to the large language model of the current version to obtain an iterated large language model of the next version, wherein the learning rate path is switched from the main path to the branch path during continued pre-training to continue pre-training the large language model of the current version with a rapidly decaying learning rate; continuing to pre-train the large language model of the current version on the main path at a preset maximum learning rate according to the new data set and the main path checkpoint corresponding to the large language model of the current version to obtain a checkpoint corresponding to the large language model of the next iterated version, so as to provide a checkpoint for subsequent version iterations.
[0008] According to the large language model version iteration method based on learning rate path switching of an embodiment of the present invention, first, a large language model of a current version is obtained; then, the large language model of the current version is continued to be pre-trained according to a new data set and a checkpoint corresponding to the large language model of the current version, so as to obtain a large language model of the next version that has been iterated, wherein the learning rate path is switched from the main path to the branch path during the continued pre-training, so as to continue to pre-train the large language model of the current version with a rapidly decaying learning rate; finally, the large language model of the current version is continued to be pre-trained on the main path at a preset maximum learning rate according to the main path checkpoint corresponding to the new data set and the large language model of the current version, so as to obtain a checkpoint corresponding to the large language model of the next version that has been iterated, so as to provide a checkpoint for subsequent version iterations; thus, by using a main path and multiple branch paths to manage the adjustment of the learning rate, on the main path, the model is pre-trained using the maximum learning rate, and an initialization checkpoint is provided for subsequent version updates; when the model needs to be updated, the model training is switched from the main path to the branch path for continued pre-training, and the learning rate undergoes a complete rapid decay process, thereby better balancing the model performance and the total training cost.
[0009] In addition, the large language model version iteration method based on learning rate path switching proposed in the above embodiment of the present invention may also have the following additional technical features: Optionally, when continuing to pre-train the current version of the large language model with a rapidly decaying learning rate, a hyperparameter is used to control the proportion of the number of rapidly decaying steps to the total number of steps in the update iteration to adjust the speed of the rapid decay of the learning rate.
[0010] Optionally, when performing the first large language model version iteration, the large language model to be iterated is pre-trained from scratch using a preset maximum learning rate on the main path.
[0011] Optionally, the learning rate includes a first learning rate and a second learning rate, the first learning rate is greater than the second learning rate, and the first learning rate serves as the preset maximum learning rate. When continuing pre-training, the first learning rate decays rapidly from the first learning rate to the second learning rate to obtain an iterated next version of the large language model.
[0012] To achieve the above-mentioned purpose, the second aspect of the present invention proposes a computer-readable storage medium, on which a large language model version iteration program based on learning rate path switching is stored. When the large language model version iteration program based on learning rate path switching is executed by a processor, the large language model version iteration method based on learning rate path switching as described above is implemented.
[0013] According to the computer-readable storage medium of an embodiment of the present invention, a large language model version iteration program based on learning rate path switching is stored, so that when the large language model version iteration program based on learning rate path switching is executed by a processor, the above-mentioned large language model version iteration method based on learning rate path switching is implemented. Thus, by using a main path and multiple branch paths to manage the adjustment of the learning rate, on the main path, the model is pre-trained using the maximum learning rate to provide an initialization checkpoint for subsequent version updates; when the model needs to be updated, the model training is switched from the main path to the branch path for continued pre-training, and the learning rate undergoes a complete rapid decay process, thereby better balancing the model performance and the total training cost.
[0014] To achieve the above-mentioned objectives, the third aspect of the present invention proposes a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the large language model version iteration method based on learning rate path switching as described above is implemented.
[0015] According to the computer device of an embodiment of the present invention, a large language model version iteration program based on learning rate path switching is stored in a memory, so that when the large language model version iteration program based on learning rate path switching is executed by a processor, the above-mentioned large language model version iteration method based on learning rate path switching is implemented. Thus, the adjustment of the learning rate is managed by using a main path and multiple branch paths. On the main path, the model is pre-trained using the maximum learning rate to provide an initialization checkpoint for subsequent version updates; when the model needs to be updated, the model training is switched from the main path to the branch path for continued pre-training, and the learning rate undergoes a complete rapid decay process, thereby better balancing the model performance and the total training cost.
[0016] To achieve the above-mentioned purpose, the fourth aspect of the present invention proposes a large language model version iteration device based on learning rate path switching, including: an acquisition module, used to obtain the current version of the large language model; a version iteration module, used to continue pre-training the current version of the large language model according to a new data set and the checkpoint corresponding to the current version of the large language model, so as to obtain an iterated next version of the large language model, wherein when continuing pre-training, the learning rate path is switched from the main path to the branch path, so as to continue pre-training the current version of the large language model with a rapidly decaying learning rate; a checkpoint update module, used to update the current version of the large language model according to the new data set and the checkpoint corresponding to the current version of the large language model. The main path checkpoint corresponding to the large language model of the previous version continues to pre-train the large language model of the current version on the main path at a preset maximum learning rate to obtain the checkpoint corresponding to the large language model of the next iterated version, so as to provide a checkpoint for subsequent version iterations; thus, by using a main path and multiple branch paths to manage the adjustment of the learning rate, on the main path, the model is pre-trained using the maximum learning rate to provide an initialization checkpoint for subsequent version updates; when the model needs to be updated, the model training switches from the main path to the branch path for continued pre-training, and the learning rate undergoes a complete rapid decay process, thereby better balancing the model performance and the total training cost.
[0017] In addition, the large language model version iteration device based on learning rate path switching proposed in the above embodiment of the present invention may also have the following additional technical features: Optionally, when continuing to pre-train the current version of the large language model with a rapidly decaying learning rate, a hyperparameter is used to control the proportion of the number of rapidly decaying steps to the total number of steps in the update iteration to adjust the speed of the rapid decay of the learning rate.
[0018] Optionally, when performing the first large language model version iteration, the large language model to be iterated is pre-trained from scratch using a preset maximum learning rate on the main path.
[0019] Optionally, the learning rate includes a first learning rate and a second learning rate, the first learning rate is greater than the second learning rate, and the first learning rate serves as the preset maximum learning rate. When continuing pre-training, the first learning rate decays rapidly from the first learning rate to the second learning rate to obtain an iterated next version of the large language model. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A schematic diagram of a flow chart of a large language model version iteration method based on learning rate path switching according to an embodiment of the present invention; Figure 2A schematic diagram of a learning rate curve of a cosine learning rate plan for updating four versions of a large language model according to the pre-training from scratch, continued pre-training, and the paradigm of the present application in an embodiment of the present invention; wherein curves of different colors represent different version updates of the large language model; Figure 3 4 is a block diagram of a large language model version iteration device based on learning rate path switching according to an embodiment of the present invention. DETAILED DESCRIPTION
[0021] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0022] In order to better understand the above technical solution, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.
[0023] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0024] Figure 1 : is a flow chart of a large language model version iteration method based on learning rate path switching according to an embodiment of the present invention. Figure 1 As shown, the large language model version iteration method based on learning rate path switching in an embodiment of the present invention includes the following steps: S101, obtaining the current version of the large language model.
[0025] That is to say, the current version of the big prediction model is obtained first, so as to update and iterate the version based on the current version of the big prediction model.
[0026] S102, continuing pre-training the current version of the large language model according to the new data set and the checkpoint corresponding to the current version of the large language model to obtain an iterated next version of the large language model, wherein the learning rate path is switched from the main path to the branch path during the continued pre-training to continue pre-training the current version of the large language model with a rapidly decaying learning rate.
[0027] It should be noted that the checkpoint corresponding to the current version of the large language model can be obtained by pre-training the previous version of the large language model on the main path at a preset maximum learning rate based on the data set for training the current version and the checkpoint corresponding to the previous version of the large language model when version update iteration is needed.
[0028] The dataset may be composed of mixed data from publicly available sources for the training corpus, including code, papers, Wikipedia, books, mathematics, CommonCrawl and C4, web pages, translations, etc., which is not specifically limited in this application.
[0029] As an embodiment, when continuing to pre-train the current version of the large language model with a rapidly decaying learning rate, a hyperparameter is used to control the ratio of the number of rapidly decaying steps to the total number of steps in the update iteration to adjust the speed of the rapid decay of the learning rate.
[0030] It should be noted that when continuing pre-training, the hyperparameters Control the ratio of fast decay steps to total steps in each update iteration. Fast decay steps affect model performance and training cost. In order to select the best This application tried different Value: from 0.2 to 0.8, increasing by 0.2 each time, and observing the changes in the pre-training performance and training cost of the learning rate path switching training paradigm of this application; the results show that when When set to 0.6 and 0.8, the overall performance of different versions of the large language model is optimal. When set to 0.6, the learning rate path switching training paradigm of this application achieves lower training cost. Set to 0.6.
[0031] As an embodiment, when performing the first large language model version iteration, the large language model to be iterated is pre-trained from scratch using a preset maximum learning rate on the main path.
[0032] That is to say, when performing the first large language model version iteration, the large language model to be iterated is pre-trained from scratch using a preset maximum learning rate on the main path to provide an initial model checkpoint for subsequent version updates.
[0033] S103, according to the new data set and the main path checkpoint corresponding to the current version of the large language model, continue to pre-train the current version of the large language model on the main path with a preset maximum learning rate to obtain the checkpoint corresponding to the next version of the large language model after the iteration, so as to provide a checkpoint for subsequent version iterations.
[0034] It should be noted that each time the large language model needs to be updated and iterated, the above steps S101-S103 can be repeated, the new data set can be used for continued pre-training, and the checkpoints obtained by training with the preset maximum learning rate can be saved.
[0035] In addition, in the training process of machine learning and deep learning, a checkpoint refers to a snapshot of the model parameters (weights and biases) saved at a specific point in time during the model training process; the checkpoint obtained by pre-training on the main path provides a superior initialization state for continued pre-training on the branch path, which helps to converge quickly on new data and maintain good performance; in this way, the training cost can be effectively controlled while maintaining or improving the pre-training performance of the model.
[0036] As an embodiment, the learning rate includes a first learning rate and a second learning rate, the first learning rate is greater than the second learning rate, and the first learning rate is used as a preset maximum learning rate. When continuing pre-training, the first learning rate decays rapidly from the first learning rate to the second learning rate to obtain an iterated next version of the large language model.
[0037] It should be noted that in order to verify the generalization of the maximum learning rate in this application, experiments were conducted by setting the maximum learning rate to 5e-5, 1e-4, 3e-4, 5e-4, and 8e-4. As the maximum learning rate increased, the paradigm of the present application always achieved better or comparable performance than pre-training from scratch, not to mention continued pre-training, which strongly highlights the generalization of the paradigm of the present application in terms of maximum learning rate; as an example, the first learning rate can be set to 3e-4 and the second learning rate can be set to 3e-5.
[0038] In addition, if Figure 2 As shown, by comparing the learning rate curve diagrams of the cosine learning rate schedule of updating four versions of a large language model using pre-training from scratch, continued pre-training, and the paradigm of the present application, the paradigm of the present application can reduce the total training cost to 58% (the same order of magnitude as continued pre-training) while maintaining the performance of a large language model comparable to pre-training from scratch.
[0039] Specifically, in order to further compare the differences in training costs between different training modes, this application defines their time complexity functions as the total number of training steps for version updates. Before giving the definition, two symbols are first introduced to facilitate the subsequent description: 1) : The number of large language model version updates; 2) : Assume that the number of steps for each model update is Step. When pre-training a large language model from scratch, it needs to be updated step, continuing pre-training requires updating step, and the pre-training paradigm of this application needs to be updated Step, where Control the proportion of the number of steps that decay rapidly to the total number of steps in each version update. Based on the above, it can be concluded that different pre-training paradigms have different effects on training. The total costs of the 2 versions of the large language model are:
[0040]
[0041]
[0042] It can be seen that the total cost of pre-training from scratch is about A quadratic function of , while continuing pre-training and our paradigm is about It is a linear function of , so it can be said that the paradigm of this application and pre-training from scratch are of the same order of magnitude in terms of total training cost; it should be noted that for the last version, the additional main path training for preparing the initialization checkpoint for the next update can be omitted, which accounts for steps, so only need step.
[0043] In addition, the model performance and training cost of training different versions of large language models using the paradigm of pre-training from scratch, continued pre-training, and this application can be measured by perplexity (PPL(↓)), as shown in the following table:
[0044] As shown in the table, based on any of the learning rate scheduling of cosine, Knee and multi-step, the paradigm of this application can achieve performance comparable to pre-training from scratch while saving 42% of the total cost (the same order of magnitude as continued pre-training).
[0045] In summary, according to the large language model version iteration method based on learning rate path switching of an embodiment of the present invention, first, the large language model of the current version is obtained; then, the large language model of the current version is continued to be pre-trained according to the new data set and the checkpoint corresponding to the large language model of the current version, so as to obtain the large language model of the next version that has been iterated, wherein the learning rate path is switched from the main path to the branch path during the continued pre-training, so as to continue to pre-train the large language model of the current version with a rapidly decaying learning rate; finally, the large language model of the current version is continued to be pre-trained on the main path at a preset maximum learning rate according to the main path checkpoint corresponding to the new data set and the current version of the large language model, so as to obtain the checkpoint corresponding to the large language model of the next version that has been iterated, so as to provide a checkpoint for subsequent version iterations; thus, by using one main path and multiple branch paths to manage the adjustment of the learning rate, on the main path, the model is pre-trained using the maximum learning rate to provide an initialization checkpoint for subsequent version updates; when the model needs to be updated, the model training is switched from the main path to the branch path for continued pre-training, and the learning rate undergoes a complete rapid decay process, thereby better balancing the model performance and the total training cost.
[0046] In addition, an embodiment of the present invention also proposes a computer-readable storage medium, on which a large language model version iteration program based on learning rate path switching is stored. When the large language model version iteration program based on learning rate path switching is executed by a processor, the large language model version iteration method based on learning rate path switching as described above is implemented.
[0047] According to the computer-readable storage medium of an embodiment of the present invention, a large language model version iteration program based on learning rate path switching is stored, so that when the large language model version iteration program based on learning rate path switching is executed by a processor, the above-mentioned large language model version iteration method based on learning rate path switching is implemented. Thus, by using a main path and multiple branch paths to manage the adjustment of the learning rate, on the main path, the model is pre-trained using the maximum learning rate to provide an initialization checkpoint for subsequent version updates; when the model needs to be updated, the model training is switched from the main path to the branch path for continued pre-training, and the learning rate undergoes a complete rapid decay process, thereby better balancing the model performance and the total training cost.
[0048] In addition, the third aspect of the present invention proposes a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the large language model version iteration method based on learning rate path switching as described above is implemented.
[0049] According to the computer device of an embodiment of the present invention, a large language model version iteration program based on learning rate path switching is stored in a memory, so that when the large language model version iteration program based on learning rate path switching is executed by a processor, the above-mentioned large language model version iteration method based on learning rate path switching is implemented. Thus, the adjustment of the learning rate is managed by using a main path and multiple branch paths. On the main path, the model is pre-trained using the maximum learning rate to provide an initialization checkpoint for subsequent version updates; when the model needs to be updated, the model training is switched from the main path to the branch path for continued pre-training, and the learning rate undergoes a complete rapid decay process, thereby better balancing the model performance and the total training cost.
[0050] In order to implement the above embodiment, the embodiment of the present invention also proposes a large language model version iteration device based on learning rate path switching, such as Figure 3 As shown, the large language model version iteration device based on learning rate path switching includes: an acquisition module 10, a version iteration module 20 and a checkpoint update module 30.
[0051] Among them, the acquisition module 10 is used to obtain the large language model of the current version; the version iteration module 20 is used to continue pre-training the large language model of the current version according to the new data set and the checkpoint corresponding to the large language model of the current version, so as to obtain the large language model of the next version that has been iterated, wherein the learning rate path is switched from the main path to the branch path during the continued pre-training, so as to continue pre-training the large language model of the current version with a rapidly decaying learning rate; the checkpoint update module 30 is used to continue pre-training the large language model of the current version on the main path at a preset maximum learning rate according to the main path checkpoint corresponding to the new data set and the current version of the large language model, so as to obtain the checkpoint corresponding to the large language model of the next version that has been iterated, so as to provide a checkpoint for subsequent version iterations.
[0052] As an embodiment, when continuing to pre-train the current version of the large language model with a rapidly decaying learning rate, a hyperparameter is used to control the ratio of the number of rapidly decaying steps to the total number of steps in the update iteration to adjust the speed of the rapid decay of the learning rate.
[0053] As an embodiment, when performing the first large language model version iteration, the large language model to be iterated is pre-trained from scratch using a preset maximum learning rate on the main path.
[0054] As an embodiment, the learning rate includes a first learning rate and a second learning rate, the first learning rate is greater than the second learning rate, and the first learning rate is used as a preset maximum learning rate. When continuing pre-training, the first learning rate decays rapidly from the first learning rate to the second learning rate to obtain an iterated next version of the large language model.
[0055] It should be noted that the above description and examples of the large language model version iteration method based on learning rate path switching are also applicable to the large language model version iteration device based on learning rate path switching in this embodiment, and will not be repeated here.
[0056] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0057] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0058] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0059] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0060] It should be noted that in the claims, any reference signs placed between brackets shall not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claim. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention may be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third etc. does not indicate any order. These words may be interpreted as names.
[0061] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0062] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
[0063] In the description of the present invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0064] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0065] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may mean that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, a first feature being "above", "above" or "above" a second feature may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is higher in level than the second feature. A first feature being "below", "below" or "below" a second feature may mean that the first feature is directly below or obliquely below the second feature, or simply means that the first feature is lower in level than the second feature.
[0066] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms should not be understood as necessarily referring to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.
[0067] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A large language model version iteration method based on learning rate path switching, characterized in that: The following steps are involved: Get the current version of the large language model; Continue pre-training the current version of the large language model according to the new data set and the checkpoint corresponding to the current version of the large language model to obtain an iterated next version of the large language model, wherein the learning rate path is switched from the main path to the branch path during the continued pre-training to continue pre-training the current version of the large language model using a fast-decaying learning rate; According to the new data set and the main path checkpoint corresponding to the current version of the large language model, continue to pre-train the current version of the large language model on the main path at a preset maximum learning rate to obtain the checkpoint corresponding to the next version of the iterated large language model, so as to provide checkpoints for subsequent version iterations.
2. The large language model version iteration method based on learning rate path switching according to claim 1, characterized in that: When continuing to pre-train the current version of the large language model with a fast-decaying learning rate, a hyperparameter is used to adjust the ratio of the number of steps of learning rate decay to the total number of steps to control the decay speed of the learning rate in the update iteration.
3. The large language model version iteration method based on learning rate path switching according to claim 1, characterized in that: When performing the first large language model version iteration, the large language model to be iterated is pre-trained from scratch using a preset maximum learning rate on the main path.
4. The large language model version iteration method based on learning rate path switching according to any one of claims 1 to 3, characterized in that: The learning rate includes a first learning rate and a second learning rate, the first learning rate is greater than the second learning rate, the first learning rate is used as the preset maximum learning rate, and when continuing pre-training, the first learning rate is quickly decayed from the first learning rate to the second learning rate to obtain the next version of the iterated large language model.
5. A computer-readable storage medium, characterized in that: A large language model version iteration program based on learning rate path switching is stored thereon, and when the large language model version iteration program based on learning rate path switching is executed by a processor, a large language model version iteration method based on learning rate path switching as described in any one of claims 1-4 is implemented.
6. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the large language model version iteration method based on learning rate path switching according to any one of claims 1 to 4 is implemented.
7. A large language model version iteration device based on learning rate path switching, characterized in that: include: The acquisition module is used to obtain the current version of the large language model; A version iteration module, used for continuing pre-training the large language model of the current version according to the new data set and the checkpoint corresponding to the large language model of the current version, so as to obtain the large language model of the next iterated version, wherein when continuing pre-training, the learning rate path is switched from the main path to the branch path, so as to continue pre-training the large language model of the current version with a fast decaying learning rate; A checkpoint update module is used to continue pre-training the current version of the large language model on the main path at a preset maximum learning rate according to the new data set and the main path checkpoint corresponding to the current version of the large language model, so as to obtain the checkpoint corresponding to the next version of the iterated large language model, so as to provide a checkpoint for subsequent version iterations.
8. The large language model version iteration device based on learning rate path switching according to claim 7, characterized in that: When the current version of the large language model is continued to be pre-trained with a rapidly decaying learning rate, a hyperparameter is used to control the ratio of the number of rapidly decaying steps to the total number of steps in the update iteration, so as to adjust the speed of the rapid decay of the learning rate.
9. The large language model version iteration device based on learning rate path switching according to claim 7, characterized in that: When performing the first large language model version iteration, the large language model to be iterated is pre-trained from scratch using a preset maximum learning rate on the main path.
10. The large language model version iteration device based on learning rate path switching according to any one of claims 7 to 9, characterized in that: The learning rate includes a first learning rate and a second learning rate, the first learning rate is greater than the second learning rate, the first learning rate is used as the preset maximum learning rate, and when continuing pre-training, the first learning rate is quickly decayed from the first learning rate to the second learning rate to obtain the next version of the iterated large language model.