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

By having multiple large models work together to generate the answer steps, code, and responses for the question-answering system, the problem of accumulated logical errors in a single round of conversation is solved, which improves the stability of the system and reduces latency.

CN119443277BActive Publication Date: 2025-09-23BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing question-answering systems are prone to logical errors and error accumulation when calling multiple tools in a single round of conversation, resulting in reduced stability and reliability and increased end-to-end latency.

Method used

Multiple large models are used to generate solution steps, solution codes and final responses respectively. The first large model generates solution steps, the second large model generates solution codes, and the third large model generates responses, ensuring the logical order and code correctness and reducing logical errors and omissions in the process of direct conversion from questions to codes.

Benefits of technology

It improves the stability and reliability of the question-answering system, reduces end-to-end latency, and reduces the need for multiple rounds of thinking and action.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119443277B_ABST
    Figure CN119443277B_ABST
Patent Text Reader

Abstract

The present disclosure provides a question-and-answer processing method, a large-model training method, an apparatus, a device, and a storage medium, which relate to the field of artificial intelligence technology, specifically to large-model, natural language processing, deep learning, and other technical fields, and can be used in application fields such as generative search, intelligent assistants, and intelligent customer service. The specific implementation scheme is as follows: obtaining a target question in a question-and-answer 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.
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 large models, natural language processing, and deep learning, and can be used in application fields such as generative search, intelligent assistants, and intelligent customer service. In particular, it relates to a question-and-answer processing method, a large 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. However, when 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 an illusion or error occurs in a round of large model calls, this error will be used as input for the next round, causing the error to accumulate and propagate throughout the entire process. This not only results in longer end-to-end latency but also reduces the stability and reliability of the question-answering system. Summary of the Invention

[0003] The present disclosure 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; employing a first large model to generate a first answer step for answering the target question based on the target question; employing 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; employing a third large model to generate a reply to the target question based on an 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, including: 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 for acquiring sample questions in a question-answering dialogue; a second acquisition module for acquiring 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 for adjusting 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-answering 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, an apparatus, a device, and a storage medium, which have the following beneficial effects:

[0015] The target question in the question-and-answer dialogue is obtained, and the first large model is used to generate the first solution step for answering the target question based on the target question; the second large model is used 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; the third large model is used to generate the response 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 generating the solution steps based on the target question, then converting the solution steps into executable code, and finally running the code to obtain the response, 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.

[0016] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

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

[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 1 is a flow chart 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] Figure 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 description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize 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 solutions disclosed herein, the collection, storage, use, processing, transmission, provision and disclosure of user personal information are all carried out with the user's consent, comply with relevant laws and regulations, and do not violate public order and good morals.

[0029] The following describes the question-answering 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 execution body of the question-answering processing method of this embodiment is the question-answering processing device, and the execution body of the large model training method is the large model training device. The question-answering 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: Obtain the target question in the question-answering dialogue.

[0034] Among them, the target question can refer to any complex question in a question-and-answer dialogue that requires calling at least two tools to generate a corresponding response. In the embodiment of the present disclosure, the target question can refer to a query (Query) input by the user.

[0035] In addition to the query, the target question can also include role instructions, the objects requested by the query, and specified tools. For example, the objects 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: Generate a first solution step for solving the target problem based on the target problem using the first large model.

[0038] 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) Generate a B-style report based on the integrated search results using the large model.

