Question and answer processing method and device, large model training method and device, equipment and storage medium

Through multiple large models, the method of generating answer steps and codes in sequence, the existing question-and-answer system has been solved, and more efficient and reliable question-and-answer processing has been achieved.

CN119443277AActive Publication Date: 2025-02-14BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411545435.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-14
Estimated Expiration
2044-10-31

AI Technical Summary

Technical Problem

When existing question-and-answer systems call multiple tools in a single-wheel dialogue, they are prone to reduce stability and reliability and increase end-to-end delay due to multiple rounds of thinking and error accumulation in the big model.

Method used

Multiple large models are used to generate answer steps, answer code and final reply in sequence, and the problem is decomposed in logical order and converted into executable code to reduce logical errors directly from the problem to the code conversion process.

Benefits of technology

Improves the stability and reliability of the Q&A system, reduces end-to-end delays, and reduces the need for multiple rounds of thinking and action.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119443277A_ABST
    Figure CN119443277A_ABST
Patent Text Reader

Abstract

The invention provides a question and answer processing method, a large model training method and device, equipment and a storage medium, relates to the technical field of artificial intelligence, in particular to the technical fields of large models, natural language processing, deep learning and the like, and can be applied to the application fields of generative search, intelligent assistants, intelligent customer service and the like. According to the specific implementation scheme, the method comprises the steps of obtaining a target question in a question-answer dialogue, and generating a first answering step for answering the target question based on the target question by adopting a first large model; a second large model is adopted to generate a first answering code of the target question based on the first answering step, and the first answering code is used for calling at least two tools in sequence; and adopting a third model to generate a reply of the target question based on an execution result of the first answering code.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, specifically to technical fields such as big models, natural language processing, and deep learning, and can be used in application fields such as generative search, intelligent assistants, and intelligent customer service, and in particular to a question-and-answer processing method, a big model training method, an apparatus, a device, and a storage medium. Background Art

[0002] Current question-answering systems generally use a function call (Function Calling) + Reasoning and Acting (ReAct) model to call tools and generate responses. This is cost-effective for simple questions, but for situations where multiple tools need to be called in a single round of conversation, the large model will perform multiple rounds of thinking and action (usually calling tools), and each round of action depends on the output results of the previous round. If a certain round of large model calls produces hallucinations or errors, then this error will be used as the input of the next round, causing errors to accumulate and propagate throughout the entire process, which not only brings longer end-to-end latency, but also reduces the stability and reliability of the question-answering system. Summary of the invention

[0003] The present invention provides a question-answering processing method, a large model training method, an apparatus, a device and a storage medium.

[0004] According to a first aspect of the present disclosure, a question-answering processing method is provided, comprising: obtaining a target question in a question-answering dialogue; using a first large model to generate a first answer step for answering the target question based on the target question; using a second large model to generate a first answer code for the target question based on the first answer step, wherein the first answer code is used to sequentially call at least two tools; using a third large model to generate a reply to the target question based on the execution result of the first answer code.

[0005] According to a second aspect of the present disclosure, a large model training method is provided, comprising: obtaining sample questions in a question-answering dialogue; obtaining a real answer code and a predicted answer code for the sample question; wherein the predicted answer code is generated by the second large model based on the answer steps output by the first large model for the sample question, and the predicted answer code is used to sequentially call at least two tools; based on the real answer code and the predicted answer code, adjusting model parameters of the first large model and / or the second large model.

[0006] According to a third aspect of the present disclosure, a question-answering processing device is provided, comprising: a first acquisition module for acquiring a target question in a question-answering dialogue; a first generation module for generating a first answer step for answering the target question based on the target question using a first large model; a second generation module for generating a first answer code for the target question based on the first answer step using a second large model, wherein the first answer code is used to sequentially call at least two tools; and a third generation module for generating a reply to the target question based on the execution result of the first answer code using a third large model.

[0007] According to a fourth aspect of the present disclosure, a large model training device is provided, comprising: a first acquisition module, used to acquire sample questions in a question-answering dialogue; a second acquisition module, used to acquire a real answer code and a predicted answer code for the sample question; wherein the predicted answer code is generated by the second large model based on the answer steps output by the first large model for the sample question, and the predicted answer code is used to sequentially call at least two tools; a parameter adjustment module, used to adjust model parameters of the first large model and / or the second large model based on the real answer code and the predicted answer code.

[0008] According to a fifth aspect of the present disclosure, there is provided an electronic device, including:

