Task processing method, automatic question answering method and task processing system
By using the combination method of shared model parameters and candidate model parameters in large model services, the problems of high deployment costs and high resource consumption of personalized services by multiple enterprises are solved, and efficient and economical personalized service provision is achieved.
Patent Information
- Application Number
- CN202311213755.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-19
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2043-09-19
AI Technical Summary
When providing personalized large-scale model services to multiple enterprises, the existing technology faces the problems of huge resource consumption and high deployment costs.
By using one shared model parameters and multiple candidate model parameters, building a task processing model, dynamically switching its exclusive parameters for each enterprise only when needed, reducing model deployment and storage costs.
It realizes efficiently providing personalized services without deploying models for each enterprise, reducing resource consumption and deployment costs.
Smart Images

Figure CN119668891A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the field of computer technology, and more particularly to a task processing method. One or more embodiments of this specification also relate to an automatic question-answering method, a task processing system, a task processing device, an automatic question-answering device, a computing device, a computer-readable storage medium, and a computer program. Background Art
[0002] With the development of computer technology, large models have begun to shine, showing extraordinary capabilities in language understanding, generation, interaction and reasoning, and are widely used in natural language processing fields such as dialogue, translation, and code generation. However, due to the huge number of parameters in large models and the different needs of different companies, how to provide personalized model services to massive companies has gradually become a research focus.
[0003] At present, enterprise-specific large models are usually trained through supervised fine-tuning: during the large model training process, all parameters of the large model are adjusted according to the needs of the enterprise to achieve the purpose of personalized training model. However, in the above solution, since the number of large model parameters is very large, and a separate exclusive large model is deployed for each enterprise, N enterprises will correspond to N large models. The deployment and storage costs lead to huge resource consumption. Therefore, a task processing solution with less resource consumption is urgently needed. Summary of the invention
[0004] In view of this, an embodiment of this specification provides a task processing method. One or more embodiments of this specification also relate to an automatic question-answering method, a task processing system, a task processing device, an automatic question-answering device, a computing device, a computer-readable storage medium, and a computer program to solve the technical defects existing in the prior art.
[0005] According to a first aspect of an embodiment of this specification, a task processing method is provided, including:
[0006] receiving a task processing request, wherein the task processing request carries data to be processed;
[0007] Filtering a target model parameter corresponding to a target requester from a plurality of candidate model parameters, wherein the candidate model parameters are obtained by training a pre-trained processing model based on a sample set specified by the requester, and each candidate model parameter corresponds to a different requester;
[0008] Constructing a task processing model according to the target model parameters and the shared model parameters, wherein the shared model parameters are model parameters shared by each requester in the pre-trained processing model, and the shared model parameters of the pre-trained processing model remain unchanged during the training process;
[0009] Input the data to be processed into the task processing model to obtain the task processing results.
[0010] According to a second aspect of an embodiment of this specification, there is provided an automatic question-answering method, comprising:
[0011] receiving a question handling request, wherein the question handling request carries data to be answered;
[0012] Filtering a target model parameter corresponding to a target requester from a plurality of candidate model parameters, wherein the candidate model parameters are obtained by training a pre-trained processing model based on a sample set specified by the requester, and each candidate model parameter corresponds to a different requester;
[0013] Constructing a task processing model according to the target model parameters and the shared model parameters, wherein the shared model parameters are model parameters shared by each requester in the pre-trained processing model, and the shared model parameters of the pre-trained processing model remain unchanged during the training process;
[0014] Input the data to be answered into the task processing model to obtain the question answering result.
[0015] According to a third aspect of an embodiment of this specification, there is provided a task processing system, including a service unit and a candidate parameter storage unit;
[0016] A candidate parameter storage unit, used to store multiple candidate model parameters;
[0017] A service unit is used to receive a task processing request, wherein the task processing request carries data to be processed; select target model parameters corresponding to a target requester from a plurality of candidate model parameters, wherein the candidate model parameters are obtained by training a pre-trained processing model based on a sample set specified by the requester, and each candidate model parameter corresponds to a different requester; construct a task processing model according to the target model parameters and shared model parameters, wherein the shared model parameters are model parameters shared by each requester in the pre-trained processing model, and the shared model parameters of the pre-trained processing model remain unchanged during the training process; input the data to be processed into the task processing model to obtain a task processing result.
[0018] According to a fourth aspect of the embodiments of this specification, there is provided a task processing device, including:
[0019] A first receiving module is configured to receive a task processing request, wherein the task processing request carries data to be processed;
[0020] A first screening module is configured to screen out target model parameters corresponding to a target requester from a plurality of candidate model parameters, wherein the candidate model parameters are obtained by training a pre-trained processing model based on a sample set specified by the requester, and each candidate model parameter corresponds to a different requester;
[0021] A first construction module is configured to construct a task processing model according to target model parameters and shared model parameters, wherein the shared model parameters are model parameters shared by each requester in a pre-trained processing model, and the shared model parameters of the pre-trained processing model remain unchanged during the training process;
[0022] The first input module is configured to input the data to be processed into the task processing model to obtain the task processing result.
[0023] According to a fifth aspect of the embodiments of this specification, there is provided an automatic question-answering device, comprising:
[0024] A second receiving module is configured to receive a question processing request, wherein the question processing request carries data to be answered;
[0025] A second screening module is configured to screen out target model parameters corresponding to the target requester from a plurality of candidate model parameters, wherein the candidate model parameters are obtained by training a pre-trained processing model based on a sample set specified by the requester, and each candidate model parameter corresponds to a different requester;
[0026] The second construction module is configured to construct a task processing model according to the target model parameters and the shared model parameters, wherein the shared model parameters are model parameters shared by the requesting parties in the pre-trained processing model, and the shared model parameters of the pre-trained processing model remain unchanged during the training process;
[0027] The second input module is configured to input the data to be answered into the task processing model to obtain the question answering result.
[0028] According to a sixth aspect of an embodiment of this specification, a computing device is provided, including:
[0029] Memory and processor;
[0030] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the method provided in the first aspect or the second aspect are implemented.
[0031] According to a seventh aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the method provided in the first aspect or the second aspect are implemented.
[0032] According to an eighth aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the method provided in the first aspect or the second aspect above.
[0033] A task processing method provided by an embodiment of the present specification receives a task processing request, wherein the task processing request carries data to be processed; selects target model parameters corresponding to a target requester from a plurality of candidate model parameters, wherein the candidate model parameters are obtained by training a pre-trained processing model based on a sample set specified by the requester, and each candidate model parameter corresponds to a different requester; constructs a task processing model according to the target model parameters and shared model parameters, wherein the shared model parameters are model parameters shared by each requester in the pre-trained processing model, and the shared model parameters of the pre-trained processing model remain unchanged during the training process; inputs the data to be processed into the task processing model to obtain a task processing result. In the process of training the pre-trained processing model using sample sets specified by different requesters, the shared model parameters in the pre-trained processing model are fixed unchanged, so that the candidate model parameters corresponding to each requester can be efficiently obtained, and it is realized that only one shared model parameter is used with different candidate model parameters to serve different requesters, and there is no need to provide a task processing model separately for each requester, thereby reducing the model deployment cost and the consumption of task processing resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 It is an architectural diagram of a task processing system;
[0035] Figure 2 is an architecture diagram of a first task processing system provided by an embodiment of this specification;
[0036] Figure 3 is an architecture diagram of a second task processing system provided by an embodiment of this specification;
[0037] Figure 4 is an architecture diagram of a third task processing system provided by an embodiment of this specification;
[0038] Figure 5 is a flowchart of a task processing method provided by an embodiment of this specification;
[0039] Figure 6 is a flow chart of an automatic question-answering method provided by an embodiment of this specification;
[0040] Figure 7 is a processing flow chart of a task processing method provided by an embodiment of this specification;
[0041] Figure 8 This is a schematic diagram of an automatic question-and-answer interface provided by an embodiment of this specification;
[0042] Fig. 9 is a schematic diagram of a task processing device provided by an embodiment of the present specification;
[0043] Fig.10 is a structural schematic diagram of an automatic question-answering device provided by an embodiment of this specification;
[0044] Fig.11 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION
[0045] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.
[0046] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0047] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0048] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0049] In one or more embodiments of this specification, a large model refers to a deep learning model with large-scale model parameters, which usually contains hundreds of millions, tens of billions, hundreds of billions, trillions, or even more than 10 trillion model parameters. A large model can also be called a foundation model / foundation model. The large model is pre-trained with large-scale unlabeled corpus to produce a pre-trained model with more than 100 million parameters. This model can adapt to a wide range of downstream tasks, and the model has good generalization ability, such as a large-scale language model (LLM, Large Language Model), a multi-modal pre-training model, etc.
[0050] When the big model is used in practice, only a small number of samples are needed to fine-tune the pre-trained model and it can be applied to different tasks. The big model can be widely used in natural language processing (NLP), computer vision and other fields. Specifically, it can be applied to computer vision tasks such as visual question answering (VQA), image description (IC, Image Caption), image generation, as well as natural language processing tasks such as text-based sentiment classification, text summary generation, and machine translation. The main application scenarios of the big model include digital assistants, intelligent robots, search, online education, office software, e-commerce, intelligent design, etc.
[0051] First, the terms involved in one or more embodiments of this specification are explained.
[0052] Language model: Language model is an abstract mathematical modeling of language based on objective language facts, and is an important direction in the field of natural language research.
[0053] With the development of computer technology, large models have begun to shine, showing extraordinary capabilities in language understanding, generation, interaction and reasoning, and are widely used in natural language processing fields such as dialogue, translation, and code generation. However, due to the huge number of parameters in large models and the different needs of different companies, how to provide personalized model services to massive companies has gradually become a research focus.
[0054] At present, supervised fine-tuning (SFT) is usually used to train enterprise-specific large models: during the large model training process, all parameters of the large model are adjusted according to the needs of the enterprise to achieve the purpose of personalized training model. However, in the above solution, due to the large number of large model parameters, the training cost is very high. At the same time, in actual deployment, a separate dedicated large model is deployed for each enterprise. N enterprises will correspond to the deployment and storage costs of N large models, resulting in huge resource consumption. Figure 1 , Figure 1 A task processing system architecture diagram is shown, such as Figure 1 As shown, the task processing system is a multi-enterprise multi-model task processing system. Enterprise A corresponds to task processing model A, enterprise B corresponds to task processing model B, enterprise C corresponds to task processing model C, and enterprise D corresponds to task processing model D.
[0055] In actual production, multiple large models need to be deployed for multiple enterprises, and the deployment cost is huge. The embodiment of this specification proposes a training and deployment solution that calls the same large model base when deploying enterprise users, supports the deployment of different enterprise models based on the unified large model base, and different enterprises only need to fine-tune the corresponding model parameters, thereby reducing the model deployment cost. Figure 2 , Figure 2 FIG. 1 shows an architecture diagram of a first task processing system provided by an embodiment of the present specification, such as Figure 2 As shown, the task processing system proposed in the embodiment of this specification is a task processing system for multiple enterprises to uniformly share model parameters and multiple candidate model parameters. Enterprise A, enterprise B, enterprise C and enterprise D share the shared model parameters of a pre-trained processing model, and each enterprise corresponds to different candidate model parameters. The candidate model parameters are obtained by training the pre-trained processing model based on the sample set specified by the enterprise. Specifically, enterprise A corresponds to candidate model parameter A, enterprise B corresponds to candidate model parameter B, enterprise C corresponds to candidate model parameter C, and enterprise D corresponds to candidate model parameter D.
[0056] Specifically, the embodiment of this specification proposes a task processing method, receiving a task processing request, wherein the task processing request carries data to be processed; filtering out target model parameters corresponding to the target requester from multiple candidate model parameters, wherein the candidate model parameters are obtained by training a pre-trained processing model based on a sample set specified by the requester, and each candidate model parameter corresponds to a different requester; constructing a task processing model according to the target model parameters and shared model parameters, wherein the shared model parameters are model parameters shared by each requester in the pre-trained processing model, and the shared model parameters of the pre-trained processing model remain unchanged during the training process; inputting the data to be processed into the task processing model to obtain a task processing result. In the process of training the pre-trained processing model using sample sets specified by different requesters, the shared model parameters in the fixed pre-trained processing model remain unchanged, so that the candidate model parameters corresponding to each requester can be efficiently obtained, and it is realized that only one shared model parameter is used with different candidate model parameters to serve different requesters, and there is no need to provide a task processing model separately for each requester, thereby reducing the model deployment cost and the consumption of task processing resources.
[0057] In this specification, a task processing method is provided. This specification also involves an automatic question-and-answer method, a task processing system, a task processing device, an automatic question-and-answer device, a computing device, a computer-readable storage medium, and a computer program, which are described in detail one by one in the following embodiments.
[0058] See also Figure 3 , Figure 3 The architecture diagram of the second task processing system provided by an embodiment of the present specification is shown. The task processing system may include a candidate parameter storage unit 100 and a service unit 200;
[0059] A candidate parameter storage unit 100, used to store a plurality of candidate model parameters;
[0060] The service unit 200 is used to receive a task processing request, wherein the task processing request carries data to be processed; select target model parameters corresponding to the target requester from multiple candidate model parameters, wherein the candidate model parameters are obtained by training a pre-trained processing model based on a sample set specified by the requester, and each candidate model parameter corresponds to a different requester; construct a task processing model according to the target model parameters and shared model parameters, wherein the shared model parameters are model parameters shared by each requester in the pre-trained processing model, and the shared model parameters of the pre-trained processing model remain unchanged during the training process; input the data to be processed into the task processing model to obtain a task processing result.
[0061] In an optional embodiment of the present specification, the task processing system further includes a shared parameter storage unit 300; the shared parameter storage unit 300 is used to store shared model parameters; and the service unit 200 is further used to obtain shared model parameters from the shared parameter storage unit 300.
[0062] By applying the solution of the embodiments of the present specification, in the process of training the pre-trained processing model using sample sets specified by different requesters, the shared model parameters in the fixed pre-trained processing model remain unchanged, so that the candidate model parameters corresponding to each requester can be efficiently obtained, and only one shared model parameter is used with different candidate model parameters to serve different requesters. There is no need to provide a separate task processing model for each requester, thereby reducing the model deployment cost and task processing resource consumption.
[0063] See also Figure 4 , Figure 4 The architecture diagram of the third task processing system provided by an embodiment of the present specification is shown, and the task processing system may include multiple clients 400 and a service unit 200. Multiple clients 400 may establish communication connections through the service unit 200. In the task processing scenario, the service unit 200 is used to provide task processing services between multiple clients 400. Multiple clients 400 may respectively serve as senders or receivers, and realize communication through the service unit 200.
[0064] The target requester can interact with the service unit 200 through the client 400 to receive data sent by other clients 400, or send data to other clients 400, etc. In the task processing scenario, the target requester can publish a data stream to the service unit 200 through the client 400, and the service unit 200 generates a task processing result according to the data stream and pushes the task processing result to other clients that have established communication.
[0065] The client 400 and the service unit 200 are connected via a network. The network provides a medium for a communication link between the client 400 and the service unit 200. The network may include various connection types, such as wired or wireless communication links or optical fiber cables, etc. The data transmitted by the client 400 may need to be encoded, transcoded, compressed, etc. before being released to the service unit 200.
[0066] The client 400 can be a browser, an APP (Application), or a web application such as an H5 (HyperText Markup Language 5, Hypertext Markup Language Version 5) application, or a light application (also known as a mini-program, a lightweight application) or a cloud application, etc. The client 400 can be based on the software development kit (SDK, Software Development Kit) of the corresponding service provided by the service unit 200, such as based on the real-time communication (RTC, Real Time Communication) SDK development and acquisition. The client 400 can be deployed in an electronic device, and needs to rely on the device to run or some APPs in the device to run. For example, the electronic device can have a display screen and support information browsing, such as a personal mobile terminal such as a mobile phone, a tablet computer, a personal computer, etc. Various other types of applications can also be configured in the electronic device, such as human-computer dialogue applications, model training applications, text processing applications, web browser applications, shopping applications, search applications, instant messaging tools, mailbox clients, social platform software, etc.
[0067] The service unit 200 may include servers that provide various services, such as servers that provide communication services to multiple clients, servers for background training that provide support for models used on the client, and servers that process data sent by the client. It should be noted that the service unit 200 can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. The server can also be a server of a distributed system, or a server combined with a blockchain. The server can also be a cloud server for basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (CDN, Content Delivery Network), and big data and artificial intelligence platforms, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.
[0068] It is worth noting that the task processing method provided in the embodiments of this specification is generally executed by the service unit, but in other embodiments of this specification, the client may also have similar functions to the service unit, thereby executing the task processing method provided in the embodiments of this specification. In other embodiments, the task processing method provided in the embodiments of this specification may also be jointly executed by the client and the service unit.
[0069] See also Figure 5 , Figure 5 A flowchart of a task processing method provided by an embodiment of the present specification is shown, which specifically includes the following steps:
[0070] Step 502: Receive a task processing request, wherein the task processing request carries data to be processed.
[0071] In one or more embodiments of the present specification, a task processing request may be received, and task processing may be performed based on the to-be-processed data carried in the task processing request to obtain a task processing result.
[0072] Specifically, the data to be processed is the object requested to be processed by the task processing request, and the data to be processed can be data in different scenarios, such as data in conference scenarios, data in e-commerce scenarios, etc. The data to be processed can also be different types of data, such as text data, audio data, image data, etc.
[0073] In practical applications, there are many ways to receive task processing requests, which are selected according to actual conditions, and the embodiments of this specification do not limit this. In one possible implementation of this specification, a task processing request sent by a target requester through a client can be received. In another possible implementation of this specification, a task processing request sent by a client at a fixed time can be received.
[0074] Step 504: Filter out target model parameters corresponding to the target requester from multiple candidate model parameters, wherein the candidate model parameters are obtained by training a pre-trained processing model based on a sample set specified by the requester, and each candidate model parameter corresponds to a different requester.
[0075] In one or more embodiments of the present specification, after receiving the task processing request, further, the target model parameters corresponding to the target requester can be screened out from a plurality of candidate model parameters.
[0076] Specifically, the target requester refers to the object that sends the task processing request. The target requester can be an individual user or an enterprise user. The candidate model parameters are obtained by training the pre-training processing model based on the sample set specified by the requester, and the method of training the pre-training processing model can be parameter-efficient fine-tuning (PEFT, Parameter-EfficientFine-Tuning). Parameter efficient fine-tuning is a training technology that freezes most of the parameters in the pre-training processing model and only trains a small part of the parameters, while ensuring that the training effect is basically the same as the full training, that is, the candidate model parameters are obtained by training the pre-training processing model of the frozen shared model parameters based on the sample set specified by the requester. The method of efficient parameter fine-tuning includes but is not limited to LoRA, Adapter, P-tuning, prefix-tuning, etc. Preferably, in the embodiment of this specification, the pre-training processing model can be trained by the LoRA method to obtain the candidate model parameters, that is, the parameter update of the model weight matrix is approximated by learning a low-rank matrix with small parameters, and only the low-rank matrix parameters are optimized during training.
[0077] The target model parameters refer to the model parameters obtained by training the pre-trained processing model based on the sample set specified by the target requester. The pre-trained processing model is a deep learning model. The pre-trained processing model can be obtained by training the large model with all parameters based on the training set. Different candidate model parameters correspond to different requesters. For example, requester A corresponds to candidate model parameter A, requester B corresponds to candidate model parameter B, and requester C corresponds to candidate model parameter C.
[0078] It is worth noting that if the target model parameters corresponding to the target requester are not included in the multiple candidate model parameters, a sample set specified by the target requester can be obtained, and the pre-trained processing model can be trained using the sample set specified by the target requester to generate the target model parameters.
[0079] In actual applications, there are many ways to filter out the target model parameters corresponding to the target requester from multiple candidate model parameters. The specific selection is based on the actual situation, and the embodiments of this specification do not impose any limitation on this.
[0080] In a possible implementation of the present specification, the target model parameter corresponding to the target requester can be directly screened out from multiple candidate model parameters according to the requester information of the target requester. For example, if the requester information of the target requester is number A, the requester information and the candidate model parameter number can be matched, and candidate model parameter A can be screened out from candidate model parameter A, candidate model parameter B, and candidate model parameter C as the target model parameter.
[0081] In another possible implementation of the present specification, a parameter screening matrix may be generated according to the requester information of the target requester, and the parameter screening matrix may be further used to screen out the target model parameters from the multiple candidate model parameters. That is, the above-mentioned screening out the target model parameters corresponding to the target requester from the multiple candidate model parameters may include the following steps:
[0082] Obtaining requester information of a target requester;
[0083] Construct parameter screening matrix based on requester information;
[0084] According to the parameter screening matrix, target model parameters are screened out from multiple candidate model parameters.
[0085] Specifically, the requester information refers to information that uniquely identifies the identity of the target requester, including but not limited to the requester identification number, Internet Protocol address, etc. The value in the row corresponding to the target requester in the parameter screening matrix is 1, and the values in the remaining rows are 0. The target model parameters can be retained through the rows with values of 1 in the parameter screening matrix, and the candidate model parameters corresponding to the rows with values of 0 can be screened out. The parameter screening matrix is used to screen out the target model parameters from multiple candidate model parameters.
[0086] It should be noted that there are multiple ways to obtain the requester information of the target requester, which can be selected according to the actual situation, and the embodiments of this specification do not limit this. In one possible implementation of this specification, the requester information of the target requester can be obtained from a database. In another possible implementation of this specification, the requester information sent by the target requester through the client can be received.
[0087] Furthermore, after obtaining the requester information of the target requester, first, the original parameter screening matrix can be obtained, and each row in the original parameter screening matrix corresponds to a requester. Then, the target row corresponding to the target requester is determined from the original parameter screening matrix according to the requester information, and the value in the target row is set to 1, and the values in other rows are set to 0, so as to obtain the parameter screening matrix. Finally, the parameter screening matrix is multiplied by multiple candidate model parameters to screen out the target model parameters corresponding to the target requester from the multiple candidate model parameters.
[0088] By applying the solution of the embodiment of this specification, the requester information of the target requester is obtained; a parameter screening matrix is constructed according to the requester information; and the target model parameters are screened out from multiple candidate model parameters according to the parameter screening matrix. By multiplying the parameter screening matrix with the multiple candidate model parameters, the target model parameters are accurately screened out from the multiple candidate model parameters.
[0089] In an optional embodiment of the present specification, a plurality of candidate model parameters may be generated in advance, and the target model parameters corresponding to the target requester may be further screened out from the plurality of pre-generated candidate model parameters. That is, before the target model parameters corresponding to the target requester are screened out from the plurality of candidate model parameters, the following steps may be further included:
[0090] Obtain sample sets respectively specified by multiple requesting parties;
[0091] For a first requester, training a pre-training processing model according to a sample set specified by the first requester to obtain a pre-training model parameter corresponding to the first requester, wherein the first requester is any one of the multiple requesters;
[0092] The candidate model parameters corresponding to each requester are screened out from the pre-trained model parameters corresponding to each requester.
[0093] Specifically, the sample sets specified by multiple requesting parties may be the same or different. The pre-trained model parameters refer to the model parameters of the pre-trained processing model obtained by training the pre-trained processing model with the sample set specified by the first requesting party. The pre-trained model parameters include the shared model parameters and the candidate model parameters corresponding to the first requesting party, and the shared model parameters remain unchanged during the training of the pre-trained processing model.
[0094] In practical applications, there are many ways to obtain sample sets specified by multiple requesters, which are selected according to actual conditions, and the embodiments of this specification do not limit this. In one possible implementation of this specification, the sample sets specified by each requester can be read from other databases or data acquisition devices. In another possible implementation of this specification, the sample sets sent by each requester through the client can be received.
[0095] It should be noted that after obtaining the pre-trained model parameters corresponding to the first requester, the shared model parameters and candidate model parameters can be separated from the pre-trained model parameters through tensor-related functions, and then stored separately, so that the corresponding candidate model parameters can be called later according to the requester information.
[0096] The scheme of the embodiment of this specification is applied to obtain sample sets respectively specified by multiple requesters; for the first requester, the pre-trained processing model is trained according to the sample set specified by the first requester to obtain the pre-trained model parameters corresponding to the first requester, wherein the first requester is any one of the multiple requesters; and the candidate model parameters corresponding to each requester are screened out from the pre-trained model parameters corresponding to each requester. In the process of training the pre-trained processing model using the sample sets specified by different requesters, the shared model parameters in the fixed pre-trained processing model remain unchanged, so that the candidate model parameters corresponding to each requester can be efficiently obtained, and it is realized that only one shared model parameter is used with different candidate model parameters to serve different requesters.
[0097] Furthermore, the above-mentioned training of the pre-trained processing model according to the sample set specified by the first requester to obtain the pre-trained model parameters corresponding to the first requester may include the following steps:
[0098] Extracting first sample data from a sample set specified by the first requesting party, wherein the first sample data is any sample data in the sample set, and the first sample data carries a first sample label;
[0099] Inputting the first sample data into the pre-training processing model to obtain a first sample prediction result;
[0100] According to the first sample prediction result and the first sample label, adjust the model parameters other than the shared model parameters in the pre-trained processing model, and return to execute the step of extracting the first sample data from the sample set specified by the first requester until the first preset stop condition is reached to obtain the pre-trained model parameters corresponding to the first requester.
[0101] It should be noted that the training method for the pre-training processing model is supervised training, and the first sample data carrying the first sample label is the real label of the pre-training processing model training process, which can also be understood as a training target, used to guide the training process of the pre-training processing model. The sample set includes multiple sample data, and the sample data can be data from different scenarios, such as data in conference scenarios and data in e-commerce scenarios. The sample data can also be different types of data, such as audio data and text data. It should be noted that if the sample data is a type of data other than text data, the sample data can be converted to obtain sample data in text form.
[0102] In actual applications, the first sample data is input into the pre-training processing model. After obtaining the first sample prediction result, the first loss value can be calculated based on the first sample prediction result and the first sample label, and the model parameters other than the shared model parameters in the pre-training processing model can be adjusted according to the first loss value. The step of extracting the first sample data from the sample set specified by the first requester is returned to execute until the first preset stop condition is reached to obtain the pre-training model parameters corresponding to the first requester.
[0103] In a possible implementation of the present specification, the first preset stop condition includes that the first loss value is less than or equal to a first preset threshold value. After calculating the first loss value according to the first sample prediction result and the first sample label, the first loss value is compared with the first preset threshold value.
[0104] Specifically, if the first loss value is greater than the first preset threshold, it means that the difference between the first sample prediction result and the first sample label is large, and the pre-training processing model has poor prediction ability for the first sample prediction result. At this time, the model parameters other than the shared model parameters in the pre-training processing model can be adjusted, and the step of extracting the first sample data from the sample set specified by the first requester is returned to continue training the pre-training processing model until the first loss value is less than or equal to the first preset threshold, indicating that the difference between the first sample prediction result and the first sample label is small, and the first preset stop condition is met, and the pre-training model parameters corresponding to the first requester are obtained.
[0105] In another possible implementation of the present specification, in addition to comparing the first loss value and the first preset threshold, it is also possible to determine whether the pre-trained model parameters corresponding to the first requesting party are obtained in combination with a preset number of iterations.
[0106] Specifically, if the first loss value is greater than the first preset threshold, the model parameters other than the shared model parameters in the pre-training processing model are adjusted, and the step of extracting the first sample data from the sample set specified by the first requesting party is returned to execute, and the pre-training processing model is continued to be trained until the first preset number of iterations is reached, and the iteration is stopped to obtain the pre-training model parameters corresponding to the first requesting party, wherein the first preset threshold and the first preset number of iterations are selected according to the actual situation, and the embodiments of this specification do not impose any limitations on this.
[0107] In practical applications, there are many functions for calculating the first loss value, such as cross entropy loss function, L1 norm loss function, maximum loss function, mean square error loss function, logarithmic loss function, etc. The specific selection is based on the actual situation, and the embodiments of this specification do not impose any restrictions on this.
[0108] The solution of the embodiment of this specification is applied, a first loss value is calculated according to the first sample prediction result and the first sample label, the first loss value is compared with the first preset stop condition, and the pre-training processing model is continued to be trained when the first preset stop condition is not met, until the first preset stop condition is met, and the training is completed to obtain the pre-training model parameters corresponding to the first requesting party. By continuously adjusting the model parameters other than the shared model parameters in the pre-training processing model, the final pre-training model parameters can be made more accurate.
[0109] It is worth noting that by fixing the shared model parameters in the pre-trained processing model, only about 1% of the parameters need to be trained to achieve a good training effect. At the same time, due to the reduction of parameters adjusted during the training process, the graphics card and storage space required for training are also significantly reduced. Taking the training of a 13B model as an example, if the pre-trained processing model is fully parameterized, at least 2 80G graphics cards are required. At the same time, if the training process stores 10 checkpoints, at least 10*20G=200G of storage space is required, which is huge. However, by efficiently fine-tuning the parameters of the fixed shared model parameters, only 1 80G graphics card is needed to train the pre-trained processing model. At the same time, if the training process stores 10 checkpoints, only 10*20G*1%=2G of storage space is required, which significantly reduces the storage space.
[0110] In an optional embodiment of the present specification, after obtaining the pre-trained model parameters corresponding to the first requesting party, the pre-trained model parameters can be sent to the first requesting party, and the first requesting party can locally build a model according to the pre-trained model parameters and determine whether the current pre-trained model parameters meet the requirements. If they do not meet the requirements, the first requesting party can send sample adjustment data to continue training the pre-trained model, that is, the above-mentioned training of the pre-trained processing model according to the sample set specified by the first requesting party, after obtaining the pre-trained model parameters corresponding to the first requesting party, can also include the following steps:
[0111] Sending the pre-trained model parameters to the first requester;
[0112] Receive sample adjustment data sent by the first requester based on the pre-training model parameters, and adjust the parameters of the pre-training processing model according to the sample adjustment data.
[0113] Specifically, the sample adjustment data may be sample data outside the sample set, or may be the number of model training iterations during parameter adjustment. The sample adjustment data is used to adjust model parameters other than shared model parameters in the pre-training processing model. If the sample adjustment data is sample data outside the sample set, the sample adjustment data may be data from different scenarios, such as data in a conference scenario or data in an e-commerce scenario. The sample adjustment data may also be data of different types, such as audio data or text data. It should be noted that if the sample adjustment data is data of a type other than text data, the sample adjustment data may be converted to obtain sample adjustment data in text form.
[0114] In actual applications, when the pre-trained model parameters are sent to the first requesting party, the pre-trained model parameters can be sent to the first requesting party through the client. Further, sample adjustment data sent by the first requesting party through the client can be received, wherein the sample adjustment data is obtained based on the pre-trained model parameters.
[0115] It should be noted that the method of adjusting the parameters of the pre-trained processing model according to the sample adjustment data is the same as the implementation method of the above-mentioned "training the pre-trained processing model according to the sample set specified by the first requesting party", and will not be repeated in this embodiment of the specification.
[0116] By applying the solution of the embodiment of this specification, the pre-trained model parameters are sent to the first requesting party; the sample adjustment data sent by the first requesting party based on the pre-trained model parameters is received, and the parameters of the pre-trained processing model are adjusted according to the sample adjustment data, so that the candidate model parameters corresponding to the first requesting party are more accurate, thereby further ensuring the accuracy of the task processing model.
[0117] In an optional embodiment of the present specification, the pre-trained model parameters include shared model parameters; after the candidate model parameters corresponding to each requesting party are screened out from the pre-trained model parameters corresponding to each requesting party, the following steps may also be included:
[0118] storing the candidate model parameters corresponding to each requester in a candidate parameter storage unit respectively;
[0119] The shared model parameters are stored in the shared parameter storage unit.
[0120] Specifically, the candidate parameter storage unit and the shared parameter storage unit may be different databases, or different storage sub-units in the same database.
[0121] It should be noted that when the candidate model parameters corresponding to each requester are respectively stored in the candidate parameter storage unit, the candidate model parameters can be stored in a column-based storage manner according to the requester information of each requester.
[0122] By applying the solution of the embodiment of this specification, after selecting the candidate model parameters corresponding to each requester from the pre-trained model parameters corresponding to each requester, the candidate model parameters corresponding to each requester are stored in the candidate parameter storage unit respectively; and the shared model parameters are stored in the shared parameter storage unit. In this way, the target model parameters corresponding to the target requester can be directly extracted from the candidate parameter storage unit, and the shared model parameters can be extracted from the shared parameter storage unit to construct the task processing model.
[0123] In practical applications, the shared model parameters may be directly stored in the shared parameter storage unit. Furthermore, since the shared model parameters are model parameters shared by each requesting party and the shared model parameters are fixed, if the shared model parameters have been stored in the shared parameter storage unit, there is no need to repeatedly store the shared model parameters in the shared parameter storage unit. That is, before storing the shared model parameters in the shared parameter storage unit, the following steps may also be included:
[0124] Determining whether the shared parameter storage unit includes shared model parameters;
[0125] Storing the shared model parameters in the shared parameter storage unit may include the following steps:
[0126] When the shared model parameters are not included in the shared parameter storage unit, the shared model parameters are stored in the shared parameter storage unit.
[0127] It should be noted that there are multiple ways to determine whether the shared parameter storage unit includes the shared model parameters, and the specific selection is made according to the actual situation. The embodiments of this specification do not impose any limitation on this.
[0128] In a possible implementation of the present specification, it can be identified whether the shared parameter storage unit is empty. If the shared parameter storage unit is empty, it means that the shared parameter storage unit does not include shared model parameters, and the shared model parameters can be stored in the shared parameter storage unit; if the shared parameter storage unit is not empty, it means that the shared parameter storage unit includes shared model parameters, and there is no need to store the shared model parameters in the shared parameter storage unit.
[0129] In another possible implementation of the present specification, since the stored data may not be the shared model parameters when the shared parameter storage unit is not empty, the stored data in the shared parameter storage unit can be obtained, and the stored data and the shared model parameters can be compared. If the stored data and the shared model parameters are different, it means that the shared parameter storage unit does not include the shared model parameters, and the shared model parameters can be stored in the shared parameter storage unit; if the stored data and the shared model parameters are the same, it means that the shared parameter storage unit includes the shared model parameters, and there is no need to store the shared model parameters in the shared parameter storage unit.
[0130] By applying the solution of the embodiment of this specification, it is determined whether the shared parameter storage unit includes the shared model parameters; if the shared model parameters are not included in the shared parameter storage unit, the shared model parameters are stored in the shared parameter storage unit. This avoids redundant storage of the shared model parameters and reduces the occupancy rate of the shared parameter storage unit.
[0131] Step 506: construct a task processing model according to the target model parameters and the shared model parameters, wherein the shared model parameters are model parameters shared by the requesting parties in the pre-trained processing model, and the shared model parameters of the pre-trained processing model remain fixed during the training process.
[0132] In one or more embodiments of the present specification, after receiving a task processing request and screening out target model parameters corresponding to the target requester from a plurality of candidate model parameters, a task processing model may be further constructed based on the target model parameters and the shared model parameters.
[0133] Specifically, shared model parameters refer to fixed parameters during the training of the pre-trained processing model based on the sample set specified by the requester, which can also be understood as frozen parameters. Since the target model parameters are obtained by training the pre-trained processing model based on the sample set specified by the target requester, the task processing model can be understood as a processing model exclusive to the target requester.
[0134] It should be noted that when constructing a task processing model according to the target model parameters and the shared model parameters, the target model parameters and the shared model parameters can be concatenated to obtain the model parameters of the task processing model.
[0135] Step 508: Input the data to be processed into the task processing model to obtain the task processing result.
[0136] In one or more embodiments of the present specification, a task processing request is received, target model parameters corresponding to the target requester are screened out from multiple candidate model parameters, and after a task processing model is constructed based on the target model parameters and shared model parameters, the data to be processed can be further input into the task processing model to obtain a task processing result.
[0137] By applying the solution of the embodiments of the present specification, in the process of training the pre-trained processing model using sample sets specified by different requesters, the shared model parameters in the fixed pre-trained processing model remain unchanged, so that the candidate model parameters corresponding to each requester can be efficiently obtained, and only one shared model parameter is used with different candidate model parameters to serve different requesters. There is no need to provide a separate task processing model for each requester, thereby reducing the model deployment cost and task processing resource consumption.
[0138] In an optional embodiment of the present specification, after inputting the data to be processed into the task processing model and obtaining the task processing result, the following steps may also be included:
[0139] Sending the task processing result to the client so that the client can display the task processing result to the target requester;
[0140] Receive adjustment information sent by the target requester through the client, and adjust the target model parameters according to the adjustment information, wherein the adjustment information is obtained based on the task processing result.
[0141] It should be noted that after the data to be processed is input into the task processing model and the task processing result is obtained, the task processing result can be sent to the client, and the model parameters of the task processing model can also be sent to the client.
[0142] In actual applications, there are many ways for the client to display the task processing results to the target requester, which are selected according to the actual situation, and the embodiments of this specification do not limit this. In one possible implementation of this specification, the client can only display the task processing results to the target requester. In another possible implementation of this specification, the client can simultaneously display the task processing results and the model parameters of the task processing model to the target requester.
[0143] It is worth noting that after obtaining the task processing result, the task processing result can be quality checked. If the quality check passes, the task processing result is sent to the client. If the quality check fails, the task processing is performed again.
[0144] Furthermore, after the client displays the task processing results to the target requester, the target requester may perform data processing on its own according to the task processing results, or may adjust the task processing results displayed by the client to generate adjustment information, and send the adjustment information to the task processing system through the client, so that the task processing system adjusts the target model parameters according to the adjustment information, wherein the adjustment information may include the data to be processed and the adjusted task processing results.
[0145] By applying the scheme of the embodiments of this specification, the task processing results are sent to the client so that the client can display the task processing results to the target requester; the adjustment information sent by the target requester through the client is received, and the target model parameters are adjusted according to the adjustment information, so that the target requester can accurately obtain the task processing results, thereby increasing the interaction with the target requester and improving the satisfaction of the target requester.
[0146] In an optional embodiment of the present specification, before filtering out the target model parameter corresponding to the target requester from the plurality of candidate model parameters, the following steps may be included:
[0147] Obtain a training set, wherein the training set includes a plurality of training data, and the training data carries a training label;
[0148] Extracting first training data from the training set, wherein the first training data is any one in the training set;
[0149] Inputting the first training data into the original processing model to obtain a first training prediction result;
[0150] The original processing model is trained according to the first training prediction result and the first training label carried by the first training data to obtain a trained pre-trained processing model.
[0151] It should be noted that the original processing model can be a deep learning model of natural language. The original processing model is trained by supervised training. The training labels carried by the training data are the real labels of the original processing model training process. The training labels can also be understood as training targets, which are used to guide the training process of the original processing model. The training set includes multiple training data, and the training data can be data from different scenarios, such as data in conference scenarios and data in e-commerce scenarios. The training data can also be different types of data, such as audio data and text data. It should be noted that if the training data is a type of data other than text data, the training data can be converted to obtain training data in text form.
[0152] There are many ways to obtain a training set, which can be selected based on actual conditions, and the embodiments of this specification do not limit this. In one possible implementation of this specification, multiple training data can be read from other data acquisition devices or databases, and a training set can be constructed based on the multiple training data. In another possible implementation of this specification, a large amount of training data can be manually input, and a training set can be constructed based on the manually input training data.
[0153] In practical applications, the first training data is input into the original processing model. After obtaining the first training prediction result, the second loss value can be calculated based on the first training prediction result and the first training label, and the model parameters of the original processing model can be adjusted based on the second loss value. The step of extracting the first training data from the training set is then returned to execute until the second preset stop condition is reached to obtain a pre-trained processing model that has completed training.
[0154] In a possible implementation of the present specification, the second preset stop condition includes that the second loss value is less than or equal to a second preset threshold value. After calculating the second loss value according to the first training prediction result and the first training label, the second loss value is compared with the second preset threshold value.
[0155] Specifically, if the second loss value is greater than the second preset threshold, it means that the difference between the first training prediction result and the first training label is large, and the original processing model has poor prediction ability for the first training prediction result. At this time, the model parameters of the original processing model can be adjusted, and the step of extracting the first training data from the training set is returned to continue training the original processing model until the second loss value is less than or equal to the second preset threshold, indicating that the difference between the first training prediction result and the first training label is small, and the second preset stop condition is met, and a pre-trained processing model that has completed training is obtained.
[0156] In another possible implementation of the present specification, in addition to comparing the magnitude relationship between the second loss value and the second preset threshold, it is also possible to determine whether the pre-training processing model is trained in combination with a preset number of iterations.
[0157] Specifically, if the second loss value is greater than the second preset threshold, the model parameters of the original processing model are adjusted, and the step of extracting the first training data from the training set is returned to continue training the original processing model until the second preset number of iterations is reached, and the iteration is stopped to obtain a pre-trained processing model that has been trained. The second preset threshold and the second preset number of iterations are selected according to actual conditions, and the embodiments of this specification do not impose any limitations on this.
[0158] In practical applications, there are many functions for calculating the second loss value, such as cross entropy loss function, L1 norm loss function, maximum loss function, mean square error loss function, logarithmic loss function, etc. The specific selection is based on the actual situation, and the embodiments of this specification do not impose any restrictions on this.
[0159] By applying the solution of the embodiment of this specification, the second loss value is calculated according to the first training prediction result and the first training label, the second loss value is compared with the second preset stop condition, and the original processing model is continuously trained when the second preset stop condition is not met, until the second preset stop condition is met, and a pre-trained processing model is obtained. By continuously adjusting the model parameters of the original processing model, the pre-trained processing model can be made more accurate.
[0160] In the embodiments of this specification, the above task processing method has many application scenarios, such as data recommendation scenarios, intelligent question answering scenarios, etc. Figure 6 , taking the application of the task processing method provided in this specification in the intelligent question-answering scenario as an example, the task processing method is further explained. Figure 6 , Figure 6 A flowchart of an automatic question-answering method provided by an embodiment of this specification is shown, which specifically includes the following steps:
[0161] Step 602: Receive a question handling request, wherein the question handling request carries data to be answered.
[0162] Step 604: Filter out target model parameters corresponding to the target requester from multiple candidate model parameters, wherein the candidate model parameters are obtained by training a pre-trained processing model based on a sample set specified by the requester, and each candidate model parameter corresponds to a different requester.
[0163] Step 606: construct a task processing model according to the target model parameters and the shared model parameters, wherein the shared model parameters are model parameters shared by the requesting parties in the pre-trained processing model, and the shared model parameters of the pre-trained processing model remain fixed during the training process.
[0164] Step 608: Input the data to be answered into the task processing model to obtain the question answering result.
[0165] It should be noted that the data to be answered is also the data to be processed, and the result of answering the question is also the result of task processing. The implementation of step 602 to step 608 is the same as the implementation of step 502 to step 508 above, and will not be described in detail in this embodiment of the specification.
[0166] By applying the solution of the embodiments of the present specification, in the process of training the pre-trained processing model using sample sets specified by different requesters, the shared model parameters in the fixed pre-trained processing model remain unchanged, so that the candidate model parameters corresponding to each requester can be efficiently obtained, and only one shared model parameter is used with different candidate model parameters to serve different requesters. There is no need to provide a separate task processing model for each requester, thereby reducing the model deployment cost and automatic question and answer resource consumption.
[0167] See also Figure 7 , Figure 7 A process flow chart of a task processing method provided by an embodiment of the present specification is shown, which specifically includes the following steps:
[0168] Step 702: Obtain sample sets respectively specified by multiple requesting parties.
[0169] Step 704: for the first requester, train a pre-trained processing model according to a sample set specified by the first requester to obtain pre-trained model parameters corresponding to the first requester, wherein the first requester is any one of the multiple requesters.
[0170] Step 706: Filter out candidate model parameters corresponding to each requesting party from the pre-trained model parameters corresponding to each requesting party.
[0171] Step 708: Store the candidate model parameters corresponding to each requester in a candidate parameter storage unit respectively.
[0172] Step 710: Store the shared model parameters in the pre-trained model parameters into a shared parameter storage unit.
[0173] Step 712: Receive a task processing request, wherein the task processing request carries data to be processed.
[0174] Step 714: Filter out target model parameters corresponding to the target requester from the multiple candidate model parameters stored in the candidate parameter storage unit, wherein the candidate model parameters are obtained by training a pre-trained processing model based on a sample set specified by the requester, and each candidate model parameter corresponds to a different requester.
[0175] Step 716: construct a task processing model according to the target model parameters and the shared model parameters in the shared parameter storage unit, wherein the shared model parameters are model parameters shared by each requester in the pre-trained processing model, and the shared model parameters of the pre-trained processing model remain fixed during the training process.
[0176] Step 718: Input the data to be processed into the task processing model to obtain the task processing result.
[0177] It should be noted that the implementation method of step 702 to step 718 is the same as the implementation method of step 502 to step 508 described above, and will not be described in detail in this embodiment of the specification.
[0178] By applying the solution of the embodiments of the present specification, in the process of training the pre-trained processing model using sample sets specified by different requesters, the shared model parameters in the fixed pre-trained processing model remain unchanged, so that the candidate model parameters corresponding to each requester can be efficiently obtained, and only one shared model parameter is used with different candidate model parameters to serve different requesters. There is no need to provide a separate task processing model for each requester, thereby reducing the model deployment cost and task processing resource consumption.
[0179] The task processing method proposed in the embodiment of this specification utilizes efficient parameter fine-tuning to train exclusive parameters for a specified enterprise. During the deployment phase, the same pre-trained processing model is used as the base to dynamically switch the corresponding exclusive parameters of different enterprises to achieve the purpose of serving different enterprises. It is achieved that only one large model is used with multiple exclusive parameters to serve multiple enterprises at the same time, achieving the goal of significantly reducing deployment and storage costs. The task processing method mainly includes three parts: efficient training, parameter splitting, storage and assembly, and efficient deployment architecture. Among them, efficient training includes full parameter training and efficient parameter fine-tuning.
[0180] Full parameter training: obtain a training set, extract first training data from the training set, input the first training data into the original processing model, obtain a first training prediction result, train the original processing model according to the first training prediction result and the first training label carried by the first training data, and obtain a pre-trained processing model.
[0181] It should be noted that, in the original processing model training phase, after the training data is prepared, the original processing model can be fine-tuned in a supervised manner for all parameters. The advantage of this method is that by fully adjusting the original processing model parameters, the training data can be better fitted and a better training effect can be achieved. However, due to the huge number of parameters in the original processing model, a large amount of graphics card resources are required for full parameter training, and a large amount of storage space is also required to store the trained checkpoint files. Therefore, this manual proposes a training method for efficient parameter fine-tuning after the original processing model training is completed.
[0182] Efficient parameter fine-tuning: obtain sample sets specified by multiple requesters respectively, train a pre-trained processing model for the first requester according to the sample set specified by the first requester, obtain the pre-trained model parameters corresponding to the first requester, and filter out candidate model parameters corresponding to each requester from the pre-trained model parameters corresponding to each requester.
[0183] Parameter splitting, storage and assembly: In actual production, in order to solve the problem of efficient training and efficient deployment of multiple enterprises, in addition to the algorithm development through efficient parameter fine-tuning, the embodiments of this specification also carry out the separate storage of candidate model parameters and the assembly of parameters during model deployment. Specifically, the candidate model parameters corresponding to each requesting party are stored in the candidate parameter storage unit respectively, and the shared model parameters are stored in the shared parameter storage unit.
[0184] It should be noted that the parameter splitting storage and assembly can be realized through the underlying tensor operation of pytorch. During the parameter assembly process, the shared model parameters and the target model parameters can be loaded separately, and then the shared model parameters and the target model parameters can be multiplied with the input matrix respectively, and then added to complete the task processing.
[0185] Efficient deployment architecture: For training tasks for N companies, one pre-trained processing model can be used as the base, and N small candidate model parameters and the shared model parameters of the base model can be loaded into the video memory together. Compared with deploying N different task processing models, the above method can effectively reduce the consumption of graphics cards by N times. When used online, the corresponding small candidate model parameters can be automatically switched according to the requests of different companies, and together with the shared model parameters, a temporary task processing model can be formed to process the request for answer generation.
[0186] The solution of the embodiments of this specification effectively solves the resource consumption problem when multiple enterprises train and deploy large models by using efficient parameter adjustment. By simultaneously combining and deploying the shared model parameters in the base pre-training processing model and the candidate model parameters of multiple enterprises, it is possible to deploy the model with only 1.x times the base model resources, greatly reducing the resource consumption problem when multiple enterprises are collaboratively deployed.
[0187] See also Figure 8 , Figure 8 The following is a schematic diagram of an automatic question-and-answer interface provided by an embodiment of the present specification. The automatic question-and-answer interface is divided into a question-handling request input interface and a reply result display interface. The question-handling request input interface includes a question-handling request input box, an "OK" control, and a "Cancel" control. The reply result display interface includes a reply result display box.
[0188] The target requester inputs a question processing request through the question processing request input box displayed by the client, wherein the question processing request carries the data to be answered, clicks the "OK" control, and the service unit receives the question processing request sent by the client, and selects the target model parameters corresponding to the target requester from multiple candidate model parameters, wherein the candidate model parameters are obtained by training the pre-trained processing model based on the sample set specified by the requester, and each candidate model parameter corresponds to a different requester; a task processing model is constructed based on the target model parameters and the shared model parameters, wherein the shared model parameters are the model parameters shared by each requester in the pre-trained processing model, and the shared model parameters of the pre-trained processing model remain unchanged during the training process; the data to be answered is input into the task processing model, the question answer result is obtained, and the question answer result is sent to the client. The client displays the question answer result in the answer result display box.
[0189] In actual applications, the target requester operates the control by clicking, double-clicking, touching, hovering the mouse, sliding, long pressing, voice control, or shaking, etc. The specific selection is based on the actual situation, and the embodiments of this specification do not impose any limitations on this.
[0190] Corresponding to the above-mentioned task processing method embodiment, this specification also provides a task processing device embodiment. Fig. 9 FIG. 1 shows a schematic diagram of a task processing device provided by an embodiment of the present specification. Fig. 9 As shown, the device comprises:
[0191] A first receiving module 902 is configured to receive a task processing request, wherein the task processing request carries data to be processed;
[0192] A first screening module 904 is configured to screen out target model parameters corresponding to a target requester from a plurality of candidate model parameters, wherein the candidate model parameters are obtained by training a pre-trained processing model based on a sample set specified by the requester, and each candidate model parameter corresponds to a different requester;
[0193] A first construction module 906 is configured to construct a task processing model according to the target model parameters and the shared model parameters, wherein the shared model parameters are model parameters shared by the requesting parties in the pre-trained processing model, and the shared model parameters of the pre-trained processing model remain unchanged during the training process;
[0194] The first input module 908 is configured to input the data to be processed into the task processing model to obtain the task processing result.
[0195] Optionally, the device also includes: a first training module, configured to obtain sample sets respectively specified by multiple requesters; for the first requester, training a pre-trained processing model according to the sample set specified by the first requester to obtain pre-trained model parameters corresponding to the first requester, wherein the first requester is any one of the multiple requesters; and screening out candidate model parameters corresponding to each requester from the pre-trained model parameters corresponding to each requester.
[0196] Optionally, the first training module is further configured to extract first sample data from a sample set specified by the first requester, wherein the first sample data is any sample data in the sample set and the first sample data carries a first sample label; input the first sample data into a pre-training processing model to obtain a first sample prediction result; adjust model parameters other than shared model parameters in the pre-training processing model according to the first sample prediction result and the first sample label, and return to execute the step of extracting the first sample data from the sample set specified by the first requester until a first preset stop condition is reached to obtain the pre-training model parameters corresponding to the first requester.
[0197] Optionally, the first training module is further configured to send the pre-trained model parameters to the first requesting party; receive sample adjustment data sent by the first requesting party based on the pre-trained model parameters, and adjust the parameters of the pre-trained processing model according to the sample adjustment data.
[0198] Optionally, the pre-trained model parameters include shared model parameters; the first training module is further configured to store the candidate model parameters corresponding to each requesting party in a candidate parameter storage unit respectively; and store the shared model parameters in the shared parameter storage unit.
[0199] Optionally, the first training module is further configured to determine whether the shared parameter storage unit includes shared model parameters; if the shared parameter storage unit does not include the shared model parameters, store the shared model parameters in the shared parameter storage unit.
[0200] Optionally, the first screening module 904 is further configured to obtain requester information of the target requester; construct a parameter screening matrix according to the requester information; and screen the target model parameters from multiple candidate model parameters according to the parameter screening matrix.
[0201] Optionally, the device also includes: a second training module, configured to obtain a training set, wherein the training set includes multiple training data, and the training data carries a training label; extract first training data from the training set, wherein the first training data is any one in the training set; input the first training data into the original processing model to obtain a first training prediction result; train the original processing model according to the first training prediction result and the first training label carried by the first training data to obtain a pre-trained processing model that has been trained.
[0202] Optionally, the device also includes: a sending module, configured to send the task processing results to the client, so that the client displays the task processing results to the target requester; receive adjustment information sent by the target requester through the client, and adjust the target model parameters according to the adjustment information, wherein the adjustment information is obtained based on the task processing results.
[0203] By applying the solution of the embodiments of the present specification, in the process of training the pre-trained processing model using sample sets specified by different requesters, the shared model parameters in the fixed pre-trained processing model remain unchanged, so that the candidate model parameters corresponding to each requester can be efficiently obtained, and only one shared model parameter is used with different candidate model parameters to serve different requesters. There is no need to provide a separate task processing model for each requester, thereby reducing the model deployment cost and task processing resource consumption.
[0204] The above is a schematic scheme of a task processing device of this embodiment. It should be noted that the technical scheme of the task processing device and the technical scheme of the above task processing method belong to the same concept, and the details of the technical scheme of the task processing device that are not described in detail can all be referred to the description of the technical scheme of the above task processing method.
[0205] Corresponding to the above-mentioned automatic question-answering method embodiment, this specification also provides an automatic question-answering device embodiment, Fig.10 FIG. 1 shows a schematic diagram of the structure of an automatic question-answering device provided by an embodiment of this specification. Fig.10 As shown, the device comprises:
[0206] The second receiving module 1002 is configured to receive a question processing request, wherein the question processing request carries data to be answered;
[0207] The second screening module 1004 is configured to screen out target model parameters corresponding to the target requester from a plurality of candidate model parameters, wherein the candidate model parameters are obtained by training a pre-trained processing model based on a sample set specified by the requester, and each candidate model parameter corresponds to a different requester;
[0208] The second construction module 1006 is configured to construct a task processing model according to the target model parameters and the shared model parameters, wherein the shared model parameters are model parameters shared by the requesting parties in the pre-trained processing model, and the shared model parameters of the pre-trained processing model remain unchanged during the training process;
[0209] The second input module 1008 is configured to input the data to be answered into the task processing model to obtain the question answering result.
[0210] By applying the solution of the embodiments of the present specification, in the process of training the pre-trained processing model using sample sets specified by different requesters, the shared model parameters in the fixed pre-trained processing model remain unchanged, so that the candidate model parameters corresponding to each requester can be efficiently obtained, and only one shared model parameter is used with different candidate model parameters to serve different requesters. There is no need to provide a separate task processing model for each requester, thereby reducing the model deployment cost and automatic question and answer resource consumption.
[0211] The above is a schematic scheme of an automatic question-answering device of this embodiment. It should be noted that the technical scheme of the automatic question-answering device and the technical scheme of the automatic question-answering method described above are of the same concept, and the details not described in detail in the technical scheme of the automatic question-answering device can be found in the description of the technical scheme of the automatic question-answering method described above.
[0212] Fig.11 The block diagram of a computing device provided by one embodiment of the present specification is shown. The components of the computing device 1100 include but are not limited to a memory 1110 and a processor 1120. The processor 1120 is connected to the memory 1110 via a bus 1130, and the database 1150 is used to store data.
[0213] The computing device 1100 also includes an access device 1140 that enables the computing device 1100 to communicate via one or more networks 1160. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 1140 may include one or more of any type of network interface (e.g., a network interface card (NIC)) of wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0214] In one embodiment of the present specification, the above components of the computing device 1100 and Fig.11 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Fig.11 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0215] The computing device 1100 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 1100 may also be a mobile or stationary server.
[0216] Among them, the processor 1120 is used to execute the following computer-executable instructions, which, when executed by the processor, implement the steps of the above-mentioned task processing method or automatic question-and-answer method.
[0217] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned task processing method and automatic question-answering method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above-mentioned task processing method or automatic question-answering method.
[0218] An embodiment of the present specification also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the above-mentioned task processing method or automatic question-answering method.
[0219] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium is the same as the technical scheme of the above-mentioned task processing method and automatic question-answering method. For details not described in detail in the technical scheme of the storage medium, please refer to the description of the technical scheme of the above-mentioned task processing method or automatic question-answering method.
[0220] An embodiment of the present specification also provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned task processing method or automatic question-answering method.
[0221] The above is a schematic scheme of a computer program of this embodiment. It should be noted that the technical scheme of the computer program and the technical scheme of the above-mentioned task processing method and automatic question answering method belong to the same concept, and the details not described in detail in the technical scheme of the computer program can be referred to the description of the technical scheme of the above-mentioned task processing method or automatic question answering method.
[0222] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0223] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0224] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.
[0225] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0226] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can understand and use this specification well. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. A task processing method, comprising: receiving a task processing request, wherein the task processing request carries data to be processed; Filtering out target model parameters corresponding to the target requester from a plurality of candidate model parameters, wherein the candidate model parameters are obtained by training a pre-trained processing model based on a sample set specified by the requester, and each candidate model parameter corresponds to a different requester; Constructing a task processing model according to the target model parameters and the shared model parameters, wherein the shared model parameters are model parameters shared by each requesting party in the pre-trained processing model, and the shared model parameters of the pre-trained processing model remain unchanged during the training process; The data to be processed is input into the task processing model to obtain a task processing result.
2. The method according to claim 1, before selecting the target model parameter corresponding to the target requester from the plurality of candidate model parameters, further comprising: Obtain sample sets respectively specified by multiple requesting parties; For a first requester, training a pre-training processing model according to a sample set specified by the first requester to obtain a pre-training model parameter corresponding to the first requester, wherein the first requester is any one of the multiple requesters; The candidate model parameters corresponding to each requesting party are screened out from the pre-trained model parameters corresponding to each requesting party.
3. The method according to claim 2, wherein the step of training a pre-trained processing model according to the sample set specified by the first requester to obtain the pre-trained model parameters corresponding to the first requester comprises: Extracting first sample data from a sample set specified by the first requester, wherein the first sample data is any sample data in the sample set, and the first sample data carries a first sample label; Inputting the first sample data into the pre-training processing model to obtain a first sample prediction result; According to the first sample prediction result and the first sample label, the model parameters other than the shared model parameters in the pre-trained processing model are adjusted, and the step of extracting the first sample data from the sample set specified by the first requester is returned to execute until the first preset stop condition is reached to obtain the pre-trained model parameters corresponding to the first requester.
4. The method according to claim 2, wherein after training the pre-training processing model according to the sample set specified by the first requester and obtaining the pre-training model parameters corresponding to the first requester, further comprises: Sending the pre-trained model parameters to the first requester; Receive sample adjustment data sent by the first requester based on the pre-trained model parameters, and adjust the parameters of the pre-trained processing model according to the sample adjustment data.
5. The method according to claim 2, wherein the pre-trained model parameters include shared model parameters; After the candidate model parameters corresponding to each requesting party are screened out from the pre-trained model parameters corresponding to each requesting party, the method further includes: storing the candidate model parameters corresponding to each requesting party in a candidate parameter storage unit respectively; The shared model parameters are stored in a shared parameter storage unit.
6. The method according to claim 5, before storing the shared model parameters in the shared parameter storage unit, further comprising: Determining whether the shared parameter storage unit includes the shared model parameter; The step of storing the shared model parameters in a shared parameter storage unit comprises: In a case where the shared model parameters are not included in the shared parameter storage unit, the shared model parameters are stored in the shared parameter storage unit.
7. The method according to claim 1, wherein the step of selecting a target model parameter corresponding to the target requester from a plurality of candidate model parameters comprises: Obtaining requester information of a target requester; Constructing a parameter screening matrix according to the requester information; The target model parameters are screened out from a plurality of candidate model parameters according to the parameter screening matrix.
8. The method according to claim 1, before selecting the target model parameter corresponding to the target requester from the plurality of candidate model parameters, further comprising: Acquire a training set, wherein the training set includes a plurality of training data, and the training data carries a training label; Extracting first training data from the training set, wherein the first training data is any one in the training set; Inputting the first training data into the original processing model to obtain a first training prediction result; The original processing model is trained according to the first training prediction result and the first training label carried by the first training data to obtain a trained pre-trained processing model.
9. The method according to claim 1, after inputting the data to be processed into the task processing model and obtaining the task processing result, further comprises: Sending the task processing result to the client, so that the client displays the task processing result to the target requester; Receive adjustment information sent by the target requester through the client, and adjust the target model parameters according to the adjustment information, wherein the adjustment information is obtained based on the task processing result.
10. An automatic question-answering method, comprising: receiving a question handling request, wherein the question handling request carries data to be answered; Filtering out target model parameters corresponding to the target requester from a plurality of candidate model parameters, wherein the candidate model parameters are obtained by training a pre-trained processing model based on a sample set specified by the requester, and each candidate model parameter corresponds to a different requester; Constructing a task processing model according to the target model parameters and the shared model parameters, wherein the shared model parameters are model parameters shared by each requesting party in the pre-trained processing model, and the shared model parameters of the pre-trained processing model remain unchanged during the training process; The data to be answered is input into the task processing model to obtain the question answering result.
11. A task processing system comprising a service unit and a candidate parameter storage unit; The candidate parameter storage unit is used to store multiple candidate model parameters; The service unit is used to receive a task processing request, wherein: The task processing request carries data to be processed; Filtering out target model parameters corresponding to the target requester from the multiple candidate model parameters, wherein the candidate model parameters are obtained by training a pre-training processing model based on a sample set specified by the requester, and each candidate model parameter corresponds to a different requester; constructing a task processing model according to the target model parameters and the shared model parameters, wherein the shared model parameters are model parameters shared by each requester in the pre-training processing model, and the shared model parameters of the pre-training processing model remain unchanged during the training process; The data to be processed is input into the task processing model to obtain a task processing result.
12. The system according to claim 11, further comprising a shared parameter storage unit; The shared parameter storage unit is used to store shared model parameters; The service unit is further used to obtain the shared model parameters from the shared parameter storage unit.
13. A computing device comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the method described in any one of claims 1 to 9 or claim 10 are implemented.
14. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the steps of any one of claims 1 to 9 or the method of claim 10.
Citation Information
Patent Citations
Model training method and device, storage medium and electronic equipment
CN113516239A
Training method and device of multi-task pre-training model, electronic equipment and medium
CN113704388A
Task processing method, system and platform and automatic question answering method
CN116431316A
System and Method For Implementing Modular Universal Reparameterization For Deep Multi-Task Learning Across Diverse Domains
US20200293888A1
Training neural networks using transfer learning
US20220108171A1