Large language model fine tuning method and device based on network layer similarity, electronic equipment and storage medium
By constructing and fine-tuning the sub-model of the large language model based on the network layer similarity method, the problem of data leakage and high computing costs during the fine-tuning of the large language model is solved, and efficient and safe model fine-tuning effect is achieved.
Patent Information
- Application Number
- CN202411697921.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-11-25
AI Technical Summary
The prior art has problems of data leakage and high computing costs in the fine-tuning of large language models, and it is difficult to achieve efficient model fine-tuning in application scenarios with resource limitations.
Through a method based on the similarity of the network layer, network layers with similar structures and functions in the initial large language model are identified, sub-models are constructed, and sub-models are trained to adjust the parameters of the initial large language model to achieve fine-tuning of the target large language model.
While protecting the privacy of user data and model parameters, this method improves the efficiency of model fine-tuning, enhances the security and privacy protection capabilities of the fine-tuning process, and is suitable for application scenarios with resource limitations.
Smart Images

Figure CN119647556A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a large language model fine-tuning method and device based on network layer similarity, as well as an electronic device and a storage medium. Background Art
[0002] In the prior art, in order to adapt large language models (LLMs) to tasks and datasets in specific fields, it is usually necessary to fine-tune LLMs. However, the fine-tuning process may involve private data of users, and it is necessary to avoid data leakage and improve the security and privacy of the fine-tuning process. On the other hand, since the number of model parameters of LLMs is usually large, directly fine-tuning the entire LLMs requires a lot of computing and time costs, and will limit the availability and flexibility of the LLMs model. It is difficult to achieve efficient model fine-tuning in resource-constrained application scenarios. Summary of the invention
[0003] In view of this, the present disclosure proposes a technical solution of a large language model fine-tuning method, device, electronic device and storage medium based on network layer similarity.
[0004] According to one aspect of the present disclosure, a large language model fine-tuning method based on network layer similarity is provided, comprising: determining the network layer similarity between any two adjacent network layers in an initial large language model according to a sample data set corresponding to a target natural language processing task; constructing a sub-model corresponding to the initial large language model according to the network layer similarity between any two adjacent network layers in the initial large language model; training the sub-model according to the sample data set to determine a trained sub-model; adjusting the initial large language model according to model parameters corresponding to the trained sub-model to determine a target large language model, wherein the target large language model has the ability to process the target natural language processing task.
[0005] In a possible implementation, the determining the network layer similarity between any two adjacent network layers in the initial large language model based on a sample data set corresponding to a target natural language processing task includes: after inputting any sample data included in the sample data set into the initial large language model, for any network layer of the initial large language model, determining the output feature corresponding to the network layer based on the output data of the network layer; and determining the network layer similarity between any two adjacent network layers based on the output feature corresponding to each network layer.
[0006] In a possible implementation, the output features corresponding to any network layer include the sentence vector corresponding to the network layer; after inputting any sample data included in the sample data set into the initial large language model, for any network layer of the initial large language model, according to the output data of the network layer, determining the output features corresponding to the network layer includes: for any network layer of the initial large language model, according to the input sequence length of the sample data input into the initial large language model, determining the hidden layer output state and position weight corresponding to each position token in the output data of the network layer; for any network layer of the initial large language model, according to the hidden layer output state and position weight corresponding to each position token in the output data of the network layer, determining the sentence vector corresponding to the network layer.
[0007] In a possible implementation, determining the network layer similarity between any two adjacent network layers based on the output features corresponding to each network layer includes: using a central kernel analysis method to determine the network layer similarity between any two adjacent network layers based on the sentence vectors corresponding to each network layer.
[0008] In a possible implementation, constructing a sub-model corresponding to the initial large language model according to the network layer similarity between any two adjacent network layers in the initial large language model includes: using a hierarchical clustering method, according to the network layer similarity between any two adjacent network layers, iteratively clustering all network layers of the initial large language model, determining multiple cluster sets, and a cluster index corresponding to each cluster set, until the number of cluster sets is equal to the preset number of storable network layers, wherein any cluster set includes multiple adjacent network layers, and the cluster index corresponding to any cluster set includes the number of network layers included in the cluster set and the position of each network layer in the cluster set in the initial large language model; for any cluster set, according to the cluster index corresponding to the cluster set, among the multiple network layers included in the cluster set, determining a representative network layer corresponding to the cluster set; and determining the sub-model according to the representative network layer corresponding to each cluster set.
[0009] In a possible implementation, the sub-model is determined according to the representative network layer corresponding to each cluster set, including: for any cluster set, according to the cluster index corresponding to the cluster set, copying the representative network layer corresponding to the cluster set, and determining the multiple copied representative network layers corresponding to the cluster set, wherein the number of copied representative network layers is equal to the number of network layers included in the cluster set; according to the cluster index corresponding to each cluster set, connecting the multiple representative network layers corresponding to each cluster set to determine the sub-model.
[0010] In a possible implementation, the initial large language model is adjusted according to the model parameters corresponding to the trained sub-model to determine the target large language model, including: using the cluster index corresponding to each cluster set to determine the parameter correspondence between the trained sub-model and the initial large language model; according to the parameter correspondence and the model parameters corresponding to the trained sub-model, the model parameters corresponding to the initial large language model are replaced to determine the target large language model.
[0011] According to another aspect of the present disclosure, a large language model fine-tuning device based on network layer similarity is provided, comprising: a similarity analysis module, used to determine the network layer similarity between any two adjacent network layers in an initial large language model according to a sample data set corresponding to a target natural language processing task; a sub-model construction module, used to construct a sub-model corresponding to the initial large language model according to the network layer similarity between any two adjacent network layers in the initial large language model; a sub-model training module, used to train the sub-model according to the sample data set to determine the trained sub-model; and a model parameter adjustment module, used to adjust the initial large language model according to the model parameters corresponding to the trained sub-model to determine the target large language model, wherein the target large language model has the ability to process the target natural language processing task.
[0012] According to another aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to implement the above method when executing the instructions stored in the memory.
[0013] According to another aspect of the present disclosure, a non-volatile computer-readable storage medium is provided, on which computer program instructions are stored, wherein the computer program instructions implement the above method when executed by a processor.
[0014] In the embodiment of the present disclosure, according to the sample data set corresponding to the target natural language processing task, the network layer similarity between any two adjacent network layers in the initial large language model is determined, so that according to the network layer similarity between any two adjacent network layers in the initial large language model, the network layers with similar structures and functions in the initial large language model can be identified, and by removing the redundant network layers with high similarity, the modular structure emerging inside the initial large language model is fully utilized to construct the sub-model corresponding to the initial large language model. According to the sample data set, the sub-model can be trained to determine the trained sub-model, and then according to the model parameters corresponding to the trained sub-model, the initial large language model can be targeted and efficiently adjusted, and the knowledge related to the target natural language processing task obtained in the trained sub-model is integrated into the initial large language model to determine the target large language model with the ability to process the target natural language processing task. Through the embodiment of the present disclosure, on the one hand, it can be ensured that the model parameters corresponding to the initial large language model will not be completely leaked, and on the other hand, the external transmission of the sample data set that may involve user privacy can be avoided, so that the efficiency of model fine-tuning can be improved while comprehensively improving the security and privacy protection capabilities of model fine-tuning.
[0015] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.
[0017] Figure 1 A flowchart of a large language model fine-tuning method based on network layer similarity according to an embodiment of the present disclosure is shown;
[0018] Figure 2 A schematic diagram showing a process of a large language model fine-tuning method based on network layer similarity according to an embodiment of the present disclosure is shown;
[0019] Figure 3 A block diagram of a large language model fine-tuning device based on network layer similarity according to an embodiment of the present disclosure is shown;
[0020] Figure 4 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0021] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
[0022] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
[0023] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.
[0024] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.
[0025] In the prior art, large language models (LLMs), such as the BERT (Bidirectional Encoder Representation from Transformers) model, the GPT (Generative Pre-Training) series of models, the T5 (Transfer Text-to-Text Transformer) model, and the LlaMA (Large Language Model Meta AI) model, have become an important research and application foundation in the field of natural language processing (NLP). These models are usually composed of billions or even trillions of parameters, and have acquired powerful language understanding and generation capabilities by pre-training on large-scale text data. They have demonstrated excellent performance in a variety of NLP tasks, including but not limited to text classification, question and answer, machine translation, and text generation. As the model scale continues to expand, the generalization ability of LLMs is also constantly improving, and it can handle more complex language tasks.
[0026] In order to adapt LLMs to tasks and data sets in specific fields, it is usually necessary to fine-tune the model parameters of LLMs. However, the fine-tuning process of LLMs may involve the use of users' private data, such as personal identity, health records, or financial information; at the same time, the model structure and model parameters of LLMs belong to the intellectual property of the LLMs owner. In the process of fine-tuning LLMs, there is also a risk of improper disclosure or copying, resulting in infringement of the intellectual property rights of the LLMs owner. Therefore, in order to improve the security and privacy of the LLMs fine-tuning process, it is necessary to avoid the leakage of LLMs-related data.
[0027] On the other hand, since the number of model parameters of LLMs is usually large, directly fine-tuning the entire LLMs will require a lot of computational and time costs, and will limit the availability and flexibility of the LLMs model, making it difficult to achieve efficient model fine-tuning in resource-constrained application scenarios.
[0028] In the prior art, in order to solve the above problems, a variety of parameter fine-tuning technologies for LLMs have been proposed, for example, inserting small trainable neural network modules into existing LLMs and only updating the parameters of these modules instead of the parameters of the entire model, namely the adapter optimization (Adapter) technology; only updating a small part of the parameters in the LLMs model, such as bias terms, etc., to reduce the number of parameters that need to be fine-tuned, namely the bit parameter optimization (BitFit) technology; inserting a low-rank matrix into the weight matrix to capture parameter changes during the fine-tuning process, thereby reducing the number of parameters that need to be stored and updated, namely the low-rank optimization (LoRA) technology; and offline fine-tuning (Offsite-Tuning) technology in which model privacy protection is achieved by compressing and transferring model layers between the server and the user end, the user end receives the compressed model layer, then fine-tunes it on local data, and then sends the updated layer parameters back to the server for integration.
[0029] Although the above-mentioned parameter fine-tuning techniques can improve data privacy protection and / or parameter fine-tuning efficiency, they usually have problems such as performance sacrifice and cannot fully exert the performance and efficiency of LLMs. For example, methods such as adapter optimization technology and bit parameter optimization technology, while reducing the number of parameters that need to be fine-tuned, may not be able to fully utilize all the information in LLMs, thereby affecting the final performance of the fine-tuned LLMs; while low-rank optimization technology has high requirements on the model structure of LLMs themselves, it may not be suitable for all types of LLMs; offline fine-tuning technology has a strong advantage in privacy protection, but it may lose some LLMs performance due to the uniform selection of layers, and it cannot be customized for tasks, nor is it designed for the characteristics of the internal network of LLMs.
[0030] In view of this, the present disclosure provides a large language model fine-tuning method based on network layer similarity, which can use the network layer similarity of LLMs to select network layers in a targeted manner and build a sub-model that can fully utilize the model information of the initial large language model; after completing the training of the sub-model according to the sample data set, the model parameters of the trained sub-model can be used to adjust the initial large language model, which can effectively improve the efficiency of model fine-tuning while protecting the privacy of user data and model parameters. The large language model fine-tuning method based on network layer similarity of an embodiment of the present disclosure is described in detail below.
[0031] Figure 1 A flow chart of a large language model fine-tuning method based on network layer similarity according to an embodiment of the present disclosure is shown. The large language model fine-tuning method based on network layer similarity can be executed by an electronic device such as a terminal device or a server. The terminal device can be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. The large language model fine-tuning method based on network layer similarity can be implemented by a processor calling computer-readable instructions stored in a memory. Alternatively, the large language model fine-tuning method based on network layer similarity can be executed by a server. As Figure 1 As shown, the large language model fine-tuning method based on network layer similarity includes:
[0032] In step S11, the network layer similarity between any two adjacent network layers in the initial large language model is determined according to the sample data set corresponding to the target natural language processing task.
[0033] The specific content of the target natural language processing task here can be flexibly set according to the actual usage scenario, and may include customized tasks corresponding to natural language processing tasks such as text classification, question and answer, machine translation and text generation in different usage scenarios. For example, it may include chatbots for specific vertical fields (financial field, medical field, etc.), etc. The present disclosure does not make specific limitations on this.
[0034] The specific content of the sample data set corresponding to the target natural language processing task can be flexibly set according to the specific content of the target natural language processing task, and this disclosure does not make any specific limitations on this.
[0035] In one example, the target natural language processing task is a text classification task in the financial field, and its corresponding sample data set may include a plurality of text data related to the financial field, and a classification label corresponding to each text data in the financial field.
[0036] The specific method of obtaining the sample data set can refer to the implementation methods in the relevant technology. For example, the sample data set can be constructed based on the downstream task pre-data provided by the target user, or it can be constructed by using open source data corresponding to other natural language processing tasks similar to the target natural language processing task. The present disclosure does not make specific limitations on this.
[0037] The initial large language model may refer to a large language model that has not been adjusted in any targeted manner after pre-training. The specific form of the large language model may refer to the implementation methods in the related art, and the present disclosure does not specifically limit this. Typically, the initial large language model is deployed on a cloud server, and the user may interact with the initial large language model through a user terminal connected to the cloud server.
[0038] After the sample data in the sample data set is input into the initial large language model, the network layer similarity between any two adjacent network layers in the initial large language model can be calculated. Among them, the network layer similarity between any two adjacent network layers can quantitatively reflect the functional similarity of the two network layers for the target natural language processing task, so as to analyze the difference in the knowledge distribution inside the model when the initial large language model processes tasks in different fields. The specific method of determining the network layer similarity can be flexibly set according to the actual use requirements, and the present disclosure does not make specific limitations on this.
[0039] The following text will describe in detail the process of determining the network layer similarity between any two adjacent network layers in the initial large language model based on the sample data set corresponding to the target natural language processing task in combination with possible implementation methods of the present disclosure, which will not be elaborated here.
[0040] In step S12, a sub-model corresponding to the initial large language model is constructed according to the network layer similarity between any two adjacent network layers in the initial large language model.
[0041] The sub-model here can represent a model constructed using at least one network layer in the initial large language model, and can be used to reversely migrate model parameters of the initial large language model; its specific form and the number of network layers it includes depend on the specific shape and number of network layers of the initial large language model, and the present disclosure does not make specific limitations on this.
[0042] By using the network layer similarity between any two adjacent network layers in the initial large language model, the similarity of the functions of different network layers can be analyzed, so as to reasonably select the network layer used to construct the sub-model based on the function of the network layer, thereby making full use of the differences in the distribution of knowledge within the model when the initial large language model processes tasks in different fields, as well as the modular characteristics of the initial large language model, to construct a sub-model that can specifically transfer and transfer knowledge related to the target natural language processing task; and enable the sub-model to fully retain the model information of the initial large language model, maintain the efficiency of the sub-model, and improve the representativeness of the sub-model. Among them, the specific method of constructing the sub-model using the network layer in the initial large language model can be flexibly set according to actual usage requirements, and the present disclosure does not make specific limitations on this.
[0043] The following text will describe in detail the process of constructing a sub-model corresponding to the initial large language model according to the network layer similarity between any two adjacent network layers in the initial large language model in combination with possible implementation methods of the present disclosure, which will not be elaborated here.
[0044] In step S13, the sub-model is trained according to the sample data set to determine the trained sub-model.
[0045] After the cloud server completes the construction of the sub-model, the user can obtain the sub-model from the cloud server through the user terminal, and use the sample data set to perform local offline training on the user terminal to determine the trained sub-model, thereby avoiding the external transmission of the sample data set that may involve user privacy, so as to improve the protection of user privacy. Among them, the specific method of training the sub-model can refer to the implementation method in the relevant technology, and this disclosure does not make specific limitations on this.
[0046] In a possible implementation, the user can select the pre-selected sample data to be used in the sample data set in advance based on the training time resources corresponding to the user end, and define the target number of training steps required for training the sub-model; based on the pre-selected sample data, the sub-model can be iteratively trained until the number of iterations meets the target number of training steps, and the trained sub-model is obtained. Among them, the training time resource can represent the time that the user can provide for training the sub-model, and its specific value can be flexibly set according to actual usage requirements, depending on the user's own time allocation, and factors such as the data processing capability of the user end, and the present disclosure does not make specific limitations on this.
[0047] In step S14, the initial large language model is adjusted according to the model parameters corresponding to the trained sub-models to determine the target large language model, wherein the target large language model has the ability to process the target natural language processing task.
[0048] The sub-model trained through the above process initially has the ability to handle the target natural language processing task. On this basis, the model parameters corresponding to the initial large language model can be fine-tuned according to the model parameters corresponding to the trained sub-model, thereby realizing the reverse transfer and migration of knowledge in the field corresponding to the target natural language processing task, so that the adjusted target large language model has the ability to handle the target natural language processing task, which can improve the efficiency of model fine-tuning; and can prevent users from contacting all model parameters of the initial large language model, realize data protection of the initial large prediction model, and improve the security of the model fine-tuning process.
[0049] Furthermore, in the process of constructing sub-models, the model scale of the sub-model can be reasonably controlled based on the training resources that the user can provide, such as training time resources and user-side hardware performance resources, and the sub-model with a smaller model scale can be used to fine-tune the initial large language model, thereby ensuring the efficiency of model fine-tuning when resources are limited.
[0050] The following text will describe in detail the process of adjusting the initial large language model according to the model parameters corresponding to the trained sub-models and determining the target large language model in combination with possible implementation methods of the present disclosure, which will not be elaborated here.
[0051] In the embodiment of the present disclosure, according to the sample data set corresponding to the target natural language processing task, the network layer similarity between any two adjacent network layers in the initial large language model is determined, so that according to the network layer similarity between any two adjacent network layers in the initial large language model, the network layers with similar structures and functions in the initial large language model can be identified, and by removing the redundant network layers with high similarity, the modular structure emerging inside the initial large language model is fully utilized to construct the sub-model corresponding to the initial large language model. According to the sample data set, the sub-model can be trained to determine the trained sub-model, and then according to the model parameters corresponding to the trained sub-model, the initial large language model can be targeted and efficiently adjusted, and the knowledge related to the target natural language processing task obtained in the trained sub-model is integrated into the initial large language model to determine the target large language model with the ability to process the target natural language processing task. Through the embodiment of the present disclosure, on the one hand, it can be ensured that the model parameters corresponding to the initial large language model will not be completely leaked, and on the other hand, the external transmission of the sample data set that may involve user privacy can be avoided, so that the efficiency of model fine-tuning can be improved while comprehensively improving the security and privacy protection capabilities of model fine-tuning.
[0052] In a possible implementation, the network layer similarity between any two adjacent network layers in the initial large language model is determined based on a sample data set corresponding to a target natural language processing task, including: after inputting any sample data included in the sample data set into the initial large language model, for any network layer of the initial large language model, according to the output data of the network layer, determining the output feature corresponding to the network layer; according to the output feature corresponding to each network layer, determining the network layer similarity between any two adjacent network layers.
[0053] After inputting any sample data in the sample data set into the initial large prediction model, the output data corresponding to each network layer in the initial large language model can be obtained respectively. For any network layer, the output features corresponding to the network layer can be determined by performing feature analysis on the output data corresponding to the network layer. Based on the output features corresponding to any two adjacent network layers, the network layer similarity between the two adjacent network layers can be determined.
[0054] Among them, the output features corresponding to any network layer can capture the semantic information and grammatical structure of the output data corresponding to the network layer, and then can be used to judge the processing performance of the network layer for the target natural language processing task; the specific form and content of the output features corresponding to any network layer can be flexibly set according to actual usage requirements, and the present disclosure does not make specific limitations on this.
[0055] According to the output features corresponding to each network layer, the specific method of calculating the network layer similarity between any two adjacent network layers can be flexibly set according to actual usage requirements, depending on the specific form of the output features of the network layer, and this disclosure does not make specific limitations on this.
[0056] In a possible implementation, the output features corresponding to any network layer include the sentence vector corresponding to the network layer; after any sample data included in the sample data set is input into the initial large language model, for any network layer of the initial large language model, the output features corresponding to the network layer are determined according to the output data of the network layer, including: for any network layer of the initial large language model, according to the input sequence length of the sample data input into the initial large language model, the hidden layer output state and position weight corresponding to each position token in the output data of the network layer are determined; for any network layer of the initial large language model, according to the hidden layer output state and position weight corresponding to each position token in the output data of the network layer, the sentence vector corresponding to the network layer is determined.
[0057] For any network layer in the initial large language model, the sequence length corresponding to its output data is the same as the input sequence length corresponding to the sample data input into the initial large language model; according to the input sequence length, the hidden layer output state and position weight corresponding to each position token in the output data of the network layer can be determined; then, the sentence vector corresponding to the network layer is determined through the hidden layer output state and position weight corresponding to each position token, so as to map the output data corresponding to the network layer to the vector space, and can quantify the semantic information and grammatical structure of the output data corresponding to the network layer. Among them, the sentence vector corresponding to the i-th network layer of the initial large language model can be expressed as formula (1):
[0058]
[0059] Among them, R i represents the sentence vector corresponding to the i-th network layer of the initial large language model; L represents the input sequence length corresponding to the initial large language model; h k represents the hidden layer output state corresponding to the kth position token in the output data of the i-th network layer; w k Represents the position weight corresponding to the k-th position token in the output data of the i-th network layer.
[0060] w k It can be expressed as formula (2):
[0061]
[0062] In a possible implementation, the network layer similarity between any two adjacent network layers is determined according to the output features corresponding to each network layer, including: using a central kernel analysis method to determine the network layer similarity between any two adjacent network layers according to the sentence vector corresponding to each network layer.
[0063] Using the Centered Kernel Analysis (CKA) method, the network layer similarity between any two adjacent network layers can be calculated based on the sentence vectors corresponding to the two adjacent network layers. Specifically, the network layer similarity between the i-th network layer and its adjacent j-th network layer can be expressed as formula (3):
[0064]
[0065] Among them, CKA(s i ,s j ) represents the network layer similarity between the i-th network layer and its adjacent j-th network layer; s i represents the sentence vector corresponding to the i-th network layer; s jrepresents the sentence vector corresponding to the j-th network layer; T represents the transposition operation; ||·|| F represents the Frobenius norm.
[0066] Through the above process, the CKA method can be used to analyze whether the functions of any two adjacent network layers when processing the target natural language processing task are similar through the sentence vectors corresponding to each network layer, and determine the network layer similarity between the two adjacent network layers, so as to facilitate targeted network layer screening of the initial large language model and reasonably construct the sub-model.
[0067] In a possible implementation, a sub-model corresponding to the initial large language model is constructed according to the network layer similarity between any two adjacent network layers in the initial large language model, including: using a hierarchical clustering method, according to the network layer similarity between any two adjacent network layers, iteratively clustering all network layers of the initial large language model, determining multiple cluster sets, and a cluster index corresponding to each cluster set, until the number of cluster sets is equal to the preset number of storable network layers, wherein any cluster set includes multiple adjacent network layers, and the cluster index corresponding to any cluster set includes the number of network layers included in the cluster set and the position of each network layer in the cluster set in the initial large language model; for any cluster set, according to the cluster index corresponding to the cluster set, among the multiple network layers included in the cluster set, determining the representative network layer corresponding to the cluster set; and determining the sub-model according to the representative network layer corresponding to each cluster set.
[0068] After obtaining the network layer similarities between all adjacent network layers in the initial large language model, the hierarchical clustering method can be used to perform traversal clustering starting from the first network layer, and the two adjacent network layers with the largest network layer similarity are determined as a cluster set; after completing the first traversal clustering, the above traversal clustering process is repeated and iterated to determine multiple cluster sets until the number of cluster sets is equal to the preset number of network layers that can be saved.
[0069] In one example, the initial large language model includes 23 network layers. The traversal clustering is performed starting from the first network layer. The network layer similarity between any two adjacent network layers can be calculated respectively, and the network layer similarity can be sorted in descending order. According to the sorting result, the network layer similarity between the 22nd network layer and the 23rd network layer can be determined, and the first cluster set can be determined based on the 22nd network layer and the 23rd network layer. Then, the sorting result can be traversed again to determine the second cluster set, or a new network layer can be added to the first cluster set. Specifically, when the similarity between the 2nd network layer and the 3rd network layer is the largest, except for the network layer similarity between the 22nd network layer and the 23rd network layer, the second cluster set can be determined based on the 2nd network layer and the 3rd network layer; when the similarity between the 21st network layer and the 22nd network layer is the largest, except for the network layer similarity between the 22nd network layer and the 23rd network layer, the 21st network layer can be added to the first cluster set. By analogy, the above process is repeated until the number of cluster sets is equal to the preset number of storable network layers, and multiple cluster sets can be determined. Each cluster set includes at least two network layers, and the two network layers are adjacent.
[0070] The preset number of network layers can be used to indicate the number of network layers that the sub-model needs to include, so as to control the model scale and model performance of the sub-model. The specific value of the preset number of network layers can be flexibly set according to actual usage requirements, and this disclosure does not make specific limitations on this.
[0071] For any cluster set, the cluster index corresponding to the cluster set can be determined according to the number of network layers included in the cluster set and the position of each network layer in the initial large language model, which can be used as a basis for subsequent sub-model construction and parameter fine-tuning.
[0072] The representative network layer corresponding to each cluster set can be determined by using the cluster index corresponding to each cluster set. The specific method of determining the representative network layer corresponding to any cluster set can be flexibly set according to actual usage requirements, and this disclosure does not make specific limitations on this.
[0073] In one example, for any cluster set, according to the cluster index corresponding to the cluster set, the position order of multiple network layers included in the cluster set can be determined, and the network layer located in the middle position can be determined as the representative network layer corresponding to the cluster set. For example, according to the cluster index corresponding to cluster set A, it can be determined that cluster set A includes 5 network layers, and according to the position of each network layer in the initial large language model, they can be determined as network layer A1, network layer A2, network layer A3, network layer A4 and network layer A5 respectively; according to the cluster index corresponding to cluster set A, network layer A3 located in the middle position can be determined as the representative network layer corresponding to cluster set A.
[0074] According to the cluster index corresponding to each cluster set, the representative network layer corresponding to each cluster set can be connected in sequence according to the position of the representative network layer corresponding to each cluster set in the initial large model, so as to construct a sub-model whose model scale meets the preset number of network layers that can be saved.
[0075] Through the above process, we can utilize the modular structure that emerges inside the initial large language model, and based on the network layer similarity between any two network layers, dynamically select the network layer for the target natural language processing task through hierarchical clustering operations, thereby building a sub-model with the ability to specifically process the target natural language processing task while maintaining the integrity and efficiency of the model performance.
[0076] In one possible implementation, a submodel is determined based on a representative network layer corresponding to each cluster set, including: for any cluster set, based on a cluster index corresponding to the cluster set, copying the representative network layer corresponding to the cluster set, and determining a plurality of copied representative network layers corresponding to the cluster set, wherein the number of copied representative network layers is equal to the number of network layers included in the cluster set; based on the cluster index corresponding to each cluster set, connecting the plurality of representative network layers corresponding to each cluster set to determine the submodel.
[0077] Furthermore, in order to make the best use of the performance of the sub-model and improve the accuracy and reliability of fine-tuning the parameters of the initial large language model, the model scale of the sub-model can be increased by duplicating the network layer so that the number of network layers included in the sub-model is the same as the number of network layers included in the initial large language model. Specifically, for any cluster set, the representative network layer corresponding to the cluster set can be duplicated according to the cluster index corresponding to the cluster set and the number of network layers included in the cluster set.
[0078] Taking the above cluster set A, where the representative network layer corresponding to cluster set A is network layer A3 as an example, according to the cluster index corresponding to cluster set A, it can be determined that cluster set A includes 5 network layers, and network layer A3 can be replicated 4 times to determine 4 replicated network layers A.
[0079] According to the cluster index corresponding to each cluster set, multiple representative network layers corresponding to each cluster set can be connected in sequence to construct a sub-model with the same model scale as the initial large language model.
[0080] Through the above process, the inter-layer parameter sharing mechanism of the network layer can be used to make the model scale of the sub-model the same as the model scale of the complete initial large language model, thereby making the performance of the sub-model closer to the performance of the complete initial large language model, and making up for the gap between offline fine-tuning and reasoning on the complete initial large language model, thereby improving the efficiency of subsequent model fine-tuning and the performance after reverse migration of model parameters during the fine-tuning process.
[0081] In a possible implementation, the initial large language model is adjusted according to the model parameters corresponding to the trained sub-models to determine the target large language model, including: using the cluster index corresponding to each cluster set to determine the parameter correspondence between the trained sub-models and the initial large language model; according to the parameter correspondence and the model parameters corresponding to the trained sub-models, the model parameters corresponding to the initial large language model are replaced to determine the target large language model.
[0082] After the training of the sub-model is completed based on the sample data set, the trained sub-model can be uploaded from the user end corresponding to the user to the cloud server where the initial large language model is located, so as to adjust the model parameters of the initial large language model using the model parameters corresponding to the trained sub-model. Specifically, by combining each cluster with the corresponding cluster index, the network layer corresponding to each network layer in the trained sub-model in the initial large language model can be determined, and then the model parameter corresponding to each model parameter in the trained sub-model in the initial large language model can be determined, and the parameter correspondence between the trained sub-model and the initial large language model can be obtained.
[0083] By utilizing the parameter correspondence and the model parameters corresponding to the trained sub-model, the model parameters corresponding to the initial large language model can be replaced, thereby achieving fine-tuning of the initial large language model, determining the target large language model, and ensuring that during the entire fine-tuning process, the sample data set used by the user that may involve user privacy information does not leave the user's corresponding user end, thereby improving the data security and privacy protection of the fine-tuning of the large language model.
[0084] Figure 2A schematic diagram of a large language model fine-tuning method based on network layer similarity according to an embodiment of the present disclosure is shown. Figure 2 As shown, after the cloud server prepares the initial large language model, the user can define the preset number of storable networks based on the user-side resources to control the model scale of the subsequently constructed sub-models.
[0085] When the user end can directly provide a sample data set corresponding to the target natural language processing task, at least one sample data can be obtained from the sample data set and input into the initial large language model to determine the network layer similarity between any two adjacent network layers in the initial large language model.
[0086] When the user end cannot directly provide a sample data set corresponding to the target natural language processing task, at least one existing data corresponding to a similar task of the target natural language processing task can be obtained to determine the network layer similarity between any two adjacent network layers in the initial large language model.
[0087] According to the network layer similarity between any two adjacent network layers in the initial large language model, combined with the preset number of storable network layers, hierarchical clustering can be performed to construct a sub-model corresponding to the initial large language model, and the sub-model is sent to the user end.
[0088] Depending on whether the training time available on the user side is limited, you can flexibly choose whether to copy and share the network layer of the sub-model to adjust the model scale of the sub-model. After the user customizes the pre-selected sample data and the target number of training steps, the sub-model can be iteratively trained on the user side. On the one hand, it can ensure that the model parameters corresponding to the initial large language model will not be completely leaked, and on the other hand, it can avoid the external transmission of sample data sets that may involve user privacy, thereby improving the efficiency of model fine-tuning while comprehensively improving the security and privacy protection capabilities of model fine-tuning.
[0089] After the number of iterations meets the target number of training steps, the trained sub-model can be sent back to the cloud server, and the initial large language model can be adjusted according to the trained sub-model and the cluster index corresponding to each cluster set to obtain the target large language model capable of processing the target natural language processing task.
[0090] In the embodiment of the present disclosure, according to the sample data set corresponding to the target natural language processing task, the network layer similarity between any two adjacent network layers in the initial large language model is determined, so that according to the network layer similarity between any two adjacent network layers in the initial large language model, the network layers with similar structures and functions in the initial large language model can be identified, and by removing the redundant network layers with high similarity, the modular structure emerging inside the initial large language model is fully utilized to construct the sub-model corresponding to the initial large language model. According to the sample data set, the sub-model can be trained to determine the trained sub-model, and then according to the model parameters corresponding to the trained sub-model, the initial large language model can be targeted and efficiently adjusted, and the knowledge related to the target natural language processing task obtained in the trained sub-model is integrated into the initial large language model to determine the target large language model with the ability to process the target natural language processing task. Through the embodiment of the present disclosure, on the one hand, it can be ensured that the model parameters corresponding to the initial large language model will not be completely leaked, and on the other hand, the external transmission of the sample data set that may involve user privacy can be avoided, so that the efficiency of model fine-tuning can be improved while comprehensively improving the security and privacy protection capabilities of model fine-tuning.
[0091] It can be understood that the above-mentioned various method embodiments mentioned in the present disclosure can be combined with each other to form a combined embodiment without violating the principle logic. Due to space limitations, the present disclosure will not repeat them. It can be understood by those skilled in the art that in the above-mentioned method of the specific implementation method, the specific execution order of each step should be determined according to its function and possible internal logic.
[0092] In addition, the present disclosure also provides a large language model fine-tuning device based on network layer similarity, an electronic device and a computer-readable storage medium, all of which can be used to implement any large language model fine-tuning method based on network layer similarity provided by the present disclosure. The corresponding technical solutions and descriptions are referred to the corresponding records in the method part and will not be repeated here.
[0093] Figure 3 FIG. 2 is a block diagram of a large language model fine-tuning device based on network layer similarity according to an embodiment of the present disclosure. Figure 3 As shown, the device 300 includes:
[0094] A similarity analysis module 301 is used to determine the network layer similarity between any two adjacent network layers in the initial large language model according to a sample data set corresponding to the target natural language processing task;
[0095] A sub-model construction module 302 is used to construct a sub-model corresponding to the initial large language model according to the network layer similarity between any two adjacent network layers in the initial large language model;
[0096] The sub-model training module 303 is used to train the sub-model according to the sample data set and determine the trained sub-model;
[0097] The model parameter adjustment module 304 is used to adjust the initial large language model according to the model parameters corresponding to the trained sub-models to determine the target large language model, wherein the target large language model has the ability to process the target natural language processing task.
[0098] In a possible implementation, the similarity analysis module 301 is specifically used to: after inputting any sample data included in the sample data set into the initial large language model, for any network layer of the initial large language model, determine the output feature corresponding to the network layer according to the output data of the network layer; and determine the network layer similarity between any two adjacent network layers according to the output feature corresponding to each network layer.
[0099] In a possible implementation, the output features corresponding to any network layer include the sentence vector corresponding to the network layer; the similarity analysis module 301 is also used to: for any network layer of the initial large language model, determine the hidden layer output state and position weight corresponding to each position token in the output data of the network layer according to the input sequence length of the sample data input into the initial large language model; for any network layer of the initial large language model, determine the sentence vector corresponding to the network layer according to the hidden layer output state and position weight corresponding to each position token in the output data of the network layer.
[0100] In a possible implementation, the similarity analysis module 301 is further used to: determine the network layer similarity between any two adjacent network layers according to the sentence vector corresponding to each network layer using a central kernel analysis method.
[0101] In a possible implementation, the sub-model construction module 302 is specifically used to: utilize a hierarchical clustering method, according to the network layer similarity between any two adjacent network layers, iteratively cluster all network layers of the initial large language model, determine multiple cluster sets, and the cluster index corresponding to each cluster set, until the number of cluster sets is equal to the preset number of storable network layers, wherein any cluster set includes multiple adjacent network layers, and the cluster index corresponding to any cluster set includes the number of network layers included in the cluster set, and the position of each network layer in the cluster set in the initial large language model; for any cluster set, according to the cluster index corresponding to the cluster set, determine the representative network layer corresponding to the cluster set among the multiple network layers included in the cluster set; and determine the sub-model according to the representative network layer corresponding to each cluster set.
[0102] In a possible implementation, the sub-model construction module 302 is also used to: for any cluster set, according to the cluster index corresponding to the cluster set, copy the representative network layer corresponding to the cluster set, and determine the multiple copied representative network layers corresponding to the cluster set, wherein the number of copied representative network layers is equal to the number of network layers included in the cluster set; according to the cluster index corresponding to each cluster set, connect the multiple representative network layers corresponding to each cluster set to determine the sub-model.
[0103] In a possible implementation, the model parameter adjustment module 304 is further used to: determine the parameter correspondence between the trained sub-model and the initial large language model using the cluster index corresponding to each cluster set; replace the model parameters corresponding to the initial large language model according to the parameter correspondence and the model parameters corresponding to the trained sub-model to determine the target large language model.
[0104] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0105] The embodiment of the present disclosure also provides a computer-readable storage medium on which computer program instructions are stored, and the computer program instructions implement the above method when executed by a processor. The computer-readable storage medium can be a volatile or non-volatile computer-readable storage medium.
[0106] An embodiment of the present disclosure further proposes an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to implement the above method when executing the instructions stored in the memory.
[0107] Figure 4 1900 is a block diagram of an electronic device according to an embodiment of the present disclosure. For example, the apparatus 1900 may be provided as a server or a terminal device. Figure 4 , the apparatus 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions, such as an application, that can be executed by the processing component 1922. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.
[0108] The device 1900 may also include a power supply component 1926 configured to perform power management of the device 1900, a wired or wireless network interface 1950 configured to connect the device 1900 to a network, and an input / output interface 1958 (I / O interface). The device 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server 2000. TM , MacOS X TM , Unix TM ,Linux TM , FreeBSD TM or similar.
[0109] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the device 1900 to perform the above method.
[0110] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.
[0111] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.
[0112] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0113] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0114] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0115] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0116] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0117] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0118] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A large language model fine-tuning method based on network layer similarity, characterized in that: include: Determine the network layer similarity between any two adjacent network layers in the initial large language model based on the sample data set corresponding to the target natural language processing task; Constructing a sub-model corresponding to the initial large language model according to the network layer similarity between any two adjacent network layers in the initial large language model; According to the sample data set, the sub-model is trained to determine the trained sub-model; The initial large language model is adjusted according to the model parameters corresponding to the trained sub-model to determine a target large language model, wherein the target large language model has the ability to process the target natural language processing task.
2. The method according to claim 1, characterized in that The determining, based on the sample data set corresponding to the target natural language processing task, the network layer similarity between any two adjacent network layers in the initial large language model comprises: After inputting any sample data included in the sample data set into the initial large language model, for any network layer of the initial large language model, determining the output feature corresponding to the network layer according to the output data of the network layer; According to the output features corresponding to each network layer, the network layer similarity between any two adjacent network layers is determined.
3. The method according to claim 2, characterized in that The output features corresponding to any network layer, including the sentence vector corresponding to the network layer; After inputting any sample data included in the sample data set into the initial large language model, for any network layer of the initial large language model, determining the output feature corresponding to the network layer according to the output data of the network layer, comprises: For any network layer of the initial large language model, determine the hidden layer output state and position weight corresponding to each position token in the output data of the network layer according to the input sequence length of the sample data input into the initial large language model; For any network layer of the initial large language model, the sentence vector corresponding to the network layer is determined according to the hidden layer output state and position weight corresponding to each position token in the output data of the network layer.
4. The method according to claim 3, characterized in that The determining the network layer similarity between any two adjacent network layers according to the output features corresponding to each network layer includes: The central kernel analysis method is used to determine the network layer similarity between any two adjacent network layers based on the sentence vectors corresponding to each network layer.
5. The method according to any one of claims 1 to 4, characterized in that: The constructing a sub-model corresponding to the initial large language model according to the network layer similarity between any two adjacent network layers in the initial large language model includes: Using a hierarchical clustering method, according to the network layer similarity between any two adjacent network layers, iteratively clustering all network layers of the initial large language model is performed to determine multiple cluster sets and a cluster index corresponding to each cluster set until the number of cluster sets is equal to the preset number of storable network layers, wherein any cluster set includes multiple adjacent network layers, and the cluster index corresponding to any cluster set includes the number of network layers included in the cluster set and the position of each network layer in the cluster set in the initial large language model; For any cluster set, according to the cluster index corresponding to the cluster set, determine a representative network layer corresponding to the cluster set among multiple network layers included in the cluster set; The sub-model is determined according to the representative network layer corresponding to each cluster set.
6. The method according to claim 5, characterized in that The determining the sub-model according to the representative network layer corresponding to each cluster set includes: For any cluster set, according to the cluster index corresponding to the cluster set, the representative network layer corresponding to the cluster set is copied, and a plurality of copied representative network layers corresponding to the cluster set are determined, wherein the number of copied representative network layers is equal to the number of network layers included in the cluster set; According to the cluster index corresponding to each cluster set, multiple representative network layers corresponding to each cluster set are connected to determine the sub-model.
7. The method according to claim 5, characterized in that The adjusting the initial large language model according to the model parameters corresponding to the trained sub-model to determine the target large language model includes: Determine the parameter correspondence between the trained sub-model and the initial large language model using the cluster index corresponding to each cluster set; According to the parameter correspondence and the model parameters corresponding to the trained sub-model, the model parameters corresponding to the initial large language model are replaced to determine the target large language model.
8. A large language model fine-tuning device based on network layer similarity, characterized in that: include: A similarity analysis module is used to determine the network layer similarity between any two adjacent network layers in the initial large language model based on the sample data set corresponding to the target natural language processing task; A sub-model construction module, used to construct a sub-model corresponding to the initial large language model according to the network layer similarity between any two adjacent network layers in the initial large language model; A sub-model training module, used to train the sub-model according to the sample data set and determine the trained sub-model; A model parameter adjustment module is used to adjust the initial large language model according to the model parameters corresponding to the trained sub-model to determine a target large language model, wherein the target large language model has the ability to process the target natural language processing task.
9. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to implement the method described in any one of claims 1 to 7 when executing the instructions stored in the memory.
10. A non-volatile computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Language recognition method based on language model and text classification method and device
CN111554268A
Text classification model, text classification method and device
CN113177118A
Pre-training model structured pruning method and system for module clustering and centroid selection
CN118468965A
Large language model training method and device, electronic equipment and storage medium
CN118520907A
Systems and methods for learning from unlabeled data and fine-tuning of models using persistent homology
US20240378444A1