Information processing method and device, electronic equipment and storage medium
By obtaining user query statements and generating prompt words based on model identification, inputting pre-trained large models to filter parameters, and selecting target service models, the problem of low model selection efficiency in MoE models is solved, and faster, accurate and flexible model selection is achieved. , improves the efficiency of reasoning.
Patent Information
- Application Number
- CN202411365378.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-01-07
AI Technical Summary
The existing architecture based on the Hybrid Expert Model (MoE) cannot accurately and efficiently select the most suitable expert model for the input data, resulting in a low model inference speed.
By obtaining the user's query statement, determining the model identity of the candidate service model, generating a prompt word and inputting a pre-trained target big model to output filter parameters, thereby selecting the target service model and querying.
It improves the selection efficiency, accuracy and flexibility of the target service model, shortens response delay, improves inference efficiency, and maximizes the use of computing power.
Smart Images

Figure CN119271781A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, specifically to technical fields such as large models and deep learning, and in particular to an information processing method, device, electronic device and storage medium. Background Art
[0002] In the related art, the architecture based on the Mixture of Experts (MoE) model relies on a dynamic selection mechanism to select the most suitable expert model for the input data, for example: selecting the most suitable expert model for the input data through a gating network, and for example: selecting the most suitable expert model for the input data through a weight distribution strategy. However, the above method cannot accurately and efficiently select the most suitable expert model for the input data. Therefore, how to accurately and efficiently select the most suitable expert model for the input data to improve the reasoning speed of the model has become a problem that needs to be solved urgently. Summary of the invention
[0003] The present disclosure proposes an information processing method, an apparatus, an electronic device, a storage medium and a computer program product.
[0004] According to the first aspect of the present disclosure, an information processing method is proposed, including: obtaining a user's query statement, and determining a model identifier of at least one candidate service model based on the query statement; generating a first prompt word based on the query statement and the model identifier, and inputting the first prompt word into a pre-trained target large model, and the target large model outputting screening parameters of the candidate service model according to the first prompt word; determining a target service model from the candidate service models according to the screening parameters; inputting the query statement into the target service model to obtain feedback information corresponding to the query statement.
[0005] According to a second aspect of the present disclosure, an information processing device is proposed, comprising: a first acquisition module, used to acquire a user's query statement, and determine a model identifier of at least one candidate service model based on the query statement; a processing module, used to generate a first prompt word based on the query statement and the model identifier, and input the first prompt word into a pre-trained target large model, and the target large model outputs a screening parameter of the candidate service model according to the first prompt word; a determination module, used to determine a target service model from the candidate service models according to the screening parameters; a second acquisition module, used to input the query statement into the target service model to obtain feedback information corresponding to the query statement.
[0006] According to the third aspect of the present disclosure, an electronic device is proposed, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the information processing method proposed in the first aspect above.
[0007] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is proposed, wherein the computer instructions are used to enable the computer to execute the information processing method proposed in the first aspect above.
[0008] According to a fifth aspect of the present disclosure, a computer program product is proposed, including a computer program, wherein when the computer program is executed by a processor, the information processing method proposed in the first aspect is implemented.
[0009] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0011] Figure 1 A flowchart of an information processing method according to an embodiment of the present disclosure;
[0012] Figure 2 A flowchart of an information processing method according to an embodiment of the present disclosure;
[0013] Figure 3 A flowchart of a target large language model training method according to an embodiment of the present disclosure;
[0014] Figure 4 A schematic diagram of a process for training a target large language model according to an embodiment of the present disclosure;
[0015] Figure 5 A flowchart of an information processing method according to an embodiment of the present disclosure;
[0016] Figure 6 is a schematic diagram of the structure of an information processing device according to an embodiment of the present disclosure;
[0017] Figure 7 A schematic block diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0018] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0019] Artificial Intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence.
[0020] A large model refers to a machine learning model with a large parameter scale and complexity. It requires a large amount of computing resources and storage space to train and store, and often requires distributed computing and special hardware acceleration technology. Large models have stronger generalization and expression capabilities.
[0021] Deep learning (DL) is a new research direction in the field of machine learning (ML). It is introduced into machine learning to make it closer to the original goal - artificial intelligence. Deep learning is to learn the inherent laws and representation levels of sample data. The information obtained in the learning process is very helpful for the interpretation of data such as text, images and sounds. Its ultimate goal is to enable machines to have analytical learning capabilities like humans and to recognize data such as text, images and sounds.
[0022] Figure 1 FIG. 1 is a flow chart of an information processing method according to an embodiment of the present disclosure. Figure 1 As shown, the method includes:
[0023] S101, obtaining a query statement of a user, and determining a model identifier of at least one candidate service model based on the query statement.
[0024] It should be noted that the execution subject of the information processing method of the embodiment of the present disclosure may be a hardware device with data information processing capabilities and / or the necessary software required to drive the hardware device to work. Optionally, the execution subject may include a workstation, a server, a computer, a user terminal and other intelligent devices. Among them, the user terminal includes but is not limited to a mobile phone, a computer, an intelligent voice interaction device, an intelligent home appliance, a vehicle-mounted terminal, etc.
[0025] In the embodiment of the present disclosure, a software development kit (SDK) component may be used to receive a user's query statement sent by a client to obtain the user's query statement.
[0026] It should be noted that, in order to ensure that the user can seamlessly integrate the services of the system (information processing system), after obtaining the user's query statement, the user's query statement can be standardized to obtain a standard query statement.
[0027] Optionally, the query statement may be parsed by an SDK component to obtain key information in the query statement, and a standard query statement may be generated based on the key information, wherein the key information includes at least a model identifier and context information of the candidate service model.
[0028] The identification of the candidate service model includes but is not limited to the name of the candidate service model and the code of the candidate service model (Identity Document, referred to as ID).
[0029] Optionally, when the user selects a service model from the service model list of the client, the selected service model is used as a candidate service model; when the user does not select a service model from the service model list of the client, the default service model is used as a candidate service model.
[0030] For example, for a service model list of {Model A, Model B, Model C, Model D, Model E}, if the service model selected by the user is {Model A, Model C, Model D}, then {Model A, Model C, Model D} will be used as candidate service models; if the user does not select a service model, then the default {Model A, Model B, Model C, Model D} will be used as the candidate service model.
[0031] Among them, the context information can be single-round dialogue information or multi-round dialogue information. When it is multi-round dialogue information, the dialogue information of the last round is the context information of the query statement, and the dialogue information of other rounds is historical dialogue information. The length threshold of the context information can be set according to actual conditions.
[0032] In the disclosed embodiment, after the standard query statement is obtained, the communication protocol of the standard query statement may be converted, and the user identity information corresponding to the standard query statement may be authenticated and verified.
[0033] Optionally, the standard query statement can be forwarded to the service inside the system through an open application programming interface (Open API) component, the communication protocol of the standard query statement can be converted, and the user identity information corresponding to the standard query statement can be authenticated and verified.
[0034] Optionally, in response to the user identity information corresponding to the standard query statement being authenticated and verified, the query statement is parsed to determine the model identifier of the candidate service model from the parsed information.
[0035] Optionally, the training samples can be input into KANs, and KANs perform task training on the text data to obtain the output results of KANs, determine the loss value of KANs based on the output results of KANs, adjust the model parameters of KANs based on the loss value, and return to use the next training sample, and continue to train the KANs with adjusted model parameters until the model training end conditions are met to obtain the pre-trained first largest language model.
[0036] S102, generating a first prompt word based on the query sentence and the model identifier, and inputting the first prompt word into a pre-trained target large model, and the target large model outputs screening parameters of the candidate service model according to the first prompt word.
[0037] In the embodiment of the present disclosure, after the query statement and the model identifier are acquired, the query statement and each model identifier may be combined to generate a first prompt word.
[0038] For example, if the query statement query is "Please imitate Lu Xun's style to generate a comment" and the model identifier is {model A, model C, model D}, then the first prompt word prompt1 is "Please imitate Lu Xun's style to generate a comment + model A", the first prompt word prompt2 is "Please imitate Lu Xun's style to generate a comment + model C", and the first prompt word prompt1 is "Please imitate Lu Xun's style to generate a comment + model D".
[0039] In the disclosed embodiment, after the first prompt word is acquired, the first prompt word may be input into a pre-trained target large model, and the target large model outputs screening parameters of the candidate service model according to the first prompt word.
[0040] Optionally, the model usage history data of the user associated with the query statement can be obtained, and the training sample set and sample service model of the big model can be determined based on the model usage history data, wherein the training sample set includes sample query statements of the big model, and the reference label of the sample query statement is determined based on the sample service model. The big model is trained according to the sample query statement, the model identifier of the sample service model, and the reference label of the sample label statement to obtain the target big model.
[0041] The screening parameter of the candidate service model may be the score of the candidate service model.
[0042] For example, the first prompt word prompt1 "Please imitate Lu Xun's style to generate a comment + model A" is input into the target large model, and the target large model outputs the score of model A. A , input the first prompt word prompt2 "Please imitate Lu Xun's style to generate a comment + model C" into the target large model, and the target large model outputs the score of model C Score C , input the first prompt word prompt3 "Please imitate Lu Xun's style to generate a comment + model D" into the target large model, and the target large model outputs the score of model D Score D .
[0043] S103: Determine a target service model from candidate service models according to the screening parameters.
[0044] In the disclosed embodiment, after the screening parameters are acquired, the target service model may be determined from the candidate service models according to the screening parameters.
[0045] It should be noted that the present disclosure does not limit the specific method of determining the target service model from the candidate service models according to the screening parameters, and the method can be selected according to the actual situation.
[0046] Optionally, the candidate service models may be sorted in descending order according to the screening parameters, and the first candidate service model ranked first is selected and used as the target service model.
[0047] For example, the score of model A is A , Score of Model C C and the score of model D D , sorted in descending order, the sorting result is Score A >Score D >Score C , then model A is used as the target service model.
[0048] S104: Input a query statement to the target service model to obtain feedback information corresponding to the query statement.
[0049] In the disclosed embodiment, after the target service model is acquired, a query statement may be input into the target service model to obtain feedback information corresponding to the query statement.
[0050] For example, if the target service model is model A, and the query statement is "Please imitate Lu Xun's style to generate a comment", input "Please imitate Lu Xun's style to generate a comment" into model A to obtain the feedback information corresponding to the query statement.
[0051] The information processing method proposed in the present invention obtains a user's query statement, determines a model identifier of at least one candidate service model based on the query statement, generates a first prompt word based on the query statement and the model identifier, and inputs the first prompt word into a pre-trained target large model, and the target large model outputs screening parameters of the candidate service model according to the first prompt word, determines the target service model from the candidate service models according to the screening parameters, inputs the query statement into the target service model, and obtains feedback information corresponding to the query statement. Thus, the present invention determines the target service model according to the screening parameters of the candidate service model output by the target large model, thereby improving the efficiency, accuracy and flexibility of determining the target service model, and inputs the query statement into the target service model to obtain feedback information corresponding to the query statement, which can maximize the use of the computing power of the target service model and ensure the efficiency and accuracy of the feedback information output by the target service model.
[0052] Figure 2 It is a flowchart of an information processing method according to the second embodiment of the present disclosure.
[0053] like Figure 2 As shown, in Figure 2 Based on the illustrated embodiment, the information processing method of the embodiment of the present disclosure may specifically include the following steps:
[0054] S201, obtaining a query statement of a user, and determining a model identifier of at least one candidate service model based on the query statement.
[0055] S202, generating a first prompt word based on the query sentence and the model identifier, and inputting the first prompt word into a pre-trained target large model, and the target large model outputs screening parameters of the candidate service model according to the first prompt word.
[0056] For the relevant contents of steps S201 and S202, please refer to the above embodiments, which will not be described again here.
[0057] Optionally, step S103 of “determining a target service model from candidate service models according to screening parameters” in the above embodiment may specifically include the following step S203.
[0058] S203, sorting the candidate service models in descending order according to the screening parameters, and selecting the first candidate service model ranked first as the target service model.
[0059] For example, for candidate service model A, candidate service model C, and candidate service model D, the score of candidate service model A is Score A , the score of candidate service model C is Score C And the score of candidate service model D is Score D , for ScoreA 、Score C and Score D Sort in descending order, the sorting result is Score A >Score D >Score C , then the candidate service model A is taken as the target service model.
[0060] Optionally, step S103 of “determining a target service model from candidate service models according to screening parameters” in the above embodiment may specifically include the following step S204.
[0061] S204, obtaining the current task volume of the candidate service models, and determining the target service model from the candidate service models according to the task volume and the screening parameters.
[0062] It should be noted that in order to ensure reasonable allocation of resources, achieve resource balance, and ensure the stability of the system, the current task volume of the candidate service model can be obtained, and the target service model can be determined from the candidate service models based on the task volume and screening parameters.
[0063] It should be noted that the present disclosure does not limit the specific method of determining the target service model from the candidate service models based on the task volume and screening parameters, and the method can be selected according to actual conditions.
[0064] Optionally, the candidate service models are sorted in descending order according to the screening parameters, and a first candidate service model ranked first is determined. In response to the task volume of the first candidate service model being greater than a set threshold, a second candidate service model ranked second is determined as the target service model.
[0065] For example, for candidate service model A, candidate service model C, and candidate service model D, the score of candidate service model A is Score A , the score of candidate service model C is Score C And the score of candidate service model D is Score D , for Score A 、Score C and Score D Sort in descending order, the sorting result is Score A >Score D >Score C , then the candidate service model A is used as the first service model. If the task volume of candidate service model A is M A Greater than the set threshold M S , then the candidate service model ranked second will be Score DAs a target service model.
[0066] Optionally, the candidate service models are sorted in descending order according to the screening parameters to obtain a first sorting result; the current task volume of the candidate service model is obtained, and the first sorting result is corrected according to the task volume to obtain a second sorting result, and the third candidate service model ranked first in the second sorting result is selected as the target service model.
[0067] For example, for candidate service model A, candidate service model C, and candidate service model D, the score of candidate service model A is Score A , the score of candidate service model C is Score C And the score of candidate service model D is Score D , for Score A 、Score C and Score D Sort in descending order, the first sort result is Score A >Score D >Score C , the current task volume of candidate service model A is M A , the current task volume of candidate service model C is M C And the current task volume of candidate service model D is M D , if the candidate service model A has a task volume M A Greater than the set threshold M S If the candidate service model D has a task volume M D Less than the set threshold M S , if the candidate service model C has a task volume M C Greater than the set threshold M S , then the second sorting result is Score D >Score A >Score C , then the third candidate service model ranked first will be Score D As a target service model.
[0068] S205: Input a query statement to the target service model to obtain feedback information corresponding to the query statement.
[0069] In the disclosed embodiment, after obtaining feedback information corresponding to the query statement, the amount of resources used by the target service model during the processing of the query statement can be monitored, and billing information corresponding to the query statement can be generated based on the amount of resources used by the target service model.
[0070] The information processing method proposed in the present disclosure obtains the user's query statement, determines the model identification of at least one candidate service model based on the query statement, generates a first prompt word based on the query statement and the model identification, and inputs the first prompt word into a pre-trained target large model, and the target large model outputs the screening parameters of the candidate service model according to the first prompt word. The candidate service models can be sorted in descending order according to the screening parameters, and the first candidate service model ranked first is selected as the target service model. The current task volume of the candidate service model can also be obtained, and the target service model can be determined from the candidate service models according to the task volume and the screening parameters, and the query statement is input into the target service model to obtain the response corresponding to the query statement. Feedback information is obtained, the amount of resources used by the target service model during the processing of the query statement is monitored, and the billing information corresponding to the query statement is generated according to the amount of resources used by the target service model. Therefore, the present invention determines the target service model according to the screening parameters of the candidate service model output by the target big model, which solves the model selection problem currently existing in the MoE model system, and can select the target service model more quickly, accurately and flexibly, shorten the response delay of the target service model, input the query statement to the target service model, and obtain the feedback information corresponding to the query statement, which greatly improves the reasoning efficiency of the target service model, and can maximize the computing power of each service model and improve the resource utilization of each service model.
[0071] The target large model training process proposed in this disclosure is explained below.
[0072] Figure 3 It is a flowchart of the target large model training method according to the third embodiment of the present disclosure.
[0073] like Figure 3 As shown, in Figure 3 Based on the illustrated embodiment, the training process of the target large model of the embodiment of the present disclosure may specifically include the following steps:
[0074] S301, obtaining model usage history data of the user associated with the query statement.
[0075] S302, determining a training sample set and a sample service model of the large model according to the historical data of model usage, wherein the training sample set includes sample query statements of the large model.
[0076] In the embodiments of the present disclosure, candidate query statements can be obtained based on historical data used by the model, and target categories of the candidate query statements can be obtained. The candidate query statements can be grouped according to the target categories to obtain a query statement set for each category, and some candidate query statements can be selected from the query statement set for each category as sample query statements. A training sample set can be obtained based on the sample query statements selected from each category.
[0077] It should be noted that in order to improve the balance of sample query statements, the present disclosure may select some candidate query statements from the query statement set of each category, for example: select 10,000 candidate query statements from the query statement set of each category, and use the selected 10,000 candidate query statements as sample query statements.
[0078] Optionally, the candidate query statement can be matched with the category description information of the subcategory of the preset second prompt word to obtain the target subcategory matching the candidate query statement, the target subcategory can be mapped to multiple preset candidate categories, and the candidate category to which the target subcategory is mapped can be used as the target category of the candidate query statement.
[0079] Optionally, the candidate query statement may be input into a pre-trained classification model to match the candidate query statement with the category description information of the subcategory of the preset second prompt word to obtain a target subcategory matching the candidate query statement.
[0080] For example, the category description information of the subcategory of the second prompt word can be "controversial moral issues involving dangers such as pornography, online fraud, phishing emails, legal security, etc.", "need to write code, or interpret and modify the code", "answer questions based on tables, etc.", "daily greetings or use the knowledge acquired during training to answer users' questions (games, encyclopedias, product maintenance), meaningless content, opinions and suggestions on issues", "subject multiple-choice questions with clear options", "text translation", "math problems or logical reasoning problems", "classification tasks, novel classification, field classification, label selection, text classification, document classification, sentiment classification, selection of appropriate action labels", "test paper making, outline writing, advertising copywriting, composition writing, article writing, idioms and ancient poems, resume writing, press release writing, legal document writing, email, brainstorming", "based on Historical conversations, user questions to determine intent, intent classification tasks, state converters, select intent from the candidate set, think about executing tasks, select the function to call or choose the next action", "provide relevant documents, user manuals, search results and extract text information through summarization and induction to answer user questions", "provide relevant documents and extract entities, addresses, names and other information from documents to extract specific content", "create titles, summarize text, pictures, and video content, and summarize given conversations", "rewrite historical conversations to generate new questions, generate new questions based on search records to provide search suggestions, question refinement, and construct query queries", "rewrite questions or queries", "rewrite text or sentences and correct errors", "ask new questions based on content, generate questions, and generate questions answer sample pairs", "Chatting under specific roles", "Need to generate simulated dialogue data as required (roles, tasks)", "Continue writing, continue writing, continue to supplement", "Summarize, abbreviate, abstract, title", "Optimize content, modify manuscripts as required, modify titles, nicknames, regenerate different content, etc.", "Health Q&A, psychological counseling, life advice, medical consultation, legal consultation", "Keyword extraction, generate keywords for given documents", "Product value issues, compare competitors, evaluate other competitors", "Copywriting includes (Internet celebrities, e-commerce, live streaming, WeChat applets", "Questions that should be refused to be answered may not meet the role requirements or may violate laws and regulations", "Generate pictures and video data as required or based on given scenarios", "Introduce attractions, attraction copywriting, strategy itinerary", "Quality rating, output scoring", "Provide search results, tables, text and other data", "Decompose questions or queries", "Play the role of intelligent customer service to answer user questions", "Write answers or articles based on specified topics, reference information, etc."
[0081] Optionally, the present disclosure may pre-set a plurality of candidate categories according to business attributes, for example, pre-set 15 candidate categories.
[0082] For example, multiple candidate categories can be "code interpreter", "close-book answer", "information extraction", "creation and continuation", "intention recognition", "summary", "rewriting and error correction", "labeling and classification", "legal ethics security and product values", "structured data question and answer", "translation", "role dialogue", "question rewriting and sample generation", "reading comprehension", and "mathematics and logic".
[0083] In the disclosed embodiment, candidate sample service models may be obtained based on model usage history data, usage frequencies of the candidate sample service models may be determined, and candidate sample service models with usage frequencies greater than a set value may be selected as sample service models.
[0084] S303: Determine a reference tag of the sample query statement based on the sample service model.
[0085] In the disclosed embodiment, answer information of a sample query statement can be obtained based on a sample service model, standard answer information of the sample query statement can be obtained, and a reference tag of the sample query statement can be determined based on the answer information and the standard answer information.
[0086] Optionally, a sample query statement may be input into the sample service model to obtain answer information corresponding to the sample query statement.
[0087] Optionally, a sample query statement may be input into a pre-trained high-order service model to obtain standard answer information corresponding to the sample query statement.
[0088] It should be noted that the present disclosure does not limit the specific method of determining the reference label of the sample query statement based on the answer information and the standard answer information, and it can be selected according to the actual situation.
[0089] Optionally, it can be determined whether the answer information is consistent with the standard answer information. If the answer information is consistent with the standard answer information, the reference label of the sample query statement is 1; if the answer information is inconsistent with the standard answer information, the reference label of the sample query statement is 0.
[0090] Optionally, a Rouge score between the answer information and the standard answer information may be obtained. In response to the Rouge score being greater than or equal to a set score threshold, the reference label of the sample query statement is 1; in response to the Rouge score being less than the set score threshold, the reference label of the sample query statement is 0.
[0091] It should be noted that the answer information can be scored by a pre-trained high-order large model, and the score of the answer information can be normalized to the range of [0, 1] according to a preset normalization rule.
[0092] S304, training the big model according to the sample query statement, the model identifier of the sample service model, and the reference label of the sample label statement to obtain the target big model.
[0093] Optionally, the large model can be a BERT model (Bidirectional Encoder Representations from Transformers)
[0094] In the disclosed embodiment, a third prompt word can be generated based on the model identifier of the sample query statement and the sample service model, and the third prompt word can be input into the big model. The big model obtains the predicted label of the sample query statement according to the third prompt word, and the loss function of the big model is determined based on the predicted label and the reference label. The model parameters of the big model are adjusted based on the loss function until the training is completed and the target big model is obtained.
[0095] Optionally, the third prompt word can be input into the large model, and the large model performs task training on the third prompt word to obtain the output result of the large model, determine the loss value of the large model based on the output result of the large model, adjust the model parameters of the large model based on the loss value, and return to use the next third prompt word to continue training the large model after adjusting the model parameters until the model training end conditions are met to obtain the trained target large model.
[0096] It should be noted that the present disclosure does not limit the setting of the model training end condition, and the model training end condition can be set according to actual conditions.
[0097] Optionally, the model training termination condition may be set as a target loss value being less than a preset loss threshold; optionally, the model training termination condition may also be set as the number of adjustments to the model parameters of the second largest language model reaching a preset number threshold.
[0098] In the embodiment of the present disclosure, after obtaining the pre-trained target big model, prompt words can be generated based on the user's query statement and the model identifier of the candidate service model, and the prompt words can be input into the pre-trained target big model, and the target big model outputs the screening parameters of the candidate service model according to the prompt words.
[0099] The specific process of the target large model training method proposed in this disclosure is explained below.
[0100] For example, Figure 4As shown, for the offline training stage (trainoffline), (1) obtain the training sample set (TrainQuerys) of the large model: group the candidate query statements according to their target categories to obtain a query statement set for each category, select some candidate query statements (balanced sampling) from the query statement set for each category as sample query statements, and obtain the training sample set based on the sample query statements selected from each category; (2) obtain the sample service model: for example, the sample service model is Eb4, Eb3.5, and EbSpeed; (3) obtain the answer information of the sample query statement, that is, obtain the answer information Response1 of the sample query statement based on the sample service model Eb4, obtain the answer information Response2 of the sample query statement based on the sample service model Eb3.5, and obtain the sample query statement based on the sample service model EbSpeed. The answer information Response3 of the sentence; (4) the answer information Response1, the answer information Response2 and the answer information Response3 are scored respectively through the pre-trained high-order large model, and the score of the answer information Response1, the score of the answer information Response2 and the score of the answer information Response3 are determined to be 10, the score of the answer information Response2 is 7 and the score of the answer information Response3 is 1; (5) normalization, normalizing the scores to the interval [0,1]; (6) model training, based on the model identifier of the sample query sentence and the sample service model, generating prompt words, inputting the third prompt word into the large model BERT, and the large model obtains the predicted label of the sample query sentence according to the prompt word, and determines the loss function of the large model based on the predicted label and the reference label, and adjusts the model parameters of the large model based on the loss function until the training is completed to obtain the target large model; for the online test phase (Test online), generate prompt words based on the query statement and the model identifiers of the candidate service models (Eb4, Eb3.5 and EbSpeed), input the first prompt word into the pre-trained target large model, and the target large model outputs a score (screening parameter) of 0.9 for the candidate service model Eb4 according to the first prompt word, a score of 0.5 for the candidate service model Eb3.5 according to the first prompt word, and a score of 0.1 for the candidate service model EbSpeed according to the first prompt word. The candidate service model Eb4 can be used as the target service model, and a query statement is input into the target service model Eb4 to obtain feedback information corresponding to the query statement.
[0101] The information processing method proposed in the present invention obtains the model usage history data of the user associated with the query statement, and determines the training sample set and sample service model of the big model according to the model usage history data, wherein the training sample set includes the sample query statement of the big model, and the reference label of the sample query statement is determined based on the sample service model. The big model is trained according to the sample query statement, the model identifier of the sample service model, and the reference label of the sample label statement to obtain the target big model. Therefore, the present invention improves the accuracy and reliability of the big model training process, and lays a foundation for the subsequent faster, more accurate and flexible output of the screening parameters of the candidate service model according to the target big model to determine the target service model.
[0102] The specific process of the information processing method provided by the present disclosure is explained below.
[0103] For example, Figure 5 As shown, an information processing system can be constructed according to the information processing method provided by the present disclosure, and the information processing system includes an SDK module, an OpenAPI module, a MoE module and a management and control module.
[0104] Optionally, for the SDK module, the query statement sent by the client can be received through the SDK, and the query statement can be parsed to obtain key information in the query statement, and a standard query statement can be generated based on the key information, wherein the key information at least includes the model identifier and context information of the candidate service model; for the OpenAPI module, the communication protocol of the standard query statement can be converted, and the user identity information corresponding to the standard query statement can be authenticated and verified; for the MoE module, the prompt word generated based on the query statement and the model identifier can be input into the pre-trained target large model, and the target large model can output the candidate service model (model 1, model 2, model 3...) according to the prompt word Filter parameters, and determine the optimal service model from model 1, model 2, model 3, etc. based on the filter parameters, that is, the target service model. The target service model is used to process query statements. After the target service model is determined, it is returned to the OpenAPI module and then returned to the SDK module through the OpenAPI module. For the management and control module, the amount of resources used by the target service model during the processing of query statements can be monitored, and the billing information corresponding to the query statement can be generated based on the amount of resources used by the target service model. Backend management tasks such as ensuring the reasonable allocation of system resources, recording the usage of service models, performing user billing, and regulating traffic when necessary to ensure system stability.
[0105] Optionally, application scenarios of the information processing method proposed in the present disclosure include but are not limited to: scenarios of inference service optimization in large-scale machine learning platforms, scenarios of expert model selection in natural language processing tasks, and scenarios of complex systems for real-time decision-making and intelligent routing.
[0106] In summary, the information processing method proposed in the present invention bypasses the routing bottleneck in the traditional MoE model by introducing a routing strategy in the peripheral service call, routes the query statement to the most suitable expert model, and significantly improves the processing efficiency of the query statement. The present invention can select the most suitable expert model more flexibly, quickly and accurately according to different query statements, achieves higher resource utilization and lower response time, can make full use of the computing power of all expert models, reduce the use of computing resources, improve the overall performance of the system, and reduce the user's final cost of use. It can be applicable to any application scenario that requires efficient expert model selection and deployment.
[0107] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0108] According to an embodiment of the present disclosure, the present disclosure also provides an information processing device for implementing the above-mentioned information processing method.
[0109] Figure 6 is a block diagram of an information processing device according to an embodiment of the present disclosure.
[0110] like Figure 6 As shown, the information processing device 600 includes: a first acquisition module 601, a processing module 602, a determination module 603 and a second acquisition module 604.
[0111] A first acquisition module 601 is used to acquire a user's query statement and determine a model identifier of at least one candidate service model based on the query statement;
[0112] Processing module 602, for generating a first prompt word based on the query statement and the model identifier, and inputting the first prompt word into a pre-trained target large model, so that the target large model outputs a screening parameter of the candidate service model according to the first prompt word;
[0113] A determination module 603 is used to determine a target service model from the candidate service models according to the screening parameters;
[0114] The second acquisition module 604 is used to input the query statement into the target service model to obtain feedback information corresponding to the query statement.
[0115] In one embodiment of the present disclosure, the determination module 603 is further used to: sort the candidate service models in descending order according to the screening parameters, and select the first candidate service model ranked first as the target service model.
[0116] In one embodiment of the present disclosure, the determination module 603 is further used to: obtain the current task volume of the candidate service model, and determine the target service model from the candidate service models based on the task volume and the screening parameters.
[0117] In one embodiment of the present disclosure, the determination module 603 is further used to: sort the candidate service models in descending order according to the screening parameters, and determine a first candidate service model ranked first; in response to the task volume of the first candidate service model being greater than a set threshold, determine a second candidate service model ranked second as the target service model.
[0118] In one embodiment of the present disclosure, the determination module 603 is also used to: sort the candidate service models in descending order according to the screening parameters to obtain a first sorting result; obtain the current task volume of the candidate service model, and modify the first sorting result according to the task volume to obtain a second sorting result; select the third candidate service model ranked first from the second sorting result as the target service model.
[0119] In one embodiment of the present disclosure, after obtaining the feedback information corresponding to the query statement, the device 600 is further used to: monitor the amount of resources used by the target service model during the processing of the query statement.
[0120] In one embodiment of the present disclosure, the device 600 is further used to: generate billing information corresponding to the query statement according to the amount of resources used by the target service model.
[0121] In one embodiment of the present disclosure, the training process of the target big model includes: obtaining model usage history data of the user associated with the query statement; determining the training sample set and sample service model of the big model based on the model usage history data, wherein the training sample set includes the sample query statement of the big model; determining the reference label of the sample query statement based on the sample service model; training the big model according to the sample query statement, the model identifier of the sample service model, and the reference label of the sample label statement to obtain the target big model.
[0122] In one embodiment of the present disclosure, the process of determining the training sample set includes: obtaining candidate query statements based on the historical data of model usage, and obtaining the target category of the candidate query statements; grouping the candidate query statements according to the target category to obtain a query statement set for each category; selecting some candidate query statements from the query statement set for each category as sample query statements; and obtaining the training sample set based on the sample query statements selected from each category.
[0123] In one embodiment of the present disclosure, the process of determining the training sample set includes: matching the candidate query statement with the category description information of the subcategory of the preset second prompt word to obtain a target subcategory matching the candidate query statement; mapping the target subcategory to a plurality of preset candidate categories, and using the candidate category to which the target subcategory is mapped as the target category of the candidate query statement.
[0124] In one embodiment of the present disclosure, the process of determining the sample service model includes: obtaining a candidate sample service model based on the model usage history data; determining the usage frequency of the candidate sample service model, and selecting the candidate sample service model whose usage frequency is greater than a set value as the sample service model.
[0125] In one embodiment of the present disclosure, the training process of the target large model includes: obtaining answer information of the sample query statement based on the sample service model; obtaining standard answer information of the sample query statement; and determining a reference label of the sample query statement based on the answer information and the standard answer information.
[0126] In one embodiment of the present disclosure, the training process of the target big model includes: generating a third prompt word based on the sample query statement and the model identifier of the sample service model; inputting the third prompt word into the big model, and having the big model obtain a predicted label of the sample query statement according to the third prompt word; determining the loss function of the big model based on the predicted label and the reference label, and adjusting the model parameters of the big model based on the loss function, until the training is completed to obtain the target big model.
[0127] In one embodiment of the present disclosure, before determining the model identifier of the candidate service model based on the query statement, the device 600 is also used to: receive the query statement sent by the client through the SDK component; parse the query statement, obtain key information in the query statement, and generate a standard query statement based on the key information, wherein the key information includes at least the model identifier and context information of the candidate service model.
[0128] In one embodiment of the present disclosure, before determining the model identifier of the candidate service model based on the query statement, the device 600 is also used to: convert the communication protocol of the standard query statement, and authenticate and verify the user identity information corresponding to the standard query statement.
[0129] The information processing device proposed in the present invention obtains a user's query statement, determines a model identifier of at least one candidate service model based on the query statement, generates a first prompt word based on the query statement and the model identifier, and inputs the first prompt word into a pre-trained target large model, and the target large model outputs screening parameters of the candidate service model according to the first prompt word, determines the target service model from the candidate service models according to the screening parameters, inputs the query statement into the target service model, and obtains feedback information corresponding to the query statement. Therefore, the present invention determines the target service model according to the screening parameters of the candidate service model output by the target large model, thereby improving the efficiency, accuracy and flexibility of determining the target service model, and inputs the query statement into the target service model to obtain feedback information corresponding to the query statement, which can maximize the use of the computing power of the target service model and ensure the efficiency and accuracy of the feedback information output by the target service model.
[0130] According to an embodiment of the present disclosure, the present disclosure also proposes an electronic device, a readable storage medium, and a computer program product.
[0131] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0132] like Figure 7 As shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0133] A number of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0134] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above, such as information processing methods. For example, in some embodiments, the information processing method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the information processing method described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform the information processing method in any other appropriate manner (e.g., by means of firmware).
[0135] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0136] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be presented to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, implements the functions / operations specified in the flow chart and / or block diagram. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0137] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0138] To propose interactions with a user account, the systems and techniques described herein may be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user account; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user account can propose input to the computer. Other types of devices may also be used to propose interactions with the user account; for example, feedback proposed to the user account may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user account may be received in any form (including acoustic input, voice input, or tactile input).
[0139] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user account computer with a graphical user account interface or a web browser through which a user account can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0140] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0141] According to an embodiment of the present disclosure, the present disclosure further provides a computer program product, including a computer program, wherein when the computer program is executed by a processor, the steps of the information processing method described in the above embodiment of the present disclosure are implemented.
[0142] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0143] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. An information processing method, wherein: The method comprises: Acquire a query statement of a user, and determine a model identifier of at least one candidate service model based on the query statement; Generate a first prompt word based on the query sentence and the model identifier, and input the first prompt word into a pre-trained target large model, so that the target large model outputs a screening parameter of the candidate service model according to the first prompt word; Determining a target service model from the candidate service models according to the screening parameters; The query statement is input into the target service model to obtain feedback information corresponding to the query statement.
2. The method according to claim 1, wherein: The step of determining a target service model from the candidate service models according to the screening parameters includes: The candidate service models are sorted in descending order according to the screening parameters, and the first candidate service model ranked first is selected as the target service model.
3. The method according to claim 1, wherein: The step of determining a target service model from the candidate service models according to the screening parameters includes: The current task volume of the candidate service model is obtained, and the target service model is determined from the candidate service models according to the task volume and the screening parameter.
4. The method according to claim 3, wherein: The step of determining the target service model from the candidate service models according to the task amount and the screening parameter includes: Sorting the candidate service models in descending order according to the screening parameters, and determining a first candidate service model ranked first; In response to the task amount of the first candidate service model being greater than a set threshold, a second candidate service model ranked second is determined as the target service model.
5. The method according to claim 3, wherein: The step of determining the target service model from the candidate service models according to the task amount and the screening parameter includes: Sorting the candidate service models in descending order according to the screening parameters to obtain a first sorting result; Acquire the current task volume of the candidate service model, and modify the first ranking result according to the task volume to obtain a second ranking result; A third candidate service model ranked first is selected from the second ranking results as the target service model.
6. The method according to claim 1, wherein: After obtaining the feedback information corresponding to the query statement, the method further includes: The amount of resources used by the target service model during the processing of the query statement is monitored.
7. The method according to claim 6, wherein: The method further comprises: The billing information corresponding to the query statement is generated according to the amount of resources used by the target service model.
8. The method according to any one of claims 1 to 7, wherein: The training process of the target large model includes: Obtain model usage history data of the user associated with the query statement; Determine a training sample set and a sample service model of a large model according to the historical data of model usage, wherein the training sample set includes sample query statements of the large model; Determining a reference tag of the sample query statement based on the sample service model; The large model is trained according to the sample query statement, the model identifier of the sample service model, and the reference label of the sample label statement to obtain the target large model.
9. The method according to claim 8, wherein: The process of determining the training sample set includes: Obtain candidate query statements based on the model usage history data, and obtain target categories of the candidate query statements; Grouping the candidate query statements according to the target category to obtain a query statement set for each category; Selecting some candidate query statements from the query statement set of each category as sample query statements; The training sample set is obtained according to the sample query sentences selected from each category.
10. The method according to claim 9, wherein: The process of determining the training sample set includes: Matching the candidate query statement with the category description information of the subcategory of the preset second prompt word to obtain the target subcategory matching the candidate query statement; The target subcategory is mapped to a plurality of preset candidate categories, and the candidate category to which the target subcategory is mapped is used as the target category of the candidate query statement.
11. The method according to claim 8, wherein: The process of determining the sample service model includes: Obtaining a candidate sample service model based on the model usage history data; The usage frequency of the candidate sample service model is determined, and the candidate sample service model whose usage frequency is greater than a set value is selected as the sample service model.
12. The method according to claim 8, wherein: The determining the reference tag of the sample query statement based on the sample service model includes: Acquire answer information of the sample query statement based on the sample service model; Obtaining standard answer information for the sample query statement; A reference tag of the sample query statement is determined according to the answer information and the standard answer information.
13. The method according to claim 8, wherein: The step of training the large model according to the sample query statement, the model identifier of the sample service model, and the label of the sample label statement to obtain the target large model includes: generating a third prompt word based on the sample query statement and the model identifier of the sample service model; Inputting the third prompt word into the large model, and allowing the large model to obtain a predicted label of the sample query sentence according to the third prompt word; Based on the predicted label and the reference label, the loss function of the large model is determined, and the model parameters of the large model are adjusted based on the loss function until the training is completed to obtain the target large model.
14. The method according to any one of claims 1 to 7, wherein: Before determining the model identifier of the candidate service model based on the query statement, the method further includes: Receiving the query statement sent by the client through the SDK component; The query statement is parsed to obtain key information in the query statement, and a standard query statement is generated based on the key information, wherein the key information at least includes a model identifier and context information of the candidate service model.
15. The method according to claim 14, wherein: Before determining the model identifier of the candidate service model based on the query statement, the method further includes: The communication protocol of the standard query statement is converted, and the user identity information corresponding to the standard query statement is authenticated and verified.
16. An information processing device, wherein: The device comprises: A first acquisition module, configured to acquire a query statement of a user and determine a model identifier of at least one candidate service model based on the query statement; A processing module, configured to generate a first prompt word based on the query statement and the model identifier, and input the first prompt word into a pre-trained target large model, so that the target large model outputs a screening parameter of the candidate service model according to the first prompt word; A determination module, configured to determine a target service model from the candidate service models according to the screening parameters; The second acquisition module is used to input the query statement into the target service model to obtain feedback information corresponding to the query statement.
17. An electronic device, characterized in that: including a processor and a memory; The processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the method according to any one of claims 1 to 15.
18. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 15 is implemented.
19. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 15.
Citation Information
Cited By
Service question and answer response method, device and equipment based on multiple models and storage medium
CN119808965A
Multi-Model Based Service Q&A Response Method, Device, Equipment and Storage Medium
CN119808965B
Service request processing method and device, storage medium and electronic equipment
CN120455551A
Large model screening method, device, equipment, medium and product
CN121743048A