Multi-scenario enterprise large model training method, system, electronic device and storage medium
Patent Information
- Application Number
- CN202410623470.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-20
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-05-20
AI Technical Summary
Current enterprise big models are prone to overfitting a single scenario when trained in specific vertical fields and cannot effectively generalize to multiple scenarios.
By determining the task list for multiple application scenarios, the training task data and training label data of each application scenario are constructed, the enterprise model is parameterized, and the training multi-scene enterprise model is obtained, and the training multi-scene enterprise model is optimized based on the test evaluation results.
提高了企业大模型的泛化能力和适应性,使其更好地应对多样化的应用场景。
Smart Images

Figure CN118468974B_ABST
Abstract
Description
Background Art
[0002] With the continuous development of artificial intelligence, deep neural network models have begun to be widely used in the field of natural language processing. In recent years, with the maturity of big model technology, the number and scale of neural network parameters have further expanded. By using a large amount of public data to pre-train the model parameters, and then fine-tuning the model parameters in combination with the annotated data of downstream tasks, the performance of big models on specific tasks has been significantly improved, such as dialogue systems, question-answering systems, translation, etc. Vertical big models include industry big models, scenario big models, enterprise big models, etc. Enterprise big models specifically refer to big models for specific enterprises that include multiple scenarios.
[0003] Although the performance of general large models is close to human level, training large models in specific vertical fields is still a challenging and promising field. The current training of enterprise large models is prone to overfitting a single scenario and cannot be generalized to multiple scenarios. Therefore, it is urgent to provide a technical solution to solve the above problems. Summary of the invention
[0004] In order to solve the above technical problems, the present invention provides a multi-scenario enterprise large model training method, system, electronic device and storage medium.
[0005] In a first aspect, the present invention provides a multi-scenario enterprise large model training method, and the technical solution of the method is as follows:
[0006] Determine the task lists corresponding to multiple application scenarios of the enterprise large model to be trained, and build the training task data and training annotation data for each application scenario based on the task lists corresponding to each application scenario;
[0007] According to the training task data and training annotation data of each application scenario, parameter training is performed on the enterprise big model to be trained to obtain a trained multi-scenario enterprise big model;
[0008] The test task data of each application scenario is input into the trained multi-scenario enterprise big model for evaluation, so as to optimize the trained multi-scenario enterprise big model according to the test evaluation results of each application scenario to obtain the target multi-scenario enterprise big model.
[0009] The beneficial effects of the multi-scenario enterprise large model training method of the present invention are as follows:
[0010] The method of the present invention can enable the enterprise large model to better cope with diverse application scenarios, and improve the generalization ability and adaptability of the model.
[0011] Based on the above scheme, the multi-scenario enterprise large model training method of the present invention can also be improved as follows.
[0012] In an optional manner, the step of performing parameter training on the enterprise big model to be trained according to the training task data and training annotation data of each application scenario to obtain the trained multi-scenario enterprise big model includes:
[0013] The training task data and the training annotation data of each application scenario are alternately used by the stochastic gradient descent method to iteratively update the parameters of the enterprise big model to be trained and the weight of each application scenario until the trained multi-scenario enterprise big model is obtained.
[0014] In an optional manner, according to the test evaluation results of each application scenario, the trained multi-scenario enterprise big model is optimized to obtain the target multi-scenario enterprise big model, including:
[0015] Obtain the general evaluation result of each application scenario in the enterprise big model to be trained, and optimize the trained multi-scenario enterprise big model according to the difference between the test evaluation result and the general evaluation result of each application scenario to obtain the target multi-scenario enterprise big model.
[0016] In an optional manner, the step of optimizing the trained multi-scenario enterprise big model according to the difference between the test evaluation result and the general evaluation result of each application scenario includes:
[0017] When the test evaluation results of each application scenario are lower than the general evaluation results, the training task data of each application scenario is adjusted, and the step of performing parameter training on the enterprise big model to be trained according to the training task data and training annotation data of each application scenario is returned to obtain the trained multi-scenario enterprise big model, so as to optimize the trained multi-scenario enterprise big model;
[0018] When the test evaluation result of any application scenario is much lower than the general evaluation result, the weight of each application scenario is adjusted, and the step of performing parameter training on the enterprise big model to be trained according to the training task data and training annotation data of each application scenario is returned to obtain the trained multi-scenario enterprise big model, so as to optimize the trained multi-scenario enterprise big model;
[0019] When the test evaluation result of any application scenario is lower than the general evaluation result, the training task data and training annotation data of the application scenario are adjusted, and the step of performing parameter training on the enterprise big model to be trained according to the training task data and training annotation data of each application scenario is returned to obtain the trained multi-scenario enterprise big model, so as to optimize the trained multi-scenario enterprise big model.
[0020] In an optional manner, multiple application scenarios include: conversational robots, intelligent agent frameworks, work order classification, content creation, and coding assistants.
[0021] In an optional manner, the task list corresponding to the conversational robot includes: multi-round conversations, reading comprehension and knowledge questions and answers; the task list corresponding to the intelligent agent framework includes: tool identification, tool use, logical reasoning and thought chain generation; the task list corresponding to the work order classification includes: information extraction, keyword extraction, text summarization and digital logic; the task list corresponding to the content creation includes: copywriting generation, text summarization, style transfer, information retrieval, article continuation and article rewriting; the task list corresponding to the coding assistant includes: text-code generation, code error correction, code continuation and code annotation.
[0022] In a second aspect, the present invention provides a multi-scenario enterprise large model training system, and the technical solution of the system is as follows:
[0023] Includes: construction module, training module and optimization module;
[0024] The construction module is used to: determine the task lists corresponding to multiple application scenarios of the enterprise large model to be trained, and construct the training task data and training annotation data for each application scenario according to the task list corresponding to each application scenario;
[0025] The training module is used to: perform parameter training on the enterprise big model to be trained according to the training task data and training annotation data of each application scenario, so as to obtain a trained multi-scenario enterprise big model;
[0026] The optimization module is used to input the test task data of each application scenario into the trained multi-scenario enterprise big model for evaluation, so as to optimize the trained multi-scenario enterprise big model according to the test evaluation results of each application scenario to obtain the target multi-scenario enterprise big model.
[0027] The beneficial effects of a multi-scenario enterprise large model training system of the present invention are as follows:
[0028] The system of the present invention can enable the enterprise large model to better cope with diverse application scenarios, thereby improving the generalization ability and adaptability of the model.
[0029] Based on the above scheme, the multi-scenario enterprise large model training system of the present invention can also be improved as follows.
[0030] In an optional manner, the training module is specifically used for:
[0031] The training task data and the training annotation data of each application scenario are alternately used by the stochastic gradient descent method to iteratively update the parameters of the enterprise big model to be trained and the weight of each application scenario until the trained multi-scenario enterprise big model is obtained.
[0032] In a third aspect, a technical solution of an electronic device of the present invention is as follows:
[0033] It includes a memory, a processor, and a program stored in the memory and running on the processor. When the processor executes the program, the steps of the multi-scenario enterprise big model training method of the present invention are implemented.
[0034] In a fourth aspect, the present invention provides a computer-readable storage medium having the following technical solution:
[0035] Instructions are stored in the computer-readable storage medium. When the computer-readable storage medium reads the instructions, the computer-readable storage medium executes the steps of the multi-scenario enterprise big model training method of the present invention.
[0036] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings are only used to illustrate the embodiments and are not to be considered as limiting the present invention. In addition, the same reference symbols are used to represent the same components throughout the accompanying drawings. In the accompanying drawings:
[0038] Figure 1 A flowchart of an embodiment of a multi-scenario enterprise large model training method of the present invention;
[0039] Figure 2 This is a schematic diagram of the hierarchical relationship of a multi-scenario enterprise model;
[0040] Figure 3 It is a schematic diagram of the optimization process of a large enterprise model with multiple scenarios;
[0041] Figure 4 A schematic diagram of the structure of an embodiment of a multi-scenario enterprise large model training system of the present invention;
[0042] Figure 5 The figure is a schematic structural diagram of an embodiment of an electronic device of the present invention. DETAILED DESCRIPTION
[0043] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein.
[0044] Figure 1 FIG. 1 is a flow chart showing an embodiment of a multi-scenario enterprise large model training method provided by the present invention. Figure 1 As shown, the following steps are included:
[0045] S1. Determine the task lists corresponding to multiple application scenarios of the enterprise large model to be trained, and construct the training task data and training annotation data for each application scenario based on the task lists corresponding to each application scenario.
[0046] Among them, the enterprise big model to be trained adopts the general big model, such as: Qwen, Baichuan, InternLM, ChatGLM and LLaMA, etc., and there is no restriction here. Figure 2 As shown, multiple application scenarios include: conversational robots, intelligent agent frameworks, work order classification, content creation, and coding assistants. The task list for conversational robots includes: multi-round conversations, reading comprehension, and knowledge questions and answers; the task list for the intelligent agent framework includes: tool identification, tool use, logical reasoning, and thought chain generation; the task list for work order classification includes: information extraction, keyword extraction, text summarization, and digital logic; the task list for content creation includes: copywriting generation, text summarization, style transfer, information retrieval, article continuation, and article rewriting; the task list for coding assistants includes: text-code generation, code error correction, code continuation, and code annotation. Taking the application scenario of a conversational robot as an example, a training annotation data is: {"scenario":"conversational robot","task":"knowledge question and answer","instruction":"give the package charge details","input":"20 yuan package discount for 2 months","output":"In the first two months of free use, GPRS charges a monthly rental fee of 20 yuan, and the pre-deposited 20 yuan fee will be returned at the end of the month. After the expiration, it will be converted to a 20 yuan package. Starting from October 1, 2015, if the personal package of a mobile phone monthly package customer who is charged by traffic is not cancelled or changed in the current month (excluding special products such as Internet cards, promotional free traffic, and gas packages), the remaining traffic in the package in the current month can be extended to the end of the next month. Other contents included in the package, such as call duration, short and multimedia messages, are only available in the current month and cannot be carried over to the next month."}, and its corresponding training task data is: {"instruction":"give the package charge details","input":"20 yuan package discount for 2 months"}.
[0047] It should be noted that one application scenario corresponds to multiple training task data and multiple training annotation data.
[0048] S2. According to the training task data and training annotation data of each application scenario, parameter training is performed on the enterprise big model to be trained to obtain a trained multi-scenario enterprise big model.
[0049] Specifically, the training task data and the training annotation data of each application scenario are alternately used by the stochastic gradient descent method to iteratively update the parameters of the enterprise big model to be trained and the weight of each application scenario until the trained multi-scenario enterprise big model is obtained.
[0050] Among them, for the t=1, 2, ..., Nth application scenario of the current iteration, assuming that the scenario contains K training task data, M data are randomly extracted from each training task data to form a B k represents a mini-batch training unit consisting of k=1, 2, ..., K training task data. Assuming Θ represents the parameters of the enterprise model to be trained, the update method for an iterative parameter for the current application scenario is l CE represents the cross entropy loss function, represents the operator for finding the gradient of Θ, α k Represents the weight coefficient of each training task data in multiple application scenarios.
[0051] It should be noted that the enterprise model to be trained takes the general large model Qwen-Chat-7B as an example, uses the training task data and training annotation data of each application scenario to train the parameters of the enterprise model to be trained, and fine-tunes the weight of the general large model (Qwen-Chat-7B). The hyperparameter settings based on the large model training open source framework Huggingface are as follows:
[0052] --finetuning_type full\
[0053] --overwrite_cache\
[0054] --per_device_train_batch_size 16\
[0055] --gradient_accumulation_steps 8\
[0056] --lr_scheduler_type cosine\
[0057] --logging_steps 10\
[0058] --save_steps 20000\
[0059] --learning_rate 3e-5\
[0060] --num_train_epochs 3.0\
[0061] --bf16
[0062] S3. Input the test task data of each application scenario into the trained multi-scenario enterprise big model for evaluation, so as to optimize the trained multi-scenario enterprise big model according to the test evaluation results of each application scenario to obtain the target multi-scenario enterprise big model.
[0063] The test task data is task data used to evaluate the application scenario. In this embodiment, a manual evaluation method is adopted, and a fine-grained evaluation is performed on the capability of the corresponding task. For the model output of the test task data of each application scenario, the corresponding quality evaluation method is shown in Table 1 below.
[0064] Table 1:
[0065] Output quality (1-5) Application scenario 1 (Example: Reading comprehension) Application scenario 2 (Example: multi-round dialogue) .. Test task data 1 .. Test task data 2 .. ... .. Average score ..
[0066] For example, the number of test task data for each application scenario is: conversation robot: 110, intelligent agent framework: 89, work order classification: 78, content creation: 100, coding assistant: 123. The evaluation scores (test evaluation results) of the ability evaluation of each application scenario are: conversation robot: 4.2 (5), intelligent agent framework: 3.6 (5), work order classification: 3.2 (5), content creation: 3.8 (5), coding assistant: 3.6 (5)
[0067] In an optional manner, according to the test evaluation results of each application scenario, the trained multi-scenario enterprise big model is optimized to obtain the target multi-scenario enterprise big model, including:
[0068] Obtain the general evaluation result of each application scenario in the enterprise big model to be trained, and optimize the trained multi-scenario enterprise big model according to the difference between the test evaluation result and the general evaluation result of each application scenario to obtain the target multi-scenario enterprise big model.
[0069] Among them, the general evaluation result is the result output by using the enterprise large model to be trained (general large model). Figure 3 Specifically, according to the difference between the test evaluation result and the general evaluation result of each application scenario, the step of optimizing the trained multi-scenario enterprise big model includes:
[0070] When the test evaluation results of each application scenario are lower than the general evaluation results, the training task data of each application scenario is adjusted, and the step of performing parameter training on the enterprise big model to be trained according to the training task data and training annotation data of each application scenario is returned to obtain the trained multi-scenario enterprise big model, so as to optimize the trained multi-scenario enterprise big model.
[0071] Among them, if the capabilities (test evaluation results) of most test task data in an application scenario are lower than the general evaluation results of the general large model, it means that there is a problem in the correspondence between capabilities and data. Therefore, it is necessary to adjust the composition of the training task data, add more representative training task data or improve the data preprocessing method.
[0072] When the test evaluation result of any application scenario is much lower than the general evaluation result, the weight of each application scenario is adjusted, and the step of performing parameter training on the enterprise big model to be trained according to the training task data and training annotation data of each application scenario is returned to obtain the trained multi-scenario enterprise big model, so as to optimize the trained multi-scenario enterprise big model.
[0073] Among them, if the test evaluation results of most application scenarios are higher than the general evaluation results, but a few test evaluation results are far lower than the general evaluation results, it means that there is an imbalance in the training of multi-scenario enterprise large models. It is necessary to adjust the weight hyperparameter settings of each application scenario to ensure that the training process of each application scenario is more balanced.
[0074] When the test evaluation result of any application scenario is lower than the general evaluation result, the training task data and training annotation data of the application scenario are adjusted, and the step of performing parameter training on the enterprise big model to be trained according to the training task data and training annotation data of each application scenario is returned to obtain the trained multi-scenario enterprise big model, so as to optimize the trained multi-scenario enterprise big model.
[0075] Among them, if the test evaluation results of most application scenarios are higher than the general evaluation results, but a few test evaluation results are slightly lower than the general evaluation results, it means that the quality of a few data needs to be improved. The data quality can be improved by increasing the training task data, improving the quality of training annotation data, etc.
[0076] It should be noted that, taking the above example as an example, the training optimization scheme determined by comparing the test evaluation results of the model with the general evaluation results of the general large model is:
[0077] The "dialogue robot" scenario increases the amount of data annotation for knowledge question-answering tasks; the weights of the adjusted training task data for the "agent framework" application scenario are 0.35:0.35:0.15:0.15; the "work order classification" application scenario adjusts the ratio of different training task data to improve data quality; the "content creation" application scenario increases the training annotation data for style transfer and information retrieval; the "coding assistant" application scenario adjusts the ratio of different training task data to improve data quality. After iterative optimization, the final scores of the test evaluation results of each application scenario are: dialogue robot: 4.5(5), agent framework: 4.1(5), work order classification: 3.7(5), content creation: 3.9(5), coding assistant: 3.9(5).
[0078] The technical solution of this embodiment meets the application requirements of multiple scenarios by training the enterprise big model, which beneficially expands the limitation that the traditional scene big model training is only for specific scenarios, and expands the application scope of the scene big model. By adapting to the data and requirements of different scenarios, the enterprise big model has wider applicability and flexibility. The technical solution of this embodiment uses multi-task training and tuning iteration, and the obtained enterprise big model can meet the diverse capability requirements in the enterprise application scenario. This means that the enterprise big model has more comprehensive and powerful functions in solving various practical problems, providing better support and solutions for enterprises. The technical solution of this embodiment establishes a complete multi-scenario evaluation system for enterprise-level big models, and accurately evaluates the ability of big model applications in scenarios by manual scoring. Such evaluation criteria can help enterprises better understand and measure the performance of big models in different scenarios, and guide further optimization and improvement. The technical solution of this embodiment determines the solution for the next training iteration according to the task-level fine-grained capability evaluation values of the fine-tuning big model and the general big model, so that the iterative optimization process of the model meets the evaluation criteria, thereby making the training and tuning process more streamlined and effective, improving the training efficiency, accelerating the iterative optimization of the model, and ultimately providing a better enterprise big model solution.
[0079] Figure 4 FIG. 2 is a schematic diagram showing a structure of an embodiment of a multi-scenario enterprise large model training system 200 provided by the present invention. Figure 4 As shown, the system 200 includes: a construction module 210, a training module 220 and an optimization module 230;
[0080] The construction module 210 is used to: determine the task lists corresponding to multiple application scenarios of the enterprise large model to be trained, and construct the training task data and training annotation data for each application scenario according to the task list corresponding to each application scenario;
[0081] The training module 220 is used to: perform parameter training on the enterprise big model to be trained according to the training task data and training annotation data of each application scenario, so as to obtain a trained multi-scenario enterprise big model;
[0082] The optimization module 230 is used to input the test task data of each application scenario into the trained multi-scenario enterprise big model for evaluation, so as to optimize the trained multi-scenario enterprise big model according to the test evaluation results of each application scenario to obtain the target multi-scenario enterprise big model.
[0083] In an optional manner, the training module 220 is specifically used for:
[0084] The training task data and the training annotation data of each application scenario are alternately used by the stochastic gradient descent method to iteratively update the parameters of the enterprise big model to be trained and the weight of each application scenario until the trained multi-scenario enterprise big model is obtained.
[0085] In an optional manner, the step of optimizing the trained multi-scenario enterprise big model according to the test evaluation results of each application scenario in the optimization module 230 to obtain the target multi-scenario enterprise big model includes:
[0086] Obtain the general evaluation result of each application scenario in the enterprise big model to be trained, and optimize the trained multi-scenario enterprise big model according to the difference between the test evaluation result and the general evaluation result of each application scenario to obtain the target multi-scenario enterprise big model.
[0087] In an optional manner, the step of optimizing the trained multi-scenario enterprise big model in the optimization module 230 according to the difference between the test evaluation result and the general evaluation result of each application scenario includes:
[0088] When the test evaluation results of each application scenario are lower than the general evaluation results, the training task data of each application scenario is adjusted, and the step of performing parameter training on the enterprise big model to be trained according to the training task data and training annotation data of each application scenario is returned to obtain the trained multi-scenario enterprise big model, so as to optimize the trained multi-scenario enterprise big model;
[0089] When the test evaluation result of any application scenario is much lower than the general evaluation result, the weight of each application scenario is adjusted, and the step of performing parameter training on the enterprise big model to be trained according to the training task data and training annotation data of each application scenario is returned to obtain the trained multi-scenario enterprise big model, so as to optimize the trained multi-scenario enterprise big model;
[0090] When the test evaluation result of any application scenario is lower than the general evaluation result, the training task data and training annotation data of the application scenario are adjusted, and the step of performing parameter training on the enterprise big model to be trained according to the training task data and training annotation data of each application scenario is returned to obtain the trained multi-scenario enterprise big model, so as to optimize the trained multi-scenario enterprise big model.
[0091] In an optional manner, multiple application scenarios include: conversational robots, intelligent agent frameworks, work order classification, content creation, and coding assistants.
[0092] In an optional manner, the task list corresponding to the conversational robot includes: multi-round conversations, reading comprehension and knowledge questions and answers; the task list corresponding to the intelligent agent framework includes: tool identification, tool use, logical reasoning and thought chain generation; the task list corresponding to the work order classification includes: information extraction, keyword extraction, text summarization and digital logic; the task list corresponding to the content creation includes: copywriting generation, text summarization, style transfer, information retrieval, article continuation and article rewriting; the task list corresponding to the coding assistant includes: text-code generation, code error correction, code continuation and code annotation.
[0093] The technical solution of this embodiment can enable the enterprise large model to better cope with diverse application scenarios, and improve the generalization ability and adaptability of the model.
[0094] The above-mentioned parameters and steps for each module to implement corresponding functions in the multi-scenario enterprise big model training system 200 of this embodiment can refer to the parameters and steps in the embodiment of the multi-scenario enterprise big model training method above, and will not be repeated here.
[0095] like Figure 5 As shown, an electronic device 300 of an embodiment of the present invention includes a processor 320, the processor 320 is coupled to a memory 310, and the memory 310 stores at least one computer program 330, and the at least one computer program 330 is loaded and executed by the processor 320, so that the electronic device 300 implements any of the above-mentioned multi-scenario enterprise large model training methods, specifically:
[0096] The electronic device 300 may have relatively large differences due to different configurations or performances, and may include one or more processors 320 (Central Processing Units, CPU) and one or more memories 310, wherein the one or more memories 310 store at least one computer program 330, and the at least one computer program 330 is loaded and executed by the one or more processors 320, so that the electronic device 300 implements any multi-scenario enterprise large model training method provided in the above embodiments. Of course, the electronic device 300 may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The electronic device 300 may also include other components for implementing device functions, which will not be repeated here.
[0097] A computer-readable storage medium according to an embodiment of the present invention stores at least one computer program, and the at least one computer program is loaded and executed by a processor so that a computer implements any of the above-mentioned multi-scenario enterprise large model training methods.
[0098] Optionally, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.
[0099] In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes any of the above-mentioned multi-scenario enterprise large model training methods.
[0100] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects and represent the definition of a specific order or sequence. The order of use of similar objects can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than the order shown or described.
[0101] Those skilled in the art know that the present invention can be implemented as a system, method or computer program product. Therefore, the present disclosure can be specifically implemented in the following forms, namely: it can be complete hardware, it can be complete software (including firmware, resident software, microcode, etc.), or it can be a combination of hardware and software, which is generally referred to as "circuit", "module" or "system" herein. In addition, in some embodiments, the present invention can also be implemented in the form of a computer program product in one or more computer-readable media, and the computer-readable medium contains computer-readable program code.
[0102] Any combination of one or more computer-readable media can be used. Computer-readable media can be computer-readable signal media or computer-readable storage media. Computer-readable storage media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, 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), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0103] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A multi-scenario enterprise large model training method, characterized in that: include: Determine the task lists corresponding to multiple application scenarios of the enterprise large model to be trained, and build the training task data and training annotation data for each application scenario based on the task lists corresponding to each application scenario; Multiple application scenarios include: conversational robots, intelligent agent frameworks, work order classification, content creation, and coding assistants; the task list corresponding to the conversational robots includes: multi-round conversations, reading comprehension, and knowledge questions and answers; the task list corresponding to the intelligent agent framework includes: tool identification, tool use, logical reasoning, and thought chain generation; the task list corresponding to the work order classification includes: information extraction, keyword extraction, text summarization, and digital logic; the task list corresponding to the content creation includes: copywriting generation, text summarization, style transfer, information retrieval, article continuation, and article rewriting; the task list corresponding to the coding assistant includes: text-code generation, code error correction, code continuation, and code annotation; According to the training task data and training annotation data of each application scenario, parameter training is performed on the enterprise big model to be trained to obtain a trained multi-scenario enterprise big model; Input the test task data of each application scenario into the trained multi-scenario enterprise big model for evaluation, so as to optimize the trained multi-scenario enterprise big model according to the test evaluation results of each application scenario to obtain the target multi-scenario enterprise big model; The step of performing parameter training on the enterprise big model to be trained according to the training task data and training annotation data of each application scenario to obtain the trained multi-scenario enterprise big model includes: The training task data and training annotation data of each application scenario are alternately used by the stochastic gradient descent method to iteratively update the parameters of the enterprise model to be trained and the weight of each application scenario until the trained multi-scenario enterprise model is obtained; wherein, for the t=1, 2, ..., N application scenarios of the current iteration, assuming that the scenario contains K training task data, M data are randomly extracted from each training task data to form a batch B k represents a small batch training unit consisting of k=1, 2, ..., K training task data; assuming Θ represents the parameters of the large enterprise model to be trained, the update method for an iterative parameter for the current application scenario is l CE represents the cross entropy loss function, represents the operator for finding the gradient of Θ, α k Represents the weight coefficient of each training task data in multiple application scenarios; According to the test evaluation results of each application scenario, the trained multi-scenario enterprise big model is optimized to obtain the target multi-scenario enterprise big model, including: Obtaining a general evaluation result of each application scenario in the enterprise big model to be trained, optimizing the trained multi-scenario enterprise big model according to the difference between the test evaluation result and the general evaluation result of each application scenario, and obtaining the target multi-scenario enterprise big model; According to the difference between the test evaluation result of each application scenario and the general evaluation result, the step of optimizing the trained multi-scenario enterprise big model includes: When the test evaluation results of each application scenario are lower than the general evaluation results, the training task data of each application scenario is adjusted, and the step of performing parameter training on the enterprise big model to be trained according to the training task data and training annotation data of each application scenario is returned to obtain the trained multi-scenario enterprise big model, so as to optimize the trained multi-scenario enterprise big model; When the test evaluation result of any application scenario is much lower than the general evaluation result, the weight of each application scenario is adjusted, and the step of performing parameter training on the enterprise big model to be trained according to the training task data and training annotation data of each application scenario is returned to obtain the trained multi-scenario enterprise big model, so as to optimize the trained multi-scenario enterprise big model; When the test evaluation result of any application scenario is lower than the general evaluation result, the training task data and training annotation data of the application scenario are adjusted, and the step of performing parameter training on the enterprise big model to be trained according to the training task data and training annotation data of each application scenario is returned to obtain the trained multi-scenario enterprise big model, so as to optimize the trained multi-scenario enterprise big model.
2. A multi-scenario enterprise large model training system, characterized in that: include: Building modules, training modules, and optimizing modules; The construction module is used to: determine the task lists corresponding to multiple application scenarios of the enterprise large model to be trained, and construct the training task data and training annotation data for each application scenario according to the task list corresponding to each application scenario; Multiple application scenarios include: conversational robots, intelligent agent frameworks, work order classification, content creation, and coding assistants; the task list corresponding to the conversational robots includes: multi-round conversations, reading comprehension, and knowledge questions and answers; the task list corresponding to the intelligent agent framework includes: tool identification, tool use, logical reasoning, and thought chain generation; the task list corresponding to the work order classification includes: information extraction, keyword extraction, text summarization, and digital logic; the task list corresponding to the content creation includes: copywriting generation, text summarization, style transfer, information retrieval, article continuation, and article rewriting; the task list corresponding to the coding assistant includes: text-code generation, code error correction, code continuation, and code annotation; The training module is used to: perform parameter training on the enterprise big model to be trained according to the training task data and training annotation data of each application scenario, so as to obtain a trained multi-scenario enterprise big model; The optimization module is used to: input the test task data of each application scenario into the trained multi-scenario enterprise big model for evaluation, so as to optimize the trained multi-scenario enterprise big model according to the test evaluation results of each application scenario to obtain a target multi-scenario enterprise big model; The training module is specifically used for: The training task data and training annotation data of each application scenario are alternately used by the stochastic gradient descent method to iteratively update the parameters of the enterprise model to be trained and the weight of each application scenario until the trained multi-scenario enterprise model is obtained; wherein, for the t=1, 2, ..., N application scenarios of the current iteration, assuming that the scenario contains K training task data, M data are randomly extracted from each training task data to form a batch B k represents a small batch training unit consisting of k=1, 2, ..., K training task data; assuming Θ represents the parameters of the large enterprise model to be trained, the update method for an iterative parameter for the current application scenario is l CE represents the cross entropy loss function, represents the operator for finding the gradient of Θ, α k Represents the weight coefficient of each training task data in multiple application scenarios; The step of optimizing the trained multi-scenario enterprise big model according to the test evaluation results of each application scenario in the optimization module to obtain the target multi-scenario enterprise big model includes: Obtaining a general evaluation result of each application scenario in the enterprise big model to be trained, optimizing the trained multi-scenario enterprise big model according to the difference between the test evaluation result and the general evaluation result of each application scenario, and obtaining the target multi-scenario enterprise big model; The step of optimizing the trained multi-scenario enterprise big model in the optimization module according to the difference between the test evaluation result and the general evaluation result of each application scenario includes: When the test evaluation results of each application scenario are lower than the general evaluation results, the training task data of each application scenario is adjusted, and the step of performing parameter training on the enterprise big model to be trained according to the training task data and training annotation data of each application scenario is returned to obtain the trained multi-scenario enterprise big model, so as to optimize the trained multi-scenario enterprise big model; When the test evaluation result of any application scenario is much lower than the general evaluation result, the weight of each application scenario is adjusted, and the step of performing parameter training on the enterprise big model to be trained according to the training task data and training annotation data of each application scenario is returned to obtain the trained multi-scenario enterprise big model, so as to optimize the trained multi-scenario enterprise big model; When the test evaluation result of any application scenario is lower than the general evaluation result, the training task data and training annotation data of the application scenario are adjusted, and the step of performing parameter training on the enterprise big model to be trained according to the training task data and training annotation data of each application scenario is returned to obtain the trained multi-scenario enterprise big model, so as to optimize the trained multi-scenario enterprise big model.
3. An electronic device, characterized in that: The electronic device includes a processor, which is coupled to a memory. The memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor so that the electronic device implements the multi-scenario enterprise big model training method as described in claim 1.
4. A computer-readable storage medium, characterized in that: At least one computer program is stored in the computer-readable storage medium, and the at least one computer program is loaded and executed by the processor so that the computer-readable storage medium implements the multi-scenario enterprise large model training method as described in claim 1.
Citation Information
Patent Citations
Multi-task learning model training method and device, electronic equipment and storage medium
CN114913371A