Question answering method and device based on large model, training method and device, intelligent agent, equipment and medium
Through multiple rounds of iterative Q&A and self-evaluation mechanisms, the prompt words of the big model are optimized, and the problem of the answer accuracy of the big model in multiple rounds of searches is solved, achieving efficient and accurate multi-hop reasoning Q&A.
Patent Information
- Application Number
- CN202510727465.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-08-12
AI Technical Summary
Existing large models may retrieve irrelevant or contradictory information during multiple rounds of search, resulting in a decrease in answer accuracy, and relying on large-scale models or artificial annotations to increase computing resources and time costs.
Through multiple iterative question-and-answer methods, the self-evaluation mechanism is used to rewritten prompt words, gradually optimize the reasoning ability of the big model, suppress erroneous reasoning branches, and improve logical consistency and relevance.
It effectively improves the accuracy and efficiency of the answers of the big model in multi-hop reasoning questions and answers, and reduces computing resources and time costs.
Smart Images

Figure CN120470097A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, particularly large language models, intelligent agents, and human-computer interaction. It can be applied to scenarios such as search enhancement generation, content generation, intelligent customer service, and question-and-answering. More specifically, this application provides a large-model-based question-and-answer method, a large-model training method, an apparatus, a large model, an intelligent agent, an electronic device, a storage medium, and a program product. Background Art
[0002] With the continuous development of artificial intelligence technology, large models have made significant progress in natural language processing in recent years. For example, large models can interact with users and respond based on their input. When processing complex problems, large models may involve complex reasoning and associations between multiple entities and relationships, requiring the integration of multiple continuous information. Summary of the Invention
[0003] This application provides a question-answering method based on a large model, a training method for a large model, an apparatus, a large model, an intelligent agent, an electronic device, a storage medium, and a program product.
[0004] According to one aspect of the present application, a question-answering method based on a big model is provided, comprising: receiving task description information to be answered; performing multiple rounds of iterative question-answering based on the task description information using the big model until task answer information that passes the big model evaluation is output; wherein any round of iteration comprises: using a first prompt word to guide the big model to decompose the task description information to obtain candidate question-answer pairs, the candidate question-answer pairs including the subtasks and answers decomposed in the current round; if the candidate question-answer pair fails the big model evaluation, rewriting the first prompt word based on the candidate question-answer pair and its evaluation result to guide the big model to regenerate the candidate question-answer pair until a target question-answer pair that passes the big model evaluation is obtained, the target question-answer pair being related to the task answer information.
[0005] According to another aspect of the present application, a training method for a large model is provided, including: obtaining description information of a task sample to be answered; performing multiple rounds of iterative question and answering based on the task sample description information using the large model to be trained, until outputting task sample answer information that passes the evaluation of the large model; wherein, any round of iteration includes: using a first prompt word to guide the large model to decompose the task sample description information to obtain candidate question and answer pairs, the candidate question and answer pairs including the sub-questions and answers decomposed in the current round; if the candidate question and answer pairs fail the evaluation of the large model, rewriting the first prompt word based on the candidate question and answer pairs and their evaluation results to guide the large model to regenerate the candidate question and answer pairs until a target question and answer pair that passes the evaluation of the large model is obtained, the target question and answer pair being related to the task answer information; and adjusting the parameters of the large model based on the iterative data involved in the multiple rounds of iterative question and answering.
[0006] According to another aspect of the present application, a question-answering device based on a large model is provided, including: an information receiving module for receiving task description information to be answered; a first iteration module for using the large model to perform multiple rounds of iterative question-answering based on the task description information until task answer information that passes the evaluation of the large model is output; wherein, any round of iteration includes: using a first prompt word to guide the large model to decompose the task description information to obtain candidate question-answer pairs, and the candidate question-answer pairs include sub-questions and answers decomposed in the current round; if the candidate question-answer pair fails to pass the evaluation of the large model, rewriting the first prompt word based on the candidate question-answer pair and its evaluation result to guide the large model to regenerate the candidate question-answer pair until a target question-answer pair that passes the evaluation of the large model is obtained, and the target question-answer pair is related to the task answer information.
[0007] According to another aspect of the present application, a training device for a large model is provided, including: a sample acquisition module for acquiring task sample description information to be answered; a second iteration module for using the large model to be trained to perform multiple rounds of iterative question and answer based on the task sample description information until task sample answer information that passes the large model evaluation is output; wherein, any round of iteration includes: using a first prompt word to guide the large model to decompose the task sample description information to obtain candidate question and answer pairs, and the candidate question and answer pairs include the sub-questions and answers decomposed in the current round; if the candidate question and answer pairs fail the large model evaluation, rewriting the first prompt word based on the candidate question and answer pairs and their evaluation results to guide the large model to regenerate the candidate question and answer pairs until a target question and answer pair that passes the large model evaluation is obtained, and the target question and answer pair is related to the task answer information; a parameter adjustment module for adjusting the parameters of the large model based on the iterative data involved in multiple rounds of iterative question and answer.
[0008] According to another aspect of the present application, a large model is provided, including a computer program, which implements the question-answering method provided according to the embodiment of the present application when executed by a processor.
[0009] According to another aspect of the present application, an intelligent agent is provided, including an input module for receiving input information; a processing module for obtaining output information by calling a large model to execute the question-answering method provided according to an embodiment of the present application based on the input information received by the input module; and an output module for outputting the output information obtained by the processing module.
[0010] According to another aspect of the present application, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so as to enable the at least one processor to execute the question-answering method or training method provided according to an embodiment of the present application.
[0011] According to another aspect of the present application, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the question-answering method or training method provided according to the present application.
[0012] According to another aspect of the present application, a computer program product is provided, including a computer program, which implements the question-answering method or training method provided according to the present application when executed by a processor.
[0013] 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 application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present application; wherein:
[0015] Figure 1 is a schematic diagram of an exemplary system architecture in which the various methods and devices described herein may be implemented according to one embodiment of the present application;
[0016] Figure 2 is a flowchart of a large model-based question-answering method according to an embodiment of the present application;
[0017] Figure 3 is a schematic diagram of constructing candidate question-answer pairs for the current round according to an embodiment of the present application;
[0018] Figure 4 is a schematic diagram of rewriting the first prompt word according to an embodiment of the present application;
[0019] Figure 5 is a schematic diagram of outputting task reply information according to an embodiment of the present application;
[0020] Figure 6 is a schematic flow chart of a large model training method according to an embodiment of the present application;
[0021] Figure 7 is a schematic flow chart of a closed loop of the inference phase and the training phase according to an embodiment of the present application;
[0022] Figure 8 is a block diagram of a large model-based question-answering device according to an embodiment of the present application;
[0023] Figure 9 is a block diagram of a large model training device according to an embodiment of the present application;
[0024] Figure 10Schematically shows a structural block diagram of an artificial intelligence agent according to an embodiment of the present application; and
[0025] Figure 11 A schematic block diagram of an example electronic device that can be used to implement embodiments of the present application is shown. DETAILED DESCRIPTION
[0026] The following description of exemplary embodiments of the present application is made in conjunction with the accompanying drawings, including various details of the embodiments of the present application 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 application. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0027] In the technical solution of this application, the user information involved (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, application and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0028] For example, Multi-Hop Question Answering (MHQA) methods typically use methods such as Retrieval-Augmented Generation (RAG) or Chain-of-Thought to retrieve evidence from multiple documents and generate answers. However, irrelevant or contradictory information may be retrieved during multiple rounds of retrieval, causing large models to incorrectly integrate or utilize evidence, affecting the accuracy of the final answer. Sub-questions generated during the reasoning process may deviate from the original question intent, resulting in incoherent or erroneous reasoning chains. Improving accuracy often relies on large-scale models or manual annotation, which introduces additional computing resources and time costs, reducing application efficiency.
[0029] Some technical terms involved in this application are explained as follows:
[0030] Multi-Hop Question Answering (MHQA) tasks: complex question answering tasks that require integrating multiple sequential pieces of information to arrive at an answer through multi-step reasoning and associations across multiple entities and relations.
[0031] Multi-hop problems: These are problems that cannot be directly obtained through a single search and require relying on multiple reasoning steps to achieve a logically coherent reasoning path, thereby integrating multiple continuous information to form a chain of evidence to deduce the final answer.
[0032] Large model: refers to a deep learning model with large-scale model parameters. Large models usually contain billions, tens of billions, hundreds of billions, trillions, or even more than ten trillion model parameters. Large models may include large-scale language models (LLM), GPT (Generative Pre-trained Transformer), large visual models, multimodal large models, and so on. The large model involved in the embodiments of the present application may be a general large model, or it may be an expert large model obtained after fine-tuning (Fine Tune) based on demand, and the embodiments of the present application do not limit this;
[0033] Intelligent agent: A system or entity that can autonomously perceive its environment, make decisions, and execute actions to complete a specific task. Large models can provide decision support for intelligent agents, empowering them with reasoning, analysis, and task planning capabilities. Intelligent agents leverage the analytical results of large models to execute or optimize their decision-making processes. Intelligent agents can integrate multiple large models to handle different types of tasks.
[0034] Prompt: It is an input instruction or context design used in human-computer interaction to guide the large model to generate specific output. Its core function is to constrain the response range and reasoning path of the large model through structured language.
[0035] Retrieval Augmented Generation (RAG): refers to the process of enhancing the input of a large model by combining information retrieval technology with more reference information from external knowledge bases or indexes on the basis of a large model, ultimately generating more accurate and richer answers or content.
[0036] Chain-of-Thought (CoT) is a technical paradigm that guides large language models to explicitly generate intermediate reasoning steps. By simulating the human thought process of step-by-step deduction, it breaks down complex problems into logically coherent sequential sub-steps and displays the complete chain of reasoning before generating the final answer.
[0037] Multi-round iterative question answering: A multi-round question answering process is constructed through the self-iterative mechanism of the large model. For example, the large model dynamically generates and evaluates subtasks and sub-answers in each round. A complete reasoning chain is gradually constructed through a continuous feedback loop, rather than statically dividing the task sequence in advance. The reasoning path is adaptively adjusted to effectively avoid logical gaps or error accumulation caused by a single decomposition.
[0038] Problem decomposition: This involves breaking down the task into subtasks in each round, and combining multiple rounds of iterations to decompose the task description information into multiple logically continuous subtasks, so that task response information can be obtained based on multiple sub-answers.
[0039] Multi-objective joint optimization: During large model training, a unified framework simultaneously optimizes multiple training tasks, constructing objective functions based on the multiple loss functions of each training task to adjust model parameters. In some embodiments, dynamic trade-off strategies (such as weight allocation, gradient coordination, or Pareto optimality) can be used to achieve synergistic enhancement of the objectives of each training task (constrained by the corresponding loss functions), rather than simple linear superposition.
[0040] Task description information: may include information in one or more modes such as text, voice, or video that describes the task content.
[0041] The embodiments of the present application provide a large-scale model-based question-answering method that implements iterations between multiple rounds and within the same round through the large-scale model's self-assessment mechanism. During the iteration process within the same round, prompt words can be rewritten based on the results of the self-assessment to calibrate the output of the current round, providing a clear guide for subsequent reasoning. This facilitates the automatic discovery of accurate iteration paths during multiple rounds of iterations, continuously optimizes the large-scale model's reasoning capabilities, relies on the large-scale model's own capabilities to effectively suppress erroneous reasoning branches, and improves the logical consistency and relevance of the reasoning process.
[0042] The technical solutions provided by this application will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0043] Figure 1 is a schematic diagram of an exemplary system architecture in which the various methods and devices described herein may be implemented according to an embodiment of the present application.
[0044] It should be noted that Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present application can be applied, to help those skilled in the art understand the technical content of the present application, but does not mean that the embodiments of the present application cannot be used in other devices, systems, environments or scenarios.
[0045] like Figure 1 As shown, the system architecture 100 according to this embodiment may include a terminal device 102, a network 103, and a server 104. The network 103 is used to provide a medium for a communication link between the terminal device 102 and the server 104. The network 103 may include various connection types, such as wired and / or wireless communication links, etc.
[0046] A user can use a terminal device 102 to interact with a server 104 via a network 103. The user can send task description information 101 through the interactive interface provided by the terminal device 102. The terminal device 102 can then send the task description information 101 to the server 104 via the network 103. The server 104 then calls the large model (or agent) to process the task description information 101 and output task response information 105. The server then sends the task response information 105 to the terminal device 102, which then displays the task response information 105 to the user.
[0047] Various communication client applications may be installed on the terminal device 102, such as intelligent assistant applications, knowledge reading applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software (for example only). A user may enter task description information 101 in the interactive interface of these client applications, and these client applications will display generated task response information 105 to the user.
[0048] For example, the terminal device 102 can be installed with a small model with a model parameter volume of about 7 billion to 14 billion. The small model refers to a large model with relatively small model parameters, such as a large-scale language model (LLM), GPT (Generative Pre-trained Transformer), a large visual model, a large multimodal model, etc. The small model is deployed locally on the terminal device 102, so that the user can send task description information 101 through the interactive interface provided by the terminal device 102. The terminal device 102 can execute the question-and-answer method provided in the embodiment of the present application, and process the task description information 101 by calling the small model (or an intelligent agent built locally based on the small model) and output task response information 105.
[0049] The terminal device 102 can be configured as various electronic devices with a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, etc.
[0050] Server 104 can be a server that provides various services, such as a backend management server (for example only) that supports content viewed by users through the interactive interface of terminal device 102. The backend management server can invoke an agent to perform data queries in response to received query requests, and feed the query results back to terminal device 102, displaying them through the interactive interface. For example, server 104 can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud computing, network services, and middleware services.
[0051] It should be noted that the large model-based question-answering method provided in the embodiment of the present application can generally be executed by the server 104. Accordingly, the large model-based question-answering device provided in the embodiment of the present application can also be set in the server 104. The large model-based question-answering method provided in the embodiment of the present application can also be executed by a server or server cluster that is different from the server 104 and can communicate with the terminal device 102 and / or the server 104. Accordingly, the large model-based question-answering device provided in the embodiment of the present application can also be set in a server or server cluster that is different from the server 104 and can communicate with the terminal device 102 and / or the server 104.
[0052] Alternatively, the large model-based question-answering method provided in the embodiment of the present application can also be generally executed by the terminal device 102. Accordingly, the large model-based question-answering device provided in the embodiment of the present application can generally be set in the terminal device 102.
[0053] It should be understood that Figure 1 The number of terminal devices and servers in the embodiment is merely illustrative. Any number of terminal devices and servers may be used as required.
[0054] Figure 2 It is a flowchart of a question-answering method based on a large model according to an embodiment of the present application.
[0055] like Figure 2 As shown, the method 200 may include:
[0056] In operation S210 , task description information to be replied is received.
[0057] For example, it can receive information input by the user, or it can receive information sent by a terminal device or server based on manual operation, event triggering, or scheduled tasks. For example, task description information can be information about a question raised by the user, and question information can be a query, question, or requirement raised by the user. Question information can be in the form of text or other modalities such as voice and image data.
[0058] In operation S220 , multiple rounds of iterative question-answering are performed based on the task description information using the large model until task answer information that passes the evaluation of the large model is output.
[0059] For example, large models can include models with billions, tens of billions, hundreds of billions, trillions, or even tens of trillions of model parameters, or smaller models (e.g., deployed locally on a terminal device) with tens of millions, hundreds of millions, or even billions of model parameters. Through multiple rounds of iterative question-and-answering, complex multi-hop problems can be gradually broken down into a series of subtasks. Based on a self-evolutionary mechanism, a correct reasoning process can be gradually evolved through self-exploration. For example, user Xiao K asks Company A's intelligent office assistant, "Can you help me retrieve my social security contributions from XX years ago while I worked at Company A?" (i.e., the task description)? This task description is a multi-hop problem. The intelligent office assistant uses the large model to conduct multiple rounds of iterative question-and-answering. This multi-hop problem can be broken down into the following sub-problems: Q1: Identify basic information such as the relevant entities (Xiao K, Company A), the time point (XX years ago), or the location of insurance (Company A's registered place); Q2: Query Xiao K's social security card number from Company A's system; Q3: Obtain Xiao K's insurance record from the relevant social security system; Q4: Query Xiao K's social security contribution base from Company A's system.
[0060] Among them, any round of iteration includes:
[0061] In operation S221, the first prompt word is used to guide the large model to decompose the task description information to obtain candidate question-answer pairs, which include subtasks and answers decomposed in the current round.
[0062] The first prompt can be used to guide the large model in executing problem decomposition instructions and answer generation instructions. For example, for the first problem decomposition in each iteration, a pre-set first prompt template can be used, such as "Please follow the steps below to process {task description information}, decompose the problem according to XX basis, reasoning rules, or thinking framework; according to {subtask}, query reference information from XX database and generate the answer."
[0063] Specifically, problem decomposition instructions can provide constraints for the decomposition of task descriptions, such as the selection of target answer pairs output in the previous round, decomposition rationale, reasoning rules, and thinking frameworks, simplifying complex task descriptions into manageable subtasks. Answer generation instructions can also be used to provide constraints for answer generation and specify reference information sources for answer generation.
[0064] Acquiring reference information can be achieved using a Retrieval Augmented Generation (RAG) approach. The RAG process involves first retrieving reference information from an external knowledge base. Based on this information and subtasks, the large model organizes, analyzes, and extracts this information to generate or infer the answer. The external knowledge base can include relevant knowledge and information related to the question, including but not limited to background knowledge, contextual information, historical conversation records, relevant documents, images, tables, videos, or database entries, to help the large model better understand and answer the question.
[0065] It can be understood that the problem decomposition in this embodiment is not like chain reasoning that decomposes the task description information into multiple logically continuous sub-tasks at one time, but gradually uses the large model to generate the decomposed sub-tasks and sub-answers for each iteration round through multiple rounds of iteration, thereby obtaining a reasoning chain and maintaining the correct iteration path.
[0066] In operation S222, the candidate question-answer pair is re-entered into the large model, and the large model's evaluation results are obtained to determine whether it passes the evaluation. If so, the next round of iteration is entered or the task response information is output. If not, operation S223 is executed.
[0067] In operation S223, if the candidate question and answer pair fails to pass the evaluation of the big model, the first prompt word is rewritten based on the candidate question and answer pair and its evaluation results to guide the big model to regenerate the candidate question and answer pair until a target question and answer pair that passes the evaluation of the big model is obtained, and the target question and answer pair is related to the task response information.
[0068] The large model can be used to evaluate candidate question-answer pairs on one or more dimensions, such as the accuracy of the answer, the relevance to the task description information, and the correlation with the target question-answer pair output in the previous round.
[0069] For example, the large model can evaluate whether candidate question-answer pairs meet expected conditions, and the generated evaluation results include the reasons for non-compliance. For example, whether the candidate pairs introduce erroneous information or are irrelevant to the task description; whether the candidate pairs are incomplete or have lost relevant information; and whether the candidate pairs are repeated or inconsistent with the target question-answer pairs output in the previous round. The reasons for non-compliance allow the large model to learn about the shortcomings of the candidate question-answer pairs, allowing for targeted corrections to the first prompt word. This guides the large model to regenerate candidate question-answer pairs while avoiding the same issues, and continuously optimizes over and over again, completing iterations within the same round.
[0070] According to the embodiments of the present application, iterations between multiple rounds and within the same round are achieved through the self-assessment mechanism of the large model. Specifically, during the iteration process within the same round, prompt words can be rewritten based on the results of the self-assessment to calibrate the output of the current round, providing a clear guide for subsequent reasoning. This facilitates the automatic discovery of accurate iteration paths during multiple rounds of iterations, enabling the continuous optimization of the large model's reasoning capabilities, effectively suppressing erroneous reasoning branches based on the large model's own capabilities, and improving the logical consistency and relevance of the reasoning process.
[0071] Figure 3 This is a schematic diagram of constructing candidate question-answer pairs for the current round according to an embodiment of the present application.
[0072] Reference Figure 3 In some embodiments, using the first prompt word to guide the big model 310 to decompose the task description information into questions to obtain candidate question-answer pairs includes: using the first prompt word to guide the big model 310 to decompose the task description information into questions based on at least one target question-answer pair output in the previous round to obtain subtasks of the current round, and there is a logical relationship between the subtasks and at least one target question-answer pair output in the previous round; using the big model 310 to process the subtasks of the current round to obtain candidate sub-answers of the current round; and constructing candidate question-answer pairs based on the subtasks and the candidate sub-answers.
[0073] Among them, having a logical relationship includes: the large model 310 can identify that there is an identifiable or deducible association between the subtask of the current round and at least one target question-answer pair output in the previous round, thereby constraining the content of the subtask, so that the problem decomposition process between different rounds conforms to the reasoning logic around the task description information.
[0074] Logical relationships may include one or more of causal relationships, conditional relationships, dependent relationships, and supplementary relationships, and the first prompt word may include prompt information of these logical relationships. For example, the causal relationship includes that the target question-answer pair in the previous round is the direct cause of the subtask in the current round, and the content of the subtask is triggered by the answer to the question-answer pair in the previous round. The conditional relationship includes that the target question-answer pair in the previous round is the constraint condition set for the subtask in the current round, and the content of the subtask satisfies the further reasoning of the condition. The dependency relationship includes that the subtask in the current round is based on the information of the target question-answer pair in the previous round, and the content of the subtask depends on the details of the answer in the previous round. The supplementary relationship includes that the target question-answer pair in the previous round does not cover all the requirements indicated by the task description information, and the subtask in the current round is used to supplement the unmentioned details.
[0075] In each iteration, the large model 310 generates subtasks for the current round based on existing iteration data (e.g., one or more target question-answer pairs output in the previous round) and inputs these subtasks into the large model to obtain sub-answers. As the iterations progress, the question-answering process of the current round becomes associated with the iteration data. For example, the correct iteration path can be constructed by using the logical relationships between the outputs of different iterations.
[0076] According to an embodiment of the present application, the target question-answer pair of the previous round is introduced to enable the large model to optimize the problem decomposition of the current round based on logical relationships, which can provide logical context constraints and improve the coherence and pertinence of the problem decomposition.
[0077] Figure 4 2 is a schematic diagram of rewriting the first prompt word according to an embodiment of the present application.
[0078] Reference Figure 4 In some embodiments, rewriting the first prompt word based on the candidate question-answer pairs and their evaluation results includes: obtaining reasoning prompt information based on at least one target question-answer pair output in the previous round; obtaining improved prompt information based on at least one candidate question-answer pair and the reason for failure in the evaluation; and inputting the first prompt word, the reasoning prompt information, and the improved prompt information into the large model 410 to generate a rewritten first prompt word.
[0079] Reasoning hints are used to constrain the main model 410 to extract hints that guide its logical deduction based on the target question-answer pair from the previous round, ensuring that the rewritten first hint reflects the aforementioned logical relationship. Improvement hints include targeted improvement directions generated based on the specific reasons why the candidate question-answer pair failed the evaluation, allowing the main model 410 to address the reasons for failure the next time it is generated.
[0080] According to the embodiments of the present application, by integrating multi-dimensional prompt information into the input, the large model 410 is guided to integrate the continuity and improvement direction of cross-round reasoning while retaining the core intent of the previous version of the prompt word, thus achieving optimized iteration of the prompt word. As a result, the rewritten prompt word can more accurately guide the large model 410 to rebuild the reasoning process and generate the expected question-answer pairs.
[0081] In some embodiments, based on the data of the previous round of completed iterative reasoning, at least one target question-answer pair output in the previous round that is related to the candidate question-answer pair is screened out; the second prompt word is used to guide the large model 410 to output the evaluation results for the candidate question-answer pair based on the task description information, the logical relationship between at least one target question-answer pair output in the previous round and the candidate question-answer pair.
[0082] The data from the previous round of completed iterative reasoning can include each target question-answer pair from the previous round, as well as records of the reasoning process (such as the deep thinking process of question decomposition and answer generation in large model 410), and reference information obtained through RAG, which is used by large model 410 as a reference to generate target question-answer pairs. The screening operation is used to obtain target question-answer pairs from the previous round that are related to the candidate question-answer pairs. For example, the degree of relevance is determined based on the similarity of at least one of the logical relationship, the reasoning process record of the current round, and the reference information, providing a logical basis for evaluation.
[0083] For example, the second prompt might include "Based on the {task description information}, analyze the {logical relationship} between the {candidate question-answer pair} and the {target question-answer pair}, evaluate whether the {candidate question-answer pair} meets the expected conditions, and output the evaluation result." Expected conditions can include accuracy assessments based on whether the answer is accurate and consistent with the actual situation. Completeness assessments can be performed by checking whether the answer covers the expected content and whether important information is omitted. Logic assessments can be performed by checking whether the candidate question-answer pair logically aligns with the target question-answer pair from the previous round.
[0084] According to an embodiment of the present application, by screening relevant target question-answer pairs, the amount of data input into the large model 410 can be reduced, and the second prompt word can be used to guide the large model 410 to achieve accurate evaluation from the overall reasoning logic.
[0085] In some embodiments, using the first prompt word to guide the large model 410 to decompose the task description information to obtain candidate question-answer pairs includes: using the first prompt word to guide the large model 410 to decompose the task description information based on at least one target question-answer pair output in the previous round to obtain multiple sub-tasks for the current round, and the multiple sub-tasks have a logical relationship with at least one target question-answer pair output in the previous round; using the large model 410 to process the multiple sub-tasks to obtain multiple candidate sub-answers for the current round; constructing multiple candidate question-answer pairs based on the multiple sub-tasks and the multiple candidate sub-answers; wherein the first prompt word includes multiple prompt information respectively used for the multiple candidate question-answer pairs, and the multiple prompt information is used to guide the large model 410 to decompose multiple sub-tasks and generate multiple sub-answers.
[0086] For example, the prompt information can include semantic and grammatical analysis of the task description information, and include the type and range of required answers, etc. Multiple prompt information can be used to construct the problem decomposition process and answer framework based on the preset intention of capturing the question, the type and range of required answers, etc.
[0087] According to an embodiment of the present application, the large model 410 can generate multiple subtasks and multiple sub-answers from different dimensions through the guidance of multiple prompt information, which can improve the generation efficiency of the large model 410 in the current iteration.
[0088] In some embodiments, it also includes: when multiple candidate question-answer pairs fail to pass the evaluation of the big model 410, rewriting the first prompt word based on the multiple candidate question-answer pairs and their respective evaluation results; or, when at least two of the multiple candidate question-answer pairs pass the evaluation of the big model 410, determining the target question-answer pair of the current round based on the evaluation results of the at least two candidate question-answer pairs.
[0089] For example, the large model 410 can be used to score multiple candidate question-answer pairs. If the score is greater than or equal to a certain threshold, the evaluation is passed. If at least two candidate question-answer pairs pass the evaluation, the candidate question-answer pair with the highest score is selected as the target question-answer pair.
[0090] According to an embodiment of the present application, when all candidate question-answer pairs fail the evaluation, the specific evaluation results of each candidate question-answer pair can be used to identify multiple reasons from multiple dimensions to comprehensively rewrite the first prompt word, effectively repairing defects in multiple dimensions and improving iteration efficiency within the same round. In addition, when there are multiple candidate question-answer pairs that pass the evaluation, the higher-quality one is selected based on the evaluation results, thereby improving the reliability of the question and answer.
[0091] In some embodiments, commonalities and complementary information can be extracted from at least two candidate question-answer pairs that have passed the evaluation to generate a target question-answer pair with more comprehensive coverage.
[0092] Figure 5 2 is a schematic diagram of outputting task response information according to an embodiment of the present application.
[0093] In some embodiments, it also includes: updating the target question and answer pair of the current round to the iterative path, the iterative path is determined according to the iterative round relationship of at least one target question and answer pair in the previous round; when the comprehensive score of the updated iterative path is greater than or equal to a first preset value, outputting the task response information, wherein the comprehensive score is obtained according to the evaluation score of the large model on each target question and answer pair in the updated iterative path.
[0094] The iterative round relationship includes the sequential relationship between each round of iteration. Through multiple rounds of self-exploration and self-verification of the large model, the iterative path can represent the reasoning process for the task description information and illustrate the process of integrating evidence and constructing a reasonable reasoning chain.
[0095] like Figure 5As shown, "F" represents an evaluation failure, and "T" represents an evaluation success. In the tth round, if the candidate question-answer pair 511 fails the evaluation, the first prompt word is rewritten to guide the large model to regenerate the target question-answer pair 512 (evaluation success). Then, based on the target question-answer pair 512 in the tth round, the iteration enters the t+1th round. Among them, if the candidate question-answer pair 521 fails the evaluation, the first prompt word is rewritten to guide the large model to regenerate the candidate question-answer pair 523. If the candidate question-answer pair 523 fails the evaluation, the first prompt word is continued to be rewritten (for example, the reasons for the non-compliance of the candidate question-answer pair 521 and the candidate question-answer pair 523 are repaired) to guide the large model to regenerate the target question-answer pair 522 (evaluation success). Based on the target question-answer pair 522, the iteration enters the t+2th round, and the first prompt word is used to guide the large model to generate the target question-answer pair 531 (evaluation success).
[0096] For example, the first prompt word at the beginning of each iteration can be consistent, or can be obtained based on the first prompt word corresponding to the target question-answer pair in the previous round. For example, the first prompt word at the beginning of round t+1 is obtained based on the first prompt word corresponding to the target question-answer pair 512 in round t, and the first prompt word at the beginning of round t+2 can be obtained based on the first prompt word corresponding to the target question-answer pair 522 in round t+1. For the iteration of the first prompt word between multiple rounds and within the same round, the large model is automatically guided and constrained to discover the accurate iteration path.
[0097] According to the embodiments of the present application, a comprehensive score based on the iterative path is used to perform a global evaluation of the entire reasoning chain, effectively improving the reliability of task response information. Furthermore, when the iterative path score meets the target, the response is output in a timely manner, allowing for a timely stop to avoid wasting resources.
[0098] Figure 6 It is a schematic flowchart of a large model training method according to an embodiment of the present application.
[0099] like Figure 6 As shown, the training method of the large model of this embodiment includes:
[0100] In operation S610 , description information of a task sample to be answered is obtained.
[0101] In operation S620, multiple rounds of iterative question-answering are performed based on the task sample description information using the large model to be trained until task sample answer information that passes the evaluation of the large model is output.
[0102] Among them, any round of iteration includes:
[0103] In operation S621, the first prompt word is used to guide the large model to decompose the task sample description information to obtain candidate question-answer pairs, where the candidate question-answer pairs include the sub-questions and answers decomposed in the current round.
[0104] In operation S622, if the candidate question-answer pair fails to pass the evaluation of the big model, the first prompt word is rewritten based on the candidate question-answer pair and its evaluation result to guide the big model to regenerate the candidate question-answer pair until a target question-answer pair that passes the evaluation of the big model is obtained, and the target question-answer pair is related to the task response information.
[0105] In operation S630 , parameters of the large model are adjusted based on the iterative data involved in the multiple rounds of iterative question-answering.
[0106] For example, Figure 6 The task sample description information, task sample response information, first prompt word, evaluation process, etc. in the training phase are the same or similar to the interpretation and processing methods of the above-mentioned large model-based question-answering method in the reasoning phase, only to reflect the differences in the embodiments.
[0107] According to the embodiments of the present application, during the training phase, through iterations between multiple rounds and iterations within the same round, based on the iterative data involved, such as the target question and answer pairs of each round, the reasoning process records, at least one of the reference information obtained through RAG, etc., the large model can learn the accurate iteration path based on the results of self-assessment, effectively suppress erroneous reasoning branches, and improve the logical consistency and relevance of the reasoning process.
[0108] In some embodiments, adjusting the parameters of the large model based on the iterative data involved in multiple rounds of iterative question and answering includes: obtaining a first loss function value based on the question decomposition results and decomposition question labels of the task sample description information in multiple rounds of iterative question and answering, obtaining a second loss function value based on the target question and answer pairs and the target question and answer pair labels in multiple rounds of iterative question and answering, and obtaining a third loss function value based on the evaluation results and evaluation labels in multiple rounds of iterative question and answering; adjusting the parameters of the large model based on the first loss function value, the second loss function value and the third loss function value.
[0109] In some embodiments, adjusting the parameters of the large model based on the iterative data involved in multiple rounds of iterative question and answer includes: obtaining a fourth loss function value based on the reference information and reference information labels retrieved by RAG for the candidate subtasks in the target question and answer pair in the multiple rounds of iterative question and answer, and adjusting the parameters of the large model based on at least one of the first loss function value, the second loss function value, the third loss function value and the fourth loss function value.
[0110] In some embodiments, based on the iterative data involved in multiple rounds of iterative question and answer, adjusting the parameters of the large model includes: obtaining a fifth loss function value based on the target first prompt word and the first prompt word label in the multiple rounds of iterative question and answer, and adjusting the parameters of the large model based on at least one of the first loss function value, the second loss function value, the third loss function value, the fourth loss function value and the fifth loss function value.
[0111] By performing weighted calculation on at least one of the first loss function value, the second loss function value, the third loss function value, the fourth loss function value and the fifth loss function value, a target loss function is obtained to adjust the parameters of the large model.
[0112] For example, the question decomposition results include multiple subtasks of multiple target question-answer pairs output by multiple rounds of iterative question-answering. The first loss function value is used to obtain the comprehensive similarity between the multiple subtasks involved in all rounds of iteration and the multiple decomposed question labels. The loss function value for each round of iteration is obtained based on the similarity between the subtasks and the decomposed question labels, as well as the similarity between the reasoning logic of the multiple subtasks and the reasoning logic of the multiple decomposed question labels. For example, a large model is used to provide a natural language description of the reasoning logic of the multiple subtasks, and also a natural language description of the reasoning logic of the multiple decomposed question labels, and then the similarity between the natural language descriptions is calculated. The second loss function value is obtained based on the comprehensive similarity between the multiple target question-answer pairs and the multiple target question-answer pair labels in the multiple rounds of iterative question-answering. The third loss function value is obtained based on the comprehensive similarity between the multiple evaluation results and the multiple evaluation result labels in the multiple rounds of iterative question-answering. The fourth loss function value is obtained based on the comprehensive similarity between the multiple reference information and the multiple reference information labels in the multiple rounds of iterative question-answering. The fifth loss function value is obtained based on the comprehensive similarity between the multiple target first prompt words and the multiple first prompt word labels in the multiple rounds of iterative question-answering. The above-mentioned comprehensive similarity can be obtained by performing a weighted summation based on the similarity data of each round of iteration.
[0113] The target first prompt word in multiple rounds of iterative question-answering includes the first prompt word corresponding to multiple target question-answer pairs output by the multiple rounds of iterative question-answering. This can be the initial first prompt word in each round or a rewritten prompt word that can output the target question-answer pair. Utilizing the fifth loss function can guide the large model to learn the rewritten first prompt word during the training phase, improving iterative reasoning efficiency.
[0114] According to an embodiment of the present application, the training objectives for one or more of question decomposition, target question-answer pairs, evaluation results, retrieval results, and first prompt words are unified into a joint optimization framework, which can achieve the coordinated improvement of various capabilities.
[0115] Figure 7 It is a schematic flowchart of a closed loop of the inference phase and the training phase according to an embodiment of the present application.
[0116] like Figure 7 As shown, in operation S710, multiple rounds of iterative question answering are performed based on the task description information q0, and question decomposition, retrieval reading and self-assessment are performed in each round.
[0117] For problem decomposition, complex multi-hop problems can be gradually broken down into a series of hierarchical subtasks. In each iteration, the large model generates the subtask subq1 for the current iteration based on the existing iteration data. For example, the input to the large model consists of the task description information q0, the problem decomposition instructions, and the target answer from the previous iteration. The large model then outputs new subtasks subq1 layer by layer through multiple iterations. By fine-grainedly converting the complex problem represented by the task description information into simple subtasks, the logical hierarchy of the problem can be clarified, providing a clear guide for subsequent retrieval and reasoning, thereby effectively reducing reasoning errors caused by decomposition bias.
[0118] For retrieval reading, a retrieval-generation approach is used to obtain reference information for each subtask and generate the corresponding sub-answer suba1. For example, in iteration t, a RAG-based retriever is used to retrieve relevant documents or fragments based on the current subtask. The retrieved reference information, along with the subtask, is then fed into the main model to generate the answer suba1 for that subtask. By fully leveraging information from external knowledge bases, each sub-answer is based on real-world evidence, thereby improving the reliability and accuracy of the answer.
[0119] For self-evaluation, after each round of iterative retrieval and reading, the large model’s own evaluation mechanism is introduced to evaluate the generated candidate question-answer pairs.<subq1,suba1> For example, the large model evaluates the effectiveness of the candidate question-answer pairs.<subq1,suba1> Perform binary evaluation and output binary decision. If it is judged as "valid", the candidate question-answer pair is retained.<subq1,suba1> The algorithm then proceeds to the next round. If the result is deemed invalid, the node is abandoned and the algorithm rewinds to regenerate a new candidate question-answer pair by rewriting the first prompt. This self-checking mechanism promptly filters out irrelevant or misleading target question-answer pairs, improving the logical consistency and relevance of the reasoning chain. This robustness control mechanism effectively suppresses reasoning bias caused by incorrect decomposition or retrieval.
[0120] Through multiple rounds of iterative question-and-answering, a rich chain of evidence can be accumulated, gradually building a complete chain of reasoning. When the model determines that the iterative data (such as the comprehensive score of the iterative path) can answer the task description information q0, it generates a task response information and ends the iteration.
[0121] In operation S720, the data output from each completed iteration is stored in an iterative path, wherein the target answer pair output from each iteration that passes the evaluation of the large model can be used as an inference node of the iterative path to gradually form a complete inference chain.
[0122] At operation S730, the training phase begins, performing multi-objective joint optimization. Through iterative self-exploration, new training data is continuously generated without additional labeling, enhancing the model's ability to generalize to unknown problems. Training fully leverages the internal capabilities of the large model and automatically generated iterative data, reducing reliance on expensive computing power and manual resources. This improves performance while reducing query and inference resource consumption, resulting in lower operating costs.
[0123] In some embodiments, an evaluation value of the target question-answer pair outputted in any round of iteration can be obtained, and the evaluation value represents the quality of the target question-answer pair; the target question-answer pair with an evaluation value greater than or equal to a second preset value is used as a training sample to train the large model.
[0124] For example, the training objectives for the three training tasks—question decomposition, retrieval and reading, and self-assessment—are unified within a joint optimization framework to synergistically improve the large model's processing capabilities for each task. For example, corresponding datasets are constructed for each training task (e.g., question decomposition dataset, retrieval and reading dataset, and self-assessment dataset), and corresponding loss functions are designed for each training task. Then, through multi-objective joint optimization, the loss functions for these three tasks are integrated into a unified objective loss function for model training. This joint training enables the large model to generate more accurate subtasks and sub-answers over multiple rounds of iterative question-answering while continuously strengthening its evaluation capabilities. For example, the large model's stronger question decomposition capabilities can generate more precise sub-questions, thereby improving the accuracy of retrieving reference information and generating sub-answers. Furthermore, its enhanced self-assessment capabilities can help generate more relevant subtasks. Through multi-objective joint optimization, the large model improves its decomposition capabilities, retrieval quality, and logical consistency.
[0125] Through the collaborative work of question decomposition, retrieval reading, and self-assessment (such as combining it with the subsequent rewriting of the first prompt word), incorrect reasoning is gradually corrected in the cycle of self-exploration, and the model capabilities are continuously enhanced through multi-objective optimization training, thus forming a complete question-answering method with a self-evolving mechanism.
[0126] Figure 8 4 is a block diagram of a large model-based question-answering device according to an embodiment of the present application.
[0127] like Figure 8 As shown, the question-answering device 800 may include an information receiving module 810 and a first iteration module 820 .
[0128] The information receiving module 810 may perform operation S210 to receive task description information to be replied.
[0129] The first iterative module 820 may perform operation S220 to perform multiple rounds of iterative question-answering based on the task description information using the large model until task response information that passes the evaluation of the large model is output.
[0130] The first iteration module 820 may include a guiding unit, a judging unit, and a rewriting unit. Each iteration includes:
[0131] The guiding unit may perform operation S221, using the first prompt word to guide the large model to decompose the task description information to obtain candidate question-answer pairs, where the candidate question-answer pairs include sub-questions and answers decomposed in the current round.
[0132] The judgment unit can execute operation S222, and the rewriting unit can execute operation S223. When the candidate question and answer pair fails to pass the evaluation of the big model, the first prompt word is rewritten based on the candidate question and answer pair and its evaluation results to guide the big model to regenerate the candidate question and answer pair until a target question and answer pair that passes the evaluation of the big model is obtained, and the target question and answer pair is related to the task response information.
[0133] In some embodiments, the guidance unit may include a question decomposition sub-unit, an answer generation sub-unit and a question-answer pair construction sub-unit. The question decomposition sub-unit is used to use the first prompt word to guide the large model to decompose the task description information based on at least one target question-answer pair output in the previous round to obtain the sub-tasks of the current round, and there is a logical relationship between the sub-tasks and at least one target question-answer pair output in the previous round; the answer generation sub-unit is used to use the large model to process the sub-tasks of the current round to obtain candidate sub-answers of the current round; the question-answer pair construction sub-unit constructs candidate question-answer pairs based on the sub-tasks and candidate sub-answers.
[0134] In some embodiments, the rewriting unit includes an inference prompt subunit, an improvement prompt subunit, and a rewriting subunit. The inference prompt subunit is configured to obtain inference prompt information based on at least one target question-answer pair output in a previous round; the improvement prompt subunit is configured to obtain improvement prompt information based on at least one candidate question-answer pair and the reason for failure in the evaluation; and the rewriting subunit is configured to input the first prompt word, the inference prompt information, and the improvement prompt information into the large model to generate a rewritten first prompt word.
[0135] In some embodiments, the question-answering device 800 may further include a screening module and an evaluation module. The screening module is used to screen out at least one target question-answer pair output in the previous round that is related to the candidate question-answer pair based on the data of the previous round of completed iterative reasoning; the evaluation module is used to use the second prompt word to guide the large model to output the evaluation result for the candidate question-answer pair based on the task description information, at least one target question-answer pair output in the previous round and the logical relationship between the candidate question-answer pair.
[0136] In some embodiments, the guidance unit may include a multi-question decomposition sub-unit, a multi-answer generation sub-unit and a multi-question-answer pair construction sub-unit. The multi-question decomposition sub-unit is used to use the first prompt word to guide the large model to decompose the task description information based on at least one target question-answer pair output in the previous round to obtain multiple sub-tasks of the current round, and the multiple sub-tasks have a logical relationship with at least one target question-answer pair output in the previous round; the multi-answer generation sub-unit is used to use the large model to process multiple sub-tasks to obtain multiple candidate sub-answers of the current round; the multi-question-answer pair construction sub-unit is used to construct multiple candidate question-answer pairs based on multiple sub-tasks and multiple candidate sub-answers; wherein the first prompt word includes multiple prompt information respectively used for multiple candidate question-answer pairs, and the multiple prompt information is used to guide the large model to decompose multiple sub-tasks and generate multiple sub-answers.
[0137] In some embodiments, when multiple candidate question-answer pairs fail the large model evaluation, the first prompt word is rewritten based on the multiple candidate question-answer pairs and their respective evaluation results; or, when at least two of the multiple candidate question-answer pairs pass the large model evaluation, the target question-answer pair for the current round is determined based on the respective evaluation results of the at least two candidate question-answer pairs.
[0138] In some embodiments, the question-and-answer device 800 may include an update module, a comprehensive scoring module and a reply output module. The update module is used to update the target question-and-answer pair of the current round to the iterative path, and the iterative path is determined according to the iterative round relationship of at least one target question-and-answer pair in the previous round; the comprehensive scoring module is used to obtain the comprehensive score of the updated iterative path; the reply output module is used to output task reply information when the comprehensive score of the updated iterative path is greater than or equal to a first preset value, wherein the comprehensive score is obtained based on the evaluation score of each target question-and-answer pair in the updated iterative path by the large model.
[0139] In some embodiments, the question-answering device 800 may include an evaluation value module and a training module. The evaluation value module is used to obtain the evaluation value of the target question-answer pair outputted by any round of iteration, and the evaluation value represents the quality of the target question-answer pair; the training module is used to use the target question-answer pair whose evaluation value is greater than or equal to a second preset value as a training sample to train the large model.
[0140] Figure 9 It is a block diagram of a large model training device according to an embodiment of the present application.
[0141] like Figure 9 As shown, the question-answering device 900 may include a sample acquisition module 910 and a second iteration module 920 .
[0142] The sample acquisition module 910 may perform operation S610 to acquire description information of a task sample to be answered.
[0143] The second iterative module 920 can perform operation S620 to perform multiple rounds of iterative question and answer based on the task sample description information using the large model to be trained until task sample response information that passes the large model evaluation is output.
[0144] The second iteration module 920 may include a training phase guiding unit, a training phase judging unit, and a training phase rewriting unit. Each iteration includes:
[0145] The training phase guiding unit may perform operation S621 for using the first prompt word to guide the large model to decompose the task sample description information to obtain candidate question-answer pairs, where the candidate question-answer pairs include the sub-questions and answers decomposed in the current round.
[0146] The training stage judgment unit can execute operation S622, and the training stage rewriting unit can execute operation S623, which is used to rewrite the first prompt word based on the candidate question and answer pair and its evaluation results when the candidate question and answer pair fails to pass the large model evaluation, so as to guide the large model to regenerate the candidate question and answer pair until the target question and answer pair that passes the large model evaluation is obtained, and the target question and answer pair is related to the task response information.
[0147] The parameter adjustment module 930 may perform operation S630 to adjust the parameters of the large model based on iterative data involved in multiple rounds of iterative question-answering.
[0148] In some embodiments, the parameter adjustment module 930 is also used to obtain a first loss function value based on the question decomposition results and decomposition question labels of the task sample description information in multiple rounds of iterative question and answer, obtain a second loss function value based on the target question and answer pairs and the target question and answer pair labels in multiple rounds of iterative question and answer, and obtain a third loss function value based on the evaluation results and evaluation labels in multiple rounds of iterative question and answer; adjust the parameters of the large model based on the first loss function value, the second loss function value and the third loss function value.
[0149] For the parts not mentioned in the apparatus part, they can be understood with reference to the various embodiments of the above-mentioned method. That is, the apparatus part includes modules for executing the various steps of any one of the method embodiments described above. In addition, the implementation methods, technical problems solved, functions achieved, and technical effects achieved of each module / unit / subunit, etc. in the apparatus part embodiment are respectively the same or similar to the implementation methods, technical problems solved, functions achieved, and technical effects achieved of each corresponding step in the method part embodiment, and will not be repeated here.
[0150] Figure 10 The structural block diagram of an artificial intelligence agent according to an embodiment of the present application is schematically shown.
[0151] In the embodiments of the present application, inspired by the von Neumann structure in modern computer theory, such as Figure 10 As shown, the AI agent 1000 may include five core modules: an input module 1010 , a control module 1020 , a storage module 1030 , a calculation module 1040 and an output module 1050 .
[0152] Input module 1010 is responsible for receiving or sensing information such as queries, requests, instructions, signals, or data from the outside world (e.g., users or the external environment) and converting it into a format that AI agent 1000 can understand and process. Input module 1010 is the primary link for AI agent 1000 to interact with the outside world. It enables AI agent 1000 to efficiently and accurately obtain necessary "sensory" information from the outside world and respond to this information.
[0153] In an example, the input module 1010 can input task description information.
[0154] In this example, the control module 1020 is the core support for the AI agent 1000 to handle complex tasks. The control module 1020 can execute the question-answering method described above.
[0155] In the example, the control module 1020 will continuously interact with the storage module 1030, the computing module 1040, and / or the output module 1050 during operation. However, it should be noted that in the embodiment of the present application, the control module 1020 acts as a single initiator to initiate communication with the storage module 1030, the computing module 1040, and / or the output module 1050, and there is no communication coupling between the storage module 1030, the computing module 1040, and the output module 1050.
[0156] In this example, the performance of control module 1020 may be closely related to the large model underlying AI agent 1000. To fully leverage the capabilities of the large language model, the internal structure of control module 1020 may be designed to be highly configurable and extensible to handle a variety of different tasks and requirements in real-world scenarios.
[0157] The storage module 1030 can be responsible for memorizing information such as iterative data during the multiple rounds of iterative question-answering. The aforementioned prompt words, iterative paths, target question-answer pairs, reasoning process records, reference information, and evidence chains can be included in the storage module 1030.
[0158] In this example, after receiving input, AI agent 1000 can use the large model to determine multiple rounds of iterative question-answering. AI agent 1000 can retrieve relevant reference information and prompt words from storage module 1030 and feed them back to control module 1020. Control module 1020 can then use the fed-back data to invoke the large model to obtain candidate question-answer pairs, invoke the large model for self-evaluation, and ultimately obtain the target question-answer pair. The result is then passed to output module 1050.
[0159] The computation module 1040 can be viewed as a predefined tool library. While large language models possess excellent language understanding and generation capabilities, they, like humans, are limited in the tasks they can perform without the aid of tools. However, once the AI agent 1000 is empowered with the ability to invoke tools, it can accomplish a wide range of tasks.
[0160] In an example, the output module 1050 may output candidate question-answer pairs, target question-answer pairs, or task answer information.
[0161] The AI agent 1000 according to the embodiment of the present application can simply and effectively improve the level of intelligence, and enhance flexibility and versatility.
[0162] According to embodiments of the present application, the present application also provides a large model, an electronic device, a readable storage medium and a computer program product.
[0163] According to an embodiment of the present application, an electronic device includes: at least one processor; and 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 so that the at least one processor can execute the above method.
[0164] According to an embodiment of the present application, a non-transitory computer-readable storage medium stores computer instructions, wherein the computer instructions are used to enable a computer to execute the above method.
[0165] According to an embodiment of the present application, a computer program product includes a computer program, and the computer program implements the above method when executed by a processor.
[0166] According to an embodiment of the present application, the large model includes a computer program, and the computer program implements the above method when executed by a processor.
[0167] Figure 11 A schematic block diagram of an example electronic device 1100 that can be used to implement embodiments of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, 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 application described and / or claimed herein.
[0168] like Figure 11 As shown, electronic device 1100 includes a computing unit 1101, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1102 or a computer program loaded from a storage unit 1108 into a random access memory (RAM) 1103. RAM 1103 may also store various programs and data required for the operation of device 800. Computing unit 1101, ROM 1102, and RAM 1103 are connected to each other via bus 804. An input / output (I / O) interface 1105 is also connected to bus 1104.
[0169] Multiple components in the electronic device 1100 are connected to the I / O interface 1105, including an input unit 1106, such as a keyboard, a mouse, etc.; an output unit 1107, such as various types of displays, speakers, etc.; a storage unit 1108, such as a magnetic disk, an optical disk, etc.; and a communication unit 1109, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1109 allows the electronic device 1100 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0170] The computing unit 1101 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the computing unit 1101 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as the large model-based search method. For example, in some embodiments, the large model-based search method can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the large model-based search method described above can be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to execute the agent-based data processing method in any other appropriate manner (eg, by means of firmware).
[0171] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-a-chip systems (SOCs), complex programmable logic devices (CPLDs), 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.
[0172] The program code for implementing the methods of the present application can be written in any combination of one or more programming languages. Such program code 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 charts and / or block diagrams 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.
[0173] In the context of this application, 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, apparatus, or device, 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, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fibers, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0174] 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).
[0175] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user 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 back-end components, middleware components, or front-end 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 a local area network (LAN), a wide area network (WAN), and the Internet.
[0176] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.
[0177] 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 application can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this application can be achieved. This is not a limitation herein.
[0178] The above specific embodiments do not constitute a limitation on the scope of protection of this application. 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 application shall be included within the scope of protection of this application.
Claims
1. A question-answering method based on a large model, comprising: Receive task description information to be answered; Perform multiple rounds of iterative question-answering based on the task description information using the large model until task response information that passes the evaluation of the large model is output; wherein each round of iteration includes: Using the first prompt word to guide the large model to decompose the task description information to obtain candidate question-answer pairs, wherein the candidate question-answer pairs include the subtasks and answers decomposed in the current round; In the case that the candidate question-answer pair fails to pass the evaluation of the big model, the first prompt word is rewritten based on the candidate question-answer pair and its evaluation result to guide the big model to regenerate the candidate question-answer pair until a target question-answer pair that passes the evaluation of the big model is obtained, and the target question-answer pair is related to the task response information.
2. The method according to claim 1, wherein The step of using the first prompt word to guide the large model to decompose the task description information into question to obtain candidate question-answer pairs includes: Using the first prompt word to guide the large model to decompose the task description information based on at least one target question-answer pair output in the previous round to obtain subtasks for the current round, where the subtasks have a logical relationship with the at least one target question-answer pair output in the previous round; Processing the subtasks of the current round using the large model to obtain candidate sub-answers of the current round; Based on the subtasks and the candidate sub-answers, the candidate question-answer pairs are constructed.
3. The method according to claim 1, wherein The rewriting of the first prompt word based on the candidate question-answer pair and the evaluation result thereof includes: Obtaining reasoning hint information based on at least one target question-answer pair output in the previous round; Based on at least one candidate question-answer pair and the reason for failure in the evaluation, improvement prompt information is obtained; The first prompt word, the inference prompt information, and the improved prompt information are input into the large model to generate a rewritten first prompt word.
4. The method according to claim 1, further comprising: Based on the data of the previous round of iterative reasoning, at least one target question-answer pair output in the previous round that is related to the candidate question-answer pair is screened out; The second prompt word is used to guide the large model to output an evaluation result for the candidate question-answer pair based on the task description information, the logical relationship between the at least one target question-answer pair output in the previous round and the candidate question-answer pair.
5. The method according to claim 1, wherein The step of using the first prompt word to guide the large model to decompose the task description information to obtain candidate question-answer pairs includes: Using the first prompt word to guide the large model to decompose the task description information based on at least one target question-answer pair output in the previous round, so as to obtain a plurality of subtasks for the current round, wherein the plurality of subtasks have a logical relationship with the at least one target question-answer pair output in the previous round; Processing the multiple subtasks using the large model to obtain multiple candidate sub-answers for the current round; Constructing a plurality of candidate question-answer pairs based on the plurality of subtasks and the plurality of candidate sub-answers; The first prompt word includes multiple prompt information respectively used for the multiple candidate question-answer pairs, and the multiple prompt information is used to guide the large model to decompose the multiple sub-tasks and generate the multiple sub-answers.
6. The method according to claim 5, further comprising: If none of the plurality of candidate question-answer pairs pass the evaluation of the large model, rewriting the first prompt word based on the plurality of candidate question-answer pairs and their respective evaluation results; or, When at least two candidate question-answer pairs among the plurality of candidate question-answer pairs pass the evaluation of the large model, a target question-answer pair for the current round is determined based on the respective evaluation results of the at least two candidate question-answer pairs.
7. The method according to claim 1, further comprising: Update the target question-answer pair of the current round to an iterative path, where the iterative path is determined based on the iterative round relationship of at least one target question-answer pair in the previous round; When the comprehensive score of the updated iterative path is greater than or equal to a first preset value, the task response information is output, wherein the comprehensive score is obtained based on the evaluation score of each target question-answer pair in the updated iterative path by the large model.
8. The method according to claim 1, further comprising: Obtaining an evaluation value of the target question-answer pair outputted in any round of iteration, wherein the evaluation value represents the quality of the target question-answer pair; The target question-answer pairs whose evaluation values are greater than or equal to a second preset value are used as training samples to train the large model.
9. A large model training method comprising: Get sample description information of tasks to be answered; Perform multiple rounds of iterative question-answering based on the task sample description information using the large model to be trained until task sample response information that passes the evaluation of the large model is output; wherein each round of iteration includes: Using the first prompt word to guide the large model to decompose the task sample description information to obtain candidate question-answer pairs, wherein the candidate question-answer pairs include the sub-questions and answers decomposed in the current round; If the candidate question-answer pair fails to pass the evaluation of the large model, rewriting the first prompt word based on the candidate question-answer pair and its evaluation result to guide the large model to regenerate candidate question-answer pairs until a target question-answer pair that passes the evaluation of the large model is obtained, where the target question-answer pair is related to the task response information; Based on the iterative data involved in the multiple rounds of iterative question and answer, the parameters of the large model are adjusted.
10. The method according to claim 9, wherein: The adjusting of the parameters of the large model based on the iterative data involved in the multiple rounds of iterative question-answering includes: A first loss function value is obtained based on the question decomposition results and decomposition question labels of the task sample description information in the multiple rounds of iterative question and answer, a second loss function value is obtained based on the target question and answer pairs and the target question and answer pair labels in the multiple rounds of iterative question and answer, and a third loss function value is obtained based on the evaluation results and evaluation labels in the multiple rounds of iterative question and answer; Adjust parameters of the large model based on the first loss function value, the second loss function value, and the third loss function value.
11. A large-scale model-based question-answering device, comprising: An information receiving module, used for receiving task description information to be replied; The first iteration module is configured to perform multiple rounds of iterative question-answering based on the task description information using the large model until task response information that passes the evaluation of the large model is output; wherein each round of iteration includes: Using the first prompt word to guide the large model to decompose the task description information to obtain candidate question-answer pairs, wherein the candidate question-answer pairs include the sub-questions and answers decomposed in the current round; In the case that the candidate question-answer pair fails to pass the evaluation of the big model, the first prompt word is rewritten based on the candidate question-answer pair and its evaluation result to guide the big model to regenerate the candidate question-answer pair until a target question-answer pair that passes the evaluation of the big model is obtained, and the target question-answer pair is related to the task response information.
12. A large model training device comprising: The sample acquisition module is used to obtain the description information of the task samples to be answered; The second iteration module is configured to perform multiple rounds of iterative question-answering based on the task sample description information using the large model to be trained, until task sample response information that passes the evaluation of the large model is output; wherein any round of iteration includes: Using the first prompt word to guide the large model to decompose the task sample description information to obtain candidate question-answer pairs, wherein the candidate question-answer pairs include the sub-questions and answers decomposed in the current round; If the candidate question-answer pair fails to pass the evaluation of the large model, rewriting the first prompt word based on the candidate question-answer pair and its evaluation result to guide the large model to regenerate candidate question-answer pairs until a target question-answer pair that passes the evaluation of the large model is obtained, where the target question-answer pair is related to the task response information; A parameter adjustment module is used to adjust the parameters of the large model based on the iterative data involved in the multiple rounds of iterative question and answer.
13. A large model comprising a computer program, wherein when the large model is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
14. An intelligent agent comprising: An input module, used for receiving input information; a processing module, configured to execute the method according to any one of claims 1 to 8 by calling the large model based on the input information received by the input module to obtain output information; An output module is used to output the output information obtained by the processing module.
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 to 8 or claims 9 to 10.
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 of any one of claims 1 to 8 or claims 9 to 10.
17. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 8 or claims 9 to 10 is implemented.
Citation Information
Cited By
Question processing method and device, storage medium and electronic equipment
CN120744080A
Method and device for generating answers
CN120822518A
Intelligent agent training method, data processing method and question answering method
CN121117622A
Intelligent agent training methods, data processing methods, and question answering methods
CN121117622B
Intelligent generation method, device and equipment for disaster response plan and medium
CN121544083A