[0009] at least one processor; and

[0010] a memory communicatively connected to the at least one processor; wherein,

[0011] The memory stores instructions that can be executed 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 question and answer processing method as described in the first aspect, or execute the large model training method as described in the second aspect.

[0012] According to the sixth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the question-answering processing method as described in the first aspect, or to execute the large model training method as described in the second aspect.

[0013] According to a seventh aspect of the present disclosure, a computer program product is provided, comprising computer instructions, which, when executed by a processor, implement the question-answering processing method as described in the first aspect, or implement the steps of the large model training method as described in the second aspect.

[0014] The present disclosure provides a question-answering processing method, a large model training method, a device, a equipment, and a storage medium, which have the following beneficial effects:

[0015] Obtain the target question in the question-answering dialogue, use the first large model to generate the first solution step for answering the target question based on the target question; use the second large model to generate the first solution code for the target question based on the first solution step, wherein the first solution code is used to sequentially call at least two tools; use the third large model to generate a reply to the target question based on the execution result of the first solution code. The present disclosure follows the logical order of answering questions, first generates the solution steps based on the target question, then converts the solution steps into executable code, and finally runs the code to get the reply, which can reduce the logical errors and omissions in the direct conversion process from question to code, and improve the stability and reliability of the present disclosure. In addition, the present disclosure does not require multiple rounds of thinking and action, which reduces end-to-end latency.

[0016] 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

[0017] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0018] Figure 1 is a flowchart of a question-and-answer processing method provided according to an embodiment of the present disclosure;

[0019] Figure 2 is a flowchart of a question-and-answer processing method provided according to another embodiment of the present disclosure;

[0020] Figure 3 is a flowchart of a question-and-answer processing method provided according to another embodiment of the present disclosure;

[0021] Figure 4 It is a flowchart of a large model training method provided according to an embodiment of the present disclosure;

[0022] Figure 5 is a flowchart of a large model training method provided according to another embodiment of the present disclosure;

[0023] Figure 6 is a flowchart of a large model training method provided according to another embodiment of the present disclosure;

[0024] Figure 7 A structural diagram of a question-answer processing device provided according to an embodiment of the present disclosure;

[0025] Figure 8 A schematic diagram of the structure of a large model training device provided according to an embodiment of the present disclosure;

[0026] Fig. 9It is a block diagram of an electronic device used to implement the question-answering processing method or large model training method of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0027] 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.

[0028] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information are all carried out with the user's consent, comply with the relevant laws and regulations, and do not violate public order and good morals.

[0029] The following describes the question and answer processing method, large model training method, device, equipment and storage medium of the embodiments of the present disclosure with reference to the accompanying drawings.

[0030] It should be noted that the executor of the question and answer processing method of this embodiment is the question and answer processing device, and the executor of the large model training method is the large model training device. The question and answer processing device or the large model training device can be implemented by software and / or hardware and can be configured in an electronic device. The electronic device may include but is not limited to a terminal, a server, etc.

[0031] Figure 1 It is a flowchart of a question-and-answer processing method provided according to an embodiment of the present disclosure.

[0032] like Figure 1 As shown, the question-answering processing method includes:

[0033] Step 101, obtaining a target question in a question-and-answer dialogue.

[0034] The target question may refer to any complex question in a question-and-answer dialogue that requires calling at least two tools to generate a corresponding reply. In the embodiment of the present disclosure, the target question may refer to a query input by a user.

[0035] In addition to the query, the target question can also include role instructions, objects requested by the query to be processed, and specified tools, etc. For example, the object can refer to files, images, videos, etc.

[0036] It should be noted that after obtaining the question input by the user, you can first determine whether the question is a complex question. If it is a complex question, you can generate a reply according to the subsequent steps. If it is not a complex question, you can generate a reply based on the FunctionCalling+ReAct mode.

[0037] Step 102: using the first large model to generate a first solution step for solving the target problem based on the target problem.

[0038] Among them, the target problem can be input into the first large model, so that the first large model thinks about the target problem based on the Chain of Thought algorithm to obtain the first solution step.

[0039] For example, if the target question is "Help me search for news and papers related to technology A and generate a report in style B", the first solution step includes:

[0040] (1) Use search tool C to obtain news about technology A.

[0041] (2) Use search tool D to obtain academic papers on technology A.

[0042] (3)Integrate search results.

[0043] (4) Use the big model to generate a B-style report based on the integrated search results.

