Large language model training method and device oriented to data authority management
By fine-tuning and merging some parameters of the large language model, combined with user permission control, the problem of data leakage and storage cost in data permission management of the large language model is solved, and efficient and safe model application is achieved.
Patent Information
- Application Number
- CN202410626469.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-20
- Publication Date
- 2024-09-24
AI Technical Summary
The training and application of large language models in data permission management scenarios involves the risk of data leakage, high hardware requirements, unshareable data, large model storage space, and frequent changes in user permissions. It is difficult for existing technologies to effectively solve these challenges.
Adopting a large language model training method oriented to data permission management, by fine-tuning some parameters of the pre-trained model, generating fine-tuning module parameters, and merging these parameters with the pre-trained model parameters according to user permissions, achieving data-level permission control and reducing computing resources Consumption and storage costs.
It effectively prevents data leakage, reduces model training and storage costs, adapts to the data access needs of users with different permissions, and improves the application efficiency and security of the model.
Smart Images

Figure CN118690381A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of generative artificial intelligence technology, and in particular to a large language model training method and device for data authority management. Background Art
[0002] By learning from massive amounts of data, large language models have achieved good results in multiple application scenarios. However, considering the risk of data leakage in large language models and the reality that domain data cannot be shared, especially in some enterprise management systems, it is necessary to strictly control the limited access and application capabilities of users with different permissions to data. The high requirements for data and hardware during the training process of large language models are also a factor that makes it difficult to promote large language models. Therefore, the training and application of large language models in data permission management scenarios is a difficult problem that technicians in related fields urgently need to solve.
[0003] Federated learning can obtain the ability to apply or not access data with different permissions through distributed training and parameter aggregation. Applicable or not access means obtaining the ability to apply data in the field, but not being able to directly obtain the data. In the scenario of data permission protection, it is necessary to strictly ensure that the data is not applicable and accessible between users with different permissions. In addition to the difference in data access rights, the difference between data permission management and federated learning also includes: the types of permission data in the permission management scenario are far more than those in federated learning. Taking the enterprise management system as an example, there may be dozens of user types with different data access rights; in terms of memory management, each field of data corresponds to a private model, and more fields will also require larger model storage space. Therefore, in the scenario of data permission protection, a single model is required to use less memory for storage; data is unbalanced, and the amount of data between different fields varies greatly; user permissions will change frequently, so the model needs to adopt a faster and lower-cost learning method to complete the data application capability after the permission change. Summary of the invention
[0004] The present invention provides a large language model training method and device for data authority management, which are used to solve the defects in the prior art.
[0005] The present invention provides a large language model training method for data rights management, comprising:
[0006] Based on the data in each field, the pre-trained large language model is trained respectively to obtain the fine-tuning module parameters in each field, and the fine-tuning module parameters in each field are stored in the specified memory;
[0007] Based on the target user's access rights to data in various fields, loading fine-tuning module parameters of the target field corresponding to the access rights from the designated memory;
[0008] The fine-tuning module parameters of each target domain are combined with the model parameters of the pre-trained large language model to obtain a target model for the domain corresponding to the target user.
[0009] According to a large language model training method for data rights management provided by the present invention, the fine-tuning module parameters of each target field are merged with the model parameters of the pre-trained large language model to obtain a target model of the field corresponding to the target user, including:
[0010] The fine-tuning module parameters of each target area are weighted summed to obtain the fusion module parameters;
[0011] The fusion module parameters and the model parameters are combined to obtain the target model.
[0012] According to a large language model training method for data rights management provided by the present invention, the weight value of the weighted sum application is determined based on the following steps:
[0013] The parameters of the fine-tuning modules of each target field are frozen, and based on the training set, the fine-tuning modules of each target field are jointly trained to update the initial weight values of each target field to obtain the weight values of each target field.
[0014] According to a large language model training method for data rights management provided by the present invention, the training set is constructed by collecting a preset amount of data from each target field data.
[0015] According to a large language model training method for data rights management provided by the present invention, the pre-trained large language model is trained based on data from various fields to obtain fine-tuning module parameters for various fields, including:
[0016] A low-rank adapter weight or a quantized low-rank adapter is added to the pre-trained large language model, and the pre-trained large language model is trained respectively using data from various fields to obtain fine-tuning module parameters for various fields.
[0017] According to a large language model training method for data rights management provided by the present invention, based on the target user's access rights to data in various fields, the target module parameters for the fields corresponding to the access rights are loaded from the designated memory, and the method also includes:
[0018] The user rights of each field data are divided to determine the access rights of different users; the access rights are used to indicate the storage address corresponding to the target field data with authority and the module parameters of the target field.
[0019] The present invention also provides a large language model training device for data rights management, comprising:
[0020] A training unit is used to train the pre-trained large language model based on the data of each field, obtain the fine-tuning module parameters of each field, and store the fine-tuning module parameters of each field into a designated memory;
[0021] A loading unit, configured to load, from the designated memory, fine-tuning module parameters of a target domain corresponding to the access rights of the target user to data in each domain;
[0022] The merging unit is used to merge the fine-tuning module parameters of each target domain with the model parameters of the pre-trained large language model to obtain a target model for the domain corresponding to the target user.
[0023] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the large language model training method for data authority management as described above is implemented.
[0024] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the large language model training method for data authority management as described in any one of the above is implemented.
[0025] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned large language model training methods for data authority management.
[0026] The large language model training method and device for data authority management provided by the present invention respectively trains the pre-trained large language model based on the data of each field, obtains the fine-tuning module parameters of each field, and realizes the training of part of the parameters of the model instead of fine-tuning the full parameters, thereby significantly reducing the consumption of computing resources while retaining the knowledge learned in the pre-trained model. In addition, based on the target user's access rights to data in each field, the present invention loads the fine-tuning module parameters of the target field corresponding to the access rights from the specified memory, realizes the authority control through the data level, and prevents the problem of data leakage at the model level. Furthermore, the present invention merges the fine-tuning module parameters of each target field with the model parameters of the pre-trained large language model to obtain the target model of the field corresponding to the target user, without the need to train the corresponding exclusive model for each user separately, thereby reducing the cost of model training and storage. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0028] Figure 1 This is one of the flow charts of the large language model training method for data rights management provided by the present invention;
[0029] Figure 2 This is the second flow chart of the large language model training method for data rights management provided by the present invention;
[0030] Figure 3 It is a structural schematic diagram of a large language model training device for data rights management provided by the present invention;
[0031] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0033] The most direct way to train and apply large models for data rights management scenarios is to train a dedicated large model for each user within the data range that the user can access, to ensure that data is invisible and unavailable between users with different rights. In order for users to have access and application capabilities within the scope of specified rights, different users need to train corresponding models on data with corresponding rights. For example, user 1 needs to train a model on data 1, while user 2 with higher data rights needs to train models on data 1, data 2, and data 3, which is a huge burden in terms of both time cost and hardware cost. If we use the method of federated learning as a reference, users with high-level rights need to conduct multiple model training and aggregation in order to obtain knowledge about multiple fields. The number of parameters that need to be updated each time is in the millions to billions, and the training cost is high and time-consuming.
[0034] In this regard, the present invention provides a large language model training method for data rights management. Figure 1 This is one of the flow charts of the large language model training method for data rights management provided by the present invention, such as Figure 1 As shown, the method comprises the following steps:
[0035] Step 110: Based on the data in each field, the pre-trained large language model is trained respectively to obtain the fine-tuning module parameters in each field, and the fine-tuning module parameters in each field are stored in the designated memory.
[0036] Specifically, the pre-trained large language model can be understood as a base large model, which can be obtained by training the initial model based on general domain data. That is, the pre-trained large language model can also be understood as a general large model.
[0037] The fine-tuning module parameters can be understood as the Lora (Low-Rank Adaptation) module parameters. When training a pre-trained large language model, low-rank adapters can be introduced into the pre-trained model to train some parameters of the model instead of fine-tuning all parameters, which can significantly reduce the consumption of computing resources while retaining the knowledge learned in the pre-trained model.
[0038] In other words, based on the pre-trained large language model, the embodiment of the present invention trains some parameters of the pre-trained large language model based on the data of each field. Finally, each field corresponds to a fine-tuning module parameter, and the fine-tuning module parameters of each field are stored in the designated memory.
[0039] Step 120: Based on the target user's access rights to data in various fields, fine-tuning module parameters corresponding to the target field and the access rights are loaded from the designated memory.
[0040] Specifically, the target user can be understood as a user who needs to train a dedicated domain model. Different users have different access rights to each domain data. For example, user 1 has access rights to domain data 1, and user 2 has access rights to both domain data 1 and domain data 2, and thus the access level of user 2 is higher than the access level of user 1. Optionally, the access rights of different users to each domain data can be determined by authenticating the user, such as verifying the user account and password to determine the user's access rights to each domain data.
[0041] According to the target user's access rights to data in various fields, the fine-tuning module parameters corresponding to the target field with the access rights are loaded from the specified memory. The target field can be understood as the field to which the target user has access rights, that is, the target user obtains the fine-tuning module parameters corresponding to the field with access rights, and cannot obtain the fine-tuning module parameters corresponding to the field without access rights, thereby achieving permission control at the data level and preventing data leakage at the model level.
[0042] In addition, the target user may have access permissions to data in only one field or may have access permissions to data in multiple fields, and thus the fine-tuning module parameters may be fine-tuning module parameters in one field or may be fine-tuning module parameters in multiple fields.
[0043] Step 130: Merge the fine-tuning module parameters of each target domain with the model parameters of the pre-trained large language model to obtain a target model for the domain corresponding to the target user.
[0044] Specifically, after obtaining the fine-tuning module parameters of each target domain, the fine-tuning module parameters of each target domain are merged with the model parameters of the pre-trained large language model, so that the obtained target model has the knowledge acquisition capability of the target domain.
[0045] Optionally, for a target user who has access rights to data in only one domain, fine-tuning module parameters corresponding to the target domain can be loaded from a specified memory, and the fine-tuning module parameters can be merged with the model parameters to obtain a target model.
[0046] Optionally, for a target user who has access rights to data in multiple fields, multiple fine-tuning module parameters corresponding to the target field can be loaded from a specified memory, and after weighted fusion of the multiple fine-tuning module parameters, they can be merged with the model parameters to obtain a target model.
[0047] The large language model training method for data permission management provided by the embodiment of the present invention trains the pre-trained large language model based on the data of each field, and obtains the fine-tuning module parameters of each field, so as to realize the training of part of the parameters of the model instead of fine-tuning the full parameters, thereby significantly reducing the consumption of computing resources while retaining the knowledge learned in the pre-trained model. In addition, based on the target user's access rights to data in each field, the embodiment of the present invention loads the fine-tuning module parameters of the target field corresponding to the access rights from the specified memory, realizes permission control at the data level, and prevents data leakage problems at the model level. Furthermore, the embodiment of the present invention merges the fine-tuning module parameters of each target field with the model parameters of the pre-trained large language model to obtain the target model of the field corresponding to the target user, without the need to train the corresponding exclusive model for each user separately, thereby reducing the cost of model training and storage.
[0048] As an optional embodiment, the pre-trained large language model can be an open source large language model obtained by training with massive general data. Correspondingly, the data in each field can be text data with category labels in each field. Then, the target model obtained by the method of the above embodiment can be used to classify the text data in the target field, that is, input the text data in the target field into the target model to obtain the text classification result output by the target model.
[0049] Based on the above embodiment, the fine-tuning module parameters of each target domain are combined with the model parameters of the pre-trained large language model to obtain a target model of the domain corresponding to the target user, including:
[0050] The fine-tuning module parameters of each target area are weighted summed to obtain the fusion module parameters;
[0051] The fusion module parameters and model parameters are combined to obtain the target model.
[0052] Specifically, the fine-tuning module parameters of each target area are weighted and summed to obtain the fusion model parameters. The weight values used in the weighted summation have been introduced in the following embodiments and will not be repeated here.
[0053] The fusion module parameters are merged with the model parameters of the pre-trained model to form a final target model. After the parameter merging, the merged parameters can be used to replace the parameters in certain layers or modules in the pre-trained model to obtain the target model.
[0054] Based on any of the above embodiments, the weight value of the weighted sum application is determined based on the following steps:
[0055] The fine-tuning module parameters of each target field are frozen, and the fine-tuning modules of each target field are jointly trained based on the training set to update the initial weight value of each target field to obtain the weight value of each target field. The training set is constructed by collecting a preset amount of data from each target field data.
[0056] As an optional embodiment, dozens of small samples can be selected from each target field to construct a training set. In the process of joint training of fine-tuning modules for each target field based on the training set, the parameters of the fine-tuning modules for each target field are frozen, and only the initial weight values of each target field are updated (wherein the initial weight value can be set to 0, and in the process of updating the initial weight value, the value range of the weight value is limited to (0,1)). Among them, the initial weight value can be gradient updated, and the parameters are normalized after each gradient update. It can be seen that in the process of weight value update learning, the amount of training parameters is the corresponding number of target fields, which greatly reduces the training cost compared to tens of billions of model parameters.
[0057] As an optional embodiment, assuming that a high-level user has N target domain data access permissions, the parameters of the fine-tuning module are The weight value is α i , where i represents the i-th fine-tuning module (i.e., Lora module), 1≤i≤N. In order for the target model to retain the ability of each fine-tuning module parameter to correspond to the sub-model as much as possible, it is necessary to ensure that the weight α i The following constraints are met:
[0058]
[0059] 0<α i <1
[0060] After the advanced user obtains the weight value of each Lora module, the weight value is stored in the specified memory. When applied, multiple Lora module parameters and the weight value of the Lora module are loaded from the specified memory, and then the multiple Lora module parameters are weighted and summed according to their respective weight values to obtain the fusion module parameters, and the fusion module parameters are merged with the model parameters, and finally the target model that can handle multiple target domain tasks can be obtained for use by advanced users. Among them, the fusion module parameters and the model parameters are merged according to the following formula:
[0061]
[0062] Among them, w 0 represents the model parameters, Indicates the fusion module parameters.
[0063] It can be seen that the embodiment of the present invention obtains weight values based on training set updates, and performs weighted summation of parameters of each fine-tuning module based on the weight values, which has stronger robustness than average aggregation of parameters of each fine-tuning module. For example, when the number of Lora modules exceeds 30, in multiple fields, weighted summation based on weight values can obtain knowledge of multiple target fields, which has strong application capabilities. In addition, in scenarios with unbalanced data, weighted summation based on weight values also shows more obvious advantages.
[0064] Based on any of the above embodiments, based on the data of each field, the pre-trained large language model is trained respectively to obtain the fine-tuning module parameters of each field, including:
[0065] A low-rank adapter or a quantized low-rank adapter is added to the pre-trained large language model, and the pre-trained large language model is trained using data from various fields to obtain the fine-tuning module parameters for each field.
[0066] For example, the Lora module parameters corresponding to data in different fields are stored in the designated memory. Taking the LLAMA-7B model with 7 billion parameters as an example, the commonly used full parameter fine-tuning and half-precision storage are adopted, and the model size is 14G. The Lora solution is adopted to perform low-rank decomposition (rank = 8) on the K, Q, and V matrices in the self-attention module, and the final model size of the Lora part is 70M; the QLora (Quantized Lora) solution is adopted to quantize the model with 4 bits, and the final model size of the Lora part is 25M.
[0067] It can be seen that the embodiments of the present invention implement training of some parameters of the model instead of fine-tuning all parameters, which can significantly reduce the consumption of computing resources while retaining the knowledge learned in the pre-trained model.
[0068] Based on any of the above embodiments, based on the target user's access rights to data in each field, target module parameters of the field corresponding to the access rights are loaded from the designated memory, and the process also includes:
[0069] Divide user permissions for data in each field and determine the access permissions of different users; access permissions are used to indicate the target field data with permissions and the storage address corresponding to the module parameters of the target field. Optionally, data sets can be divided according to actual business conditions, and access permissions for each field of data can be defined. Users with different data permissions can be specified to access one or more fields of data. By specifying data permissions, users can be strictly restricted to accessing and using data within a certain field. Data-level permission control can prevent data leakage at the model level.
[0070] Based on any of the above embodiments, Figure 2 This is the second flow chart of the large language model training method for data rights management provided by the present invention. Figure 2 As shown, the method comprises the following steps:
[0071] Step 1: Based on the user permission levels of data access rights, the lowest permission users have access and application rights to data in a certain field, while high-level permission users are assigned data access rights in multiple fields. The access rights specify the accessible field data and the storage address of the model parameters.
[0072] Step 2: Efficient model training for domain data. Each domain data corresponds to a data unit. Through low-rank adaptation (Lora) and model quantization (Quantized Model) and other technologies, Lora or QLora is selected to train some parameters of the large model, so that each domain corresponds to a Lora module, and different data units are converted into model parameter forms and stored in the memory space corresponding to different domains. Compared with the full model parameters, the parameter amount of the Lora module is reduced to less than 1%, saving storage costs.
[0073] Step 3: Model weight learning for advanced users. According to the storage address specified by the access permission, load the Lora module parameters of multiple fields trained in step 2, sample a small amount of data from the specified multiple fields, and use the sampled small sample data set to learn the weight values of the Lora modules in different fields. After training, store the weight values.
[0074] Step 4: Users with the lowest level of authority acquire knowledge in their respective fields by loading the Lora module parameters in the memory space specified by the user authority. Users with high-level authority load the Lora module parameters of multiple fields through user authority, and load the weight values of the Lora modules for multiple fields trained in step 3. The fusion module parameters are obtained by weighted summation of the weight values of the Lora modules for multiple fields, and the fusion module parameters are merged with the model parameters of the pre-trained large language model to obtain new model parameters, so as to finally obtain the target model with the knowledge application capability for multiple fields.
[0075] In order to illustrate the effectiveness of the present invention, the present invention has conducted experimental exploration on the clinical trial screening standard short text classification (CHIP-CTC) dataset. The dataset contains 44 common clinical problems, such as: diseases, symptoms (patient feelings), signs (doctor detection), pregnancy-related, etc. In order to meet the characteristics of multiple permission types and large data differences in user permission management scenarios, the present invention has selected some of the fields as data that can be accessed by high-level permission users. The hyperparameters used for the training of the Lora module are Lora_alpha=32, R=8, and the parameters of the K, Q, and V parts in the self-attention are trained. The comparative experiment adopts the method of average weighted aggregation of multiple Lora module parameters. Table 1 is a comparison list of the sizes of data sets in different fields. Table 1 shows the data sizes of some fields. The imbalance of the data reflects the characteristics of large data differences.
[0076] Table 1
[0077] field Number of training sets Laboratory tests 1142 Tumor progression 131 Living situation 31 Dependency 370 Life expectancy 166 Allergy tolerance 668 Education 19
[0078] Table 2 is a list of text classification capabilities for users with advanced permissions. The experimental results in Table 2 show the comparison of the text classification capabilities of users with advanced permissions in multiple domains in the new model aggregated using the Lora parameter weight learnable method, the base model that has not been trained with domain data, and the model that uses a simple average weight aggregation model. The evaluation indicators use precision, recall, and F1 (f1-score).
[0079] The experimental results show that the weighted aggregation performed by the learnable Lora module weights method introduced in the present invention has greatly improved the classification ability in different fields compared with the base model and the average weight aggregation model, which verifies the effectiveness of the present invention.
[0080] Table 2
[0081]
[0082]
[0083] The large language model training device for data authority management provided by the present invention is described below. The large language model training device for data authority management described below and the large language model training method for data authority management described above can be referenced to each other.
[0084] Based on any of the above embodiments, Figure 3 : is a schematic diagram of the structure of a large language model training device for data rights management provided by the present invention, such as Figure 3 As shown, the device comprises:
[0085] The training unit 310 is used to train the pre-trained large language model based on the data of each field, obtain the fine-tuning module parameters of each field, and store the fine-tuning module parameters of each field in a designated memory;
[0086] A loading unit 320, configured to load fine-tuning module parameters corresponding to the target domain with the access rights from a designated memory based on the target user's access rights to the data in each domain;
[0087] The merging unit 330 is used to merge the fine-tuning module parameters of each target domain with the model parameters of the pre-trained large language model to obtain a target model for the domain corresponding to the target user.
[0088] Figure 4 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 4As shown, the electronic device may include: a processor 410, a memory 420, a communications interface 430 and a communication bus 440, wherein the processor 410, the memory 420 and the communications interface 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 420 to execute the large language model training method for data authority management, the method comprising: training the pre-trained large language model based on the data of each field, obtaining the fine-tuning module parameters of each field, and storing the fine-tuning module parameters of each field in the designated memory; based on the target user's access rights to the data of each field, loading the fine-tuning module parameters of the target field corresponding to the access rights from the designated memory; merging the fine-tuning module parameters of each target field with the model parameters of the pre-trained large language model to obtain the target model of the field corresponding to the target user.
[0089] In addition, the logic instructions in the above-mentioned memory 420 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0090] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the large language model training method for data permission management provided by the above methods, and the method includes: based on the data of each field, respectively training the pre-trained large language model to obtain the fine-tuning module parameters of each field, and storing the fine-tuning module parameters of each field to a designated memory; based on the target user's access rights to the data of each field, loading the fine-tuning module parameters of the target field corresponding to the access rights from the designated memory; merging the fine-tuning module parameters of each target field with the model parameters of the pre-trained large language model to obtain the target model of the field corresponding to the target user.
[0091] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the above-mentioned large language model training methods for data permission management, the method comprising: based on the data of each field, training the pre-trained large language model respectively to obtain fine-tuning module parameters of each field, and storing the fine-tuning module parameters of each field to a designated memory; based on the target user's access rights to the data of each field, loading the fine-tuning module parameters of the target field corresponding to the access rights from the designated memory; merging the fine-tuning module parameters of each target field with the model parameters of the pre-trained large language model to obtain the target model of the field corresponding to the target user.
[0092] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0093] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0094] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A large language model training method for data rights management, characterized in that: include: Based on the data in each field, the pre-trained large language model is trained respectively to obtain the fine-tuning module parameters in each field, and the fine-tuning module parameters in each field are stored in the specified memory; Based on the target user's access rights to data in various fields, loading fine-tuning module parameters of the target field corresponding to the access rights from the designated memory; The fine-tuning module parameters of each target domain are combined with the model parameters of the pre-trained large language model to obtain a target model for the domain corresponding to the target user.
2. The large language model training method for data rights management according to claim 1, characterized in that: The step of merging the fine-tuning module parameters of each target domain with the model parameters of the pre-trained large language model to obtain a target model for the domain corresponding to the target user includes: The fine-tuning module parameters of each target area are weighted summed to obtain the fusion module parameters; The fusion module parameters and the model parameters are combined to obtain the target model.
3. The large language model training method for data rights management according to claim 2 is characterized in that: The weight values of the weighted summation application are determined based on the following steps: The parameters of the fine-tuning modules of each target field are frozen, and based on the training set, the fine-tuning modules of each target field are jointly trained to update the initial weight values of each target field to obtain the weight values of each target field.
4. The large language model training method for data rights management according to claim 3 is characterized in that: The training set is constructed by collecting a preset amount of data from each target field.
5. The large language model training method for data rights management according to any one of claims 1 to 4, characterized in that: Based on the data of each field, the pre-trained large language model is trained respectively to obtain the fine-tuning module parameters of each field, including: A low-rank adapter or a quantized low-rank adapter is added to the pre-trained large language model, and the pre-trained large language model is trained respectively using data from various fields to obtain fine-tuning module parameters for various fields.
6. The large language model training method for data rights management according to any one of claims 1 to 4, characterized in that: Based on the target user's access rights to data in various fields, the target module parameters of the fields corresponding to the access rights are loaded from the designated memory, and the method also includes: The user rights of each field data are divided to determine the access rights of different users; the access rights are used to indicate the storage address corresponding to the target field data with authority and the module parameters of the target field.
7. A large language model training device for data rights management, characterized in that: include: A training unit is used to train the pre-trained large language model based on the data of each field, obtain the fine-tuning module parameters of each field, and store the fine-tuning module parameters of each field into a designated memory; A loading unit, configured to load, from the designated memory, fine-tuning module parameters of a target domain corresponding to the access rights of the target user to data in each domain; The merging unit is used to merge the fine-tuning module parameters of each target domain with the model parameters of the pre-trained large language model to obtain a target model for the domain corresponding to the target user.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the large language model training method for data authority management as described in any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the large language model training method for data authority management as described in any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the large language model training method for data authority management as described in any one of claims 1 to 6 is implemented.
