Answer generation method and model training method
By generating sub-questions and answers related to important entities, the training method of the large language model is optimized, which solves the problem of inaccurate answers of the large language model when processing complex questions and achieves more accurate answer generation.
Patent Information
- Application Number
- CN202510953393.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-10
- Publication Date
- 2025-10-17
AI Technical Summary
When dealing with complex or knowledge-intensive user questions, large language models have difficulty accurately defining the meaning of entities, resulting in inaccurate answers and easily generating noisy and irrelevant text.
By obtaining the original question to generate sub-questions and sub-answers related to important entities, the supervised fine-tuning training method is used to optimize the large language model so that it can generate sub-questions around important entities and generate target answers based on the sub-questions.
It improves the accuracy of answers, can capture subtle knowledge connections in complex questions, and generate more accurate responses.
Smart Images

Figure CN120805864A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present specification relate to the technical field of computer technology, and particularly relate to an answer generation method and a model training method. BACKGROUND
[0002] With the development of Internet technology, when answering a question based on a user, a large language model can be used to answer the question of the user, so as to quickly give an answer information to the question. Generally, the large language model can use the internal existing knowledge to decompose and plan the question of the user, and based on the sub-questions decomposed for the question, the question is answered step by step to obtain the final answer.
[0003] However, if the text information of the user question is relatively complex or in a knowledge-intensive scenario, the knowledge of the large language model itself cannot accurately define the entity meaning, and can only perform shallow syntax decomposition, and then decompose the original question into sub-questions according to the syntax structure, so that the device is difficult to capture subtle clues and complex knowledge associations according to the sub-questions, and even the retrieved text has noise and is irrelevant, and thus the generated answer is inaccurate. SUMMARY
[0004] Therefore, the embodiments of the present specification provide an answer generation method and a model training method. One or more embodiments of the present specification also relate to an answer generation device, a model training device, a computing device, a computer-readable storage medium, and a computer program product to solve the technical defects in the prior art.
[0005] According to a first aspect of the embodiments of the present specification, an answer generation method is provided, comprising: obtaining an original question and inputting the original question to a target model; generating at least one sub-question and a corresponding sub-answer based on the original question by the target model, and obtaining a target answer to the original question based on the at least one sub-question and the corresponding sub-answer; wherein the at least one sub-question has an order, the sub-question is related to an important entity, and the important entity is obtained based on the original question.
[0006] According to a second aspect of the embodiments of the present specification, a model training method is provided, comprising: obtaining a first training data set; the first training data set includes a plurality of first training data; the first training data includes an initial question, sample answer information corresponding to the initial question, a plurality of sample sub-questions corresponding to the initial question, sample sub-answer corresponding to each sample sub-question, and sample important entity information corresponding to each sample sub-question; The large language model to be trained is supervised fine-tuning trained according to the first training data set, and a large language model after supervised fine-tuning is obtained. The large language model after supervised fine-tuning is used to generate at least one sub-question and a corresponding sub-answer based on the original question, and obtain a target answer for the original question based on the at least one sub-question and the corresponding sub-answer.
[0007] According to a third aspect of the embodiments of the present specification, an answer generation apparatus is provided, comprising a question obtaining module and an answer obtaining module. The question obtaining module is configured to obtain an original question and input the original question to a target model. The answer obtaining module is configured to generate at least one sub-question and a corresponding sub-answer based on the original question by the target model, and obtain a target answer for the original question based on the at least one sub-question and the corresponding sub-answer; wherein the at least one sub-question has an order, the sub-question is related to an important entity, and the important entity is obtained based on the original question.
[0008] According to a fourth aspect of the embodiments of the present specification, a model training apparatus is provided, comprising a training data obtaining module and a supervised fine-tuning module. The training data obtaining module is configured to obtain a first training data set; the first training data set comprises a plurality of first training data; the first training data comprises an initial question, sample answer information corresponding to the initial question, a plurality of sample sub-questions corresponding to the initial question, sample sub-answer information corresponding to each sample sub-question, and sample important entity information corresponding to each sample sub-question. The supervised fine-tuning module is configured to perform supervised fine-tuning training on a large language model to be trained according to the first training data set, and obtain a large language model after supervised fine-tuning; the large language model after supervised fine-tuning is used to generate at least one sub-question and a corresponding sub-answer based on the original question, and obtain a target answer for the original question based on the at least one sub-question and the corresponding sub-answer.
[0009] According to a fifth aspect of the embodiments of the present specification, a computing device is provided, comprising: a memory and a processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions, and the computer programs / instructions realize the steps of the above-mentioned answer generation method or model training method when executed by the processor.
[0010] According to a sixth aspect of the embodiments of the present specification, a computer readable storage medium is provided, which stores computer programs / instructions, and the computer programs / instructions realize the steps of the above-mentioned answer generation method or model training method when executed by the processor.
[0011] According to a seventh aspect of an embodiment of the present specification, a computer program product is provided, comprising computer programs / instructions which, when executed by a processor, implement the steps of the above-mentioned answer generation method or model training method.
[0012] An answer generation method is provided in an embodiment of the present specification. The method can include obtaining an original question and inputting the original question into a target model; generating at least one sub-question and a corresponding sub-answer based on the original question by the target model, and obtaining a target answer for the original question based on the at least one sub-question and the corresponding sub-answer; wherein the at least one sub-question has an order, the sub-question is related to an important entity, and the important entity is obtained based on the original question. Thus, the target model can generate sub-questions around the important entity, rather than generating sub-questions based on the syntax structure of the original question, and obtain corresponding sub-answers based on the sub-questions. Then, the target answer corresponding to the original question can be generated based on the at least one sub-question and the sub-answer, which improves the accuracy of the generated target answer. At the same time, the target model can capture subtle clues and complex knowledge associations based on the sub-answers generated by the important entity when processing complex questions or questions in a knowledge-intensive scenario, and generate accurate answer information. BRIEF DESCRIPTION OF DRAWINGS
[0013] Figure 1 is a flowchart of an answer generation method provided by an embodiment of the present specification; Figure 2 is a flowchart of a model training method provided by an embodiment of the present specification; Figure 3 is a schematic diagram of answer information in a specified format in a target instruction provided by an embodiment of the present specification; Figure 4 is a structural schematic diagram of an answer generation device provided by an embodiment of the present specification; Figure 5 is a structural schematic diagram of a model training device provided by an embodiment of the present specification; Figure 6 is a structural block diagram of a computing device provided by an embodiment of the present specification. DETAILED DESCRIPTION
[0014] In the following description, many specific details are set forth in order to provide a thorough understanding of the present specification. However, the present specification can be practiced in many different ways beyond the specific details disclosed herein, and the skilled person can make similar substitutions without departing from the scope of the present specification. Therefore, the present specification is not limited to the specific implementation disclosed below.
[0015] The terminology used in this disclosure of one or more embodiments is for the purpose of describing particular embodiments only and is not intended to be limiting of one or more embodiments. As used in this disclosure one or more of the singular forms "a," "an" and "the" include plural referents unless the context clearly dictates otherwise. It will also be understood that the term "and / or," as used herein, refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0016] It is to be understood that the terms first, second, etc. can be employed in this disclosure of one or more embodiments to describe various information. Such information should not be limited by these terms. These terms are only used to distinguish one category of information from another category of information. For example, a first can be termed a second, and, similarly, a second can be termed a first, without departing from the scope of one or more embodiments. As used herein, the term "if' can be construed to mean "when" or "upon" or "in response to determining" terms that indicate some manner of correlation or relation.
[0017] In addition, it should be noted that the data involved in one or more embodiments of the present application are all information and data authorized by the user or authorized by all parties, and the statistics, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation portal for user to choose authorization or refusal.
[0018] First, the terms involved in one or more embodiments of the present specification are explained.
[0019] Retrieval-Augmented Generation (RAG): is an artificial intelligence framework that combines information retrieval and text generation to improve the accuracy and timeliness of large language models by dynamically introducing external knowledge.
[0020] Knowledge graph: is a structured semantic network used to describe entities and their relationships in the real world. It formalizes knowledge through graph structures such as edges and nodes, allowing computers to understand and process human language. Entities can represent specific objects or abstract concepts in the real world, such as people, places, organizations, events, and concepts. Relationships can represent the connections between entities, such as "located in," "contains," "parent-child," "employed by," and others. The smallest unit of representation in a knowledge graph can be a triple, which is constructed in the form of a subject entity, a relationship, and an object entity.
[0021] Sub-problems: refers to the decomposition of complex tasks into multiple simple and independent sub-tasks, and each sub-task model needs to solve small problems, which can reduce task complexity and improve processing efficiency.
[0022] Fine-tuning: A machine learning technique used to adjust a pre-trained large language model to better suit a specific task. It involves further training the model using a labeled dataset on top of the pre-trained model to optimize its performance on the specific task.
[0023] Inference chain: A process of deriving a final conclusion from known premises or evidence through a series of logically connected inference steps. It breaks down complex problems into simpler inference steps, each based on explicit logical rules or factual evidence, forming a coherent logical path.
[0024] In this specification, an answer generation method and a model training method are provided. One or more embodiments of this specification also relate to an answer generation device, a model training device, a computing device, a computer-readable storage medium, and a computer program product, which are described in detail in the following embodiments.
[0025] See Figure 1 , Figure 1 A flowchart of an answer generation method provided by an embodiment of this specification is shown, including the following specific steps: Step 102: Obtain the original question and input it into the target model.
[0026] Embodiments of this specification are applied to an application or system platform configured with a large language model, such as a server-side of an application program, or a cloud computing platform dedicated to data processing.
[0027] The original question is a text described in natural language by a user input on a user terminal, which needs to be answered. The user terminal can be a mobile phone, tablet, notebook computer, desktop computer, smart watch, etc. The original question can be a question raised by the user in one or more fields, such as medical field, education field, science field, biochemistry field, humanities field, social field, and physics field, etc.
[0028] Step 104: Generate at least one sub-question and corresponding sub-answer based on the original question through the target model, and obtain the target answer for the original question based on the at least one sub-question and corresponding sub-answer; wherein the at least one sub-question has an order, and the sub-question is related to an important entity; the important entity is obtained based on the original question.
[0029] The target model can be a model with question and answer functions, specifically a model with inference ability to generate at least one sub-question based on an important entity, generate corresponding sub-answers based on the at least one sub-question, and generate a target answer based on the at least one sub-question and corresponding sub-answers.
[0030] A sub-problem can be obtained by decomposing the original problem around an important entity. The sub-problem can solve part or all of the problems in the original problem, or can clarify the meaning implied in the original problem, or can eliminate the ambiguity in the original problem.
[0031] A sub-problem can have a corresponding relationship with a sub-answer. The target answer can be a sub-answer corresponding to the last sub-problem generated by the target model based on the original problem.
[0032] An important entity can be a key entity extracted from the original problem that can be used to process the original problem. Alternatively, if the generated sub-problem is not the first sub-problem generated by the target model, the important entity can be a key entity extracted from the original problem and the already generated sub-problems and corresponding sub-answers that can be used to process the original problem. Alternatively, if the generated sub-problem is not the first sub-problem generated by the target model, the important entity can be a key entity extracted from the already generated sub-problems and corresponding sub-answers that can be used to process the original problem. The important entity can be one or more important entities extracted by the target model. Specifically, the extraction of the important entity can be the entity with a higher weight obtained by the target model based on the attention mechanism from the original problem and / or the already generated sub-problems and corresponding sub-answers. Illustratively, as a method for obtaining important entity information, specifically, the large language model can assign a weight to each entity information in the process of identifying entity information in the original problem based on the self-attention mechanism, and the entity information with a weight value greater than or equal to a preset weight threshold can be regarded as important entity information. Alternatively, the target model can directly extract the important entity from the original problem and / or the already generated sub-problems and corresponding sub-answers, illustratively, by training the model with data containing at least the important entity and reference information capable of extracting the important entity, etc., to obtain a target model capable of identifying important entities, so that the model does not need to calculate based on the attention mechanism, and can quickly identify important entities.
[0033] The order of at least one sub-problem generated by the target model based on the original problem can be the order in which the target model generates each sub-problem based on the original problem.
[0034] The original question is obtained and input into the target model; the target model generates at least one sub-question and corresponding sub-answer based on the original question, and obtains the target answer to the original question based on the at least one sub-question and corresponding sub-answer; wherein, at least one sub-question has a sequence and is related to an important entity; the important entity is obtained based on the original question. This enables the target model to generate sub-questions around important entities, rather than generating sub-questions based on the grammatical structure of the original question and obtaining corresponding sub-answers based on the sub-questions. It can then generate a target answer corresponding to the original question based on at least one sub-question and a corresponding sub-answer, thereby improving the accuracy of the generated target answer. At the same time, it can also enable the target model to capture subtle clues and complex knowledge associations based on the sub-answers generated by important entities when dealing with complex problems or problems in knowledge-intensive scenarios, and generate accurate answer information.
[0035] Optionally, at least one sub-question and a corresponding sub-answer are generated based on the original question through the target model, including: obtaining an important entity based on the original question and / or the reasoning chain located before the current reasoning chain, the reasoning chain including the important entity, a sub-question of the original question related to the important entity, and a sub-answer for the sub-question; obtaining a sub-question based on the important entity and / or the original question; and obtaining a sub-answer based on the sub-question.
[0036] If the important entity currently required belongs to the important entity in the first reasoning chain, the target model can extract the important entity only from the original question. If the important entity currently required belongs to the important entity in a non-first reasoning chain, the target model can obtain the important entity from the original question and the reasoning chain before the current reasoning chain; or, the target model can obtain the important entity from the reasoning chain before the current reasoning chain.
[0037] An inference chain is the process by which the target model analyzes and infers the original question. During the target model's processing of the original question, one or more inference chains may be generated. If the original question is too simple, the target model may generate an inference chain for the original question. If an inference chain is generated, it will also include key entities, sub-questions related to the key entities, and sub-answers corresponding to the sub-questions. The sub-answers may be the target answers to the original question.
[0038] A sub-question can contain important entities and some relevant information of the original question. Alternatively, a sub-question can contain information with similar semantics to the original question and also contain important entities.
[0039] The important entity is obtained based on the original question and / or an inference chain located before the current inference chain, the inference chain including the important entity, a sub-question of the original question related to the important entity, and a sub-answer to the sub-question; the sub-question is obtained based on the important entity and / or the original question; and the sub-answer is obtained based on the sub-question. Thus, the sub-question can be generated based on the important entity and the original question, so that the generated sub-question is not obtained based on simple syntax structure disassembly, but is related to the important entity, so that the sub-question generated by the target model is more targeted and more suitable for the semantics expressed by the original question, thereby improving the accuracy of the generated sub-answer, so that the sub-answer is more referential relative to the solution of the original question.
[0040] Optionally, after the sub-answer is obtained based on the sub-question, the method further includes the following specific steps: in a case where the generated inference chain meets an answer generation condition corresponding to the original question, generating a target answer based on at least one sub-question and a corresponding sub-answer; and in a case where the generated inference chain does not meet the answer generation condition corresponding to the original question, generating a next inference chain.
[0041] For example, the target instruction for instructing the target model to process the data can include whether the generated inference chain meets the answer generation condition corresponding to the original question. For example, the target model can calculate the confidence of each inference step based on the sub-inference chain corresponding to each inference step in the inference chain, and determine whether the generated inference chain meets the answer generation condition corresponding to the original question based on the confidence. Specifically, if the confidence of a continuous preset number of inference steps is greater than or equal to a preset confidence threshold, it is determined that the generated inference chain meets the answer generation condition corresponding to the original question. If there is an inference step with a confidence less than the preset confidence threshold among the confidence of the continuous preset number of inference steps, it is determined that the generated inference chain does not meet the answer generation condition corresponding to the original question.
[0042] For example, the target instruction for instructing the target model to process the data can include whether the generated inference chain meets the answer generation condition corresponding to the original question. For example, the target model can determine whether the sub-answer in each inference chain covers all core elements of the original question, such as time, place, character, cause and effect, etc. Specifically, this can be achieved by disassembling the question keywords and matching the answer content.
[0043] Exemplarily, the target model can also determine whether the inference chain is sufficient based on the difficulty of the original question and the number of inference chains, for example, if the original question is relatively difficult, determine whether the number of inference chains is greater than or equal to a preset number threshold, if the number of inference chains is greater than or equal to the preset number threshold, determine that the generated inference chain meets the answer generation condition corresponding to the original question, if the number of inference chains is less than the preset number threshold, determine that the generated inference chain does not meet the answer generation condition corresponding to the original question.
[0044] Exemplarily, the target model can also learn a model function for judging the sufficiency of the inference chain information through training. Thus, the sufficiency of the inference chain information can be autonomously judged through the learned model function to obtain a judgment result, and subsequent processing can be performed based on the judgment result.
[0045] The next inference chain can include important entities determined based on the original question and the inference chains before the next inference chain, sub-questions corresponding to the important entities, and sub-answers corresponding to the sub-questions.
[0046] By generating the target answer based on at least one sub-question and the corresponding sub-answer when the generated inference chain meets the answer generation condition corresponding to the original question, and generating the next inference chain when the generated inference chain does not meet the answer generation condition corresponding to the original question, the target model can determine whether to output the final answer or continue reasoning analysis, so that the original question can be answered with sufficient knowledge, the accuracy of the target answer corresponding to the original question output by the target model can be improved, and an incorrect answer can be avoided in the case of insufficient knowledge.
[0047] Optionally, the inference chain further includes background knowledge of the important entity, and the background knowledge is obtained through the following specific steps: determining an entity node matched with the important entity from a knowledge graph related to the important entity; obtaining a set of edges of the entity node, the edges indicating relationships or attributes between the entity nodes; determining a set of related edges from the set of edges based on the original question; determining the background knowledge of the important entity based on the entity node, the set of related edges, and another entity node connected by the set of related edges; and obtaining a sub-question based on the important entity and / or the original question, including: obtaining the sub-question based on at least one of the important entity, the background knowledge, and the original question.
[0048] The knowledge graph can provide fine-grained knowledge and related information associated with important entities. Fine-grained knowledge can represent highly detailed and specific knowledge for each entity, and can capture subtle differences between entities. The sub-question can be a highly relevant sub-task generated for the important entity and the background knowledge obtained from the knowledge graph, or it can also represent a sub-task obtained by decomposing the original question based on the important entity and the background knowledge obtained from the knowledge graph.
[0049] The smallest structural unit in the knowledge graph can be a triple. The triple can be knowledge information displayed in the subject-predicate-object structure, for example, one of the two entities is the subject, one entity is the object, and the relationship or attribute is the predicate.
[0050] The entity node can represent node information consistent with the semantics of the important entity searched from the entity set of the knowledge graph.
[0051] The edge set can be an entity node one-hop connection edge representing the important entity in the knowledge graph. For example, if entity 1 is connected to entity 2 through edge 1, entity 2 is connected to entity 3 through edge 2, and entity 1 is an entity node matching the important entity, edge 1 can represent a one-hop connection edge, and edge 2 can represent a two-hop connection edge.
[0052] The relationship can be used to represent the association between entity nodes, such as association relationships including, located, parent-child, employed, etc. The attribute can represent entity attribute information, or relationship attribute information, etc. For example, the important entity information is Xiaoming, and the entity attribute information can be Xiaoming's age, height, weight, etc.
[0053] The related edge set can be a semantic matching of the edge set to the original question, and the edges in the edge set with a matching degree greater than or equal to a preset matching degree can be combined into the related edge set.
[0054] The background knowledge can be triple information composed of an entity node, a related node, and another entity node.
[0055] The sub-question can be generated based on the important entity, the background knowledge, and the original question; or it can also be generated based on the important entity and the original question.
[0056] The knowledge graph has a topological structure, which can narrow down the candidate range and improve the efficiency of retrieving background knowledge from the knowledge graph. The topological structure can represent the connection mode between entities, such as star structure, chain structure, and network structure, etc. Based on the important entity, the background knowledge corresponding to the important entity is obtained from the knowledge graph. Specifically, based on a preset matching rule, an entity node matching the important entity is searched from an entity set of the knowledge graph; a sub-knowledge graph corresponding to the important entity information is determined from the knowledge graph, and a node and an edge corresponding to the important entity one-hop are searched from the sub-knowledge graph; the edge can include relationship information or attribute information; the node can include target entity information having an association relationship with the important entity information, and thus the background knowledge including the important entity information, the target entity information, and the relationship or attribute between the two entities can be obtained. The preset matching rule can be a rule based on semantic similarity for matching, or a rule based on text consistency for matching.
[0057] In order to improve the accuracy of the collected knowledge, the retriever can also be used to perform an extended search on the edge set. Specifically, more edges and nodes related to the important entity can be expanded and filtered through multi-hop query, path discovery, attention mechanism, etc. to obtain a related triple set. The target model can determine the background knowledge from the related triple set.
[0058] By determining the entity node matching the important entity from the knowledge graph related to the important entity; obtaining an edge set of the entity node, the edge indicating the relationship or attribute between the entity nodes; based on the original question, determining a related edge set from the edge set; based on the entity node, the related edge set, and another entity node connected by the related edge set, determining the background knowledge of the important entity; based on at least one of the important entity, the background knowledge and the original question, obtaining a sub-question, so as to avoid the problem of missing a lot of information by directly performing semantic retrieval based on the original question, or avoiding the problem of relying only on the identified entity to retrieve irrelevant content, wasting large language model power, and interfering with the target model processing the original question. The ability of the large language model to process the original question can be improved.
[0059] Optionally, based on the sub-question, the sub-answer can be obtained, which can include the following specific steps: retrieving the sub-question to obtain at least one piece of evidence information; based on the evidence information, obtaining the sub-answer.
[0060] The target model can use RAG technology to retrieve at least one piece of evidence information from a preset database for the sub-question. The preset database can be a database containing multiple data sources. The preset database can be a knowledge database serving as an external knowledge base to provide reference knowledge for the large language model. The sub-answer can be answer information included in the evidence information retrieved from the preset database, which can correctly answer the sub-question.
[0061] The evidence information can be knowledge information related to the sub-question provided in the preset database, and can be retrieved from the preset database by semantic retrieval, for example. The several pieces of evidence information are processed. If there are pieces of evidence information conflicting with each other in the several pieces of evidence information, reliable correct evidence information can be determined based on the frequency, or the source or the confidence of the pieces of evidence information conflicting with each other in the several pieces of evidence information. The weight value is determined according to the source authority, the time freshness and the semantic matching degree with the first sub-question of the correct evidence information, the correct evidence information with the highest weight value is adopted, and the decoding strategy is used to process the correct evidence information with the highest weight value to obtain the sub-answer corresponding to the sub-question. The above-mentioned example is not a specific limitation of determining the sub-answer based on the evidence information. In actual application, the several pieces of evidence information can also be processed by other ways to obtain the sub-answer corresponding to the sub-question, for example, the evidence information is processed based on the reinforcement learning evidence sorting mode to obtain the sub-answer information, which is not listed one by one here.
[0062] At least one piece of evidence information is obtained by searching for the sub-question. The sub-answer is obtained based on the evidence information. Thus, the information gap caused by the key entity extracted from the knowledge graph can be made up, and the evidence information containing the accurate sub-answer can be provided, and then the sub-answer that can accurately answer the first sub-question can be obtained.
[0063] In order to facilitate understanding of the answer generation method in the embodiments of the present specification, the prompt word is: given a general question, the question is gradually decomposed using relevant knowledge to form a data chain. Analyze whether this data chain provides enough information to answer the original question. If the information is sufficient: answer "final answer: the final answer is here"; if the information is insufficient: continue to decompose the question to build a more complete data chain, and collect additional evidence from external knowledge. The external knowledge should be presented in the following format: <reference> search results < / reference>.
[0064] General question: What is the actor who plays role B in the movie "AAA" responsible for? Chain 1: Important entity: AAA. <reference> Related background: Entity 1: AAA (2011 movie). The main actor of AAA (2011 movie) is a certain certain. Entity 2: AAA (1945 movie). The main actor of AAA (1945 movie) is b certain certain. AAA (1945 movie) actor b certain certain. Entity 3: AAA (play). C certain certain plays role B in AAA (play).< / reference> Sub-question: Who plays role B in the movie "AAA"? <Reference Evidence Context 1: Title: "CCC" Text: In the late 1930s, she also appeared on the television network's "MM's Story." She was also a member of the casts of "G" and "T." Her first screen credit was for the role of D in the 1945 film "AAA," which starred B as B. The following year she appeared in "U" with D, E, and F. Then, in 1949, G gave an interesting but brief performance (uncredited) as an extremely polite but non-wasteful loan processor in "T."
[0065] <Reference Evidence Context 2: Title: "AAA (1945 film)" Text: The film was reported to have changed little from the "long but quite interesting" stage version, and specifically mentioned H as "one of the most capable young actors of the year." AAA (1945 film) AAA is a 1945 comedy film starring B as B when she was 17. In the film, two teenage girls start to become interested in boys, causing worry for their respective parents. The parents' arguments about which girl is more of a bad influence cause more problems than they solve.
[0066] <Reference Evidence Context 3: Title: "AAA (1945 film)" Text: AAA (1945 film) AAA is a 1945 comedy film starring B as B when she was 17. In the film, two teenage girls start to become interested in boys, causing worry for their respective parents. The parents' arguments about which girl is more of a bad influence cause more problems than they solve. The film was adapted from the play "AAA," which was in turn adapted from a short story by B. The story, play, and film were all written by FHH.
[0067] <Reference Evidence Context 4: Title: "FHH" Text: GPI", the latter two of which he also directed. He collaborated with the similarly named but unrelated actor H on several films: "F1934" (1934), "WM" (1935), and "C" (1936). One of H's most enduring creations was the character B, who first appeared in his 1943 play "AAA" and was brought to the screen by B in the 1945 film adaptation. The character later appeared in a series of magazine articles, another B film, and a radio and television series called "MC."< / Reference> Sub-answer: B.
[0068] Chain 2: Important entity: bxxx. <Reference> Related background: Entity 1: bxxx. Character B is played by bxxx. Character B is played by bxxx. AAA (1945 film) stars bxxx. AAA (1945 film) stars bxxx. AAA (1945 film) actor bxxx.< / 参考> Sub-question: What kind of ambassador has Mr. B served as? Reference: Evidence Context 1: Title: "B So-and-so" Text: B So-and-so (April 23, 1928 – February 10, 2014) was an actress, singer, dancer, and businesswoman. In adulthood, she was appointed a promotional ambassador for XXX. She gained international acclaim in the feature film "BE," specifically designed to celebrate her talent. She also won a Special Teen Academy Award in February.
[0069] Evidence Context 2: Title: "B" Text: He served as Chairman of the NN Association for many years and served as its president for a period of time in 1984. B started working in finance in 1967.
[0070] Evidence Context 3: Title: "B" Text: (1976-January 21, 1977) Responsible for arranging the inauguration ceremony and inaugural ball for Y. She held the position of S and was an exceptional individual. B witnessed two pivotal moments in history.
[0071] Evidence Context 4: Title: "b某" Text: After b某 became the XXX promotional ambassador, he participated in the FFF event.< / 参考> Sub-answer: XXX publicity ambassador.
[0072] Final answer: XXX Promotion Ambassador.
[0073] For the above chain 1, the target model can eliminate the ambiguity in important entities through background knowledge. For example, based on the important entity "AAA", three entities with different meanings are retrieved from the knowledge graph, so that the meaning of the important entity in the overall question can be determined through the authenticity of the above entities 1-3 and the relevance to the overall question; thus, sub-questions can be generated based on the important entity and the overall question, and relevant evidence can be retrieved based on the true meaning of the important entity to obtain evidence context 1-4, and determine that the person who plays the role B in the movie "AAA" in the overall question is b. For chain 2, only one entity related to the important entity can be retrieved from the knowledge graph. Therefore, the important entity is not ambiguous. The large language model can generate sub-questions that can be used to answer the overall question based on the overall question and the unambiguous important entity. For example, <reference> and< / 参考> The information between them can represent the knowledge information recalled from the outside by the large language model, rather than the internal knowledge of the large language model.
[0074] See alsoFigure 2 , Figure 2 A flowchart of a model training method provided by an embodiment of the present specification is shown, including the following specific steps: Step 202: Obtain a first training data set.
[0075] The first training data set includes a plurality of first training data; the first training data includes an initial question, sample answer information corresponding to the initial question, a plurality of sample sub-questions corresponding to the initial question, sample sub-answer information corresponding to each sample sub-question, and sample important entity information corresponding to each sample sub-question.
[0076] The embodiment of the present specification is applied to an application or a system platform capable of training a model, for example, a server side of an application program, and for example, a cloud computing platform dedicated to model training. One or more large language models can also be configured in the application or system platform.
[0077] The initial question can represent the overall question that needs to be answered. The first training data set can be obtained from a preset training database. The preset training database can store a plurality of first training data of the same format. The sample answer information is the answer information for answering the initial question. The sample sub-answer is the answer information for answering the sample sub-question.
[0078] Optionally, before obtaining the first training data set, a method for generating the first training data includes the following specific steps: obtaining a first preset data set; the first preset data set contains an initial question, a plurality of sample sub-questions, sample sub-answers, sample evidence, and sample answers; extracting a sample triple from the sample evidence; the sample triple contains a first sample entity, a second sample entity having an association relationship with the first sample entity, and an association relationship between the first sample entity and the second sample entity; determining the background knowledge corresponding to each sample sub-question in the plurality of sample sub-questions and the sample important entity corresponding to each sample sub-question from the sample triple, to obtain a reasoning chain corresponding to each sample sub-question; splicing the reasoning chain according to the order of the sample sub-questions in the first preset data set, to obtain at least one sample reasoning chain with an order; and generating the first training data based on the sample reasoning chain, the initial question, and the sample answer.
[0079] The first preset data set can be one or more of a data set with evidence information, an overall question, and sub-questions corresponding to the overall question. The plurality of sample sub-questions in the first preset data set can be a chain of sub-questions arranged in order. Each sample sub-question in the first preset data set corresponds to one or more evidences.
[0080] The triple is a subject-predicate-object structure containing entities and relationships extracted from the evidence. The server can extract triples from the evidence using a preset large language model; it can also use a preset large language model to identify target triples that can support sample sub-questions from several extracted triples, use the target triples as background knowledge corresponding to the sample sub-questions, and identify sample important entities corresponding to the sample sub-questions from the target triples. Illustratively, the preset large language model can be at least one of the existing large language models with natural language processing capabilities.
[0081] If the initial question or sample sub-question in the first preset data set is a structured question, the structured question can be converted into a natural language question using a preset large language model. Illustratively, the reasoning chain can include a sample sub-question, background knowledge corresponding to the sample sub-question, sample important entities corresponding to the sample sub-question, and sample sub-answers corresponding to the sample sub-question. The reasoning chain in the sample reasoning chain can include multiple sample sub-questions; the reasoning chain of each sample sub-question in the sample reasoning chain can be obtained by splicing in the order of the sample sub-questions in the first preset data set. The sample reasoning chain can be a total reasoning chain, and the reasoning chain of the sample sub-question can be a sample sub-reasoning chain.
[0082] Illustratively, the server or platform can also splice the sample reasoning chain and the sample answer to obtain a sample answer. The sample answer can be data used to train the large language model to output the sample reasoning chain and the sample answer.
[0083] Illustratively, the server or platform can also obtain sample prompt words; the sample prompt words can include at least one of a restriction condition for constraining the large language model, a task for prompting the large language model to complete, a role for prompting the large language model to play, etc.
[0084] Illustratively, the server or platform can splice the initial question, the sample answer, and the sample prompt word to obtain first training data, and can store the first training data in a preset training database, so that when training the large language model, the first training data can be directly obtained from the preset training database, improving the model training efficiency. The first training data set can be represented by the formula S SFT ={I S ,q S ,o} represents, wherein S SFT represents the first training data set, q S represents the initial question, I S represents the sample prompt word, and o represents the sample answer, which can be represented by [P N ,A] represents P NThe sample inference chain is represented, and A represents a sample answer. In order to avoid interference with the ability of the large language model to learn the inference mode due to recall, the recall between the two special marks <reference> and < / reference> is improved, and the ability of the large language model to learn the inference mode is improved.
[0085] By obtaining a first preset data set; the first preset data set contains an initial question, a plurality of sample sub-questions, sample sub-answers, sample evidence, and a sample answer; sample triples are extracted from the sample evidence; the sample triples contain a first sample entity, a second sample entity having an association relationship with the first sample entity, and an association relationship between the first sample entity and the second sample entity; from the sample triples, determine the background knowledge corresponding to each sample sub-question in the plurality of sample sub-questions and the sample important entity corresponding to each sample sub-question, to obtain an inference chain corresponding to each sample sub-question; the inference chains are spliced in the order of the sample sub-questions in the first preset data set to obtain at least one sample inference chain with an order; based on the sample inference chain, the initial question and the sample answer, generate first training data. Thus, a sample inference chain with a certain order can be generated, and then a supervised fine-tuning training sample can be generated based on the sample inference chain, the sample answer and the initial question, so that the large language model can learn the analysis and inference process of the initial question to obtain the sample answer contained in the first training sample and the inference ability.
[0086] Step 204: Supervised fine-tuning training of the large language model to be trained based on the first training data set to obtain a supervised fine-tuned large language model.
[0087] The supervised fine-tuned large language model is used to generate at least one sub-question and a corresponding sub-answer based on the original question, and to obtain a target answer for the original question based on the at least one sub-question and the corresponding sub-answer.
[0088] Exemplarily, the large language model to be trained can be a pre-trained large language model with natural language processing capability.
[0089] Exemplarily, the supervised fine-tuned large language model can be obtained by performing a preset number of rounds of supervised fine-tuning training on the large language model to be trained using the first training data set. The number of first training data used in each round of supervised fine-tuning training can be the same or different. The first training data used in each round can be different or partially the same.
[0090] Exemplarily, through supervised fine-tuning training, the core function: is optimized. Wherein, L SFT represents the loss value of the supervised fine-tuning training; o represents the answer information; P represents the probability; o t represents the t-th word in the answer information; o<t denotes the first t-1 words in the answer information; denotes the parameters in the large language model; denotes the average on the supervised data set.
[0091] By obtaining a first training data set composed of several first training data including an initial question, sample answer information corresponding to the initial question, a plurality of sample sub-questions corresponding to the initial question, sample sub-answers corresponding to each sample sub-question, and sample important entities corresponding to each sample sub-question, and performing supervised fine-tuning training on the large language model to be trained according to the first training data set, a supervised fine-tuned large language model is obtained. The supervised fine-tuned large language model can be used to generate at least one sub-question and corresponding sub-answer based on the original question, and obtain a target answer for the original question based on the at least one sub-question and the corresponding sub-answer, and output the answer information according to the structure of the inference chain shown in the first training data, so that the large language model has the ability to reason based on important entity information and background knowledge in the original question, and improves the accuracy of the large language model in processing the original question. Therefore, the supervised fine-tuned model can be applied to the above answer generation method.
[0092] Optionally, after obtaining the supervised fine-tuned large language model, in order to improve the generalization ability of the large language model, the supervised fine-tuned large language model can be further trained, including the following specific steps: obtaining a second preset data set, the data set including different types of sampling questions; processing the sampling questions based on the supervised fine-tuned large language model to obtain a second training sample data set; training the supervised fine-tuned large language model according to the second training sample data set to obtain a trained large language model.
[0093] The second preset data set can include a data set of questions in different fields. The sampling question can be a total question that needs to be answered collected from the preset data set. The supervised fine-tuned large language model can generate a second training sample containing the sampling question, the inference chain, and the answer corresponding to the sampling question.
[0094] Exemplarily, the trained large language model can be obtained after a preset number of training of the supervised fine-tuned large language model; or, it can also be obtained in the case that the loss value of the trained large language model is less than or equal to a preset loss threshold through the validation set. The preset number of times and the number of second training data in the second training data set can be set based on actual needs.
[0095] The second preset data set is obtained, and the data set includes different types of sampling questions; the sampling questions are processed based on the large language model after supervised fine-tuning to obtain a second training sample data set; and the large language model after supervised fine-tuning is trained according to the second training sample data set to obtain a trained large language model. The generalization ability of the large language model is improved, and the ability of the large language model to process complex original problems and the accuracy of output answer information are further improved, so that the trained model can be applied to the above-mentioned answer generation method.
[0096] Optionally, the second training sample data set includes positive samples and negative samples; the sampling questions are processed based on the large language model after supervised fine-tuning to obtain a second training sample data set, including the following specific steps: the sampling questions are processed by using the large language model after supervised fine-tuning to obtain a plurality of candidate samples; the candidate samples at least include candidate answer information; the positive samples are determined from the plurality of candidate samples based on the candidate answer information; and the negative samples are determined from the plurality of remaining candidate samples based on the candidate answer information.
[0097] The positive samples can represent samples containing expected preferred answer information. The negative sample answer information can represent samples containing unexpected rejection answer information. The positive samples and the negative sample answers are determined from a plurality of information obtained by processing the sampling questions based on the large language model after supervised fine-tuning.
[0098] The large language model after supervised fine-tuning can process any sampling question multiple times to obtain a plurality of candidate answer information, and generate a plurality of candidate samples based on the plurality of candidate answer information and the any sampling question. Exemplarily, the plurality of candidate answer information is obtained as follows: the large language model after supervised fine-tuning is prompted by a prompt word to process any sampling question multiple times to obtain a plurality of candidate answer information; or any sampling question is input multiple times into the large language model after supervised fine-tuning to obtain a plurality of candidate answer information. The plurality of candidate answer information can be all the same candidate answer information; the plurality of candidate answer information can include partially same candidate answer information; and the plurality of candidate answer information can also include all different candidate answer information.
[0099] The positive samples can include expected preferred answer information and sampling questions. The negative sample answer information can include unexpected rejection answer information and sampling questions. In order to improve the generalization ability of the model, any sampling question can generate a plurality of different second training sample data. Any sampling question can also generate only one second training sample data.
[0100] The plurality of candidate samples are obtained by processing the sampling question by using the large language model after supervised fine-tuning. The candidate samples at least include candidate answer information. The positive sample is determined from the plurality of candidate samples based on the candidate answer information. The negative sample is determined from the plurality of remaining candidate samples based on the candidate answer information. Thus, the positive sample and the negative sample can be screened based on the output of the large language model after supervised fine-tuning, and the large language model is trained by the positive sample and the negative sample, so that the large language model can learn the preferred answer and the rejected answer based on the positive sample and the negative sample, and the generalization ability of the large language model is improved.
[0101] Optionally, determining the positive sample from the plurality of candidate samples based on the candidate answer information comprises the following specific steps: determining a reward weight of the candidate sample based on the candidate answer information; and determining the positive sample from the plurality of candidate samples based on the reward weight of the candidate sample.
[0102] The reward weight is used to represent the degree of conformity of the candidate answer information to the expectation. The higher the reward weight, the more the candidate answer information conforms to the expectation; the lower the reward weight, the less the candidate answer information conforms to the expectation. The expectation can represent the expectation that the correct answer can be output in a specified format. The reward weight of the positive sample is greater than or equal to a preset reward weight. The answer information contained in the positive sample is the correct answer corresponding to the sampling question and conforms to the specified format.
[0103] By determining the reward weight of the candidate sample based on the candidate answer information, and determining the positive sample from the plurality of candidate samples based on the reward weight of the candidate sample, the positive sample that conforms to the expectation can be determined from the candidate sample based on the reward weight, and more learnable positive samples are provided for the large language model.
[0104] Optionally, the reward weight comprises at least one of a format weight, a process weight and a result weight; the second preset data set further comprises sampling answer information corresponding to the sampling question; the candidate answer information at least comprises candidate reasoning chain information and candidate answer information; and determining the reward weight of the candidate sample based on the candidate answer information comprises the following specific steps: calculating the format weight based on the format of the candidate answer information; the format weight is used to represent whether the candidate answer information satisfies the specified format in the target instruction; the target instruction can instruct the supervised fine-tuning training model to output the answer information according to the specified format for the sampling question; calculating the process weight based on the entity information contained in the candidate reasoning chain information; the process weight is used to represent the degree to which the candidate important entity contained in the candidate reasoning chain is contained in the candidate sub-question in the candidate reasoning chain information; and calculating the result weight based on the candidate answer information and the sampling answer information; the result weight is used to represent the consistency between the candidate answer information and the sampling answer information.
[0105] The target instruction can be prompt word information, which can include prompt information indicating a model output format, prompt information indicating a model role, and prompt information indicating a task to be completed by the model, and the like.
[0106] The format weight can be a weight for evaluating whether the candidate answer information conforms to the specified format in the target instruction. Illustratively, the format weight can be calculated based on the formula: , wherein, represents the format weight.
[0107] To facilitate understanding of the specified format in the target instruction exemplified by the embodiments of the present specification, refer to Figure 3 , Figure 3 a schematic diagram of answer information conforming to the specified format in the target instruction provided by one embodiment of the present specification is shown. As Figure 3 indicated, the specified format in the target instruction can include a reasoning link in the reasoning chain information, such as "link i", an important entity, such as "entity 1: ... ", relevant background extracted from a knowledge graph, such as "entity 1: E1... entity L: E L ", a sub-question, such as "Q", evidence information, such as "d1,..., d n ", and a sub-answer, such as "a1", and the like. Figure 3 The information between <reference> and < / reference> is knowledge retrieved from the outside, which is not internal knowledge of the large model. Figure 3 For example, the answer information can also include a target answer corresponding to the original question, but Figure 3 is not shown in ,
[0108] The process weight can be a score for evaluating whether the reasoning process in the candidate answer information is reasonable. The process weight aims to determine whether the supervised fine-tuned large language model can generate a more targeted problem decomposition based on the identified entities and the background knowledge obtained by knowledge graph retrieval to assist the sub-questions. To ensure that the supervised fine-tuned large language model can take the identified important entities as the central anchor point for constructing sub-questions, the process weight is determined based on the important entities contained in the sub-questions. Illustratively, the process weight can be calculated based on the formula: , wherein, represents the process weight. m represents the length of the reasoning step of the reasoning chain, or the number of sub-questions contained in the reasoning chain information. i Q represents the i-th sub-question in the reasoning chain information. computing a sub-result process weight; wherein and both represent the important entity information involved in the process of generating the i-th sub-question.
[0109] The result weight is a score used to evaluate the difference between the candidate answer information in the candidate answer information and the sampling answer information. The greater the difference between the candidate answer information and the sampling answer information, the lower the result weight; the smaller the difference between the candidate answer information and the sampling answer information, the higher the result weight. Exemplarily, the result weight can be calculated based on the formula: . Wherein, represents the result weight. represents the candidate answer information; represents the number of words in the candidate answer information; represents the sampling answer information; represents the number of words in the sampling answer information; represents the number of overlapping words between the candidate answer information and the sampling answer information.
[0110] To improve the quality of the generated second training sample data, the sampling question and the generated candidate answer information can be screened out to avoid generating low-quality second training sample data to interfere with the training of the large language model. Optionally, the result weight can be used for screening to obtain the screened answer information and the sampling question. Exemplarily, the result weight of each candidate answer information of any sampling question can be obtained; if the result weight of each candidate answer information of any sampling question is 1, it can be indicated that the sampling question is too simple and cannot provide meaningful second training sample data for the large language model for preference differentiation, and the sampling question and its corresponding each candidate answer information are excluded; if the result weight of each candidate answer information of any sampling question is 0, it can be indicated that there is a lack of sufficient evidence information in the preset database to provide the correct answer, or the sampling question is too difficult for the current generation model to effectively reason, and the sampling question and its corresponding each candidate answer information are excluded.
[0111] For any sampling question, candidate positive sample answer information can be screened out based on a preset condition. Exemplarily, the candidate positive sample answer information set can be defined as W={ (P m ,a,r format ,r outcome ,r process ) | r format =1,r outcome =1,r process>0.7}, W represents a candidate positive sample answer information set, and the physical meanings of the other characters can refer to the above explanations, which will not be described in detail here. It can be understood that each candidate positive sample answer information in W satisfies the preset requirement of r format = 1, r outcome = 1, r process > 0.7. In actual application, the preset requirement can also be set based on actual needs, and the conditions involved in the above W are not specifically limited. The target positive sample answer information (P m + , a + , r format + , r outcome + , r process + ) can be any one of the candidate positive sample answer information in the set W.
[0112] By obtaining the sampling answer information corresponding to any sampling question from the second preset data set, calculating the format weight based on the format of the candidate answer information, calculating the process weight based on the entity information contained in the candidate reasoning chain information, calculating the result weight based on the candidate answer information and the sampling answer information, and calculating the reward weight based on the format weight, the process weight and the result weight, the positive sample can be selected by at least one of the process weight, the format weight and the result weight, so that the large language model can learn to output the preferred answer.
[0113] Optionally, the negative sample is determined from the plurality of remaining candidate samples, including the following specific steps: determining the reward weight of the remaining candidate sample based on the remaining candidate answer information of the remaining candidate sample; determining the negative sample from the remaining candidate sample based on the reward weight of the positive sample and the reward weight of the remaining candidate sample.
[0114] The remaining candidate sample can be the sample remaining in the candidate sample after processing the positive sample. The reward weight of the negative sample can be a sample with a large difference from the reward weight of the positive sample.
[0115] Optionally, the reward weight at least includes the format weight, the result weight and the process weight; the negative sample is determined from the remaining candidate sample, including the following specific steps: determining a first preset threshold based on the process weight of the positive sample; if the remaining candidate sample satisfies the first preset rule: the format weight of the remaining candidate sample indicates that the remaining candidate sample satisfies the specified format in the target instruction, and the process weight of the remaining candidate sample is less than or equal to the first preset threshold, and the result weight of the remaining candidate sample is less than or equal to the second preset threshold, the remaining candidate sample is determined as the negative sample; the sampling question contained in the negative sample is the same as the sampling question contained in the positive sample.
[0116] If the format weight is 1, it can be indicated that the output candidate answer information conforms to the specified format in the target instruction.
[0117] The first preset threshold can be a value used to determine whether the process weight meets the expectation. For example, the first preset threshold can be based on r process + The first preset value is calculated by subtracting the first preset value. The first preset value can be 0.2, 0.25, 0.27, etc.
[0118] The second preset threshold can be a value determined based on the expected quality of the result output by the large language model. To identify more diverse negative samples based on candidate samples, optionally, the second preset threshold includes an upper limit value and a lower limit value; if the result weight is less than or equal to the lower limit value, the remaining candidate samples can be determined as simple negative samples, which can indicate that the large language model can understand the reasoning chain format, but cannot obtain the correct answer information. If the result weight is less than or equal to the upper limit value, the remaining candidate samples can be determined as moderate negative samples, which can indicate that the reasoning chain information generated by the large language model can partially contribute to the correct answer. The upper limit value can be 0.5, 0.45, 0.47, etc. The lower limit value can be 0.2, 0.18, 0.23, etc. Here, the values of the upper limit value and the lower limit value are not specifically limited and can be determined based on actual needs. For example, if the reward weight of the remaining candidate answer satisfies r format - = 1, and r outcome - <= 0.2, and r process - <= r process + - 0.2, the remaining candidate samples can be considered as simple negative samples. If the reward weight of the remaining candidate answer satisfies r format - = 1, and 0.2 < r outcome - <= 0.5, and r process - <= r process + - 0.2, the remaining candidate samples can be considered as moderate negative samples.
[0119] Optionally, the reward weight at least includes a format weight, a result weight, and a process weight; the negative sample is determined from the remaining candidate sample, including the following specific steps: determining a first preset threshold based on the process weight of the positive sample; determining a third preset threshold based on the result weight of the positive sample; if the remaining candidate sample satisfies a second preset rule: the format weight of the remaining candidate sample indicates that the remaining candidate sample satisfies the specified format in the target instruction, and the process weight of the remaining candidate sample is less than or equal to the first preset threshold, and the result weight of the remaining candidate sample is less than or equal to the third preset threshold, then the remaining candidate sample is determined as the negative sample; the sampling question included in the negative sample is the same as the sampling question included in the positive sample.
[0120] The third preset threshold can be a value greater than the second preset threshold, which can be calculated based on the result weight of the positive sample minus a second preset value. The second preset value can be determined based on actual needs. The third preset threshold can be a range value determined based on the positive sample, or it can also be a limit value.
[0121] For example, if the third preset threshold is a range value, the candidate sample whose reward weight of the remaining candidate answer information satisfies r format - = 1 and 0.5 < r outcome - <= r outcome + -0.3 and r process - <= r process + -0.2 can be determined as a difficult negative sample. The difficult negative sample can indicate that the inference chain information of the large language model can basically lead to the correct answer, but due to some specific details, the answer still has errors.
[0122] Optionally, the reward weight at least includes a format weight; the negative sample is determined from the remaining candidate sample, including the following specific steps: if the remaining candidate sample satisfies a third preset rule: the format weight of the remaining candidate sample indicates that the remaining candidate sample does not satisfy the specified format in the target instruction, then the remaining candidate sample is determined as the negative sample.
[0123] If the format weight can be 0, it can indicate that the output format of the large language model does not satisfy the specified format in the target instruction. If r format - = 0, it can be determined as a format negative sample, which can indicate that the large language model does not master the format of the inference chain information.
[0124] Exemplarily, the sum value of the reward weight can be determined based on the result weight, the format weight and the process weight, the sum value is sorted, the remaining candidate samples after sorting are traversed based on the positive sample pair, and one negative sample is selected from the remaining candidate samples in the above manner; and then one positive sample is selected from the positive sample set, and the remaining candidate samples ranked after the last selected negative sample are traversed as the starting position to obtain the negative sample corresponding to the positive sample.
[0125] Through the above-mentioned screening methods of multiple negative samples, the data diversity of direct preference optimization pairing is guaranteed, the recognition accuracy of the large language model after training for preference answers and rejection answers is improved, and the generalization ability of the large language model is improved.
[0126] Exemplarily, in the process of constructing the preference optimization pairing as the second training sample data, in order to guarantee the data diversity, multiple preference optimization pairings can be constructed as the second training sample data for one sampling question. The second training data set can adopt S DPO ={I,q,o + ,o -} represents, or S DPO ={I,q,o +}{I,q,o -} represents. Wherein, o + represents the positive sample answer information, o - represents the negative sample answer information, S DPO represents the second training data set, I represents the prompt word information; q represents the sampling question.
[0127] Exemplarily, by training the large language model after supervised fine-tuning, the function: can be optimized. Wherein, L DPO represents the loss value of training; represents the parameters in the large language model in the Pth training; represents the parameters in the large language model in the P-1th training. P represents probability; o t + represents the tth word in the positive sample answer information; o <t + represents the first t-1 words in the positive sample answer information; o t - represents the tth word in the negative sample answer information; o <t - represents the first t-1 words in the negative sample answer information; represents the average on the second training data set; β represents the hyperparameter. I represents the question, and q represents the prompt word.
[0128] Corresponding to the method embodiments, the specification also provides answer generation device embodiments, Figure 4 A structural diagram of an answer generation device is shown. As shown in the figure, Figure 4 The answer generation device includes a question obtaining module 402 and an answer obtaining module 404. The question obtaining module 402 is configured to obtain an original question and input the original question into a target model. The answer obtaining module 404 is configured to generate at least one sub-question and a corresponding sub-answer based on the original question through the target model, and obtain a target answer for the original question based on the at least one sub-question and the corresponding sub-answer; wherein the at least one sub-question has an order, the sub-question is related to an important entity, and the important entity is obtained based on the original question.
[0129] In an optional embodiment of the specification, the answer obtaining module 404 is further configured to obtain the important entity based on the original question and / or an inference chain located before the current inference chain, the inference chain including the important entity, a sub-question of the original question related to the important entity, and a sub-answer for the sub-question; obtain the sub-question based on the important entity and / or the original question; and obtain the sub-answer based on the sub-question.
[0130] In an optional embodiment of the specification, the answer obtaining module 404 is further configured to generate the target answer based on the at least one sub-question and the corresponding sub-answer in a case where the generated inference chain meets an answer generation condition corresponding to the original question, and generate a next inference chain in a case where the generated inference chain does not meet the answer generation condition corresponding to the original question.
[0131] In an optional embodiment of the specification, the answer obtaining module 404 is further configured to determine an entity node matching the important entity from a knowledge graph related to the important entity, obtain a set of edges of the entity node, the edges indicating relationships or attributes between the entity nodes, determine a set of relevant edges from the set of edges based on the original question, determine background knowledge of the important entity based on the entity node, the set of relevant edges, and another entity node connected by the set of relevant edges, and obtain the sub-question based on the important entity and / or the original question, including obtaining the sub-question based on at least one of the important entity, the background knowledge, and the original question.
[0132] In an optional embodiment of the specification, the answer obtaining module 404 is further configured to search for at least one piece of evidence information for the sub-question, and obtain the sub-answer based on the evidence information.
[0133] The answer generation device provided by the embodiment of the present specification obtains an original question, inputs the original question into a target model, generates at least one sub-question and a corresponding sub-answer based on the original question through the target model, and obtains a target answer for the original question based on the at least one sub-question and the corresponding sub-answer, wherein the at least one sub-question has an order, the sub-question is related to an important entity, and the important entity is obtained based on the original question. Thus, the target model can generate a sub-question around the important entity instead of generating a sub-question based on the syntax structure of the original question, and a corresponding sub-answer is obtained based on the sub-question, and then a target answer corresponding to the original question can be generated based on the at least one sub-question and the sub-answer, thereby improving the accuracy of the generated target answer. At the same time, the target model can also generate accurate answer information by capturing subtle clues and complex knowledge associations based on the sub-answers generated by the important entity when processing complex questions or questions in a knowledge-intensive scenario.
[0134] The above is a schematic scheme of the answer generation device of the embodiment. It should be noted that the technical scheme of the answer generation device belongs to the same concept as the technical scheme of the answer generation method described above, and the details of the technical scheme of the answer generation device that are not described in detail can be referred to the description of the technical scheme of the answer generation method.
[0135] Corresponding to the method embodiments described above, the present specification also provides a model training device embodiment, Figure 5 A structural schematic diagram of a model training device provided by an embodiment of the present specification is shown. As shown in the figure, Figure 5 The model training device includes a training data acquisition module 502 and a supervised fine-tuning module 504. The training data acquisition module 502 is configured to acquire a first training data set; the first training data set includes a plurality of first training data; the first training data includes an initial question, sample answer information corresponding to the initial question, a plurality of sample sub-questions corresponding to the initial question, sample sub-answers corresponding to each sample sub-question, and sample important entity information corresponding to each sample sub-question. The supervised fine-tuning module 504 is configured to perform supervised fine-tuning training on the large language model to be trained according to the first training data set to obtain a large language model after supervised fine-tuning; the large language model after supervised fine-tuning is used to generate at least one sub-question and a corresponding sub-answer based on an original question, and obtain a target answer for the original question based on the at least one sub-question and the corresponding sub-answer.
[0136] In an optional embodiment of the present specification, the training data acquisition module 502 is further configured to: acquire a first preset data set; the first preset data set includes an initial question, a plurality of sample sub-questions, sample sub-answers, sample evidence, and sample answers; extract sample triples from the sample evidence; the sample triples include a first sample entity, a second sample entity having an association relationship with the first sample entity, and an association relationship between the first sample entity and the second sample entity; determine background knowledge corresponding to each sample sub-question in the plurality of sample sub-questions and a sample important entity corresponding to each sample sub-question from the sample triples to obtain a reasoning chain corresponding to each sample sub-question; splice the reasoning chains according to the order of the sample sub-questions in the first preset data set to obtain at least one sample reasoning chain with an order; and generate first training data based on the sample reasoning chain, the initial question, and the sample answers.
[0137] In an optional embodiment of the present specification, the supervised fine-tuning module 504 is further configured to: acquire a second preset data set, the data set including different types of sampling questions; process the sampling questions based on the large language model after supervised fine-tuning to obtain a second training sample data set; and train the large language model after supervised fine-tuning based on the second training sample data set to obtain a trained large language model.
[0138] In an optional embodiment of the present specification, the second training sample data set includes positive samples and negative samples; the supervised fine-tuning module 504 is further configured to: process the sampling questions based on the large language model after supervised fine-tuning to obtain a plurality of candidate samples; the candidate samples at least include candidate answer information; determine the positive samples from the plurality of candidate samples based on the candidate answer information; and determine the negative samples from the plurality of remaining candidate samples based on the candidate answer information.
[0139] In an optional embodiment of the present specification, the candidate answer information at least includes candidate reasoning chain information and candidate answer information; the supervised fine-tuning module 504 is further configured to: determine a reward weight of the candidate sample based on the candidate answer information; and determine the positive samples from the plurality of candidate samples based on the reward weight of the candidate sample.
[0140] In an optional embodiment of the present specification, the reward weight comprises at least one of a format weight, a process weight, and a result weight; the second preset data set further comprises sampling answer information corresponding to the sampling question; the candidate answer information at least comprises candidate reasoning chain information and candidate answer information; the supervision fine-tuning module 504 is further configured to: calculate the format weight based on the format of the candidate answer information; the format weight is used to indicate whether the candidate answer information meets the specified format in the target instruction; the target instruction can instruct the supervision fine-tuning training model to output the answer information according to the specified format for the sampling question; calculate the process weight based on the entity information contained in the candidate reasoning chain information; the process weight is used to indicate the degree to which the candidate important entity contained in the candidate reasoning chain is contained in the candidate sub-question in the candidate reasoning chain information; calculate the result weight based on the candidate answer information and the sampling answer information; the result weight is used to indicate the consistency between the candidate answer information and the sampling answer information.
[0141] In an optional embodiment of the present specification, the supervision fine-tuning module 504 is further configured to: determine the reward weight of the remaining candidate sample based on the remaining candidate answer information of the remaining candidate sample; and determine the negative sample from the remaining candidate sample based on the reward weight of the positive sample and the reward weight of the remaining candidate sample.
[0142] In an optional embodiment of the present specification, the reward weight at least comprises a format weight, a result weight, and a process weight; the supervision fine-tuning module 504 is further configured to: determine a first preset threshold based on the process weight of the positive sample; if the remaining candidate sample satisfies a first preset rule: the format weight of the remaining candidate sample indicates that the remaining candidate sample meets the specified format in the target instruction, the process weight of the remaining candidate sample is less than or equal to the first preset threshold, and the result weight of the remaining candidate sample is less than or equal to a second preset threshold, the remaining candidate sample is determined as the negative sample; the sampling question contained in the negative sample is the same as the sampling question contained in the positive sample.
[0143] In an optional embodiment of the present specification, the reward weight at least comprises a format weight, a result weight, and a process weight; the supervision fine-tuning module 504 is further configured to: determine a first preset threshold based on the process weight of the positive sample; determine a third preset threshold based on the result weight of the positive sample; if the remaining candidate sample satisfies a second preset rule: the format weight of the remaining candidate sample indicates that the remaining candidate sample meets the specified format in the target instruction, the process weight of the remaining candidate sample is less than or equal to the first preset threshold, and the result weight of the remaining candidate sample is less than or equal to the third preset threshold, the remaining candidate sample is determined as the negative sample; the sampling question contained in the negative sample is the same as the sampling question contained in the positive sample.
[0144] In an optional embodiment of the present specification, the reward weight at least includes a format weight; the supervision fine-tuning module 504 is further configured to: if the remaining candidate sample satisfies a third preset rule: the format weight of the remaining candidate sample indicates that the remaining candidate sample does not satisfy the specified format in the target instruction, the remaining candidate sample is determined as a negative sample.
[0145] The model training apparatus provided in the embodiments of the present specification comprises a first training data set composed of several first training data groups including initial questions, sample answer information corresponding to the initial questions, a plurality of sample sub-questions corresponding to the initial questions, sample sub-answers corresponding to each sample sub-question, and sample important entities corresponding to each sample sub-question, and the like, and performs supervision fine-tuning training on the large language model to be trained according to the first training data set, to obtain a large language model after supervision fine-tuning. The large language model after supervision fine-tuning can be used to generate at least one sub-question and a corresponding sub-answer based on an original question, and obtain a target answer for the original question based on the at least one sub-question and the corresponding sub-answer, and output answer information according to the structure of the inference chain shown in the first training data, so that the large language model has the ability to reason based on important entity information and background knowledge in the original question, and improves the accuracy of the large language model in processing the original question.
[0146] The above is a schematic scheme of a model training apparatus of the present embodiment. It should be noted that the technical scheme of the model training apparatus belongs to the same concept as the technical scheme of the model training method described above, and the details of the technical scheme of the model training apparatus that are not described in detail can be referred to the description of the technical scheme of the model training method.
[0147] Figure 6 A structural block diagram of a computing device provided by an embodiment of the present specification is shown. The components of the computing device 600 include, but are not limited to, a memory 610 and a processor 620. The processor 620 is connected to the memory 610 through a bus 630, and a database 650 is used to save data.
[0148] The computing device 600 also includes an access device 640 that enables the computing device 600 to communicate via one or more networks 660. Examples of such networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or combinations of such networks, such as the Internet. The access device 640 can include one or more of any type of network interface (for example, a network interface card (NIC)) such as a wired or wireless network interface, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC).
[0149] In one embodiment of the present specification, the above-mentioned components of the computing device 600 and other components not shown in the Figure 6 may be connected to each other, for example, through a bus. It should be understood that Figure 6 The computing device structure diagram shown is only for the purpose of example, and is not a limitation on the scope of the present specification. Those skilled in the art can add or replace other components as needed.
[0150] The computing device 600 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (for example, a tablet computer, a personal digital assistant, a laptop computer, a content computer, a netbook, etc.), a mobile phone (for example, a smartphone), a wearable computing device (for example, a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 600 can also be a mobile or stationary server.
[0151] The processor 620 is configured to execute computer programs / instructions that implement the steps of the above-mentioned recommendation model training method or object recommendation method when the computer programs / instructions are executed by the processor.
[0152] The above is a schematic solution of the computing device of the embodiment. It should be noted that the technical solution of the computing device belongs to the same concept as the technical solutions of the answer generation method and the model training method, and details of the technical solution of the computing device that are not described in detail can be found in the description of the technical solution of the answer generation method or the model training method.
[0153] An embodiment of the present specification also provides a computer readable storage medium storing computer programs / instructions, which, when executed by a processor, implement the steps of the above answer generation method or model training method.
[0154] The above is a schematic solution of the computer readable storage medium of the embodiment. It should be noted that the technical solution of the storage medium belongs to the same concept as the technical solutions of the answer generation method and the model training method, and details of the technical solution of the storage medium that are not described in detail can be found in the description of the technical solution of the answer generation method or the model training method.
[0155] An embodiment of the present specification also provides a computer program product comprising computer programs / instructions, which, when executed by a processor, implement the steps of the above answer generation method or model training method.
[0156] The above is a schematic solution of the computer program product of the embodiment. It should be noted that the technical solution of the computer program product belongs to the same concept as the technical solutions of the answer generation method and the model training method, and details of the technical solution of the computer program product that are not described in detail can be found in the description of the technical solution of the answer generation method or the model training method.
[0157] The above describes specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the acts or steps recited in the claims can be performed in a different order than the order in which they are recited and still achieve desirable results. In addition, the processes depicted in the figures do not necessarily require the particular order shown, or sequential order to achieve the desired results. In certain implementations, multitasking and parallel processing can be advantageous.
[0158] The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the contents contained in the computer readable medium can be appropriately increased or decreased according to the requirements of patent practice. For example, according to the patent practice in some regions, the computer readable medium does not include electrical carrier signals and telecommunication signals.
[0159] It should be noted that, for the foregoing method embodiments, in order to facilitate description, they are all expressed as a combination of a series of actions, but those skilled in the art should know that the embodiments of the present specification are not limited by the order of the described actions, because according to the embodiments of the present specification, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments of the present specification.
[0160] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0161] The preferred embodiments of the present specification disclosed above are only used to help explain the present specification. The alternative embodiments do not describe all the details and limit the invention to only the specific embodiments. Obviously, according to the content of the embodiments of the present specification, many modifications and changes can be made. The present specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of the present specification, so that those skilled in the art can well understand and use the present specification. The present specification is limited only by the claims and their entire scope and equivalents.
Claims
1. A method for generating an answer, characterized in that: include: Get the original problem and input it into the target model; At least one sub-question and a corresponding sub-answer are generated based on the original question through the target model, and a target answer to the original question is obtained based on the at least one sub-question and the corresponding sub-answer; wherein the at least one sub-question has an order, and the sub-questions are related to important entities; the important entities are obtained based on the original question.
2. The method according to claim 1, characterized in that Generating at least one sub-question and a corresponding sub-answer based on the original question using the target model includes: Obtaining an important entity based on the original question and / or a reasoning chain preceding the current reasoning chain, wherein the reasoning chain includes an important entity, a sub-question of the original question related to the important entity, and a sub-answer to the sub-question; Obtaining sub-questions based on the important entities and / or the original question; Based on the sub-questions, sub-answers are obtained.
3. The method according to claim 2, characterized in that After obtaining the sub-answers based on the sub-questions, the method further includes: generating a target answer based on the at least one sub-question and the corresponding sub-answer, if the generated reasoning chain meets the answer generation condition corresponding to the original question; If the generated reasoning chain does not meet the answer generation condition corresponding to the original question, a next reasoning chain is generated.
4. The method according to claim 2, characterized in that The reasoning chain also includes background knowledge of the important entity; the process of obtaining the background knowledge includes: Determining an entity node matching the important entity from a knowledge graph related to the important entity; Obtain an edge set of the entity node, where the edge indicates a relationship or attribute between the entity nodes; Based on the original problem, determining a relevant edge set from the edge set; Determining background knowledge of the important entity based on the entity node, the related edge set, and another entity node connected by the related edge set; The obtaining of sub-questions based on the important entity and / or the original question includes: A sub-question is obtained based on at least one of the important entity, the background knowledge, and the original question.
5. The method according to claim 2, characterized in that Based on the sub-questions, sub-answers are obtained, including: Searching for the sub-question to obtain at least one piece of evidence information; Based on the evidence information, the sub-answer is obtained.
6. A model training method, characterized in that: include: Obtain a first training data set; the first training data set includes a plurality of first training data; The first training data includes an initial question, sample answer information corresponding to the initial question, multiple sample sub-questions corresponding to the initial question, sample sub-answers corresponding to each of the sample sub-questions, and sample important entity information corresponding to each of the sample sub-questions; The large language model to be trained is subjected to supervised fine-tuning training based on the first training data set to obtain a large language model after supervised fine-tuning; the large language model after supervised fine-tuning is used to generate at least one sub-question and a corresponding sub-answer based on the original question, and based on the at least one sub-question and the corresponding sub-answer, a target answer to the original question is obtained.
7. The method according to claim 6, characterized in that The method further comprises: Obtaining the first preset data set; the first preset data set includes the initial question, the multiple sample sub-questions, the sample sub-answers, sample evidence, and the sample answers; Extracting a sample triple from the sample evidence; the sample triple includes a first sample entity, a second sample entity having an association relationship with the first sample entity, and an association relationship between the first sample entity and the second sample entity; Determining, from the sample triples, background knowledge corresponding to each of the multiple sample subproblems and the sample important entities corresponding to each of the sample subproblems, to obtain a reasoning chain corresponding to each of the sample subproblems; splicing the reasoning chains according to the order of the sample sub-problems in the first preset data set to obtain at least one sample reasoning chain with an order; The first training data is generated based on the sample reasoning chain, the initial question, and the sample answer.
8. The method according to claim 6, characterized in that The method further comprises: Acquire a second preset data set, where the data set includes different types of sampling problems; Processing the sampling problem based on the supervised fine-tuned large language model to obtain a second training sample dataset; The supervised fine-tuned large language model is trained according to the second training sample data set to obtain a trained large language model.
9. The method according to claim 8, characterized in that The second training sample data set includes positive samples and negative samples; the sampling problem is processed based on the large language model after the supervised fine-tuning to obtain the second training sample data set, including: Processing the sampling problem using the supervised fine-tuned large language model to obtain a plurality of candidate samples; the candidate samples at least include candidate answer information; Determining the positive sample from the multiple candidate samples based on the candidate answer information; Based on the candidate answer information, the negative sample is determined from a plurality of remaining candidate samples.
10. The method according to claim 9, characterized in that Determining the positive sample from the plurality of candidate samples based on the candidate answer information includes: Determining a reward weight for the candidate sample based on the candidate answer information; The positive sample is determined from the multiple candidate samples based on the reward weights of the candidate samples.
11. The method according to claim 10, characterized in that The reward weight includes at least one of a format weight, a process weight, and a result weight; the second preset data set also includes sample answer information corresponding to the sample question; The candidate answer information at least includes candidate reasoning chain information and candidate answer information; The step of determining the reward weight of the candidate sample based on the candidate answer information includes: Calculating a format weight based on the format of the candidate answer information; the format weight is used to indicate whether the candidate answer information satisfies a specified format in a target instruction; the target instruction can instruct the supervised fine-tuning training model to output answer information for the sampled question in a specified format; Calculating a process weight based on the entity information included in the candidate reasoning chain information; the process weight is used to indicate the degree to which the candidate important entity included in the candidate reasoning chain is included in the candidate sub-problem in the candidate reasoning chain information; A result weight is calculated based on the candidate answer information and the sample answer information; the result weight is used to represent the degree of consistency between the candidate answer information and the sample answer information.
12. The method according to claim 10, characterized in that Determining the negative sample from the plurality of remaining candidate samples includes: Determining reward weights for the remaining candidate samples based on the remaining candidate answer information of the remaining candidate samples; The negative sample is determined from the remaining candidate samples based on the reward weight of the positive sample and the reward weights of the remaining candidate samples.
13. The method according to claim 12, characterized in that The reward weight at least includes format weight, result weight and process weight; Determining the negative sample from the remaining candidate samples includes: Determining a first preset threshold based on the process weight of the positive sample; If the remaining candidate samples meet the first preset rule: the format weight of the remaining candidate samples indicates that the remaining candidate samples meet the specified format in the target instruction, and the process weight of the remaining candidate samples is less than or equal to the first preset threshold, and the result weight of the remaining candidate samples is less than or equal to the second preset threshold, then the remaining candidate samples are determined to be the same as the negative samples; the sampling problem contained in the negative samples is the same as the sampling problem contained in the positive samples.
14. The method according to claim 12, characterized in that The reward weight at least includes format weight, result weight and process weight; Determining the negative sample from the remaining candidate samples includes: Determining a first preset threshold based on the process weight of the positive sample; Determining a third preset threshold based on the result weight of the positive sample; If the remaining candidate samples meet the second preset rule: the format weight of the remaining candidate samples indicates that the remaining candidate samples meet the specified format in the target instruction, and the process weight of the remaining candidate samples is less than or equal to the first preset threshold, and the result weight of the remaining candidate samples is less than or equal to the third preset threshold, then the remaining candidate samples are determined to be the negative samples; the sampling problem contained in the negative samples is the same as the sampling problem contained in the positive samples.
15. The method according to claim 12, characterized in that The reward weight at least includes a format weight; and determining the negative sample from the remaining candidate samples includes: If the remaining candidate samples satisfy a third preset rule: the format weight of the remaining candidate samples indicates that the remaining candidate samples do not satisfy a specified format in the target instruction, then the remaining candidate samples are determined as negative samples.
16. An answer generation device, characterized in that: Including question acquisition module and answer acquisition module; The question acquisition module is configured to acquire the original question and input it into the target model; The answer obtaining module is configured to generate at least one sub-question and a corresponding sub-answer based on the original question through the target model, and obtain a target answer to the original question based on the at least one sub-question and the corresponding sub-answer; wherein the at least one sub-question has an order, and the sub-question is related to an important entity; the important entity is obtained based on the original question.
17. A model training device, characterized in that: Including training data acquisition module and supervised fine-tuning module: The training data acquisition module is configured to acquire a first training data set; the first training data set includes a plurality of first training data; the first training data includes an initial question, sample answer information corresponding to the initial question, multiple sample sub-questions corresponding to the initial question, sample sub-answers corresponding to each of the sample sub-questions, and sample important entity information corresponding to each of the sample sub-questions; The supervised fine-tuning module is configured to perform supervised fine-tuning training on the large language model to be trained based on the first training data set to obtain a large language model after supervised fine-tuning; the large language model after supervised fine-tuning is used to generate at least one sub-question and a corresponding sub-answer based on the original question, and obtain a target answer to the original question based on the at least one sub-question and the corresponding sub-answer.
18. A computing device, characterized in that include: memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer program / instructions are executed by the processor, the steps of the method according to any one of claims 1 to 15 are implemented.
19. A computer-readable storage medium, characterized in that It stores a computer program / instruction, which implements the steps of the method according to any one of claims 1 to 15 when executed by a processor.
20. A computer program product, characterized in that The method comprises a computer program / instruction which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 15.