[0044] (5) I would create a main function to perform these steps and use helper functions to handle each step.

[0045] Compared with the Function Calling+ReAct model, the first model in this disclosure only requires one thinking, which significantly reduces the number of thinking times in the question-and-answer dialogue, thereby reducing the end-to-end latency.

[0046] Step 103: Generate a first solution code for the target problem based on the first solution step using the second large model, wherein the first solution code is used to sequentially call at least two tools.

[0047] The second largest model and the first largest model may refer to the same large model or different large models.

[0048] In some embodiments, the first solution step can be input into the second large model to obtain a first solution code generated by the second large model. The first solution code can be used to call tools in sequence according to the tool calling sequence in the first solution step, wherein the tools include: script commands, application programming interfaces (APIs), functions, large models, etc.

[0049] In some embodiments, after obtaining the first answer code, the first answer code may be executed to obtain an execution result of the first answer code. Wherein, if the first answer code is executed correctly, the execution result of the first answer code may be understood as an initial response to the target question. For example, the execution result of the first answer code corresponding to the target question "help me search for news and papers related to technology A, and generate a report in style B" may refer to a report in style B.

[0050] In the case where multiple tools need to be called in a single round of dialogue, there may be logical judgments, loops, cross-tool references, etc. between multiple tools. For the Function Calling+ReAct mode, it is difficult to deal with these problems completely relying on the understanding ability of the large model. However, the aforementioned problems are what the code is good at. Therefore, obtaining the solution code of the target problem enables the present disclosure to have the ability to deal with logical judgments, loops, cross-tool references, etc.

[0051] Step 104: Generate a response to the target question using the third model based on the execution result of the first answer code.

[0052] The third large model, the first large model and the second large model may refer to the same large model or different large models.

[0053] In some embodiments, the execution result of the first answer code can be input into the third model, so that the third model generates a reply to the target question according to the execution result of the first answer code. The reply to the target question includes not only the execution result of the first answer code, but also an introduction, a transition, and a conclusion.

[0054] In some embodiments, when the first answer code is executed correctly, the third model can be used to generate a response to the target question based on the execution result of the first answer code; when the first answer code is executed incorrectly, the response to the target question can be generated based on the Function Calling+ReAct mode.

[0055] In an embodiment of the present disclosure, a target question in a question-and-answer dialogue is obtained, and a first large model is used to generate a first solution step for answering the target question based on the target question; a second large model is used to generate a first solution code for the target question based on the first solution step, wherein the first solution code is used to sequentially call at least two tools; and a third large model is used to generate a reply to the target question based on the execution result of the first solution code. The present disclosure follows the logical order of answering questions, firstly generates solution steps based on the target question, then converts the solution steps into executable code (i.e., solution code), and finally runs the code to obtain a reply, which can reduce logical errors and omissions in the direct conversion process from question to code, and improve the stability and reliability of the present disclosure. In addition, the present disclosure does not require multiple rounds of thinking and action, which reduces end-to-end latency.

[0056] Figure 2 It is a flowchart of a question and answer processing method provided according to another embodiment of the present disclosure.

[0057] like Figure 2 As shown, the question-answering processing method includes:

[0058] Step 201, obtaining a target question in a question-and-answer dialogue.

[0059] Step 202: using the first large model to generate a first solution step for solving the target problem based on the target problem.

[0060] In some embodiments, at least two tools that need to be called in a question-and-answer dialogue for a target question may be obtained; a first large model is used to generate a first solution step based on the target question and the at least two tools.

[0061] The at least two tools to be called may refer to designated tools included in the target problem, or may refer to tools obtained by inferring tool calls based on the target problem.

[0062] In some embodiments, the target problem and tool identifications of at least two tools may be input into a first large model to obtain a first solution step.

[0063] Using the tools needed to be called as auxiliary information for the first model to generate the first solution step can enable the first model to think about how to reasonably use these tools to reason about the solution process, and help the first model decompose complex problems into several relatively simple sub-problems, thereby generating clearer and more coherent solution steps.

[0064] Step 203, for any first solution step, according to the solution sequence between the first solution steps, the second large model is used to generate the solution code corresponding to the first solution step.

[0065] In some embodiments, for any first solution step, the solution code corresponding to the first solution step can be generated by calling the automatic code generation API through the second large model according to the solution order between the first solution steps.

