Question answering method and device based on large model, training method and device, intelligent agent, equipment and medium
By adopting multi-tasking and retrieval enhancement generation technology in large models, the problem that large models cannot effectively answer questions in specific application fields is solved, and the accuracy and comprehensiveness of knowledge questions and answers are improved.
Patent Information
- Application Number
- CN202411304004.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2024-12-10
AI Technical Summary
Existing large models cannot effectively answer complex questions in specific application areas or enterprise environments, and lack of professional knowledge, resulting in low accuracy of knowledge Q&A.
A big model-based question-and-answer method is adopted to obtain question information, reference information and prompt information, generate and evaluate answers using multi-task processing, and combine search enhanced generation (RAG) technology to build a knowledge question-and-answer model that conforms to specific fields.
Improves the accuracy and comprehensiveness of answers output from large models, allowing them to provide assessed, accurate and comprehensive answers in specific application areas or enterprise environments.
Smart Images

Figure CN119106123A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, especially to natural language processing technology, deep learning, large language models, human-computer interaction and other technical fields, and specifically to a question-answering method, training method, device, intelligent agent, equipment, medium and product based on a large model. Background Art
[0002] With the development of artificial intelligence technology, large models have shown significant results in many fields such as natural language processing, computer vision, and multimodal tasks. Through large-scale training data and complex network structures, large models can deeply understand language features, thereby achieving understanding and processing of complex problems. However, how to effectively improve the accuracy of knowledge questions and answers is still a direction worth exploring. Summary of the invention
[0003] The present disclosure provides a large-model-based question-answering method, training method, apparatus, intelligent agent, equipment, medium, and product.
[0004] According to one aspect of the present disclosure, a question-answering method based on a big model is provided, including: obtaining question information, reference information corresponding to the question information, and prompt information; processing the question information and the reference information according to the prompt information and a multi-task processing method of answer generation and answer evaluation by calling the big model to obtain target answer information of the question information; and outputting the target answer information.
[0005] According to another aspect of the present disclosure, a training method for a large model is provided, including: obtaining sample question information, sample reference information corresponding to the sample question information, and sample prompt information; processing the sample question information and the sample reference information according to the sample prompt information in a multi-task processing manner of answer generation and answer evaluation by calling the large model to obtain sample answer information of the sample question information; and training the large model based on the sample answer information and labels corresponding to the sample question information, wherein the labels include reference answer information corresponding to the sample question information.
[0006] According to another aspect of the present disclosure, a question-answering device based on a big model is provided, including: an acquisition module for acquiring question information, reference information corresponding to the question information, and prompt information; a processing module for processing the question information and reference information by calling the big model and according to the prompt information in a multi-task processing manner of answer generation and answer evaluation to obtain target answer information of the question information; and an output module for outputting the target answer information.
[0007] According to another aspect of the present disclosure, a training device for a large model is provided, including: a sample acquisition module for acquiring sample question information, sample reference information corresponding to the sample question information, and sample prompt information; a sample processing module for processing the sample question information and the sample reference information according to the sample prompt information in a multi-task processing manner of answer generation and answer evaluation by calling the large model to obtain sample answer information of the sample question information; and a sample training module for training the large model based on the sample answer information and labels corresponding to the sample question information, wherein the labels include reference answer information corresponding to the sample question information.
[0008] According to another aspect of the present disclosure, an intelligent agent is provided, including: an input module for receiving input information; a processing module for determining a target task based on the input information received by the input module, determining a large model based on the target task, and obtaining output information by calling the large model to execute the method described above; and an output module for outputting the output information obtained by the processing module.
[0009] According to another aspect of the present disclosure, 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 that the at least one processor can execute the above method.
[0010] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the above method.
[0011] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, and the computer program implements the above method when executed by a processor.
[0012] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0014] Figure 1 An exemplary system architecture to which a large model-based question-answering method and device can be applied according to an embodiment of the present disclosure is schematically shown;
[0015] Figure 2 The flowchart of the question-answering method based on the big model according to the embodiment of the present disclosure is schematically shown;
[0016] Figure 3 A schematic diagram schematically shows prompt information based on a thought chain method according to an embodiment of the present disclosure;
[0017] Figure 4 The answer diagram according to the embodiment of the present disclosure is schematically shown;
[0018] Figure 5 A flowchart of a large model-based question-answering method according to another embodiment of the present disclosure is schematically shown;
[0019] Figure 6 A flowchart of a large model training method according to an embodiment of the present disclosure is schematically shown;
[0020] Figure 7 A schematic diagram schematically shows evaluation prompt information of a large model according to an embodiment of the present disclosure;
[0021] Figure 8 Schematically shows a flowchart of constructing multi-task training data according to an embodiment of the present disclosure;
[0022] Fig. 9 A block diagram of a question-answering device based on a large model according to an embodiment of the present disclosure is schematically shown;
[0023] Fig.10 A block diagram of a device for large model training according to an embodiment of the present disclosure is schematically shown;
[0024] Fig.11 A schematic diagram of a structure of an intelligent agent according to an embodiment of the present disclosure is shown; and
[0025] Fig.12 A block diagram of an electronic device suitable for implementing a large model-based question-answering method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0026] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0027] Figure 1 An exemplary system architecture to which a large model-based question-answering method and apparatus can be applied according to an embodiment of the present disclosure is schematically shown.
[0028] It should be noted that Figure 1The examples shown are only examples of system architectures to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but do not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios. For example, in another embodiment, an exemplary system architecture to which the large model-based question-answering method and apparatus can be applied may include a terminal device, but the terminal device may implement the large model-based question-answering method and apparatus provided in the embodiments of the present disclosure without interacting with the server.
[0029] like Figure 1 As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.
[0030] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as knowledge reading applications, web browser applications, search applications, instant messaging tools, email clients and / or social platform software, etc. (only as examples).
[0031] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0032] The server 105 may be a server that provides various services, such as a background management server (only an example) that provides support for the content browsed by the user using the terminal devices 101, 102, and 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to the user request) to the terminal device.
[0033] It should be noted that the large model-based question-answering method provided in the embodiment of the present disclosure can generally be executed by the terminal device 101, 102, or 103. Accordingly, the large model-based question-answering device provided in the embodiment of the present disclosure can also be set in the terminal device 101, 102, or 103.
[0034] Alternatively, the question-answering method based on the big model provided in the embodiment of the present disclosure may also be generally executed by the server 105. Accordingly, the question-answering device based on the big model provided in the embodiment of the present disclosure may generally be arranged in the server 105. The question-answering method based on the big model provided in the embodiment of the present disclosure may also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the question-answering device based on the big model provided in the embodiment of the present disclosure may also be arranged in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105.
[0035] For example, when a user performs human-computer interaction with terminal devices 101, 102, 103, terminal devices 101, 102, 103 can obtain question information, and then send the obtained question information to server 105, which searches based on the question information to obtain reference information, and then processes the question information and reference information according to the multi-task processing method of answer generation and answer evaluation by calling the large model according to the prompt information to obtain the target answer information of the question information. Alternatively, a server or server cluster that can communicate with terminal devices 101, 102, 103 and / or server 105 processes the question information and outputs the target answer information of the question information.
[0036] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0037] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision, disclosure and application of user personal information involved comply with the provisions of relevant laws and regulations, take necessary confidentiality measures, and do not violate public order and good morals.
[0038] In the technical solution of the present disclosure, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.
[0039] Although the big model can summarize and answer the questions raised by users, it is unable to answer questions related to specific application fields or enterprise environments due to the lack of relevant professional knowledge. Therefore, the method based on Retrieval Augmented Generation (RAG) was born. The main process of RAG is to use the question information raised by the user to first retrieve reference information from the external knowledge base, and then use the big model to generate the corresponding answer information based on the reference information and question information. Therefore, how to build a knowledge question and answer model so that the RAG effect meets the specific application field or enterprise environment becomes particularly critical.
[0040] The present disclosure provides a question-answering method based on a large model, which obtains question information, reference information corresponding to the question information, and prompt information; by calling the large model, according to the prompt information, the question information and the reference information are processed in a multi-task processing manner of answer generation and answer evaluation to obtain target answer information of the question information; and the target answer information is output.
[0041] Therefore, the big model is used to perform multi-task processing on the prompt information, including answer generation and answer evaluation, so that the expected answer information output by the big model is evaluated, accurate and comprehensive.
[0042] The following will be Figure 2 A detailed description of the large model-based question answering method.
[0043] Figure 2 The flowchart of the big model-based question-answering method according to an embodiment of the present disclosure is schematically shown.
[0044] like Figure 2 As shown, the method includes operations S210 to S220.
[0045] In operation S210, question information, reference information corresponding to the question information, and prompt information are obtained.
[0046] In operation S220, the large model is called to process the question information and the reference information in a multi-task processing manner of answer generation and answer evaluation according to the prompt information to obtain target answer information of the question information.
[0047] In operation S230, target answer information is output.
[0048] According to an embodiment of the present disclosure, question information may be a query, question or demand raised by a user, and the question information may be in text form or in other modalities such as voice and image.
[0049] According to an embodiment of the present disclosure, reference information may be knowledge information related to question information provided to help the big model better understand and answer question information, including but not limited to background knowledge, context information, historical conversation records, related documents, pictures, tables, videos or database entries, etc.
[0050] According to an embodiment of the present disclosure, the prompt information may be instruction information for guiding the large model to perform a specific task or generate output data in a specific format.
[0051] For example, the prompt information may include answer generation instructions, which can be used to provide constraints for the generation of answer information, set scenarios for the generation of answer information, provide a thinking framework, and specify the format, length, style, etc. of the answer information output.
[0052] The prompt information may also include an answer evaluation instruction, which may evaluate the answer information generated based on the answer generation instruction in different dimensions. For example, the answer information may be evaluated in multiple dimensions such as content, structure, and language style.
[0053] According to an embodiment of the present disclosure, the large model may be a large language model (LLM) trained based on massive text data. The present disclosure is not limited to this. The large model may also be a multimodal large language model trained based on a combination of multiple modal information such as text, images, videos, and audio.
[0054] According to an embodiment of the present disclosure, the answer generation task may include understanding and analyzing the question information, determining the core points, key words, and type and structure of the question information, arranging, analyzing, and extracting reference information, and generating or inferring target answer information using the content of the reference information.
[0055] According to an embodiment of the present disclosure, the answer evaluation task may include evaluating the content, structure and language style of the answer information. The present disclosure is not limited to this, and may also evaluate the reference information cited in the answer question information, and may also evaluate the reasoning process of the answer information, etc.
[0056] According to an embodiment of the present disclosure, by utilizing a large model to process multiple tasks such as answer generation and answer evaluation based on prompt information, the large model can take into account the requirements and constraints of these two tasks, so that the large model can evaluate and optimize the generated answer information while generating target answer information, thereby ensuring that the generated answer information is accurate and comprehensive.
[0057] According to some embodiments of the present disclosure, when executing Figure 2 Before the operation S210 shown, the question-answering method may further include: identifying the type of question information.
[0058] The type of question information can be a knowledge question and answer type, a common sense question type, or a logical question type, etc. Question information of the knowledge question and answer type requires the big model to answer it based on reference information. Question information of the common sense question type or the logical question type can be answered directly by the big model without the help of reference information.
[0059] According to the embodiments of the present disclosure, Figure 2 The operation S210 of obtaining question information, reference information corresponding to the question information, and prompt information may include: if the question information is determined to be a knowledge question and answer type, based on the question information, determining reference information from an information set. The information set may include reference segments for constituting the reference information.
[0060] According to some embodiments of the present disclosure, the information set may be an information set from an internal and / or external knowledge base. The present disclosure is not limited thereto. The information set may also be a knowledge set of a related knowledge field constructed by a user, such as an information set composed of internal management documents of an enterprise.
[0061] According to an embodiment of the present disclosure, the reference information may be retrieved from the information set using the question information to obtain the original content information associated with the question information. The obtained original content information is further processed, such as sorted, screened, and extracted. The present disclosure is not limited thereto. The reference information may also be directly composed of the original content information.
[0062] The reference information may include one or more reference segments and link information for indicating the source of each reference segment, so as to be used for tracing the reference segment.
[0063] According to an embodiment of the present disclosure, reference information is obtained from an information set so that a large model can generate or infer target answer information in a reasonable manner.
[0064] When it is determined that the question information is not a knowledge question and answer type, the target answer information can be obtained by calling the big model to process the question information. For example, the question information is input into the big model to obtain the target answer information. For example, the question information is a chat type question information, "Can you chat with me?" The big model can use the pre-trained question and answer knowledge to reply the target answer information "Of course. How was your work today?"
[0065] In the process of executing the question-answering method, the type of question information is identified in advance. When faced with multiple tasks that can handle different functions, the type of task to be processed can be determined by identifying the type of question information, thereby improving the ability to handle subsequent tasks.
[0066] According to some embodiments of the present disclosure, when executing Figure 2The operation S210 shown, obtaining question information, reference information corresponding to the question information, and prompt information may also include: performing modal conversion on original content information of a predetermined modality to obtain a reference segment; and obtaining an information set based on the reference segment and link information.
[0067] For example, the original content information may be a non-text type of modality such as a table or a picture. The multimodal large model may be used to perform modal conversion on the non-text type to obtain a reference segment.
[0068] The multimodal large model may include a Transformer image encoder, a Transformer text encoder, and a Transformer multimodal decoder. Accordingly, the text modality information may be used as the input of the Transformer text encoder to obtain the output language feature sequence, the image modality information may be used as the input of the Transformer image encoder to obtain the output visual feature sequence, and then the language feature sequence and the visual feature sequence may be used as the input of the Transformer multimodal decoder to output the reference segment.
[0069] According to the embodiments of the present disclosure, by performing modal conversion on the original content information, the non-text type of modality can be converted into a text type, so that the information type of the reference information can be adapted to the big model, thereby improving the big model's processing capability for the reference information, and further improving the big model's processing capability for performing answer generation tasks, thereby improving the accuracy of the answer information.
[0070] According to the embodiments of the present disclosure, Figure 2 The operation S220 shown, by calling the large model, according to the prompt information, and processing the question information and the reference information in a multi-task processing manner of answer generation and answer evaluation to obtain the answer information of the question information, may include: in response to the answer generation instruction in the acquired prompt information, processing the question information and the reference information according to the answer generation instruction to obtain the initial answer information of the question information. In response to the answer evaluation instruction in the acquired prompt information, evaluating the initial answer information according to the answer evaluation instruction. In the case where the initial answer information meets the expected conditions in the prompt information, obtaining the target answer information based on the initial answer information.
[0071] According to an embodiment of the present disclosure, the answer generation instruction may be one or more groups of instructions, commands or constraints to instruct the large model on how to generate initial answer information for question information.
[0072] According to an embodiment of the present disclosure, processing question information and reference information may include semantic analysis and grammatical analysis of question information to capture the intent of question information, the type of answer information required, and the scope of answer information, etc. An initial answer information framework may also be constructed based on capturing the intent of question information, the type and scope of answer information required, etc. The answer information framework may include background (e.g., a brief introduction to the background of question information), subject (e.g., a detailed description of the content of answer information), and conclusion (e.g., a summary of the key points of answer information), but the present disclosure is not limited thereto, and other appropriate answer information frameworks may also be set.
[0073] Processing the problem information and the reference information may also include identifying the reference information, determining the reference fragment associated with the problem information, and judging the relevance and reliability of the reference fragment. If the reference information includes multiple reference fragments, the multiple reference information are integrated and compared to select relevant and reliable reference fragments.
[0074] According to an embodiment of the present disclosure, the initial answer information may be text answer information directly generated or generated by inference based on the reference information. The initial answer information may also be obtained by filling the determined reference information into the constructed answer information framework, or by inferring based on the determined reference information and then filling the inferred content information into the constructed answer information framework.
[0075] According to an embodiment of the present disclosure, the answer evaluation instruction may be one or more groups of instructions, commands, etc. The correctness, completeness, logic, timeliness, output format, etc. of the initial answer information may be evaluated, and corresponding evaluation information may be generated.
[0076] According to an embodiment of the present disclosure, the expected condition may be a standard or requirement set in the prompt information. For example, the expected condition may be set as the answer information being complete, having no logical errors, being output in a predetermined format, etc. The present disclosure is not limited thereto, and other expected conditions, standards or indicators may also be set as required.
[0077] When the initial answer information meets the expected conditions in the prompt information, the initial answer information can be directly output as the target answer information.
[0078] In the case where the initial answer information does not meet the expected conditions in the prompt information, the initial answer information can be modified based on the evaluation information and the reference information to obtain the target answer information.
[0079] After the initial answer information is generated, the initial answer information can be compared with the expected conditions one by one to check whether the initial answer information meets all the expected conditions. If one or more of the initial answer information does not meet the expected conditions, the initial answer information is adjusted according to the evaluation information and the reference information in at least one of the following ways: supplementing, regenerating, deleting redundant information, and adjusting the format of the initial answer information according to the reference information.
[0080] According to an embodiment of the present disclosure, the initial answer information is evaluated and tested using expected conditions through answer evaluation instructions in the prompt information, so that the target answer information can be dynamically adjusted to ensure the quality and accuracy of the target answer information.
[0081] According to some embodiments of the present disclosure, performing the following Figure 2 The operation S210 shown, obtaining question information, reference information corresponding to the question information, and prompt information may also include: generating prompt information based on a thinking chain instruction and expected conditions for indicating a thinking chain processing method for answer generation and answer evaluation.
[0082] The thought chain processing method can be a method for making the large model process or reason according to a series of orderly steps or logical chains when generating answers and answer evaluation. The thought chain instruction is a specific instruction for guiding the large model to operate according to the thought chain processing method.
[0083] In the process of answer generation, the thought chain instruction may include how to process reference information and how to generate answer information to generate target answer information. The present disclosure is not limited thereto, and the thought chain instruction may also include steps such as identifying question information and decomposing question information.
[0084] During the answer evaluation process, the thinking chain instructions may also include steps to verify the initial answer information and evaluate its accuracy and rationality, which may be to compare the initial answer information with the expected results, check the accuracy, completeness, logic and output format of the initial answer information, etc.
[0085] Figure 3 The following is a schematic diagram of prompt information based on a thought chain method according to an embodiment of the present disclosure.
[0086] like Figure 3As shown, the prompt information may include a thought chain instruction 310 (Chain-of-Thought) and a final answer instruction 320 (Final Answer). The thought chain instruction 310 enables the large model to infer the target answer information step by step based on the reference information and provide examples. The examples may include but are not limited to the reference fragments adopted and the reasons for adopting the reference fragments. In addition, expected conditions may also be included, such as limiting the format and requirements of the output. The final answer instruction 320 is used to obtain information such as the requirements for generating the target answer information and how to handle special situations.
[0087] According to the embodiments of the present disclosure, by clarifying the thought chain instructions, the big model is guided to answer the problem information according to orderly steps and requirements, thereby improving the logical reasoning ability of the big model, so that the big model can clearly understand and solve the problem information.
[0088] According to an embodiment of the present disclosure, in response to obtaining an answer evaluation instruction in the prompt information, the information is evaluated according to the answer evaluation instruction, which may be an evaluation of the initial answer information, and may include at least one of the following: an evaluation of whether the expected conditions are met, reasons for determining whether the initial answer information meets the expected conditions, and determining a reference fragment of the reference information from the initial answer information.
[0089] For example, the expected conditions may include one or more of the conditions such as the correctness of the answer information, the completeness of the answer information, the logic of the answer information, and the format of the answer information.
[0090] The accuracy can be assessed by checking whether the information in the initial answer information is accurate and consistent with the actual situation. The completeness can be assessed by checking whether the information in the initial answer information covers all expected content and whether important information is omitted. The logic can be assessed by checking whether the structure and expression of the initial answer information are clear, organized, and logical. The format of the answer information can be assessed by checking whether the format of the initial answer information meets the expected conditions.
[0091] By evaluating whether the initial answer information meets the expected conditions, it is possible to check whether the initial answer information accurately meets all conditions, thereby determining whether the generated target answer information meets the expected conditions.
[0092] According to some embodiments of the present disclosure, in an evaluation task, the big model will not only determine whether the initial answer information meets the expected conditions, but will also generate explanations or reasons to explain why the initial answer information meets or does not meet the expected conditions, so as to help the big model understand why the generated initial answer information meets or does not meet the expected conditions.
[0093] For example, the reasons for whether the expected conditions are met may include one or more of the following: whether the initial answer information introduces erroneous information that is irrelevant to the question information; whether the initial answer information is incomplete or missing relevant information; whether the initial answer information is repeated, inconsistent, or incoherent; whether the format of the output answer information is inaccurate, etc.
[0094] By determining the reasons why the initial answer information meets the expected conditions, the large model can learn why the initial answer information is wrong, so as to make targeted corrections to the wrong initial answer information.
[0095] According to some embodiments of the present disclosure, in an evaluation task, by determining whether there is a corresponding reference fragment in the initial answer information, it can be determined whether the initial answer information is generated based on the reference information or inferred based on the reference information, so as to ensure that the generated target answer information is based on evidence rather than fabricated false or unreliable information.
[0096] By determining the reference fragment corresponding to the initial answer information, the basis and source of generating the initial answer information can also be determined, which can be used to verify the reliability and validity of the answer information.
[0097] According to an embodiment of the present disclosure, when the information satisfies the expected conditions in the prompt information, obtaining the target answer information based on the information may include: determining a reference segment from the reference information based on the format conversion instruction and the initial answer information in response to the format conversion instruction in the acquired prompt information. Obtaining answer information of a predetermined modality based on the original content information corresponding to the reference segment.
[0098] For example, the format conversion instruction may be an instruction to convert at least a portion of the text of the initial answer information into a table, an image, etc. The present disclosure is not limited thereto. The format conversion instruction may also include converting the initial answer information into a fixed format text, such as a markdown format.
[0099] According to an embodiment of the present disclosure, the reference fragment represents a fragment used to generate the initial answer information, which is a fragment highly related to the initial answer information. Based on the initial answer information, the reference information can be searched or semantic similarity matched to determine the reference fragment from the reference information.
[0100] According to an embodiment of the present disclosure, the answer information of the predetermined modality may be a modality that the user desires to generate, for example, it may be plain text, a table, or a picture, etc. It may also be a modality that is a combination of text, a table, and a picture, etc.
[0101] According to an embodiment of the present disclosure, the original content corresponding to the reference segment is the content included in the data source of the reference segment, for example, the content of the original web page or the content of the original database.
[0102] Data of other modalities associated with the reference segment may be determined through a data source. For example, pictures, tables, videos, etc. Pictures, tables, videos, etc. related to the reference segment in the original content may be output as at least a part of the initial answer information. The present disclosure is not limited thereto. Answer information of a predetermined modality may also be regenerated based on information related to the reference segment in the original content.
[0103] Figure 4 The figure schematically shows a schematic diagram of answer information according to an embodiment of the present disclosure.
[0104] The modality of the target answer information can be determined from the format conversion instruction. In the case where the modality or format of the initial answer information is different from the modality or format predetermined in the format conversion instruction, the original content information can be called based on the link information of the reference segment. The original content information is used as part of the target answer information, thereby obtaining the target answer information of the predetermined modality. Figure 4 As shown, when the predetermined modality in the format conversion instruction includes a combination of text and a table, the reference segment can be replaced with the original content information corresponding to the reference segment to obtain the target answer information of the predetermined modality including the text and the original content information such as a table. This makes the content of the target answer information rich and diverse.
[0105] According to the embodiments of the present disclosure, by using the original content information to obtain the target answer information of the predetermined modality, the diverse needs of users can be met, and a more convenient and efficient use experience can be brought to the users.
[0106] According to an embodiment of the present disclosure, when the information meets the expected conditions in the prompt information, obtaining the target answer information based on the information may further include: calling the original content information using the link information corresponding to the reference segment.
[0107] According to an embodiment of the present disclosure, the link information may provide a location or path pointing to the original content. The link information may be a URL, a file path, a database index or other forms of reference. Using the link information, the large model can access and retrieve the original content information corresponding to the reference segment.
[0108] According to the embodiments of the present disclosure, through link information, the system can quickly locate and access original content information, improve the efficiency and speed of data access, avoid large models directly performing modal conversion on reference fragments, and simplify processing operations.
[0109] Figure 5 The flowchart of a large model-based question-answering method according to another embodiment of the present disclosure is schematically shown.
[0110] like Figure 5 As shown, the question information 510 is input into the large model M520, and the type of the question information is identified by calling the large model M520 to determine the type of the question information. Determine whether the type of the question information is a knowledge question and answer type. When it is determined that the type of the question information is not a knowledge question and answer type, the large model M520 directly outputs the answer information 550. When it is determined that the type of the question information is a knowledge question and answer type, a search is performed in the information set 430 to obtain the reference information 540. The reference information 540 and the question information 510 are input into the large model M520, and the large model M520 is called, and according to the prompt information, the question information 510 and the reference information 540 are processed in a multi-task processing manner of answer generation and answer evaluation, and after executing the answer generation task and the answer evaluation task, the target answer information 550 is output.
[0111] According to an embodiment of the present disclosure, a large model may be trained in the following manner: using evaluation sample pairs to train the large model.
[0112] The evaluation sample pair may include sample question information, sample reference information corresponding to the sample question information, reference answer information of the sample question information, and reference evaluation information used to evaluate the reference answer information.
[0113] According to an embodiment of the present disclosure, the reference answer information of the sample question information may be answer information that matches the sample question information, and may serve as an answer information label.
[0114] According to an embodiment of the present disclosure, the reference evaluation information may include evaluation conclusions, evaluation reasons, evaluation details, etc. The reference evaluation information may represent evaluation results of sample question information and reference answer information.
[0115] In one implementation of training a large model, sample question information, sample reference information, and sample prompt information may be obtained, and sample answer information may be obtained by calling the large model, processing the sample question information and sample reference information according to the prompt information and the answer information generation task processing method. The sample answer information and the sample question information may be evaluated using the evaluation large model to obtain sample evaluation information. The large model may be adjusted based on the similarity between the sample answer information and the reference answer information, and the similarity between the sample evaluation information and the reference evaluation information.
[0116] Another implementation method of training the big model is to obtain sample question information, sample reference information and sample prompt information, and by calling the big model, process the sample question information and sample reference information according to the prompt information in a multi-task processing manner of answer generation and answer evaluation to obtain sample answer information and sample evaluation information. Based on the similarity between the sample answer information and the reference answer information, and the similarity between the sample evaluation information and the reference evaluation information, the big model is adjusted and trained.
[0117] Using the above two methods to train the big model can enable the big model to learn the relevant knowledge of generating accurate and comprehensive answer information by referring to the evaluation information, thereby improving the question-answering ability of the big model.
[0118] For details of another implementation of training a large model, see Figure 5 Flowchart of the training method for the large model shown.
[0119] Figure 6 A flowchart of a large model training method according to an embodiment of the present disclosure is schematically shown.
[0120] like Figure 6 The training method of the large model includes: operations S610~S630.
[0121] In operation S610, sample question information, sample reference information corresponding to the sample question information, and sample prompt information are obtained.
[0122] In operation S620, the sample question information and the sample reference information are processed in a multi-task processing manner of answer generation and answer evaluation according to the sample prompt information by calling the large model to obtain sample answer information of the sample question information.
[0123] In operation S630, a large model is trained based on the labels corresponding to the sample answer information and the sample question information. The labels include reference answer information corresponding to the sample question information.
[0124] In one example, if Figure 6 The sample question information, sample answer information, and sample reference information shown are similar to those Figure 2 The interpretations and processing methods of the question information, target answer information, and reference information shown are the same or similar, only to reflect the different embodiments. Similarly, if the only difference between the nouns involved in the training method of the large model and the nouns involved in the question-answering method based on the large model is "sample", the interpretations and processing methods are the same or similar. No further details will be given here.
[0125] According to the embodiments of the present disclosure, since the sample answer information is generated by the big model through processing the answer generation and answer evaluation tasks in a multi-task processing manner, the big model can learn how to generate correct target answer information from the evaluation task, so that the output of the big model is accurate, effective and comprehensive.
[0126] According to an embodiment of the present disclosure, when executing Figure 6 Before the operation S610 shown, the training method of the large model may further include: training the large model based on the sample question information and the initial sample answer information corresponding to the sample question information.
[0127] According to an embodiment of the present disclosure, the sample question information can be input into multiple large language models to obtain multiple answer information of the sample question information, and the multiple answer information can be processed, for example, the multiple answer information can be scored, and the answer information with the highest score can be selected as the initial sample answer information, thereby obtaining the original training data of the sample question information and the initial sample answer information pair. The present disclosure is not limited to this. The sample question information and the initial sample answer information can also be obtained from an open source database.
[0128] Using sample question information and initial sample answer information to train the large model can enable the large model to perform answer generation tasks. Figure 6 The operations S610 to S630 shown can improve the training efficiency of a large model that has the ability to handle multiple tasks of answer generation and answer evaluation.
[0129] According to an embodiment of the present disclosure, a large model is trained based on sample question information and initial sample answer information corresponding to the sample question information, including: inputting the sample question information into the large model to obtain sample answer information of the sample question information; and training the large model based on the sample answer information and the initial sample answer information.
[0130] According to the example disclosed in the present invention, sample question information is input into the large model to obtain sample answer information, and the initial sample answer information is used as a label to calculate the loss. The present invention does not limit the loss function, and a conventional loss function can be selected, or the similarity between the sample answer information and the initial sample answer information can be used as a basis for adjusting parameters, as long as the initial sample answer information and the sample answer information are used to adjust the parameters of the large model.
[0131] According to an embodiment of the present disclosure, when executing Figure 6 Before the operation S610 shown, the training method of the large model may further include: preprocessing the initial sample answer information corresponding to the sample question information to obtain reference answer information. The preprocessing method includes at least one of the following: deleting content, inserting erroneous content, and changing the description order of the content.
[0132] According to the embodiments of the present disclosure, by deleting content, inserting erroneous content, changing the description order of the content, etc., the initial sample answer information can be processed to obtain one or more erroneous reference answer information corresponding to the sample question information. The training samples constructed using the sample question information and the reference answer information and the training samples constructed using the sample question information and the initial sample answer information can be used to train the large model, so that the large model can simultaneously learn what is the erroneous answer information and what is the correct answer information. In addition, by constructing the reference answer information in the above manner, the negative samples in the training samples can be increased, thereby avoiding overfitting the question information due to all being positive samples.
[0133] According to an embodiment of the present disclosure, in Figure 6 Before the operation S620 shown, the training method of the large model may further include: generating reference evaluation information.
[0134] Generating reference evaluation information may include: by calling the evaluation big model, according to the evaluation prompt information, using the thinking chain method to process the sample question information and the reference answer information, and obtaining the reference evaluation information for evaluating the reference answer information.
[0135] According to an embodiment of the present disclosure, a thought chain instruction can be set in the evaluation prompt information, so that the evaluation model processes the sample question information and the reference answer information according to the thought chain instruction, and obtains the reference evaluation information for evaluating the reference answer information. Thus, a reference standard for training the large model to perform the answer evaluation task is constructed.
[0136] Using the evaluation big model to process sample question information and reference answers in a chain-of-thought manner can improve the accuracy and effectiveness of the reference evaluation information, thereby improving the ability and training efficiency of using the reference evaluation information as a label to train the big model to perform answer evaluation tasks.
[0137] Figure 7 A schematic diagram schematically shows evaluation prompt information of a large model according to an embodiment of the present disclosure.
[0138] like Figure 7 As shown, the evaluation prompt information includes a scenario setting instruction 710, which is used to define the role of the large model and the tasks to be performed. For example, the large model is defined as an evaluation assistant, and the answer information output by the question-answering type assistant needs to be evaluated and analyzed.
[0139] The logic chain instruction 720 is used to instruct the large model to evaluate the reference answer information, determine whether the reference answer information is correct, and list the incorrect reason information. For example:
[0140] 1. Correct answer: The style and semantics are correct, and there is no fabricated information to create illusions;
[0141] 2. Wrong answer: The semantics are completely wrong;
[0142] 3. Some answers are wrong: including correct information and wrong information. The errors are as follows:
[0143] (1) Factual errors / illusionary errors: When answering, incorrect information that is irrelevant to the user’s question is introduced or fabricated.
[0144] (2) Completeness error: When answering, the correct information is ignored, and only a part of the answer is given, which is incomplete. For example, relevant and correct information is lost.
[0145] (3) Logical errors: the answer is inconsistent, repetitive, and incoherent.
[0146] (4) Style error: The output format is incorrect.
[0147] Input instruction 730 is used to indicate the input of the evaluation task, for example:
[0148] Input: {prompt of question-answering task}
[0149] Output: {response of the question-answering task}
[0150] Output instruction 740 is used to indicate the output of the evaluation task, for example:
[0151] Evaluate the above input and output, and output fields in JSON format, including three fields: evaluation conclusion, reason and details.
[0152] According to the embodiments of the present disclosure, by introducing the chain of thought into the evaluation big model, the logical reasoning ability of the evaluation big model is improved, thereby improving the confidence of the reference evaluation information.
[0153] Figure 8 The flowchart of constructing multi-task training data according to an embodiment of the present disclosure is schematically shown.
[0154] like Figure 8 As shown, the sample question information 810 and the initial sample answer information 820 are used as training data. The initial sample answer information 820 is preprocessed, such as adding, deleting and modifying operations, to obtain reference answer information 830. The sample question information 810 and the reference answer information 830 are input into the evaluation large model for answer evaluation, and reference evaluation information 840 can be obtained. Based on the reference evaluation information 840, the reference answer information 830 and the sample question information 810, multi-task training data 850 for large model training is obtained.
[0155] According to the embodiments of the present disclosure, Figure 6The operation S630 shown, training the large model based on the sample answer information and the labels corresponding to the sample question information, may include: adjusting the parameters of the large model based on the similarity between the output information of the large model and the labels.
[0156] The output information includes sample answer information and sample evaluation information, and the label also includes reference evaluation information for evaluating the reference answer information.
[0157] According to an embodiment of the present disclosure, a natural language processing (NLP) technology, such as cosine similarity, Jaccard similarity, or a word embedding-based method, may be used to calculate the semantic similarity between the output information and the label.
[0158] The similarity between the output information and the label may include a weighted sum of a first similarity between the sample answer information and the corresponding reference answer information and a second similarity between the sample evaluation information and the corresponding reference evaluation information.
[0159] According to an embodiment of the present disclosure, adjusting the parameters of the large model based on the similarity between the output information of the large model and the label may include: adjusting the parameters of the answer generation task based on the first similarity, and adjusting the parameters of the answer evaluation task based on the second similarity. However, it is not limited to this. The similarity between the output information and the label can also be used to adjust the parameters of the large model.
[0160] By analyzing the similarity between the sample answer information and sample evaluation information output by the large model and the true label (including reference answer information and reference evaluation information), the parameters of the large model are adjusted to improve the performance and accuracy of the large model.
[0161] According to an embodiment of the present disclosure, when it is determined that the sample question information is of a knowledge question and answer type, sample reference information is determined from a sample information set based on the sample question information, wherein the sample information set includes sample reference segments for constituting the sample reference information.
[0162] According to an embodiment of the present disclosure, before operation S610, the method further includes performing a modality conversion on the sample original content information of a predetermined modality to obtain a sample reference segment, and obtaining a sample information set based on the sample reference segment and the sample link information.
[0163] According to an embodiment of the present disclosure, based on sample prompt information, sample question information and sample reference information are processed in a multi-task processing manner of answer generation and answer evaluation to obtain sample answer information of the sample question information, including: in response to the answer generation instruction obtained in the sample prompt information, the sample question information and sample reference information are processed according to the answer generation instruction to obtain sample initial answer information of the sample question information. In response to the answer evaluation instruction obtained in the sample prompt information, the sample initial answer information is evaluated according to the answer evaluation instruction. In the case where the sample initial answer information meets the expected conditions in the sample prompt information, the sample answer information is obtained based on the sample initial answer information.
[0164] According to an embodiment of the present disclosure, in response to obtaining an answer evaluation instruction in the sample prompt information, evaluating the sample initial answer information according to the answer evaluation instruction includes at least one of the following: evaluating whether the sample initial answer information meets the expected conditions. Determining the reasons for whether the sample initial answer information meets the expected conditions. Determining a sample reference segment of the sample reference information from the sample initial answer information.
[0165] According to an embodiment of the present disclosure, based on the sample initial answer information, obtaining the sample answer information includes, in response to the format conversion instruction obtained in the sample prompt information, determining the sample reference segment from the sample reference information based on the format conversion instruction and the sample initial answer information. Based on the sample original content information corresponding to the sample reference segment, obtaining the sample answer information of the predetermined modality.
[0166] According to an embodiment of the present disclosure, original content information is called using link information corresponding to a sample reference segment.
[0167] In an embodiment of the present disclosure, during operation S620, sample prompt information is generated based on a thinking chain instruction and expected conditions for indicating a thinking chain processing method for answer generation and answer evaluation.
[0168] In related technologies, the training methods of large question-answering models are mainly divided into two categories: one is SFT (Supervised Fine-Tuning), which is supervised model fine-tuning, mainly through manually constructing prompts and ideal answer information to let the large model learn. The other is RLHF (Reinforcement Learning with Human Feedback), which is a reinforcement learning method combined with human feedback, such as PPO (Proximal Policy Optimization) and DPO (Distributed Proximal Policy Optimization). It mainly builds a<Query,Reject-Answer, Accept-Answer> (i.e., question information, rejected answer information, and accepted answer information) data pairs. This enables the big model to learn to distinguish which answer information is undesirable and which answer information is in line with expectations. Through such a feedback mechanism, the big model can continuously optimize its strategy to more accurately meet the needs and preferences of human users.
[0169] For the SFT method, it is impossible for the large model to learn what the wrong samples are like and why they are wrong. This may cause bottlenecks in the training effect of the large model, and the generated answer information may sometimes not meet the expected conditions. For the RLHF method, a large amount of manually labeled data is required for training. If the training data is relatively small, the effect after training will be limited, and it is difficult to unify the answer information standard, and it is difficult to construct training data.
[0170] Compared with the above method, the training method of the embodiment of the present disclosure introduces an evaluation task in the training. In addition to allowing the large model to effectively understand what is the correct answer information, the evaluation task also allows the large model to understand what is the wrong answer information, so that the large model can avoid generating wrong answer information as much as possible. The large model does not need to use the RLHF training method to learn what is the wrong answer information, which not only saves the cost of manual labeling, but also has a more accurate and comprehensive training effect than the original SFT method.
[0171] Fig. 9 A block diagram of a question-answering device based on a large model according to an embodiment of the present disclosure is schematically shown.
[0172] like Fig. 9 As shown, the large model-based question-answering device 900 includes an acquisition module 910 , a processing module 920 and an answer output module 930 .
[0173] The acquisition module 910 is used to acquire question information, reference information corresponding to the question information, and prompt information.
[0174] The processing module 920 is used to process the question information and the reference information by calling the large model according to the prompt information and in a multi-task processing manner of answer generation and answer evaluation to obtain the target answer information of the question information.
[0175] The answer output module 930 is used to output target answer information.
[0176] According to an embodiment of the present disclosure, the processing module includes an answer generation submodule, an evaluation submodule, and a determination submodule.
[0177] The answer generation submodule is used to respond to the answer generation instruction obtained in the prompt information, process the question information and reference information according to the answer generation instruction, and obtain initial answer information of the question information.
[0178] The evaluation submodule is used to respond to the answer evaluation instruction obtained in the prompt information and evaluate the initial answer information according to the answer evaluation instruction.
[0179] The determination submodule is used to obtain target answer information based on the initial answer information when the initial answer information meets the expected conditions in the prompt information.
[0180] According to an embodiment of the present disclosure, the determination submodule includes: a first determination unit and a second determination unit.
[0181] The first determining unit is configured to determine the reference segment from the reference information in response to the format conversion instruction obtained in the prompt information and based on the format conversion instruction and the initial answer information.
[0182] The second determination unit is used to obtain target answer information of a predetermined modality based on original content information corresponding to the reference segment.
[0183] According to an embodiment of the present disclosure, the determination submodule further includes: a calling unit.
[0184] The calling unit is used to call the original content information by using the link information corresponding to the reference segment.
[0185] According to an embodiment of the present disclosure, the acquisition module includes: an acquisition submodule.
[0186] The acquisition submodule is used to determine reference information from an information set based on the question information when the question information is determined to be a knowledge question and answer type. The information set includes reference fragments used to form the reference information.
[0187] According to an embodiment of the present disclosure, the acquisition module further includes: a modality conversion submodule and an information set determination submodule.
[0188] The modality conversion submodule is used to perform modality conversion on the original content information of the predetermined modality to obtain a reference segment.
[0189] The information set determination submodule is used to obtain the information set based on the reference fragment and the link information.
[0190] According to an embodiment of the present disclosure, the evaluation submodule includes at least one of the following evaluation units:
[0191] The first evaluation unit is used to evaluate whether the initial answer information meets the expected conditions.
[0192] The second evaluation unit is used to determine whether the initial answer information meets the reasons for the expected conditions.
[0193] The third evaluation unit is configured to determine a reference segment of the reference information from the initial answer information.
[0194] According to an embodiment of the present disclosure, the acquisition module includes: a prompt information generation submodule.
[0195] The prompt information generation submodule is used to generate prompt information based on the thinking chain instruction and expected conditions for indicating the thinking chain processing method of answer generation and answer evaluation.
[0196] According to an embodiment of the present disclosure, the large model is obtained by training the following modules:
[0197] The training module is used to train a large model using evaluation sample pairs, wherein the evaluation sample pairs include sample question information, sample reference information corresponding to the sample question information, reference answer information of the sample question information, and reference evaluation information for evaluating the reference answer.
[0198] Fig.10 A block diagram of a large model training device according to an embodiment of the present disclosure is schematically shown.
[0199] like Fig.10 As shown, the large model training device 1000 includes a sample acquisition module 1010, a sample processing module 1020 and a sample training module 1030.
[0200] The sample acquisition module 1010 is used to acquire sample problem information, sample reference information corresponding to the sample problem information, and sample prompt information.
[0201] The sample processing module 1020 is used to process the sample question information and the sample reference information according to the sample prompt information by calling the large model in a multi-task processing manner of answer generation and answer evaluation to obtain sample answer information of the sample question information.
[0202] The sample training module 1030 is used to train the large model based on the labels corresponding to the sample answer information and the sample question information. The labels include the reference answer information corresponding to the sample question information.
[0203] According to an embodiment of the present disclosure, the training device of the large model also includes: a sample evaluation module.
[0204] The sample evaluation module is used to process sample question information and reference answer information in a chain of thoughts by calling the evaluation model according to the evaluation prompt information, so as to obtain reference evaluation information for evaluating the reference answer information.
[0205] According to an embodiment of the present disclosure, the training device of the large model also includes: a preprocessing module.
[0206] The preprocessing module is used to preprocess the initial sample answer information corresponding to the sample question information to obtain reference answer information.
[0207] According to an embodiment of the present disclosure, the preprocessing method includes at least one of the following: deleting content, inserting erroneous content, and changing the description order of content.
[0208] According to an embodiment of the present disclosure, the sample training module includes: a parameter adjustment submodule.
[0209] The parameter adjustment submodule is used to adjust the parameters of the large model based on the similarity between the output information of the large model and the label. The output information includes sample answer information and sample evaluation information, and the label also includes reference evaluation information for evaluating the reference answer information.
[0210] According to an embodiment of the present disclosure, the training device of the large model further includes:
[0211] The sample pre-training module is used to train the large model based on the sample question information and the initial sample answer information corresponding to the sample question information.
[0212] According to an embodiment of the present disclosure, the sample pre-training module includes: a sample answer generation submodule and a sample training submodule.
[0213] The sample answer generation submodule is used to process the sample question information by calling the large model to obtain sample answer information of the sample question information.
[0214] The sample training submodule is used to train the large model based on the sample answer information and the initial sample answer information.
[0215] Fig.11 The structural block diagram of an intelligent agent according to an embodiment of the present disclosure is schematically shown.
[0216] In the embodiments of the present disclosure, inspired by the von Neumann structure in modern computer theory, such as Fig.11 As shown, the agent 1100 may include multiple core modules: an input module 1110 , a processing module 1120 , and an output module 1130 .
[0217] The input module 1110 is responsible for receiving or sensing information such as queries, requests, instructions, signals, problem information or data from the outside world (such as users or external environment), and converting it into a format that can be understood and processed by the intelligent agent 1100. The input module 1110 is the primary link for the intelligent agent 1100 to interact with the outside world. It enables the intelligent agent 1100 to efficiently and accurately obtain the necessary "sensory" information from the outside world and respond to this information.
[0218] In an example, the input module 1110 may be used to receive input information. The input information may include question information as described above.
[0219] In the example, the processing module 1120 is the core support for the ability of the agent 1100 to handle complex tasks. The processing module 1120 is used to determine the target task based on the input information received by the input module 1110. The large model is determined based on the target task. By calling the large model, the question-answering method based on the large model described above can be executed to obtain output information. The output information may include the target answer information as described above.
[0220] In an example, the output module 1130 may be used to output the output information obtained by the processing module 1120, such as the target answer information described above.
[0221] In an example, the processing module 1120 may include a control unit 1121 , a storage unit 1122 , and an operation unit 1123 .
[0222] During operation, the control unit 1121 will continuously interact with the storage unit 1122, the computing unit 1123 and / or the output module 1130. However, it should be noted that in the embodiment of the present disclosure, the control unit 1121 acts as a single initiator to initiate communication with the storage unit 1130, the computing unit 1123 and / or the output module 1150, and there is no communication coupling between the storage unit 1122, the computing unit 1123 and the output module 1150.
[0223] In the example, the performance of the control unit 1121 may be closely related to the large model based on the agent 1100. In order to give full play to the capabilities of the large language model, the internal structure of the control unit 1121 may be designed to be highly configurable and scalable to cope with various types of tasks and requirements in real scenarios.
[0224] The storage unit 1122 may be responsible for memorizing information such as historical conversations, event flows, etc. The prompt information and information set as described above may be included in the storage unit 1122 .
[0225] In the example, after the intelligent agent 1100 obtains the question information, the intelligent agent 1100 can use the question information to determine the target task. Determine reference information from the information set based on the target task. The reference information can be stored in the storage unit 1122. The intelligent agent 1100 can retrieve relevant prompt information and reference information from the storage unit 1122 and feed it back to the control unit 1121. Then, the control unit 1121 can use the feedback prompt information and reference information to determine the large model based on the target task. The target answer information corresponding to the question information is obtained by calling the large model, and the target answer information is passed to the output module 1130.
[0226] The operation unit 1123 can be regarded as a predefined tool library. The search engine, format conversion tool, etc. mentioned above can be included in the operation unit 1123.
[0227] In the example, when the agent 1100 needs to convert the format of the initial target answer, the relevant search engine or format conversion tool can be called from the operation unit 1123, and the original content information corresponding to the reference segment can be called by the search engine, and the original content information can be fed back to the control unit 1121. Alternatively, the reference segment can be converted by using the format conversion tool to obtain the content of the predetermined modality, and the content of the predetermined modality can be fed back to the control unit 1121. Then, the control unit 1121 can use the original content information or the content information of the predetermined modality fed back to obtain the target answer information, and pass the target answer information to the output module 1130, so that the output module 1130 outputs the target answer information to the user. It can be understood that although the large language model has excellent language understanding and generation capabilities, it is the same as a person, without the help of any tools, and the tasks that can be solved are very limited. When the agent 1100 is given the ability to call tools, it can achieve tasks such as completing mathematical operations with the help of a calculator, completing data analysis with the help of python, and completing weather forecasts with the help of a search engine.
[0228] According to the embodiment of the present disclosure, the intelligent agent 1100 can simply and effectively improve the level of intelligence, and improve flexibility and versatility.
[0229] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0230] According to an embodiment of the present disclosure, an electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above method.
[0231] According to an embodiment of the present disclosure, 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 above method.
[0232] According to an embodiment of the present disclosure, a computer program product includes a computer program, and the computer program implements the above method when executed by a processor.
[0233] Fig.12 A schematic block diagram of an example electronic device 1200 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0234] like Fig.12 As shown, the device 1200 includes a computing unit 1201, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1202 or a computer program loaded from a storage unit 1208 into a random access memory (RAM) 1203. In the RAM 1203, various programs and data required for the operation of the device 1200 can also be stored. The computing unit 1201, the ROM 1202, and the RAM 1203 are connected to each other via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.
[0235] A number of components in the device 1200 are connected to an input / output (I / O) interface 1205, including: an input unit 1206, such as a keyboard, a mouse, etc.; an output unit 1207, such as various types of displays, speakers, etc.; a storage unit 1208, such as a disk, an optical disk, etc.; and a communication unit 1209, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1209 allows the device 1200 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0236] The computing unit 1201 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1201 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1201 performs the various methods and processes described above, such as a large model-based question-answering method. For example, in some embodiments, the large model-based question-answering method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 1208. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1200 via the ROM 1202 and / or the communication unit 1209. When the computer program is loaded into the RAM 1203 and executed by the computing unit 1201, one or more steps of the large model-based question-answering method described above may be performed. Alternatively, in other embodiments, the computing unit 1201 may be configured to execute the large model-based question-answering method in any other appropriate manner (eg, by means of firmware).
[0237] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0238] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0239] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0240] 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).
[0241] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user 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 may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0242] A computer system may include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises through computer programs running on 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 combined with a blockchain.
[0243] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0244] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A question answering method based on a large model, comprising: Obtaining question information, reference information corresponding to the question information, and prompt information; By calling the large model, according to the prompt information, the question information and the reference information are processed in a multi-task processing manner of answer generation and answer evaluation to obtain target answer information of the question information; as well as The target answer information is output.
2. The method according to claim 1, wherein: The method of calling the large model and processing the question information and the reference information in a multi-task processing manner of answer generation and answer evaluation according to the prompt information to obtain answer information of the question information includes: In response to obtaining an answer generation instruction in the prompt information, processing the question information and the reference information according to the answer generation instruction to obtain initial answer information of the question information; In response to obtaining the answer evaluation instruction in the prompt information, evaluating the initial answer information according to the answer evaluation instruction; and In the case where the initial answer information satisfies the expected conditions in the prompt information, the target answer information is obtained based on the initial answer information.
3. The method according to claim 2, wherein: When the information satisfies the expected condition in the prompt information, obtaining the target answer information based on the information includes: In response to obtaining the format conversion instruction in the prompt information, determining a reference segment from the reference information based on the format conversion instruction and the initial answer information; and Based on the original content information corresponding to the reference segment, the target answer information of the predetermined modality is obtained.
4. The method according to claim 3, wherein: In the case where the information satisfies the expected condition in the prompt information, obtaining the target answer information based on the information further includes: The original content information is called using the link information corresponding to the reference segment.
5. The method according to any one of claims 1 to 4, wherein: The obtaining of question information, reference information corresponding to the question information, and prompt information includes: In the case where it is determined that the question information is of a knowledge question and answer type, the reference information is determined from an information set based on the question information, wherein the information set includes reference segments for constituting the reference information.
6. The method according to claim 5, wherein: The obtaining of question information, reference information corresponding to the question information, and prompt information further includes: Performing modality conversion on the original content information of the predetermined modality to obtain a reference segment; and The information set is obtained based on the reference segment and the link information.
7. The method according to any one of claims 2 to 6, wherein: The step of evaluating the information according to the answer evaluation instruction in response to obtaining the answer evaluation instruction in the prompt information includes at least one of the following: Evaluate whether the initial answer information meets the expected conditions; the reasons for determining whether the initial answer information meets the expected conditions; and A reference segment of the reference information is determined from the initial answer information.
8. The method according to any one of claims 1 to 7, wherein: The obtaining of question information, reference information corresponding to the question information, and prompt information includes: The prompt information is generated based on a thought chain instruction and expected conditions for indicating a thought chain processing manner using answer generation and answer evaluation.
9. According to the method according to any one of claims 1 to 7, the large model is trained by: The large model is trained using evaluation sample pairs, where: The evaluation sample pair includes sample question information, sample reference information corresponding to the sample question information, reference answer information of the sample question information, and reference evaluation information used to evaluate the reference answer information.
10. A large model training method, comprising: Obtaining sample question information, sample reference information corresponding to the sample question information, and sample prompt information; By calling the large model and processing the sample question information and the sample reference information according to the sample prompt information in a multi-task processing manner of answer generation and answer evaluation, sample answer information of the sample question information is obtained; as well as The large model is trained based on the labels corresponding to the sample answer information and the sample question information, wherein the labels include reference answer information corresponding to the sample question information.
11. The method according to claim 10, further comprising: By calling the evaluation big model and processing the sample question information and the reference answer information in a thinking chain manner according to the evaluation prompt information, reference evaluation information for evaluating the reference answer information is obtained.
12. The method according to claim 10 or 11, further comprising: Preprocessing the initial sample answer information corresponding to the sample question information to obtain the reference answer information, The preprocessing method includes at least one of the following: Deleting content, inserting erroneous content, and changing the order of description of content.
13. The method according to claim 11, wherein: The step of training the large model based on the labels corresponding to the sample answer information and the sample question information includes: The large model is adjusted based on the similarity between the output information of the large model and the label, wherein the output information includes the sample answer information and the sample evaluation information, and the label also includes the reference evaluation information for evaluating the reference answer information.
14. The method according to any one of claims 10 to 13, further comprising: The large model is trained based on the sample question information and the initial sample answer information corresponding to the sample question information.
15. The method according to claim 14, wherein: The step of training the large model based on the sample question information and the initial sample answer information corresponding to the sample question information includes: Processing the sample question information by calling the large model to obtain sample answer information for the sample question information; and The large model is trained based on the sample answer information and the initial sample answer information.
16. A question-answering device based on a large model, comprising: An acquisition module, used to acquire question information, reference information corresponding to the question information, and prompt information; A processing module, configured to process the question information and the reference information in a multi-task processing manner of answer generation and answer evaluation by calling the large model according to the prompt information, so as to obtain target answer information of the question information; as well as The answer output module is used to output the target answer information.
17. The device according to claim 16, wherein: The processing module comprises: an answer generation submodule, configured to respond to an answer generation instruction obtained in the prompt information, process the question information and the reference information according to the answer generation instruction, and obtain initial answer information of the question information; an evaluation submodule, configured to evaluate the initial answer information according to the answer evaluation instruction in response to the answer evaluation instruction obtained in the prompt information; and The determination submodule is used to obtain the target answer information based on the initial answer information when the initial answer information meets the expected conditions in the prompt information.
18. The device according to claim 17, wherein: The determination submodule comprises: a first determining unit, configured to determine a reference segment from the reference information in response to a format conversion instruction obtained in the prompt information and based on the format conversion instruction and the initial answer information; and The second determination unit is used to obtain the target answer information of a predetermined modality based on the original content information corresponding to the reference segment.
19. The device according to claim 18, wherein: The determining submodule also includes: The calling unit is used to call the original content information by using the link information corresponding to the reference segment.
20. The device according to any one of claims 16 to 19, wherein: The acquisition module comprises: The acquisition submodule is used to determine the reference information from an information set based on the question information when it is determined that the question information is of a knowledge question and answer type, wherein the information set includes reference fragments used to constitute the reference information.
21. The device according to claim 20, wherein: The acquisition module also includes: A modality conversion submodule, configured to perform modality conversion on original content information of a predetermined modality to obtain a reference segment; and The information set determination submodule is used to obtain the information set based on the reference fragment and the link information.
22. The device according to any one of claims 17 to 21, wherein: The evaluation submodule includes at least one of the following evaluation units: A first evaluation unit, configured to evaluate whether the initial answer information meets the expected condition; A second evaluation unit, configured to determine whether the initial answer information meets the expected condition; as well as The third evaluation unit is configured to determine a reference segment of the reference information from the initial answer information.
23. The device according to any one of claims 16 to 22, wherein: The acquisition module comprises: The prompt information generating submodule is used to generate the prompt information based on the thinking chain instruction and expected conditions for indicating the thinking chain processing mode of answer generation and answer evaluation.
24. The device according to any one of claims 16 to 22, wherein the large model is obtained by training the following modules: A training module is used to train the large model using evaluation sample pairs, wherein: The evaluation sample pair includes sample question information, sample reference information corresponding to the sample question information, reference answer information of the sample question information, and reference evaluation information used to evaluate the reference answer.
25. A large model training device, comprising: A sample acquisition module, used to acquire sample problem information, sample reference information corresponding to the sample problem information, and sample prompt information; A sample processing module, configured to process the sample question information and the sample reference information in a multi-task processing manner of answer generation and answer evaluation by calling the large model according to the sample prompt information, so as to obtain sample answer information of the sample question information; as well as A sample training module is used to train the large model based on the sample answer information and the labels corresponding to the sample question information, wherein the labels include reference answer information corresponding to the sample question information.
26. The apparatus according to claim 25, further comprising: The sample evaluation module is used to process the sample question information and the reference answer information in a chain of thoughts by calling the evaluation model according to the evaluation prompt information, so as to obtain reference evaluation information for evaluating the reference answer information.
27. The apparatus according to claim 25 or 26, further comprising: A preprocessing module is used to preprocess the initial sample answer information corresponding to the sample question information to obtain the reference answer information. The preprocessing method includes at least one of the following: Deleting content, inserting erroneous content, and changing the order of description of content.
28. The device according to claim 26, wherein Sample training modules include: A parameter adjustment submodule is used to adjust the parameters of the large model based on the similarity between the output information of the large model and the label, wherein the output information includes the sample answer information and the sample evaluation information, and the label also includes the reference evaluation information for evaluating the reference answer information.
29. The apparatus according to any one of claims 25 to 28, further comprising: The sample pre-training module is used to train the large model based on the sample question information and the initial sample answer information corresponding to the sample question information.
30. The device according to claim 29, wherein: The sample pre-training modules include: a sample answer generation submodule, configured to process the sample question information by calling the large model to obtain sample answer information of the sample question information; and The sample training submodule is used to train the large model based on the sample answer information and the initial sample answer information.
31. An intelligent agent, comprising: An input module, used for receiving input information; a processing module, configured to determine a target task based on the input information received by the input module, determine a large model based on the target task, and obtain output information by calling the large model to execute the method according to any one of claims 1 to 10; An output module is used to output the output information obtained by the processing module.
32. 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 according to any one of claims 1 to 15.
33. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-15.
34. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 15.
Citation Information
Cited By
Training sample data generation method and device, readable storage medium and program product
CN120277419A
Scientific and technological document question and answer method and device, storage medium and electronic equipment
CN120296137A
Scientific and technological document question-answering method, device, storage medium, and electronic device
CN120296137B
Attribution method and system
CN120338083A
Question answering method, system and related device
CN120353905A