[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 thought, which significantly reduces the number of thoughts in the question-and-answer dialogue and thus reduces the end-to-end latency.

[0046] Step 103: Generate a first answer code for the target problem based on the first answer step using the second large model, wherein the first answer 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 sequentially call tools according to the tool calling sequence in the first solution step, where 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 can be executed to obtain an execution result of the first answer code. If the first answer code is executed correctly, the execution result of the first answer code can be understood as the initial response to the target question. For example, for the target question "Search for news and papers related to technology A and generate a report in style B," the execution result of the first answer code corresponding to the target question can be a report in style B.

[0050] When multiple tools need to be called in a single conversation, there may be logic constraints, loops, and cross-tool references between them. The Function Calling + ReAct model makes it difficult to handle these issues solely relying on the understanding capabilities of a large model. However, these issues are well-suited for code. Therefore, obtaining the code that solves the target problem enables this disclosure to handle logic constraints, loops, cross-tool references, and other issues.

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

[0052] The third largest model, the first largest model and the second largest 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 response to the target question based on the execution result of the first answer code. The response to the target question includes not only the execution result of the first answer code, but also an introduction, transitions, 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 model.

[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 answer step for answering the target question based on the target question; a second large model is used 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; and a third large model is used to generate a reply to the target question based on the execution result of the first answer code. The present disclosure follows the logical order of answering questions, first generating answer steps based on the target question, then converting the answer steps into executable code (i.e., answer code), and finally running 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: Obtain the target question in the question-answering dialogue.

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

[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 required tools 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, the solution code corresponding to the first solution step is generated.

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

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

[0069] In the embodiment of the present disclosure, for any first solution step, the second large model can extract the 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 to generate the answer code and thereby improving the efficiency of answering the target question.

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

[0072] The answer codes corresponding to the first answer steps may be combined according to the answering order between the first answering 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, for the explanation of step 201 and step 205, reference can be made to the relevant description in any embodiment of the present disclosure, and no further details are given here.

[0075] In the disclosed embodiment, for any first solution step, the second large model is used to generate a corresponding solution code for the first solution step according to the solution order between the first solution steps. Based on the solution code corresponding to the first solution step, the first solution code for the target question is generated. By using the second large model to generate the solution code corresponding to each first solution step according to the solution order, logical coherence between the first solution steps can be ensured, thereby generating a more accurate and reliable solution code. Furthermore, generating the corresponding solution code based on the solution order can improve the readability of the solution 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: Obtain the target question in the question-answering dialogue.

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

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

[0081] In step 304, when the first answer code is executed correctly, a 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 that occurs during the execution of the first answer code.

[0084] Step 306: Obtain a second answer code for the target question based on 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 answer step for the target problem and reference adjustment information for the first answer code based on the execution error information, the target problem and the first answer code; a 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.

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

[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 code execution success rate.

[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 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 model based on the execution result of the first answer code in any embodiment of the present disclosure.

[0091] It should be noted that, for the explanation of steps 301 - 304 and step 307 , reference can be made to the relevant description in any embodiment of the present disclosure, and no further details are given here.

[0092] In this embodiment, if the first answer code fails to execute correctly, the execution error information of the first answer code is obtained; based on the execution error information, a second answer code for the target question is obtained; and a third model is used to generate a response to the target question based on the execution result of the second answer code. This disclosure uses the execution feedback information of the answer code as a basis for improving the code, making it capable of autonomous fault tolerance.

[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: Obtain 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: Obtain the actual answer code and the predicted answer code for 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. For example, 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 answer code and the predicted answer code.

[0102] In an embodiment of the present disclosure, sample questions are obtained from a question-and-answer conversation; actual answer codes and predicted answer codes are obtained for the sample questions; and model parameters of a first large model and / or a second large model are adjusted based on the actual answer codes and the predicted answer codes. This disclosure adjusts model parameters of the first large model and / or the second large model based on the actual answer codes and the predicted answer codes, thereby improving the accuracy and execution success rate of answer codes generated by the large models.

[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: Obtain sample questions in the question-answering dialogue.

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

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

[0108] Step 503: Use the fifth model to execute the reference answer code, and select the real answer code from the reference answer code based on 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 largest model, the second largest model, the third largest model and the fourth largest model.

[0110] The execution result of the reference answer code may 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 real answer code; when the number of the fifth largest model 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 real answer code.

[0112] Step 504: Obtain the predicted answer code for 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, for the explanation of step 501 and steps 504 - 505 , reference can be made to the relevant description in any embodiment of the present disclosure, and no further details are given here.

[0115] In the disclosed embodiment, a sample question is input into at least one fourth-largest model to obtain a reference answer code output by the fourth-largest model for the sample question. The reference answer code is executed using the fifth-largest model, and a true answer code is selected from the reference answer code based on the execution result of the reference answer code. The disclosed embodiment can automatically obtain the true answer code for the sample question using the fourth and fifth-largest models, which is highly efficient and can automatically construct large-scale training data, improving the training effect of the large models.

[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, a seed question is obtained from the question library, which requires calling at least two tools to generate a response in a question-answering 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 can be the same large model or refer to different large models.

[0120] The question library 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] The seed question can be expanded based on a query evolution algorithm to obtain an 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: Obtain the actual answer code and the predicted answer code for 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 of any embodiment of the present disclosure and will not be repeated here.

[0129] In the disclosed embodiments, the sixth model is used to retrieve seed questions from a question library, which require at least two tools to generate responses in a question-and-answer conversation. The seed questions are then expanded to generate expanded questions. Finally, questions are selected based on the seed questions and / or the expanded questions to generate sample questions. This expansion of the seed questions and the selection of sample questions from the seed questions and / or the expanded questions ensures a diverse set of sample questions, thereby improving the generalization capabilities of the large model when generating answer code.

[0130] Figure 7 2 is a structural diagram of a question-answering processing device provided according to an embodiment of the present disclosure.

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

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

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

[0134] A second generating module 703 is configured 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 configured to:

[0137] For any first solution step, according to the solution order between the first solution steps, the second large model is used to generate the 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 question is generated.

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

[0140] Using the second largest model, search the function library for the target function that matches the first solution step;

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

[0142] Based on the objective function and parameters, the 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 obtaining module is used to obtain execution error information of the first answer code when an error occurs in the execution of the first answer code;

[0145] A third acquisition module is used to obtain a second answer code for 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 configured to:

[0148] Using the first 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 adopting 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 configured to:

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

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

[0153] It should be noted that the aforementioned explanation of the question-answering processing method is also applicable to the question-answering 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 model based on the answer steps output by the first 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 configured to:

[0161] Inputting 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 based on 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 configured to:

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

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

[0166] Based on the seed questions and / or extended questions, questions are selected 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] Figure 9 A schematic block diagram of an example electronic device 900 that can be used to implement embodiments 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 assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0170] like Figure 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 into a RAM (Random Access Memory) 903. In the RAM 903, various programs and data required for the operation of the electronic device 900 can also be stored. The computing unit 901, the ROM 902, and the 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 magnetic 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 via a computer network such as the Internet and / or various telecommunication networks.

[0172] The computing unit 901 can be a variety of general-purpose and / or specialized 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 Unit), various dedicated AI (Artificial Intelligence) computing chips, various computing units that run 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 the question-answering processing method and the large model training method. For example, in some embodiments, the question-answering processing method and the large model training method can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as the storage unit 908. In some embodiments, part or all of the computer program can 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-answering processing method and the large model training method described above can be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to perform the question-answering processing method or the large model training method in any other appropriate manner (e.g., by means of firmware).

[0173] Various embodiments of the systems and techniques described herein can 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 can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes 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.

[0174] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, 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 apparatus. 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 apparatus, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include an electrical connection based on one or more wires, a portable computer disk, a hard disk, RAM, ROM, EPROM (Electrically Programmable Read-Only-Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), an optical storage device, a magnetic storage device, 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 can 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 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 can 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 server are generally remote from each other and typically interact via a communication network. This client-server relationship is established by computer programs running on the respective computers, establishing a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host, a host product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosts and VPS services ("Virtual Private Servers" or simply "VPS"). The server may also be a server in a distributed system or a server integrated with blockchain.

[0179] It's important to note that artificial intelligence (AI) is the study of how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). This encompasses both hardware and software technologies. AI hardware technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, and big data processing. AI software technologies primarily encompass computer vision, speech recognition, natural language processing, machine learning / deep learning, big data processing, and knowledge graphs.

[0180] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not a limitation herein.

[0181] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.

Claims

1. A question-answering processing method, comprising: Obtain the target question in the question-answering dialogue; Using the 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; Using a third model to generate a response to the target question based on the execution result of the first answer code; The method further comprises: When an error occurs in executing the first answer code, obtaining error information about the execution of the first answer code; Using the first large model, based on the execution error information, the target problem, and the first answer code, a second answer step for the target problem and reference adjustment information for the first answer code are generated; using the second large model, based on the second answer step and the reference adjustment information, a second answer code for the target problem is generated; The third model is used to generate a response to the target question based on the execution result of the second 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 order between the first solution steps, using the second large model, generate a solution code corresponding to the first solution step; A first answer code for the target question is generated based on the answer code corresponding to the first answer step.

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 largest 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 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 large model is adopted to generate the first solution step based on the target problem and the at least two tools.

5. A large model training method, comprising: Get sample questions from the Q&A conversation; Obtaining a true 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 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, model parameters of the first large model and / or the second large model are adjusted; wherein the first large model and the second large model are used to implement the question and answer processing method according to any one of claims 1 to 4.

6. The method according to claim 5, wherein: The step of obtaining the actual answer code for the sample question includes: Inputting the sample question into at least one fourth model to obtain a reference answer code output by the fourth model for the sample question; 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.

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

8. 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 is configured to generate a first solution step for solving the target problem based on the target problem using a first large model; a second generating module, configured to generate a first answer code for the target problem based on the first answering step by using a second large model, wherein the first answer code is used to sequentially call at least two tools; a third generation module, configured to generate a response to the target question based on the execution result of the first answer code using a third model; Wherein, the device further comprises: A second obtaining module is configured to obtain execution error information of the first answer code when an execution error occurs in the first answer code; a third acquisition module, configured to use the first large model to generate, based on the execution error information, the target problem, and the first answer code, a second answer step for the target problem and reference adjustment information for the first answer code; and use the second large model to generate, based on the second answer step and the reference adjustment information, a second answer code for the target problem; 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.

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

10. The device according to claim 9, wherein The second generating module is used to: Using the second largest 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.

11. The device according to claim 8, wherein The first generating module is configured to: Obtain at least two tools that need to be called in the question-and-answer dialogue for the target question; The first large model is adopted to generate the first solution step based on the target problem and the at least two tools.

12. 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 question, and the predicted answer code is used to sequentially call at least two tools; A parameter adjustment module is used to adjust 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; wherein, the first large model and the second large model are used to implement the question and answer processing method described in any one of claims 1-4.

13. The device according to claim 12, wherein The second acquisition module is used to: Inputting the sample question into at least one fourth model to obtain a reference answer code output by the fourth model for the sample question; 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.

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

15. 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-4 or 5-7.

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

17. A computer program product comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method according to any one of claims 1 to 4 or 5 to 7.

Citation Information

Patent Citations

  • 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