[0066] In some embodiments, for any first solution step, the second large model is used to query the objective function matching the first solution step from the function library; according to the first solution step, the parameters of the objective function are obtained; based on the objective function and the parameters, a solution code corresponding to the first solution step is generated.

[0067] The function library includes calling functions of various tools and operation functions for performing various operations, such as sorting functions, integration functions, etc.

[0068] In the disclosed embodiment, for any first solution step, the second large model can identify the key operation in the first solution step, and based on the key operation, query the target function matching the first solution step from the function library.

[0069] In the disclosed embodiment, for any first solution step, the second large model can extract parameters of the objective function from the first solution step, and fill the extracted parameters into the objective function to obtain the solution code corresponding to the first solution step.

[0070] Through automated function matching and parameter extraction, the second largest model can quickly generate a code snippet containing the target function and its correct parameters, shortening the time for generating answer codes and thereby improving the efficiency of answering target questions.

[0071] Step 204: Generate a first answer code for the target problem based on the answer code corresponding to the first answer step.

[0072] Among them, the answer codes corresponding to the first answer steps can be combined according to the answer sequence between the first answer steps to obtain the first answer code.

[0073] Step 205: Generate a response to the target question using the third model based on the execution result of the first answer code.

[0074] It should be noted that the explanation of step 201 and step 205 can be found in the relevant description in any embodiment of the present disclosure, and will not be repeated here.

[0075] In the disclosed embodiment, for any first answer step, the second large model is used to generate the answer code corresponding to the first answer step according to the answer sequence between the first answer steps; based on the answer code corresponding to the first answer step, the first answer code of the target problem is generated. By generating the answer code corresponding to each first answer step according to the answer sequence using the second large model, the logical coherence between each first answer step can be ensured, thereby generating a more accurate and reliable answer code. In addition, generating the corresponding answer code based on the answer sequence can improve the readability of the answer code.

[0076] Figure 3 It is a flowchart of a question and answer processing method provided according to another embodiment of the present disclosure.

[0077] like Figure 3 As shown, the question-answering processing method includes:

[0078] Step 301, obtaining the target question in the question-answering dialogue.

[0079] Step 302: using the first large model to generate a first solution step for solving the target problem based on the target problem.

[0080] Step 303: Generate a first answer code for the target problem based on the first answer step using the second largest model.

[0081] Step 304, when the first answer code is executed correctly, the third model is used to generate a response to the target question based on the execution result of the first answer code.

[0082] Step 305: When an execution error occurs in the first answer code, obtain execution error information of the first answer code.

[0083] Wherein, in the case of an execution error of the first answer code, a corresponding error log will be generated, and the error log includes various execution error information occurring during the execution of the first answer code.

[0084] Step 306: Obtain a second answer code for the target question according to the execution error information.

[0085] In some embodiments, the first answer code may be modified based on the execution error information to obtain the second answer code.

[0086] In some embodiments, a first large model is used to generate a second solution step for the target problem and reference adjustment information for the first solution code based on execution error information, the target problem and the first solution code; a second large model is used to generate a second solution code for the target problem based on the second solution step and the reference adjustment information.

[0087] It should be noted that the second solution step may be the same as the first solution step or may be different.

[0088] The first model can use the execution error information, target problem and the first solution code to rethink, optimize the solution steps and / or clarify the code adjustment direction, so that the second model can generate more accurate solution code and improve the execution success rate of the code.

[0089] Step 307: Use the third model to generate a response to the target question based on the execution result of the second answer code.

[0090] Among them, the third largest model generates the content of the reply to the target question based on the execution result of the second answer code. Please refer to the content of the reply to the target question generated by the third largest model based on the execution result of the first answer code in any embodiment of the present disclosure.

[0091] It should be noted that the explanation of steps 301-304 and step 307 can be found in the relevant description in any embodiment of the present disclosure, and will not be repeated here.

[0092] In the embodiment of the present disclosure, when the first answer code is executed incorrectly, the execution error information of the first answer code is obtained; according to the execution error information, the second answer code of the target question is obtained; and the third model is used to generate a reply to the target question based on the execution result of the second answer code. The present disclosure uses the execution feedback information of the answer code as the basis for improving the code, so that the present disclosure has autonomous fault tolerance capability.

[0093] Figure 4 It is a flowchart of a large model training method provided according to an embodiment of the present disclosure.

[0094] like Figure 4 As shown, the large model training method includes:

[0095] Step 401, obtaining sample questions in the question-and-answer dialogue.

