A data generation method and electronic device
By generating and expanding atomic question-answer pairs based on entity information, the shortcomings of existing datasets in terms of scale and complexity are addressed. This enables the efficient construction of composite question-answer data for multi-step query/reasoning, improves the diversity and generalization ability of the data, and supports the continuous training and evaluation of high-performance agents.
Patent Information
- Application Number
- CN202611329264.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-28
- Publication Date
- 2026-11-17
AI Technical Summary
Existing public datasets are insufficient in terms of scale, complexity, and diversity to meet the needs of continuous training and evaluation of high-performance agents, especially in terms of multi-hop reasoning, multimodal understanding, and cross-domain knowledge integration.
By generating atomic question-answer pairs based on entity information and generating target composite questions and answers through multi-hop expansion processing, and by adopting answer-driven and question-driven iterative expansion mechanisms, high-quality composite question-answer data containing multi-step query or reasoning steps is constructed.
The system automatically constructs high-quality composite question-and-answer data containing multi-step queries/reasoning and hidden intermediate answers, breaking through the limitations of existing data synthesis methods, improving the diversity and generalization ability of generated data, and providing efficient and low-cost data support for continuous training and evaluation of models with strong logical reasoning capabilities.
Smart Images

Figure CN123117342A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of artificial intelligence and cross-modal data processing technology, and in particular to a data generation method and an electronic device. Background Technology
[0002] With the rapid development of Large Language Models (LLMs) and agent technologies, the evaluation and training of models on complex open-domain tasks has become a research hotspot. Benchmarks such as GAIA (General AI Assistant Benchmark) require models to possess comprehensive capabilities such as multi-hop reasoning, multi-modal understanding, tool use, and / or cross-domain knowledge integration. However, existing public datasets are significantly insufficient in terms of scale, complexity, and diversity, making it difficult to meet the needs of continuous training and evaluation of high-performance agents. Summary of the Invention
[0003] Therefore, this application discloses the following technical solution:
[0004] A data generation method, comprising:
[0005] Obtain the first entity information;
[0006] Based on the first entity information, a related first atomic question-and-answer pair is generated; the first atomic question-and-answer pair includes a first atomic question and a corresponding first answer.
[0007] The first atomic question-answer pair is subjected to multi-hop expansion processing to obtain the target composite question and the corresponding target answer;
[0008] The first atomic problem includes a single-step query or reasoning step; the target composite problem includes a multi-step query or reasoning step, but does not include the first answer.
[0009] Optionally, based on the first entity information, a related first atomic question-and-answer pair is generated, including:
[0010] Determine the context information that satisfies the association conditions with the first entity information;
[0011] Extract target knowledge that can be used to form an answer from the context information;
[0012] Determine the association between the target knowledge and the first entity information;
[0013] The first atomic question-answer pair is generated based on the target knowledge and the relationship.
[0014] Optionally, the first atomic question-answer pair is subjected to multi-hop expansion processing to obtain the target composite question and the corresponding target answer, including:
[0015] Obtain the question elements and / or answer elements in the current atomic question-answer pair, perform question-based and / or answer-based solution link extension based on the question elements and / or answer elements to generate a new atomic question-answer pair, and generate the target composite question and the corresponding target answer based on the atomic question-answer pair obtained from at least one extension iteration;
[0016] The current atomic question-and-answer pair is either the first atomic question-and-answer pair or the corresponding atomic question-and-answer pair generated during the extended processing.
[0017] Optionally, based on the question elements and / or the answer elements, a question-based and / or answer-based solution chain extension is performed to generate new atomic question-answer pairs, including at least one of the following:
[0018] Extract second entity information from the current answer contained in the current atomic question-answer pair, and generate a second atomic question-answer pair related to the current answer based on the second entity information;
[0019] Extract third entity information from the current atomic question contained in the current atomic question-answer pair, determine the superset content including the third entity information, and generate a third atomic question-answer pair based on the relationship between the third entity information and the superset content.
[0020] Optionally, generate new atomic question-and-answer pairs, including:
[0021] If the number of new entity information that can be extracted from the current atomic question contained in the current atomic question is less than a first threshold, the step of extracting second entity information from the current answer contained in the current atomic question is triggered to generate the second atomic question and answer pair.
[0022] If the number of new entity information that can be extracted from the current atomic question reaches the first threshold, the step of extracting third entity information from the current atomic question contained in the current atomic question-answer pair is triggered to generate the third atomic question-answer pair;
[0023] If the number of consecutive executions of generating the third atomic question-answer pair reaches a second threshold, a step of extracting the second entity information from the current answer contained in the current atomic question-answer pair is triggered to generate the second atomic question-answer pair.
[0024] Optionally, the first atomic question-answer pair is subjected to multi-hop expansion processing to obtain the target composite question and the corresponding target answer, including:
[0025] Starting from the reasoning trajectory represented by the first atomic question-answer pair, the reasoning trajectory is expanded iteratively until the expanded reasoning trajectory meets the termination condition. Based on the expanded reasoning trajectory, the target composite question and the corresponding target answer are determined.
[0026] Each iteration of the expansion includes: generating new atomic question-answer pairs based on the current target inference trajectory to be expanded, and incorporating the new atomic question-answer pairs into the target inference trajectory.
[0027] Optionally, starting from the reasoning trajectory represented by the first atomic question-and-answer pair, the reasoning trajectory is expanded iteratively, including:
[0028] A set of trajectories is determined, wherein each element of the set of trajectories is a sequence of atomic question-answer pairs used to characterize the reasoning trajectory;
[0029] Obtain the current target inference trajectory to be expanded from the trajectory set. The target inference trajectory is the inference trajectory represented by the first atomic question-answer pair, or the inference trajectory represented by the atomic question-answer pair sequence formed by the first atomic question-answer pair and the corresponding expanded atomic question-answer pair.
[0030] Generate new atomic question-answer pairs based on the target reasoning trajectory;
[0031] The target inference trajectory is updated based on the new atomic question-answer pair. If the updated target inference trajectory satisfies the termination condition, the target composite question and the corresponding target answer are generated based on the updated target inference trajectory. If the updated target inference trajectory does not satisfy the termination condition, the updated target inference trajectory is added to the trajectory set to iterate the trajectory expansion process.
[0032] Optionally, generating new atomic question-answer pairs based on the target inference trajectory includes:
[0033] The target inference trajectory is extended along multiple directions to generate new atomic question-and-answer pairs corresponding to each direction, and the target inference trajectory is updated based on the new atomic question-and-answer pairs corresponding to each direction.
[0034] The different directions represent the different extension strategies and / or different extension anchors on which the target reasoning trajectory is extended.
[0035] Optionally, before generating the target composite question and its corresponding target answer based on the atomic question-answer pairs obtained from at least one expansion iteration, the method further includes:
[0036] Detect the repetition of content among the atomic question-and-answer pairs;
[0037] In response to duplicate content appearing in different atomic question-answer pairs, deduplication processing is performed on the duplicate content to obtain deduplicated atomic question-answer pairs, and the target composite question and the corresponding target answer are generated based on the deduplicated atomic question-answer pairs;
[0038] Based on the atomic question-answer pairs obtained from at least one expansion iteration, the target composite question and the corresponding target answer are generated, including:
[0039] Based on the atomic question-answer pairs obtained from at least one expansion iteration, extract the question sequence and the answer sequence;
[0040] The atomic problems in the problem sequence are fused together to obtain the target composite problem;
[0041] The target answer to the target compound question is determined based on the answer sequence.
[0042] An electronic device, comprising:
[0043] Memory, used to store at least one set of computer instructions;
[0044] A processor is configured to perform the following processing by executing a set of instructions stored in the memory:
[0045] Obtain the first entity information;
[0046] Based on the first entity information, a related first atomic question-and-answer pair is generated; the first atomic question-and-answer pair includes a first atomic question and a corresponding first answer.
[0047] The first atomic question-answer pair is subjected to multi-hop expansion processing to obtain the target composite question and the corresponding target answer;
[0048] The first atomic problem includes a single-step query or reasoning step; the target composite problem includes a multi-step query or reasoning step, but does not include the first answer.
[0049] A storage medium carrying one or more computer instruction sets, which, when executed by an electronic device, enable the electronic device to implement any of the data generation methods provided above. Attached Figure Description
[0050] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0051] Figure 1 This is a flowchart of the data generation method provided in this application;
[0052] Figure 2 This is an example of generating the first atomic question-and-answer pair provided in this application;
[0053] Figure 3 This is a flowchart illustrating the answer-driven expansion provided in this application;
[0054] Figure 4 This is a flowchart illustrating the problem-driven extension provided in this application;
[0055] Figure 5 This is a flowchart of the system implementation for generating multi-hop question-answer pairs provided in this application;
[0056] Figure 6 This is a structural diagram of the data generation apparatus provided in this application;
[0057] Figure 7 This is a structural diagram of the electronic device provided in this application. Detailed Implementation
[0058] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0059] This application provides a data generation method and an electronic device for data synthesis and enhancement for complex tasks such as GAIA, in order to solve the problem that existing public datasets are difficult to meet the needs of continuous training and evaluation of high-performance agents in terms of scale, complexity and / or diversity.
[0060] The method can be applied to electronic devices in a variety of general or special computing environments or configurations, such as personal computers, server computers, smart terminals, handheld or portable devices, tablet devices, etc.
[0061] See Figure 1 The flowchart shown illustrates the data generation method provided in this application embodiment, which may include the following steps 101 to 103, which are described in detail below.
[0062] Step 101: Obtain the information of the first entity.
[0063] The first entity information and other entity information mentioned below (such as the second entity information and the third entity information) may include, but are not limited to, entity identifiers such as entity name, ID (Identity) and / or number, to identify related nouns or concepts.
[0064] In this embodiment, entity information (such as entity identifiers) is used as a seed for data synthesis and enhancement to ultimately generate the required data. The first entity information obtained in this step is used as a seed node for data synthesis and enhancement to initiate the data generation process.
[0065] The first entity information can be randomly selected from a preset entity library, or it can be specified based on the task requirements of a specific field (such as sports, science, entertainment, geography, history, finance, etc.). There are no restrictions on this, and it can be determined according to the actual application.
[0066] Step 102: Based on the first entity information, generate a related first atomic question-answer pair; the first atomic question-answer pair includes a first atomic question and a corresponding first answer.
[0067] Optionally, context information associated with the first entity information can be obtained, and a first atomic question-and-answer pair related to the first entity information can be generated based on the context information.
[0068] Each atomic question-and-answer pair consists of an atomic question and a corresponding answer. Each atomic question contains a single query or reasoning step, meaning the answer to the question can be obtained by executing one query or reasoning step. For example, the first atomic question Q1: Who is the director of a certain movie? The first answer to the first atomic question A1: Director X.
[0069] The context information associated with the first entity information can refer to a set of content descriptions (such as a set of event descriptions) that takes the first entity information as the core description object or is related to the first entity information. It can include, but is not limited to, background data used to objectively record the inherent attributes, external characteristics, categories and / or associated events of the first entity information, and can be any modal or multimodal data such as text corpus (such as definitions, parameter descriptions), image data (such as physical images, structural diagrams), audio and video streams and / or structured data records.
[0070] The first atomic question-answer pair generated in this step serves as the basic unit of the data generation process, providing fundamental support for the generation of complex questions and answers based on multi-hop expansion processing.
[0071] Step 103: Perform multi-hop expansion processing on the first atomic question-answer pair to obtain the target composite question and the corresponding target answer.
[0072] After obtaining the first atomic question-answer pair, the elements in the first atomic question-answer pair and / or their associated elements can be used as extension anchors to perform a solution link extension based on the question and / or the answer. The first atomic question-answer pair is then fused with at least one new atomic question-answer pair generated by the extension to obtain the target composite question and the corresponding target answer.
[0073] The target composite problem involves multiple query or reasoning steps and does not include intermediate answers such as the first answer. Specifically, obtaining the target answer requires executing multiple query and / or reasoning steps (e.g., 2 to 5 or even more reasoning steps). Each subsequent query / reasoning step depends on the output of the preceding query / reasoning steps, and the target composite problem does not directly expose intermediate answers in the solution chain.
[0074] For example, the objective compound problem Q o The question asks: In which country was the director of film A born? The answer is A. o The answer to this complex problem is: the United Kingdom. To find the answer, we first need to determine the director X of film A, then further determine the country of director X. This problem does not directly expose intermediate answers in the solution chain, such as "director X".
[0075] This application embodiment automatically generates a first atomic question-and-answer pair using the first entity information as a seed node, and further performs multi-hop expansion processing on the first atomic question-and-answer pair to generate a target composite question and the corresponding target answer. It can automatically construct high-quality composite question-and-answer data containing multi-step queries / reasoning and hiding intermediate answers without a lot of manual intervention. This not only breaks through the limitations of existing data synthesis methods in terms of reasoning depth and logical complexity, but also improves the diversity and generalization ability of the generated data, thereby providing efficient and low-cost data support for continuous training / evaluation of related models or agents with strong logical reasoning capabilities.
[0076] In an optional embodiment, step 102 in the method of this application, namely generating a related first atomic question-answer pair based on the first entity information, can be further implemented as the following steps "2-1"-"2-4".
[0077] 2-1: Determine the context information that satisfies the association conditions with the first entity information.
[0078] Optionally, the context information can be obtained by using the first entity information or its similar entity information (such as synonyms of a noun) as the retrieval basis and through retrieval enhancement methods.
[0079] The search enhancement methods may include, but are not limited to, at least one of Wikipedia page retrieval, search engine query, web page content crawling, file reading, audio / video reading, or video analysis. The contextual information may include, but is not limited to, multimodal information such as text, images, hyperlinks, and / or audio / video content.
[0080] 2-2: Extract target knowledge from the context information that can be used to form the answer.
[0081] After obtaining the context information, one or more deterministic facts, attributes, and / or data can be extracted from the context information as target knowledge that can be used to form an answer.
[0082] For example, a large language model can be used to analyze and understand the obtained multimodal contextual information, extracting one or more deterministic facts, attributes, or data as the target knowledge. This target knowledge is used as key information fragments capable of answering questions posed based on the first entity information.
[0083] 2-3: Determine the association between the target knowledge and the first entity information.
[0084] This step is used to construct a semantic association between the first entity information and the target knowledge. This semantic association clarifies the logical connection between the question and the answer, including but not limited to logical connections such as attribute relationships, subordinate relationships, causal relationships, or action relationships.
[0085] 2-4: Generate the first atomic question-answer pair based on the target knowledge and the association relationship.
[0086] Specifically, question text can be generated based on the above-mentioned relationship, and the extracted target knowledge can be used as the answer to the question or the answer elements can be sampled from the target knowledge to form the answer to the question, thereby combining and generating the first atomic question-answer pair.
[0087] For example, given a movie title as the primary entity identifier, assuming the retrieved context information includes the director's information (such as director's name, gender, date of birth, list of films directed, etc.), the relationship between the two can be determined as a directing relationship. Based on this relationship, the primary question can be generated: Who is the director of this movie? Furthermore, based on the target knowledge about the director extracted from the context information, the primary answer to this primary question can be generated: Director X.
[0088] See Figure 2This provides an example of generating the first atomic question-answer pair, where Identifier represents the identifier, representing the first entity information; Tools represents the tools used for context retrieval based on the Identifier; "Text and Image" represents the retrieved context information; Relationship represents the association between the Identifier and the target knowledge extracted from the context information; LLM represents the Large Language Model; and Questions and Answer represent the first atomic question-answer pair finally generated based on the target knowledge and the association.
[0089] This embodiment uses entity identifiers and other entity information as seeds, combined with retrieval enhancement mechanisms, to extract deterministic facts from multimodal contexts to generate atomic question-answer pairs containing unique answers. This eliminates model illusion and ensures the objectivity, accuracy, and logical necessity of the answers. Simultaneously, it can flexibly construct atomic questions covering any scenario, providing high-quality, traceable, broadly scenario-covering, and highly scalable basic data units for building complex reasoning tasks.
[0090] In an optional embodiment, step 103 of the method of this application, namely, performing multi-hop expansion processing on the first atomic question-answer pair to obtain the target composite question and the corresponding target answer, can be implemented as follows:
[0091] Obtain the question elements and / or answer elements in the current atomic question-answer pair, perform question-based and / or answer-based solution link extension based on the question elements and / or answer elements to generate a new atomic question-answer pair, and generate the target composite question and the corresponding target answer based on the atomic question-answer pair obtained from at least one extension iteration.
[0092] The current atomic question-and-answer pair is either the first atomic question-and-answer pair or the corresponding atomic question-and-answer pair generated during the extended processing.
[0093] In the above implementation process, the solution link is extended based on the question elements and / or the answer elements to generate new atomic question-answer pairs, which can be further implemented as at least one of the following two extension methods.
[0094] a. Answer-based expansion: Extract second entity information from the current answer contained in the current atomic question-answer pair, and generate a second atomic question-answer pair related to the current answer based on the second entity information.
[0095] Optionally, a new entity identifier can be extracted from the answer contained in the current atomic question-answer pair as second entity information, and a new atomic question (i.e., the new atomic question is about the answer) can be generated based on the second entity information to serve as the second atomic question. The second answer corresponding to the second atomic question can then be further determined, thus forming a second atomic question-answer pair. This extension method follows the "answer"... New entity identifier The new question-and-answer pair is an extension of the existing reasoning chain, suitable for extending it to a deeper level.
[0096] For example, suppose the current first atomic question-answer pair is "Q1: Who is the director of a certain movie? A1: Director X". In this extension method a, the current answer "Director X" can be extracted as the second entity information (new identifier). Then, a new second atomic question-answer pair is generated around "Director X", such as "Q2: Which university did Director X graduate from? A2: University Y". Subsequently, the new and old questions can be merged to generate a target composite question, and its corresponding target answer can be determined. For example, the target composite question "Which university did the director of a certain movie graduate from?" has the target answer "University Y".
[0097] See Figure 3 The diagram illustrates the answer-driven expansion process, where Q / A represents the current atomic question-answer pair, Aswer represents the answer in the current atomic question-answer pair, GAP represents the atomic question generation module, and Single-hop Q / A represents the new atomic question-answer pair expanded through the answer-driven expansion method. Subsequently, the final target composite question (multi-hop question) and the corresponding answer can be generated based on each atomic question-answer pair.
[0098] b. Question-based expansion: Extract third entity information from the current atomic question contained in the current atomic question-answer pair, determine the superset content including the third entity information, and generate a third atomic question-answer pair based on the relationship between the third entity information and the superset content.
[0099] Optionally, a new entity identifier other than the original identifier (first entity information) can be extracted from the current question contained in the current atomic question-answer pair as third entity information. Then, a "reverse superset search" method is used to find the superset content containing the new entity identifier, and a new question is generated based on the relationship between the superset and the new entity identifier as the third atomic question. The third answer corresponding to the third atomic question is then determined, thus forming a third atomic question-answer pair. This extension method follows the "question"... New entity identifier Superset The directional expansion of the new question-answer pair can be used to increase the reasoning breadth of a question.
[0100] For example, suppose the current first atomic question-answer pair is "Q1: What other works has director X, who directed the science fiction film 'Movie A', directed? A1: 'Movie B'", and suppose the original identifier, i.e., the first entity information, is "science fiction film 'Movie A'". In this extension method b, a new entity identifier other than the original identifier can be extracted from question Q1, i.e., "director X" can be extracted as the third entity information. Subsequently, using a reverse superset search mechanism, a superset containing "director X" is found, such as "director X is the producer of a science fiction film 'Movie B'", and a third atomic question pair is generated based on this superset content, such as "Q3: Which science fiction film's producer is director X? A3: 'Movie B'". Subsequently, by merging the atomic questions, a target composite question can be generated, such as "The director of science fiction film 'Movie A', or the producer of which science fiction film?", with the corresponding target answer being "'Movie B'".
[0101] See Figure 4 This shows a flowchart illustrating the problem-driven expansion process, where Q / A and GAP have different meanings. Figure 3 In the code, Q / A and GAP have the same meaning, representing the current atomic question-answer pair and the atomic question generation module, respectively. Question represents the question in the current atomic question-answer pair, and Identifier 1, Identifier 2...Identifier n represent the n new entity identifiers extracted from Question, which are used as anchors to expand the atomic question-answer pair. Multi-hop Q / A represents the final multi-hop question-answer pair generated based on each atomic question-answer pair, that is, the target composite question and the corresponding target answer.
[0102] In practical applications, at least one of the two extension methods mentioned above can be executed iteratively until the termination condition is met, thereby generating a target composite question containing multiple query or reasoning steps and its corresponding target answer.
[0103] The termination condition may include, but is not limited to, at least one of the following:
[0104] Condition 1: The target complex problem contains a set number of query / reasoning steps;
[0105] Condition 2: The number of iterations reaches the set number;
[0106] Condition 3: The iteration time reaches the set duration;
[0107] Condition 4: The currently generated target complex problem has met the preset semantic integrity requirements, or the current reasoning link has formed a logical closed loop.
[0108] This embodiment uses single-hop atomic question-answer pairs as basic units. Through a dual-strategy iterative expansion mechanism of "answer-driven" and "question-driven," it explicitly expands the solution chain along the depth and / or width dimensions. This ensures that the generated target composite question possesses a realistic and rigorous multi-step reasoning structure, overcoming the shortcomings of known LLM self-generation methods, such as weak multi-hop reasoning capabilities, susceptibility to pseudo-multi-hop (i.e., complex problems that "appear multi-hop but are actually single-hop," lacking genuine logical dependencies between sub-questions and allowing direct answers without multi-step reasoning or retrieval), and lack of explicit control over intermediate steps. Simultaneously, this mechanism effectively controls the logical closure and semantic integrity of the reasoning chain, guaranteeing the uniqueness and objective accuracy of the answers to multi-hop questions.
[0109] In an optional embodiment, when explicitly expanding the solution path along the depth and / or width dimensions using a dual-strategy iterative expansion mechanism of "answer-driven" and "problem-driven", the following adaptive alternation strategy can be adopted to alternate between the two expansion methods:
[0110] 3-1: If the number of new entity information that can be extracted from the current atomic question in the current atomic question contained in the current atomic question-answer pair is lower than the first threshold, the answer-driven expansion method is triggered to generate a new atomic question-answer pair through the answer-driven expansion method;
[0111] 3-2: If the number of new entity information that can be extracted from the current atomic problem reaches the first threshold, the question-driven extension method is triggered to generate new atomic question-answer pairs through the question-driven extension method;
[0112] 3-3: If the number of consecutive executions of question-driven extension reaches the second threshold, the answer-driven extension method is triggered to switch to generating new atomic question-answer pairs through the answer-driven extension method.
[0113] The specific values of the first and second thresholds can be customized according to requirements.
[0114] For example, when the number of new identifiers that can be extracted from the current atomic problem is less than 1, the system automatically switches to the answer-driven expansion mode; when the number of new identifiers that can be extracted from the current atomic problem is sufficient (e.g., the number is greater than or equal to 1), the system automatically switches to the problem-driven expansion mode; when the number of consecutive executions of problem-driven expansion reaches the upper limit, the system forces the use of the answer-driven expansion mode to complete the last hop, thereby ensuring the diversity and integrity of the reasoning chain.
[0115] This embodiment can adaptively control the diversity and completeness of inference paths for multi-hop complex problems, making it easier to construct data samples that are more suitable for complex tasks like GAIA.
[0116] In an optional embodiment, step 103 of the method of this application, namely, performing multi-hop expansion processing on the first atomic question-answer pair to obtain the target composite question and the corresponding target answer, can be implemented as follows:
[0117] Starting with the reasoning trajectory represented by the first atomic question-answer pair, the reasoning trajectory is expanded iteratively until the expanded reasoning trajectory meets the termination condition. Based on the expanded reasoning trajectory, the target composite question and the corresponding target answer are determined.
[0118] Each iteration of the expansion includes: generating new atomic question-answer pairs based on the current target inference trajectory to be expanded, and incorporating the new atomic question-answer pairs into the target inference trajectory.
[0119] The termination conditions here are similar to those described above, and may include, but are not limited to, at least one of the following:
[0120] Condition 1: The total number of hops for the latest extended inference trajectory reaches or exceeds the target value, so that the final generated target composite question contains a set number of query / inference steps.
[0121] Condition 2: The corresponding number of iterations reaches the set number;
[0122] Condition 3: The corresponding iteration time reaches the set duration;
[0123] Condition 4: The target composite problem generated based on the extended latest inference trajectory can meet the preset semantic integrity requirements, or the current inference link has formed a logical closed loop.
[0124] In the above implementation process, starting from the reasoning trajectory represented by the first atomic question-answer pair, the reasoning trajectory is expanded iteratively, which can be further implemented as the following steps "4-1"-"4-4":
[0125] 4-1: Determine the trajectory set, where each element in the trajectory set is a sequence of atomic question-answer pairs used to characterize the reasoning trajectory.
[0126] In the process of expanding the reasoning trajectory iteratively, starting from the reasoning trajectory represented by the first atomic question-answer pair, the first atomic question-answer pair and the corresponding atomic question-answer pairs generated along the same path during the expansion process can be arranged in order (e.g., according to the order of generation time) to obtain at least one atomic question-answer pair sequence, and each sequence can be used as a reasoning trajectory to form a trajectory set.
[0127] It is easy to understand that initially, the trajectory set contains one element, specifically the reasoning trajectory represented by the first atomic question-answer pair.
[0128] In practice, optionally, a first-in-first-out (FIFO) queue can be used to manage the trajectory set uniformly. Each element in the queue (i.e., each element in the trajectory set) is an ordered list of atomic question-answer pairs, representing a reasoning path from the starting point to the current extended position.
[0129] 4-2: Obtain the target inference trajectory to be expanded from the trajectory set. The target inference trajectory is the inference trajectory represented by the first atomic question-answer pair, or the inference trajectory represented by the atomic question-answer pair sequence formed by the first atomic question-answer pair and the corresponding expanded atomic question-answer pairs.
[0130] Optionally, a breadth-first search strategy can be adopted, popping one or more currently searched trajectories from the queue as target inference trajectories, and performing parallel or serial expansion.
[0131] 4-3: Generate new atomic question-and-answer pairs based on the target reasoning trajectory.
[0132] For each target reasoning trajectory to be expanded, it can be expanded using at least one of the dual-strategy iterative expansion mechanisms based on "answer-driven" and "question-driven" approaches described above to generate new atomic question-answer pairs.
[0133] For example, extract second entity information from the current answer contained in the most recently generated current atomic question-answer pair on the target reasoning trajectory, and generate a second atomic question-answer pair related to the current answer based on the second entity information. Alternatively, extract third entity information from the current atomic question contained in the most recently generated current atomic question-answer pair on the target reasoning trajectory, determine the superset content including the third entity information, and generate a third atomic question-answer pair based on the relationship between the third entity information and the superset content, etc.
[0134] 4-4: Update the target reasoning trajectory based on the new atomic question-answer pair, so that if the updated target reasoning trajectory satisfies the termination condition, generate the target composite question and the corresponding target answer based on the updated target reasoning trajectory; if the updated target reasoning trajectory does not satisfy the termination condition, add the updated target reasoning trajectory to the trajectory set to iterate the trajectory expansion process.
[0135] After generating new atomic question-and-answer pairs based on the target inference trajectory, the generated new atomic question-and-answer pairs can be incorporated into the target inference trajectory, for example, by appending them sequentially to the end of the target inference trajectory, thereby expanding or updating the target inference trajectory.
[0136] In practice, the single-hop reasoning trajectory represented by the first atomic question-answer pair can be expanded into a multi-hop reasoning trajectory by iterating the above process continuously until the termination condition is met. Then, the atomic question-answer pair sequence contained in the obtained target reasoning trajectory is logically reorganized to generate the corresponding target composite question and target answer.
[0137] This embodiment, through extended mechanisms such as trajectory sets and dual-strategy iteration, can automatically evolve single-hop question answering into multi-hop reasoning trajectories with logical closed loops. This not only improves the reasoning depth and semantic integrity of complex questions, but also enhances data synthesis efficiency and robustness through queued management.
[0138] In an optional embodiment, generating new atomic question-answer pairs based on the target inference trajectory can be further implemented as follows:
[0139] The target reasoning trajectory is extended along multiple directions to generate new atomic question-and-answer pairs corresponding to each direction, and the target reasoning trajectory is updated based on the new atomic question-and-answer pairs corresponding to each direction.
[0140] The different directions represent the different extension strategies and / or different extension anchors on which the target reasoning trajectory is extended.
[0141] Different extension strategies may include, but are not limited to, the different extension logics such as "answer-driven extension" or "question-driven extension" mentioned above.
[0142] Different extension anchors can refer to, but are not limited to, different entity objects or different information nodes within the current target inference trajectory used to trigger new extensions. For example, a new entity identifier in the answer contained in the current atomic question-answer pair, or a new entity identifier in the contained question, etc.
[0143] For example, assuming that the latest generated atomic question-answer pair on the target inference trajectory contains questions that can extract multiple new entity identifiers, and the answers that can also extract multiple new entity identifiers, then the different new entity identifiers in the questions and / or answers can be used as different extension anchors, and the target inference trajectory can be extended using the corresponding question-driven extension method or answer-driven extension method for each extension anchor, thereby forming multiple different extension directions or extension branches corresponding to multiple different extension anchors.
[0144] This embodiment expands the target inference trajectory in multiple directions by using different expansion strategies and / or expansion anchors, which can generate multiple branch paths from the same target inference trajectory. Through this multi-path expansion, multiple logically rigorous multi-hop problems with different inference dimensions can be automatically generated, thereby improving the richness and diversity of data samples.
[0145] In an optional embodiment, the method of this application generates the target composite question and the corresponding target answer based on the atomic question-answer pair obtained from at least one expansion iteration, which can be further implemented as the following steps "5-1"-"5-3":
[0146] 5-1: Extract the question sequence and answer sequence based on the atomic question-answer pairs obtained from at least one expansion iteration.
[0147] Optionally, questions and answers can be extracted from the first atomic question-and-answer pair and each atomic question-and-answer pair expanded during the expansion iteration process, thereby obtaining a question sequence formed by the extracted questions and an answer sequence formed by the extracted answers.
[0148] In the implementation method of generating target composite questions and target answers through reasoning trajectory expansion, questions and answers can be extracted from the reasoning trajectory obtained after the reasoning trajectory expansion is completed to obtain question sequence and answer sequence.
[0149] During the extraction process, the extracted questions / answers can be arranged in an orderly manner according to the execution order of the extended iteration (such as timestamps, logical dependency levels, or the order of inference links) to ensure that the obtained question sequence and answer sequence can accurately reflect the evolution logic of the task from simple to complex and from single step to multi step.
[0150] 5-2: The atomic problems in the problem sequence are fused to obtain the target composite problem.
[0151] The fusion process may include, but is not limited to, steps such as semantic concatenation, referential resolution, logical relation reconstruction, and natural language rewriting, in order to fuse the atomic problems (or, by referring to the corresponding answers, fuse them) into a natural and fluent multi-hop problem. The fusion process may, but is not limited to, follow at least one of the following rules:
[0152] a. Hidden intermediate answers: No intermediate sub-answers may appear directly or be implied in the final question;
[0153] b. Complete Information Retention: All key information, constraints, and background descriptions in the sub-problems must be completely retained;
[0154] c. Multimodal source annotation: Based on the modality type (image, video, audio) corresponding to each sub-problem, the information source is naturally annotated in the fusion problem;
[0155] d. Single interrogative sentence constraint: The final question contains only one explicit interrogative sentence, corresponding to the final answer; all other information is expressed in the form of declarative sentences or finite clauses.
[0156] In this context, the sub-problems and sub-answers mentioned above represent the corresponding atomic problems and atomic answers.
[0157] For example, firstly, a large language model or a predefined fusion template is used to semantically combine the independent atomic problems in the question sequence; then, for the atomic problems in the question sequence that are dependent on each other, pronouns (such as "it" or "the") or relational conjunctions (such as "based on the above results" or "among them") are introduced to resolve the referential issues and connect them logically, so as to eliminate the semantic disconnect caused by directly splicing atomic problems; finally, the preliminary fused problem is rewritten and polished in natural language, and the above rules are followed in the above processing, so as to finally generate a target compound problem that is grammatically fluent, logically rigorous and conforms to human expression habits.
[0158] For example, suppose the sequence of questions includes the atomic questions "Which famous science fiction movie was released in 2016?" and "Who is the director of the movie?", after the above fusion process, the target composite question "Who is the director of the famous science fiction movie released in 2016?" can be generated.
[0159] 5-3: Determine the target answer corresponding to the target compound question based on the answer sequence.
[0160] After identifying the target composite question, the target answer corresponding to the target composite question can be extracted from the answer sequence, or the target answer corresponding to the target composite question can be integrated / inferred based on the atomic answers contained in the answer sequence.
[0161] In other words, the method for determining the target answer can be flexibly configured according to the type of the target composite question. For example, if the target composite question is a reasoning-type or link-dependent question, the answer corresponding to the last atomic question in the answer sequence can be directly used as the final target answer of the target composite question; if the target composite question is an aggregation-type question (i.e., it requires the integration of multiple information points to answer), then the atomic answers in the answer sequence can be extracted and integrated, and a comprehensive target answer containing all elements can be generated according to preset aggregation rules (such as list concatenation, numerical summation, text summarization, etc.).
[0162] Following the previous compound question, "Who directed the famous science fiction film released in 2016?", since the core question is "director," it is a link-dependent question. The first atomic answer in the answer sequence, "The famous science fiction film released in 2016, Movie A," is merely an intermediate reasoning node used to support the analysis of subsequent questions. Therefore, we can directly extract the target atomic answer "Director X" corresponding to the final logical node from the answer sequence and determine it as the target answer for the compound question.
[0163] This embodiment extracts an ordered sequence of questions / answers from each atomic question-and-answer pair obtained through extended iteration, and uses semantic fusion technology to transform the discrete atomic questions in the sequence into logically rigorous composite target questions. This fundamentally overcomes the shortcomings of related technologies where self-generated questions are mostly single-hop or pseudo-multi-hop. At the same time, through explicit reasoning trajectory construction and flexible answer determination strategies, it achieves precise control and verification of intermediate reasoning steps, effectively solving the problems of uncontrollable logic and non-unique answers in complex multi-step question-and-answer systems, and significantly improving the reasoning depth, accuracy, and interpretability of the generated data.
[0164] In an optional embodiment, before generating the target composite question and corresponding target answer based on the atomic question-answer pair obtained from at least one expansion iteration, the method of this application may further include the following processing steps "6-1"-"6-2":
[0165] 6-1: Detect the repetition of content contained in each atomic question-and-answer pair.
[0166] Optionally, content duplication detection can be performed on the first atomic question-and-answer pair and each atomic question-and-answer pair expanded during the expansion iteration process.
[0167] For the implementation method of generating target composite questions and target answers through reasoning trajectory expansion, content duplication detection can be performed on the atomic question-answer pairs in each reasoning trajectory obtained after the reasoning trajectory expansion is completed.
[0168] The content duplication detection of each atomic question-answer pair may include, but is not limited to, calculating the similarity of question texts (such as calculating cosine similarity based on semantic vectors) and the overlap of answer texts (such as answer entities) between each atomic question-answer pair. If any two atomic question-answer pairs are found to be highly consistent in question semantics and point to the same answer entity, or if there are redundant questions and answers pointing to the same intermediate entity, it can be determined that there is duplicate content.
[0169] 6-2: In response to duplicate content in different atomic question-answer pairs, perform deduplication processing on the duplicate content to obtain deduplicated atomic question-answer pairs, and generate the target composite question and the corresponding target answer based on the deduplicated atomic question-answer pairs.
[0170] When duplicate content is detected, the corresponding content in the duplicate content can be retained or removed according to the preset deduplication rules.
[0171] The deduplication rules may include, but are not limited to, at least one of the following:
[0172] Rule 1: Retain the first-generated content from the duplicate content and remove redundant items generated later;
[0173] Rule 2: Retain the more complete information from the duplicate content;
[0174] Rule 3: Retain content with more natural language expression and smoother logic among repeated content.
[0175] Subsequently, the target composite question and its corresponding target answer can be generated based on the retained atomic question-answer pairs after deduplication.
[0176] For example, suppose the following sequence of atomic question-and-answer pairs is obtained through extended iteration:
[0177] Atomic Q&A with A: "What is the most famous science fiction movie released in 2016?" - "Movie A";
[0178] Atomic Q&A with B: "Who is the director of Movie A?" - "Director X";
[0179] Atomic Q&A with C: "Who directed Movie A?" - "Director X".
[0180] By performing content duplication detection on the above atomic question-answer pairs, it was found that the question semantics of atomic question-answer pairs B and C are highly overlapping, and their answer entities are identical, thus determining that they are duplicate content. Assuming that the pre-defined deduplication rule requires retaining the first atomic question-answer pair, then atomic question-answer pair B can be retained, and the redundant atomic question-answer pair C can be removed. Finally, the deduplicated atomic question-answer pair sequence {A, B} is obtained, and the target composite question "Who is the director of the famous science fiction film Movie A, released in 2016?" can be generated based on this simplified sequence.
[0181] In practical applications, duplicate detection and deduplication can be performed on existing atomic question-and-answer pairs in real time during the iterative expansion process, or duplicate detection and deduplication can be performed on all atomic question-and-answer pairs after the expansion is completed. There is no restriction on this, and it can be determined according to the actual application requirements.
[0182] For example, in an implementation method that generates target composite questions and target answers through inference trajectory expansion, it is possible, but not limited to, to perform duplicate detection and deduplication on the atomic question-answer pairs on each current inference trajectory in real time during the inference trajectory expansion process, so as to retain the effective trajectory after deduplication, and continue to expand the trajectory along the corresponding direction (such as multiple expansion directions formed by different expansion strategies and / or different expansion anchor points) based on the effective trajectory.
[0183] This embodiment introduces a mechanism for detecting and deduplicating duplicates of atomic question-answer pairs, eliminating redundant or invalid question-answer pairs. This effectively eliminates semantic redundancy and logical dead loops in the inference chain, while also simplifying the data scale, reducing computational resource consumption, and ensuring the logical coherence and conciseness of the final generated target composite question.
[0184] In an optional embodiment, the atomic problems in the problem sequence are fused to obtain the target composite problem, which can be further implemented as follows:
[0185] 7-1: By fusing the atomic problems in the problem sequence, multiple candidate composite problems are generated.
[0186] Optionally, a large language model can be used to fuse the atomic problems in the problem sequence and generate multiple candidate composite problems.
[0187] In a practical implementation, the question sequence can be input into a large language model, and by adjusting the model's decoding parameters or adopting diverse prompting strategies, the large language model can output multiple candidate compound questions with different sentence structures but semantic coherence while maintaining the original meaning.
[0188] 7-2: Conduct quality assessments for each candidate composite problem.
[0189] After obtaining each candidate composite problem, a multi-dimensional quality assessment can be performed on each candidate composite problem based on a pre-built quality assessment model or scoring rules to obtain the quality assessment results corresponding to each candidate composite problem, such as a comprehensive quality score or quality level.
[0190] The evaluation dimensions may include, but are not limited to, information completeness (such as whether all key information is covered), logical coherence (such as whether the sentences are fluent and the logical relationships are natural) and / or grammatical correctness.
[0191] 7-3: Based on the corresponding quality assessment results, candidate composite problems that meet the quality conditions are selected as the target composite problem.
[0192] The quality criteria here are used to select high-quality candidate composite problems as the target composite problem.
[0193] The quality conditions may be set to at least one of the following: the corresponding comprehensive quality score reaches the set score, the corresponding quality level reaches the set level, and the corresponding comprehensive quality score is the highest score among the top_k (e.g., top_1) comprehensive quality scores of each candidate composite problem.
[0194] Where k≥1, and k is an integer.
[0195] After obtaining the comprehensive quality score and / or quality level of each candidate composite problem, the candidate composite problems that meet the quality conditions can be selected as the final target composite problem based on the quality assessment results.
[0196] This embodiment obtains multiple candidate composite problems by semantically recombining and diversifying the generation of atomic problem sequences. Then, it selects the best candidate composite problem from among the candidates using a quality assessment mechanism to obtain the final target composite problem. This not only solves the semantic awkwardness and logical omissions caused by simply splicing atomic problems and improves the naturalness and accuracy of composite problems, but also enhances the robustness of the system through an automated diversification generation and selection process, providing a precise input foundation for subsequent knowledge retrieval or model training / reasoning tasks.
[0197] In an optional embodiment, the method of this application may further include the following processing:
[0198] Generate answer format constraint instructions that match the target composite question, and perform format normalization processing on the target answer based on the answer format constraint instructions.
[0199] This embodiment can serve as a post-processing step in a multi-hop data synthesis pipeline, used to further perform instruction format normalization processing on the output multi-hop question-and-answer data (the target answer corresponding to the target composite question). Its specific implementation process may include, but is not limited to, the following processing steps:
[0200] I. Classification of Answer Types
[0201] Semantic analysis can be performed on the original target answer corresponding to the target compound question to identify its answer type, such as entity name (e.g., person name, place name, organization name, movie name), numerical value (e.g., integer, floating-point number), time (e.g., date, time period, year), or Boolean value (e.g., yes, no).
[0202] II. Type-Aware Question-Answer Rewriting
[0203] Based on the identified answer type, corresponding answer format constraint instructions can be appended to the end of the target compound question to perform standardization and simplification / removal of redundant modifications, format specification, and other normalization processes on the target answer, retaining only the core information that conforms to the answer format constraint instructions, such as "please only answer the specific year", "please answer the time of occurrence in a specific time format", or "please only answer the entity name", thereby obtaining the rewritten question-answer pair.
[0204] III. Semantic Consistency Verification
[0205] The rewritten question-answer pairs are subjected to semantic consistency verification to ensure that the final target answer (the target answer that conforms to the answer format constraint instructions after rewriting) can still logically and accurately respond to the target compound question.
[0206] Semantic consistency verification may include, but is not limited to: verifying the logical implication relationship between the question and the answer, verifying the alignment and completeness of the core entities between the question and the answer, verifying whether the answer strictly conforms to the format constraint instructions, and / or verifying the semantic missing or logical break of the answer, so as to ensure the accuracy of the final synthesized data (the final target composite question and its corresponding target answer) and the effectiveness of instruction following.
[0207] This embodiment effectively eliminates the problems of answer redundancy and inconsistent formatting, and while ensuring logical consistency and accuracy, it significantly improves the effectiveness of synthetic data in training instruction following ability.
[0208] In an optional embodiment, when the method of this application performs multi-hop expansion processing on the first atomic question-answer pair to obtain and output the target composite question and the corresponding target answer, it can also output corresponding additional information.
[0209] The additional information may include, but is not limited to, the resource paths of the relevant resources on which the data is based during the data generation process, the tool call information corresponding to the relevant resources, and / or the complete inference trajectory.
[0210] The relevant resources may include, but are not limited to, context information that satisfies the association conditions with the first entity information; the tool call information is used to indicate the relevant retrieval tools required to obtain the context information; the complete reasoning trajectory is used to characterize the logical reasoning link in the process of generating the target composite question and the corresponding target answer, which fully records the thought process of gradually deriving and generating the target composite question and the target answer from the first atomic question-answer pair through multi-hop expansion processing.
[0211] Optionally, the target composite question and its corresponding target answer, along with additional information such as resource paths, tool call information, and / or complete reasoning trajectories, can be generated into a structured data file or data record and then output or saved.
[0212] This embodiment achieves transparency and traceability of the entire data generation chain by synchronously outputting or saving additional information such as resource paths, tool call information, and / or complete inference trajectories. This not only improves the interpretability and logical coherence of the synthesized data, but also facilitates tracing back the data source to verify the authenticity of the information, thereby improving the overall quality of the multi-hop question-answering dataset.
[0213] The following is an application example of the method of this application.
[0214] See this example. Figure 5 The system implementation process for generating multi-hop question-and-answer pairs is as follows.
[0215] Step 1: Configure input parameters.
[0216] The following parameters can be pre-configured, but are not limited to:
[0217] 1) Entity identifier list: Specifies the entities for which data needs to be generated, such as athlete names, movie titles, academic concepts, etc.
[0218] 2) Modality type configuration: Specify the modality type (image, video, audio, plain text, research document, multiple sources, etc.) for each entity;
[0219] 3) Target number of jumps configuration: Specify the target number of jumps for the generated multi-hop problem (e.g., 2 jumps, 3 jumps, 4 jumps or more);
[0220] 4) Number of child processes: Specifies the maximum number of parallel processing threads during the extension process.
[0221] Referring to Table 1, the system may, but is not limited to, support the following modal types of processing.
[0222] Table 1
[0223]
[0224] Step 2: Perform atomic task generation processing.
[0225] The following processing can be performed on each entity identifier:
[0226] 1) Select the retrieval strategy based on the modality type (i.e., call the corresponding type of tool);
[0227] 2) Perform search enhancements to obtain multimodal context;
[0228] 3) Generate atomic question-answer pairs using a large language model;
[0229] 4) Perform atomic problem quality filtering;
[0230] 5) The filtered atomic question-answer pairs are placed into the BFS (Breadth-First Search) trajectory queue.
[0231] Step 3: Perform multi-hop expansion.
[0232] When the trajectory queue is not empty, the following processing is performed in a loop:
[0233] 1) Pop the tracks to be expanded in batches from the queue;
[0234] 2) Perform parallel expansion on each trajectory, including: a) extracting new entity identifiers from the current question; b) deciding whether to use answer-driven expansion or question-driven expansion based on the dual-strategy expansion mechanism; c) executing the selected expansion strategy to generate new atomic question-answer pairs; d) appending the new atomic question-answer pairs to the trajectory.
[0235] 3) Perform trajectory deduplication detection;
[0236] 4) Determine based on the number of jumps:
[0237] If the number of jumps does not meet the target, the trajectory is re-entered into the queue; if the number of jumps meets the target, the trajectory is output and the fusion process begins.
[0238] Step 4: Implement problem fusion.
[0239] For each qualifying trajectory, perform the following processing:
[0240] 1) Extract the sub-question sequence, sub-answer sequence, and modality list;
[0241] 2) Utilize a large language model to generate multiple (e.g., 5) candidate composite questions for fusion;
[0242] 3) Perform quality scoring on each candidate composite problem;
[0243] 4) Select the candidate composite problem with the highest score as the final target composite problem.
[0244] Step 5: Enhanced instruction following.
[0245] Instruction following enhancement is a post-processing step in the multi-hop data synthesis pipeline, responsible for performing instruction format normalization on the output multi-hop question-and-answer data. This step, through three sub-steps—answer type classification, type-aware question-and-answer rewriting, and semantic consistency verification—adds explicit answer format constraint instructions to the end of the multi-hop questions. This simultaneously performs standardization and simplification, format normalization, and other normalization processes on the answers, thereby improving the effectiveness of the synthesized data in training instruction following ability.
[0246] Step 6: Output the final data.
[0247] The fused instruction follow-up enhanced multi-hop problem, final answer, complete reasoning trajectory and associated resource path are saved as a structured data file.
[0248] See Table 2, which shows the advantages of the present application solution compared to various prior art solutions.
[0249] Table 2
[0250]
[0251] The following further summarizes the advantages of this application's solution compared to the mainstream data compositing solutions currently available in the prior art:
[0252] 1) Compared with existing schemes for LLM self-instruct / Evol-instruct data generation, the core advantage of this application is that it uses external real knowledge sources to replace the internal parameter knowledge of LLM as the generation foundation, which fundamentally solves the problems of knowledge illusion and unverifiable facts in self-generation methods; at the same time, through the dual-path collaborative multi-hop inference chain extension mechanism, it breaks through the limitation of self-generation methods that can only generate shallow single-hop instructions, and constructs complex inference data with logical coherence, controllable depth (2-5 hops), and complete tool call trajectory.
[0253] 2) Compared with existing schemes for collecting agent trajectory data, the core advantage of this application is that it uses external real knowledge sources to provide verifiable ground truth instead of the agent's own erroneous reasoning answers, and uses breadth-first search queue (BFS) and structured control of the quality of generated questions to replace the randomness and noise of agent exploration, thereby generating high-quality multimodal multi-hop reasoning data with standard answers, controllable hop count, clean tool calls, and can be directly used for supervised training.
[0254] Corresponding to the above method, this application embodiment also provides a data generation apparatus, the composition of which is as follows: Figure 6 As shown, it includes:
[0255] Module 601 is used to obtain the first entity information;
[0256] The generation module 602 is used to generate a related first atomic question-answer pair based on the first entity information; the first atomic question-answer pair includes a first atomic question and a corresponding first answer;
[0257] Extension module 603 is used to perform multi-hop extension processing on the first atomic question-answer pair to obtain the target composite question and the corresponding target answer;
[0258] The first atomic problem includes a single-step query or reasoning step; the target composite problem includes a multi-step query or reasoning step, but does not include the first answer.
[0259] In one alternative implementation, the generation module 602 is specifically used for:
[0260] Determine the context information that satisfies the association conditions with the first entity information;
[0261] Extract target knowledge that can be used to form an answer from the context information;
[0262] Determine the association between the target knowledge and the first entity information;
[0263] The first atomic question-answer pair is generated based on the target knowledge and the relationship.
[0264] In an optional implementation, the extension module 603 is specifically used for:
[0265] Obtain the question elements and / or answer elements in the current atomic question-answer pair, perform question-based and / or answer-based solution link extension based on the question elements and / or answer elements to generate a new atomic question-answer pair, and generate the target composite question and the corresponding target answer based on the atomic question-answer pair obtained from at least one extension iteration;
[0266] The current atomic question-and-answer pair is either the first atomic question-and-answer pair or the corresponding atomic question-and-answer pair generated during the extended processing.
[0267] In an optional implementation, the extension module 603, when performing question-based and / or answer-based solution link extension based on the question elements and / or the answer elements to generate new atomic question-answer pairs, is specifically used for:
[0268] Extract second entity information from the current answer contained in the current atomic question-answer pair, and generate a second atomic question-answer pair related to the current answer based on the second entity information;
[0269] Extract third entity information from the current atomic question contained in the current atomic question-answer pair, determine the superset content including the third entity information, and generate a third atomic question-answer pair based on the relationship between the third entity information and the superset content.
[0270] In an optional implementation, the extension module 603 is specifically used for:
[0271] If the number of new entity information that can be extracted from the current atomic question contained in the current atomic question is less than a first threshold, the step of extracting second entity information from the current answer contained in the current atomic question is triggered to generate the second atomic question and answer pair.
[0272] If the number of new entity information that can be extracted from the current atomic question reaches the first threshold, the step of extracting third entity information from the current atomic question contained in the current atomic question-answer pair is triggered to generate the third atomic question-answer pair;
[0273] If the number of consecutive executions of generating the third atomic question-answer pair reaches a second threshold, a step of extracting the second entity information from the current answer contained in the current atomic question-answer pair is triggered to generate the second atomic question-answer pair.
[0274] In an optional implementation, the extension module 603 is specifically used for:
[0275] Starting from the reasoning trajectory represented by the first atomic question-answer pair, the reasoning trajectory is expanded iteratively until the expanded reasoning trajectory meets the termination condition. Based on the expanded reasoning trajectory, the target composite question and the corresponding target answer are determined.
[0276] Each iteration of the expansion includes: generating new atomic question-answer pairs based on the current target inference trajectory to be expanded, and incorporating the new atomic question-answer pairs into the target inference trajectory.
[0277] In an optional implementation, the extension module 603, when iteratively extending the inference trajectory represented by the first atomic question-answer pair, is specifically used for:
[0278] A set of trajectories is determined, wherein each element of the set of trajectories is a sequence of atomic question-answer pairs used to characterize the reasoning trajectory;
[0279] Obtain the current target inference trajectory to be expanded from the trajectory set. The target inference trajectory is the inference trajectory represented by the first atomic question-answer pair, or the inference trajectory represented by the atomic question-answer pair sequence formed by the first atomic question-answer pair and the corresponding expanded atomic question-answer pair.
[0280] Generate new atomic question-answer pairs based on the target reasoning trajectory;
[0281] The target inference trajectory is updated based on the new atomic question-answer pair. If the updated target inference trajectory satisfies the termination condition, the target composite question and the corresponding target answer are generated based on the updated target inference trajectory. If the updated target inference trajectory does not satisfy the termination condition, the updated target inference trajectory is added to the trajectory set to iterate the trajectory expansion process.
[0282] In an optional implementation, the extension module 603, when generating new atomic question-answer pairs based on the target inference trajectory, is specifically used for:
[0283] The target inference trajectory is extended along multiple directions to generate new atomic question-and-answer pairs corresponding to each direction, and the target inference trajectory is updated based on the new atomic question-and-answer pairs corresponding to each direction.
[0284] The different directions represent the different extension strategies and / or different extension anchors on which the target reasoning trajectory is extended.
[0285] In an optional embodiment, the above-mentioned device further includes a deduplication module, used for:
[0286] Before generating the target composite question and the corresponding target answer based on the atomic question-answer pairs obtained from at least one expansion iteration, the redundancy between the contents contained in each atomic question-answer pair is detected.
[0287] In response to duplicate content appearing in different atomic question-answer pairs, deduplication processing is performed on the duplicate content to obtain deduplicated atomic question-answer pairs, and the target composite question and the corresponding target answer are generated based on the deduplicated atomic question-answer pairs;
[0288] Extension module 603, when generating the target composite question and corresponding target answer based on the atomic question-answer pair obtained from at least one extension iteration, is specifically used for:
[0289] Based on the atomic question-answer pairs obtained from at least one expansion iteration, extract the question sequence and the answer sequence;
[0290] The atomic problems in the problem sequence are fused together to obtain the target composite problem;
[0291] The target answer to the target compound question is determined based on the answer sequence.
[0292] This application also discloses an electronic device, the composition and structure of which are as follows: Figure 7 As shown, it may include:
[0293] Memory 10 is used to store the computer instruction set;
[0294] Computer instruction sets can be implemented in the form of computer programs.
[0295] Processor 20 is configured to implement the data generation method provided in any of the above method embodiments by executing a set of computer instructions in the memory.
[0296] The processor can be a central processing unit (CPU), a graphics processing unit (GPU), an application-specific integrated circuit (ASIC), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a neural network processor (NPU), a deep learning processor (DPU), or other programmable logic devices.
[0297] Optionally, the electronic device may also include a display device for displaying information.
[0298] Optionally, electronic devices may also include storage resources such as memory and cache.
[0299] Optionally, the electronic device may also include an image acquisition device.
[0300] In addition to these components, electronic devices may also include communication interfaces, communication buses, and other parts. Memory, processor, and communication interface communicate with each other through the communication bus.
[0301] Communication interfaces are used for communication between electronic devices and other devices. Communication buses can be Peripheral Component Interconnect (PCI) buses or Extended Industry Standard Architecture (EISA) buses, and can be categorized into address buses, data buses, control buses, etc.
[0302] This application also discloses a storage medium carrying one or more computer instruction sets, which, when executed by an electronic device, enable the electronic device to implement the data generation method provided in any of the above method embodiments.
[0303] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0304] For ease of description, the above systems or devices are described separately as various modules or units based on their functions. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware components.
[0305] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence or the part that makes a creative contribution, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.
[0306] Finally, it should be noted that in this document, relational terms such as first, second, third, and fourth are used to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0307] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A data generation method, comprising: Obtain the first entity information; Based on the first entity information, generate the relevant first atomic question-and-answer pair; The first atomic question-and-answer pair includes a first atomic question and a corresponding first answer; The first atomic question-answer pair is subjected to multi-hop expansion processing to obtain the target composite question and the corresponding target answer; The first atomic problem includes a single-step query or reasoning step; the target composite problem includes a multi-step query or reasoning step, but does not include the first answer.
2. The data generation method according to claim 1, wherein based on the first entity information, a related first atomic question-answer pair is generated, comprising: Determine the context information that satisfies the association conditions with the first entity information; Extract target knowledge that can be used to form an answer from the context information; Determine the association between the target knowledge and the first entity information; The first atomic question-answer pair is generated based on the target knowledge and the relationship.
3. The data generation method according to claim 1, wherein the first atomic question-answer pair is subjected to multi-hop expansion processing to obtain the target composite question and the corresponding target answer, including: Obtain the question elements and / or answer elements in the current atomic question-answer pair, perform question-based and / or answer-based solution link extension based on the question elements and / or answer elements to generate a new atomic question-answer pair, and generate the target composite question and the corresponding target answer based on the atomic question-answer pair obtained from at least one extension iteration; The current atomic question-and-answer pair is either the first atomic question-and-answer pair or the corresponding atomic question-and-answer pair generated during the extended processing.
4. The data generation method according to claim 3, wherein a solution chain extension based on the question elements and / or the answer elements is performed to generate new atomic question-answer pairs, including at least one of the following: Extract second entity information from the current answer contained in the current atomic question-answer pair, and generate a second atomic question-answer pair related to the current answer based on the second entity information; Extract third entity information from the current atomic question contained in the current atomic question-answer pair, determine the superset content including the third entity information, and generate a third atomic question-answer pair based on the relationship between the third entity information and the superset content.
5. The data generation method according to claim 4, generating new atomic question-answer pairs, comprising: If the number of new entity information that can be extracted from the current atomic question contained in the current atomic question is less than a first threshold, the step of extracting second entity information from the current answer contained in the current atomic question is triggered to generate the second atomic question and answer pair. If the number of new entity information that can be extracted from the current atomic question reaches the first threshold, the step of extracting third entity information from the current atomic question contained in the current atomic question-answer pair is triggered to generate the third atomic question-answer pair; If the number of consecutive executions of generating the third atomic question-answer pair reaches a second threshold, a step of extracting the second entity information from the current answer contained in the current atomic question-answer pair is triggered to generate the second atomic question-answer pair.
6. The data generation method according to claim 1, wherein the first atomic question-answer pair is subjected to multi-hop expansion processing to obtain the target composite question and the corresponding target answer, including: Starting from the reasoning trajectory represented by the first atomic question-answer pair, the reasoning trajectory is expanded iteratively until the expanded reasoning trajectory meets the termination condition. Based on the expanded reasoning trajectory, the target composite question and the corresponding target answer are determined. Each iteration of the expansion includes: generating new atomic question-answer pairs based on the current target inference trajectory to be expanded, and incorporating the new atomic question-answer pairs into the target inference trajectory.
7. The data generation method according to claim 6, taking the reasoning trajectory represented by the first atomic question-answer pair as the starting point, expands the reasoning trajectory iteratively, including: A set of trajectories is determined, wherein each element of the set of trajectories is a sequence of atomic question-answer pairs used to characterize the reasoning trajectory; Obtain the current target inference trajectory to be expanded from the trajectory set. The target inference trajectory is the inference trajectory represented by the first atomic question-answer pair, or the inference trajectory represented by the atomic question-answer pair sequence formed by the first atomic question-answer pair and the corresponding expanded atomic question-answer pair. Generate new atomic question-answer pairs based on the target reasoning trajectory; The target inference trajectory is updated based on the new atomic question-answer pair. If the updated target inference trajectory satisfies the termination condition, the target composite question and the corresponding target answer are generated based on the updated target inference trajectory. If the updated target inference trajectory does not satisfy the termination condition, the updated target inference trajectory is added to the trajectory set to iterate the trajectory expansion process.
8. The data generation method according to claim 7, generating new atomic question-answer pairs based on the target inference trajectory, comprising: The target inference trajectory is extended along multiple directions to generate new atomic question-and-answer pairs corresponding to each direction, and the target inference trajectory is updated based on the new atomic question-and-answer pairs corresponding to each direction. The different directions represent the different extension strategies and / or different extension anchors on which the target reasoning trajectory is extended.
9. The data generation method according to claim 3, before generating the target composite question and the corresponding target answer based on the atomic question-answer pair obtained from at least one expansion iteration, further includes: Detect the repetition of content among the atomic question-and-answer pairs; In response to duplicate content appearing in different atomic question-answer pairs, deduplication processing is performed on the duplicate content to obtain deduplicated atomic question-answer pairs, and the target composite question and the corresponding target answer are generated based on the deduplicated atomic question-answer pairs; Based on the atomic question-answer pairs obtained from at least one expansion iteration, the target composite question and the corresponding target answer are generated, including: Based on the atomic question-answer pairs obtained from at least one expansion iteration, extract the question sequence and the answer sequence; The atomic problems in the problem sequence are fused together to obtain the target composite problem; The target answer to the target compound question is determined based on the answer sequence.
10. An electronic device, comprising: Memory, used to store at least one set of computer instructions; A processor is configured to perform the following processing by executing a set of instructions stored in the memory: Obtain the first entity information; Based on the first entity information, a related first atomic question-and-answer pair is generated; the first atomic question-and-answer pair includes a first atomic question and a corresponding first answer. The first atomic question-answer pair is subjected to multi-hop expansion processing to obtain the target composite question and the corresponding target answer; The first atomic problem includes a single-step query or reasoning step; the target composite problem includes a multi-step query or reasoning step, but does not include the first answer.