[0096] Among them, the sample question may refer to a complex question in a question-and-answer dialogue that requires calling at least two tools to generate corresponding responses.

[0097] Step 402, obtaining the actual answer code and the predicted answer code of the sample question.

[0098] The predicted answer code is generated by the second largest model based on the answer steps output by the first largest model for the sample problem, and the predicted answer code is used to sequentially call at least two tools.

[0099] The predicted answer code may refer to the answer code actually generated by the large model based on the sample question, and the real answer code may refer to the correct answer code corresponding to the sample question. Exemplarily, the real answer code may refer to the code manually written based on the sample question.

[0100] Step 403: Adjust model parameters of the first large model and / or the second large model based on the real solution code and the predicted solution code.

[0101] Among them, the supervised fine-tuning (SFT) algorithm or the reinforcement learning from human feedback (RLFT) algorithm can be combined to adjust the model parameters of the first large model and / or the second large model based on the real solution code and the predicted solution code.

[0102] In the embodiment of the present disclosure, sample questions in the question-answering dialogue are obtained; the real answer code and the predicted answer code of the sample question are obtained; and the model parameters of the first large model and / or the second large model are adjusted based on the real answer code and the predicted answer code. The present disclosure adjusts the model parameters of the first large model and / or the second large model based on the real answer code and the predicted answer code, which can improve the accuracy and execution success rate of the large model generating the answer code.

[0103] Figure 5 It is a flowchart of a large model training method provided according to another embodiment of the present disclosure.

[0104] like Figure 5 As shown, the large model training method includes:

[0105] Step 501, obtaining sample questions in the question-answering dialogue.

[0106] Step 502: Input the sample question into at least one fourth largest model to obtain a reference answer code output by the fourth largest model for the sample question.

[0107] The fourth largest model may refer to at least one of the first largest model, the second largest model and the third largest model, or may refer to at least one large model other than the first largest model, the second largest model and the third largest model. The reference answer code output by the fourth largest model may be one or more.

[0108] Step 503: Use the fifth model to execute the reference answer code, and select the real answer code from the reference answer code according to the execution result of the reference answer code.

[0109] Among them, the fifth largest model refers to at least one of the first largest model, the second largest model, the third largest model and the fourth largest model, and may also refer to at least one large model other than the first large model, the second large model, the third large model and the fourth large model.

[0110] Among them, the execution result of the reference answer code can be used to indicate whether the reference answer code is executed correctly.

[0111] In some embodiments, when the number of the fifth largest model is one, the correctly executed reference answer code can be used as the true answer code; when the number of the fifth largest models is multiple, the number of correct executions of the reference answer code can be obtained, and the reference answer code with a correct execution number greater than a set threshold can be used as the true answer code.

[0112] Step 504, obtaining the predicted answer code of the sample question.

[0113] Step 505: Adjust model parameters of the first large model and / or the second large model based on the real solution code and the predicted solution code.

[0114] It should be noted that the explanation of step 501 and steps 504-505 can be found in the relevant description in any embodiment of the present disclosure, and will not be repeated here.

[0115] In the embodiment of the present disclosure, a sample problem is input into at least one fourth largest model to obtain a reference answer code output by the fourth largest model for the sample problem; the fifth largest model is used to execute the reference answer code, and a real answer code is selected from the reference answer code according to the execution result of the reference answer code. The present disclosure can automatically obtain the real answer code of the sample problem through the fourth largest model and the fifth largest model, with high efficiency, and can automatically construct large-scale training data to improve the training effect of the large model.

[0116] Figure 6 It is a flowchart of a large model training method provided according to another embodiment of the present disclosure.

[0117] like Figure 6 As shown, the large model training method includes:

[0118] Step 601, using the sixth model, obtains from the question library seed questions that require calling at least two tools to generate responses in a question-and-answer dialogue.

[0119] Among them, the sixth largest model and the first largest model, the second largest model, the third largest model, the fourth largest model and the fifth largest model may be the same large model or may refer to different large models.

[0120] The question bank may include questions obtained from online logs of the question-answering system and / or questions obtained from historical conversations in typical conversation scenarios.

[0121] In some embodiments, the sixth model is used to sample questions in the question library to obtain complex questions that require calling at least two tools to generate responses in a question-and-answer dialogue, namely, seed questions.

[0122] Step 602: Expand the question based on the seed question to obtain an expanded question.

[0123] Among them, based on the query evolution algorithm, the seed question can be expanded to obtain the expanded question.

[0124] Step 603: Select questions based on the seed questions and / or the extended questions to obtain sample questions.

[0125] A certain number of questions may be selected from the seed questions and / or the extended questions as sample questions.

[0126] Step 604, obtaining the actual answer code and the predicted answer code of the sample question.

[0127] Step 605: Adjust model parameters of the first large model and / or the second large model based on the real solution code and the predicted solution code.

[0128] It should be noted that the explanation of steps 604-605 can be found in the relevant description in any embodiment of the present disclosure and will not be repeated here.

[0129] In the embodiment of the present disclosure, the sixth large model is used to obtain seed questions from the question library that require calling at least two tools to generate replies in the question-answering dialogue; expand the questions based on the seed questions to obtain expanded questions; and select questions based on the seed questions and / or expanded questions to obtain sample questions. The present disclosure expands the seed questions and selects sample questions from the seed questions and / or expanded questions, thereby ensuring the diversity of the sample questions and improving the generalization ability of the large model when generating answer codes.

[0130] Figure 7 It is a structural diagram of a question and answer processing device provided according to an embodiment of the present disclosure.

[0131] like Figure 7 As shown, the question-answer processing device includes:

[0132] A first acquisition module 701 is used to acquire a target question in a question-answering dialogue;

[0133] A first generating module 702 is used to generate a first solution step for solving the target problem based on the target problem using the first large model;

[0134] A second generation module 703 is used to generate a first solution code for the target problem based on the first solution step using the second large model, wherein the first solution code is used to sequentially call at least two tools;

[0135] The third generation module 704 is used to generate a response to the target question based on the execution result of the first answer code using the third model.

[0136] As a possible implementation of the embodiment of the present disclosure, the second generating module 703 is used to:

[0137] For any first solution step, according to the solution sequence between the first solution steps, the second largest model is used to generate a solution code corresponding to the first solution step;

[0138] Based on the answer code corresponding to the first answer step, a first answer code for the target problem is generated.

[0139] As a possible implementation of the embodiment of the present disclosure, the second generating module 703 is used to:

[0140] Using the second largest model, query the target function matching the first solution step from the function library;

[0141] According to the first solution step, obtaining parameters of the objective function;

[0142] Based on the objective function and the parameters, a solution code corresponding to the first solution step is generated.

[0143] As a possible implementation of the embodiment of the present disclosure, the device further includes:

[0144] A second acquisition module is used to acquire execution error information of the first answer code when an execution error occurs in the first answer code;

[0145] A third acquisition module is used to acquire a second answer code of the target problem according to the execution error information;

[0146] The fourth generation module is used to generate a response to the target question based on the execution result of the second answer code using the third model.

[0147] As a possible implementation of the embodiment of the present disclosure, the third acquisition module is used to:

[0148] Using the first large model, based on the execution error information, the target problem and the first solution code, a reference adjustment information of a second solution step of the target problem and the first solution code is generated;

[0149] A second solution code for the target problem is generated by using the second largest model based on the second solution step and the reference adjustment information.

[0150] As a possible implementation of the embodiment of the present disclosure, the first generating module 702 is used to:

[0151] Obtain at least two tools that need to be called in the question-answering dialogue for the target question;

[0152] A first large model is adopted to generate a first solution step based on a target problem and at least two tools.

[0153] It should be noted that the above explanation of the question and answer processing method is also applicable to the question and answer processing device of this embodiment and will not be repeated here.

[0154] Figure 8 It is a structural diagram of a large model training device provided according to an embodiment of the present disclosure.

[0155] like Figure 8 As shown, the large model training device includes:

[0156] A first acquisition module 801 is used to acquire sample questions in a question-and-answer dialogue;

[0157] The second acquisition module 802 is used to obtain the real answer code and the predicted answer code of the sample question;

[0158] The predicted answer code is generated by the second largest model based on the answer steps output by the first largest model for the sample problem, and the predicted answer code is used to sequentially call at least two tools;

[0159] The parameter adjustment module 803 is used to adjust the model parameters of the first large model and / or the second large model based on the real solution code and the predicted solution code.

[0160] As a possible implementation of the embodiment of the present disclosure, the second acquisition module 802 is used to:

[0161] Input the sample problem into at least one fourth-largest model to obtain a reference answer code output by the fourth-largest model for the sample problem;

[0162] The fifth model is used to execute the reference answer code, and the real answer code is selected from the reference answer code according to the execution result of the reference answer code.

[0163] As a possible implementation of the embodiment of the present disclosure, the first acquisition module 801 is used to:

[0164] The sixth model is used to obtain seed questions from the question library that require at least two tools to generate responses in the question-answering dialogue;

[0165] Expand the problem based on the seed problem to obtain the expanded problem;

[0166] Based on the seed questions and / or the extended questions, question selection is performed to obtain sample questions.

[0167] It should be noted that the above explanation of the large model training method is also applicable to the large model training device of this embodiment and will not be repeated here.

[0168] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0169] Fig. 9 A schematic block diagram of an example electronic device 900 that can be used to implement an embodiment of the present disclosure is shown. The electronic device 900 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.

[0170] like Fig. 9 As shown, the electronic device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a ROM (Read-Only Memory) 902 or a computer program loaded from a storage unit 908 to a RAM (Random Access Memory) 903. In RAM 903, various programs and data required for the operation of the electronic device 900 can also be stored. The computing unit 901, ROM 902, and RAM 903 are connected to each other via a bus 904. An I / O (Input / Output) interface 905 is also connected to the bus 904.

[0171] Multiple components in the electronic device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the electronic device 900 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0172] The computing unit 901 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a CPU (Central Processing Unit), a GPU (Graphic Processing Units), various dedicated AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, a DSP (Digital Signal Processor), and any appropriate processor, controller, microcontroller, etc. The computing unit 901 performs the various methods and processes described above, such as a question-and-answer processing method and a large model training method. For example, in some embodiments, the question-and-answer processing method and the large model training method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the question-and-answer processing method and the large model training method described above may be executed. Alternatively, in other embodiments, the computing unit 901 may be configured to execute the question-answering processing method or the large model training method in any other suitable manner (e.g., by means of firmware).

[0173] Various embodiments of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application Specific Standard Products), SOCs (System On Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that may be executed and / or interpreted on a programmable system including at least one programmable processor that may be a dedicated or general-purpose programmable processor that may 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.

[0174] 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 provided 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, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. 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.

[0175] 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 device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include electrical connections based on one or more lines, portable computer disks, hard disks, RAM, ROM, EPROM (Electrically Programmable Read-Only-Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0176] To provide interaction with a user, the systems and techniques described herein can 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; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0177] The systems and techniques described herein may be implemented in a computing system that includes backend 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 frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend 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: LAN (Local Area Network), WAN (Wide Area Network), the Internet, and blockchain networks.

[0178] 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 between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.

[0179] It should be noted that artificial intelligence is a discipline that studies how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.), and includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.

[0180] 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.

[0181] 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. A question-answering processing method, comprising: Get the target question in the question-answering dialogue; Using a first large model to generate a first solution step for solving the target problem based on the target problem; Using a second large model to generate a first answer code for the target problem based on the first answer step, wherein the first answer code is used to sequentially call at least two tools; A third model is used to generate a response to the target question based on the execution result of the first answer code.

2. The method according to claim 1, wherein: The step of using the second largest model to generate a first answer code for the target problem based on the first answer step includes: For any of the first solution steps, according to the solution sequence between the first solution steps, using the second large model, generate a solution code corresponding to the first solution step; Based on the answer code corresponding to the first answer step, a first answer code for the target question is generated.

3. The method according to claim 2, wherein: The step of using the second large model to generate a solution code corresponding to the first solution step includes: Using the second large model, searching for an objective function matching the first solution step from a function library; According to the first solution step, obtaining the parameters of the objective function; Based on the objective function and the parameters, a solution code corresponding to the first solution step is generated.

4. The method according to claim 1, wherein: The method further comprises: In case that the first answer code is executed incorrectly, obtaining execution error information of the first answer code; Obtaining a second answer code for the target question according to the execution error information; The third model is used to generate a response to the target question based on the execution result of the second answer code.

5. The method according to claim 4, wherein: The step of obtaining a second answer code for the target question according to the execution error information includes: Using the first large model, based on the execution error information, the target problem and the first solution code, generating reference adjustment information of a second solution step of the target problem and the first solution code; The second large model is used to generate a second answer code for the target problem based on the second answer step and the reference adjustment information.

6. The method according to claim 1, wherein: The step of using the first large model to generate a first solution for answering the target problem based on the target problem includes: Obtain at least two tools that need to be called in the question-and-answer dialogue for the target question; The first solution step is generated by using the first large model based on the target problem and the at least two tools.

7. A large model training method, comprising: Get sample questions from a Q&A session; Obtaining a real answer code and a predicted answer code for the sample problem; The predicted answer code is generated by the second largest model based on the answer steps output by the first largest model for the sample problem, and the predicted answer code is used to sequentially call at least two tools; Based on the true solution code and the predicted solution code, model parameters of the first large model and / or the second large model are adjusted.

8. The method according to claim 7, wherein: The method of obtaining the real answer code of the sample question includes: Input the sample problem into at least one fourth model to obtain a reference answer code output by the fourth model for the sample problem; The fifth model is used to execute the reference answer code, and the real answer code is selected from the reference answer code according to the execution result of the reference answer code.

9. The method according to claim 7, wherein: The sample questions in the question-answering dialogue include: The sixth model is used to obtain seed questions from the question library that require at least two tools to generate responses in the question-answering dialogue; Expanding the problem based on the seed problem to obtain an expanded problem; Based on the seed question and / or the extended question, question selection is performed to obtain the sample question.

10. A question-answer processing device, comprising: The first acquisition module is used to obtain the target question in the question-answering dialogue; A first generating module, configured to generate a first solution step for solving the target problem based on the target problem by using a first large model; A second generation module, configured to generate a first solution code for the target problem based on the first solution step by using a second large model, wherein the first solution code is used to sequentially call at least two tools; The third generation module is used to generate a response to the target question based on the execution result of the first answer code by adopting a third model.

11. The device according to claim 10, wherein: The second generating module is used for: For any of the first solution steps, according to the solution sequence between the first solution steps, using the second large model, generate a solution code corresponding to the first solution step; Based on the answer code corresponding to the first answer step, a first answer code for the target question is generated.

12. The device according to claim 11, wherein The second generating module is used for: Using the second large model, searching for an objective function matching the first solution step from a function library; According to the first solution step, obtaining the parameters of the objective function; Based on the objective function and the parameters, a solution code corresponding to the first solution step is generated.

13. The device according to claim 10, wherein: The device also includes: A second acquisition module is used to acquire execution error information of the first answer code when an execution error occurs in the first answer code; A third acquisition module, configured to acquire a second answer code for the target question according to the execution error information; The fourth generation module is used to generate a response to the target question based on the execution result of the second answer code using the third model.

14. The device according to claim 13, wherein: The third acquisition module is used to: Using the first large model, based on the execution error information, the target problem and the first solution code, generating reference adjustment information of a second solution step of the target problem and the first solution code; The second large model is used to generate a second answer code for the target problem based on the second answer step and the reference adjustment information.

15. The device according to claim 10, wherein: The first generating module is used for: Obtain at least two tools that need to be called in the question-answering dialogue for the target question; The first solution step is generated by using the first large model based on the target problem and the at least two tools.

16. A large model training device, comprising: The first acquisition module is used to obtain sample questions in the question-answering dialogue; A second acquisition module is used to obtain the real answer code and the predicted answer code of the sample question; The predicted answer code is generated by the second largest model based on the answer steps output by the first largest model for the sample problem, and the predicted answer code is used to sequentially call at least two tools; A parameter adjustment module is used to adjust model parameters of the first large model and / or the second large model based on the real solution code and the predicted solution code.

17. The device according to claim 16, wherein: The second acquisition module is used to: Input the sample problem into at least one fourth model to obtain a reference answer code output by the fourth model for the sample problem; The fifth model is used to execute the reference answer code, and the real answer code is selected from the reference answer code according to the execution result of the reference answer code.

18. The device according to claim 16, wherein: The first acquisition module is used to: The sixth model is used to obtain seed questions from the question library that require at least two tools to generate responses in the question-answering dialogue; Expanding the problem based on the seed problem to obtain an expanded problem; Based on the seed question and / or the extended question, question selection is performed to obtain the sample question.

19. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6 or 7-9.

20. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method of any one of claims 1-6 or 7-9.

21. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method of any one of claims 1-6 or 7-9.

Citation Information

Patent Citations

  • Intelligent agent question and answer method and device, storage medium and equipment

    CN118469017A

  • Data generation method and device based on large model, equipment and medium

    CN118643139A

  • Problem processing method and device based on large model, electronic equipment and storage medium

    CN118643140A

  • Generative ai for control and management of manufacturing processes

    WO2024220444A2