Sample data acquisition and model training method, medium, equipment and program product
By decoupling logic optimization from content generation in thought chain models, the method enhances the accuracy and stability of question generation models by optimizing thought chain logic and generating solution step information independently.
Patent Information
- Authority / Receiving Office
- HK · HK
- Patent Type
- Applications
- Current Assignee / Owner
- HANGZHOU ANT KUAI TECHNOLOGY CO LTD
- Filing Date
- 2026-04-20
- Publication Date
- 2026-07-10
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
(19) State Intellectual Property Office (12) Invention Patent Application (10) Application Publication Number (43) Application Publication Date (21) Application Number 202511195800.8 (22) Application Date 2025.08.25 (71) Applicant Hangzhou Ant Cool Love Technology Co., Ltd. Address Room 1226, Building 5, Huanglong International Center, Xihu District, Hangzhou City, Zhejiang Province, 310058 (72) Inventors Zheng Kaiyuan, Li Liangqi, Zhang Junjie, Zhan Wanke, Zhao Xiaoke, Zhou Zhaowen, Wu Yin, Liu He, Zhang Bo, Cai Jiansheng, Li Zhe (74) Patent Agency Beijing Bosijia Intellectual Property Agency Co., Ltd. 11415 Patent Attorney Zhang Huan (51) Int.Cl. G06F 40 / 186 (2020.01) G06F 18 / 214 (2023.01) (54) Invention Title: Method, Medium, Device, and Program Product for Acquiring Sample Data and Training a Model (57) Abstract: A method, medium, device, and program product for acquiring sample data and training a model, the method comprising: acquiring a thought chain template, the thought chain template being used to define target information points, the target information points being used to describe information extracted from an input question for thought chain reasoning; in response to acquiring a current input question, generating solution step information corresponding to the current input question based on the thought chain template; the solution step information being used to describe the reasoning steps used when performing thought chain reasoning on the current input question based on the information described by the target information points; generating sample data based on the current input question and the solution step information; the sample data being used to train a first question generation model based on thought chain reasoning. Claims 2 pages, Description 11 pages, Drawings 3 pages, CN 121072504 A 2025.12.05 CN 1 21 07 25 04 A 1. A method for acquiring sample data, the method comprising: acquiring a thought chain template, the thought chain template being used to define target information points, the target information points being used to describe information extracted from an input question for thought chain reasoning; in response to acquiring a current input question, generating solution step information corresponding to the current input question based on the thought chain template; the solution step information being used to describe the reasoning steps used when performing thought chain reasoning on the current input question based on the information described by the target information points; generating sample data based on the current input question and the solution step information; the sample data being used to train a first question generation model based on thought chain reasoning. 2. The method according to claim 1, wherein generating solution step information corresponding to the current input question based on the thought chain template comprises: acquiring multiple candidate information points; extracting information described by the multiple candidate information points from the current input question;1. Filter out the information described by the target information point from the information described by the plurality of candidate information points; generate solution steps information corresponding to the current input question based on the information described by the target information point. 2. The method according to claim 2, wherein the plurality of candidate information points are organized into a graph structure, the graph structure includes a plurality of nodes, each node corresponding to one of the plurality of candidate information points; the method further includes: selecting the target information point from the plurality of candidate information points based on the graph structure. 3. The method according to claim 3, wherein the plurality of nodes form at least one inference link; selecting the target information point from the plurality of candidate information points based on the graph structure includes: determining the shortest inference link among the at least one inference link; determining all candidate information points corresponding to each node on the shortest inference link as target information points. 5. The method according to claim 2, wherein the number of target information points is greater than 1; the thought chain template further includes an arrangement strategy for the information described by multiple target information points; generating the solution step information corresponding to the current input question based on the information described by the target information points includes: arranging the information described by the multiple target information points based on the arrangement strategy to obtain the solution step information corresponding to the current input question; and / or the thought chain template further includes a post-processing strategy for the solution step information; before generating sample data based on the current input question and the solution step information, the method further includes: post-processing the solution step information based on the post-processing strategy. 6. The method according to claim 1, further including: training a second question generation model based on the sample data; inputting verification data into the trained second question generation model to generate answer information corresponding to the verification data; the verification data includes the stem information of at least one question; obtaining the number of lexical units included in the solution step information; and performing quality verification on the thought chain template based on the accuracy of the answer information generated by the second question generation model and the number of lexical units included in the solution step information. 7. A model training method, the method comprising: acquiring sample data; the sample data being acquired based on the method of any one of claims 1 to 6; and training a question generation model based on reasoning chain based on the sample data. 8. A computer-readable storage medium having a computer program stored thereon, the computer program, when executed by a processor, implementing the method of any one of claims 1 to 7. 9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor.A computer program, wherein the processor executes the computer program to implement the method described in any one of claims 1 to 7. 10. A computer program product, comprising a computer program, which, when executed by a processor, implements the method described in any one of claims 1 to 7. Claims 2 / 2 pages 3 CN 121072504 A Method, medium, device and program product for acquiring sample data and training models Technical Field
[0001] This specification relates to the field of computer technology, and more particularly to a method, medium, device and program product for acquiring sample data and training models. Background Art
[0002] Currently, thought chain, as an effective reasoning method, is increasingly used in question generation models. With the help of thought chain, question generation models can gradually decompose the question stem information and perform logical deduction to obtain the solution step information, and generate the answer to the question based on the solution step information. In order for the question generation model to obtain the ability to reason based on thought chain, the sample data used to train the question generation model also needs to include the solution step information obtained by reasoning based on thought chain logic. However, in related technologies, the optimization and adjustment of the thought chain logic and content generation are intertwined and coupled, making it difficult to optimize the thought chain logic independently. This coupling leads to the quality of the thought chain logic being highly dependent on subjective judgment, making the quality of the generated sample data uncontrollable. The question generation model trained based on the above sample data may have logical loopholes and inconsistent content descriptions during the reasoning process, resulting in unstable reasoning ability and affecting the effect of practical application. Summary of the Invention
[0003] In a first aspect, embodiments of this specification provide a method for obtaining sample data, the method comprising:
[0004] obtaining a thought chain template, the thought chain template being used to define target information points, the target information points being used to describe information extracted from input questions for thought chain reasoning;
[0005] in response to obtaining the current input question, generating solution step information corresponding to the current input question based on the thought chain template; the solution step information being used to describe the reasoning steps used when performing thought chain reasoning on the current input question based on the information described by the target information points;
[0006] generating sample data based on the current input question and the solution step information; the sample data being used to train a first question generation model based on thought chain reasoning.
[0007] In a second aspect, embodiments of this specification provide a model training method, the method comprising:
[0008] acquiring sample data; the sample data being acquired based on the method described in the first aspect;
[0009] training a question generation model based on reasoning based on thought chains based on the sample data.
[0010] In a third aspect, embodiments of this specification provide a computer-readable storage medium having a computer program stored thereon.
[0011] In a fourth aspect, an embodiment of this specification provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method described in any embodiment of this specification.
[0012] In a fifth aspect, an embodiment of this specification provides a computer program product, including a computer program, wherein the computer program, when executed by a processor, implements the method described in any embodiment of this specification.
[0013] This embodiment of the specification decouples the logical optimization of the thinking chain from the content generation. First, a target information point is defined through a thinking chain template to describe the information that needs to be extracted from the input question for thinking chain reasoning. After obtaining the current input question from page 1 / 11 of the specification (CN 121072504 A), the solution step information corresponding to the current input question is generated based on the thinking chain template, and sample data is generated based on the current input question and the solution step information to train a first question generation model based on thinking chain reasoning. The process of obtaining the thought chain template is essentially an optimization process of the thought chain logic. At this stage, the focus can be on sorting out, adjusting and optimizing the logic to ensure that the logic of the thought chain is rigorous, reasonable and efficient, thereby improving the accuracy of reasoning. In the stage of generating problem-solving step information based on the thought chain template, the focus is on content generation, applying the optimized logic to the specific input question to generate logical and accurate reasoning steps, effectively improving the quality of the generated content. Through this decoupling of logic optimization and content generation, this specification can independently control the content generation and thought chain logic optimization process, improve the logic and accuracy of the sample data, so that the trained first question generation model can learn higher quality and more reliable reasoning logic, and improve the reasoning accuracy and stability of the reasoning performance of the first question generation model.
[0014] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this specification. Brief Description of the Drawings
[0015] The accompanying drawings are incorporated in and constitute a part of this specification. These drawings illustrate embodiments consistent with this specification and are used together with the specification to illustrate the technical solutions of this specification.
[0016] FIG1 is a flowchart of a sample data acquisition method according to an embodiment of this specification.
[0017] FIG2 is a schematic diagram of a graphical structure according to an embodiment of this specification.
[0018] FIG3 is an overall flowchart according to an embodiment of this specification.
[0019] FIG4 is a block diagram of a sample data acquisition device according to an embodiment of this specification.
[0020] FIG5 is a schematic diagram of a computer device according to an embodiment of this specification. Detailed Description
[0021] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, the same numbers in different drawings denote the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this specification as detailed in the appended claims.
[0022] The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of this specification. The singular forms “a,” “the,” and “the” used in this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more associated listed items. Additionally, the term “at least one” herein means any combination of at least two of any one or more of a plurality.
[0023] It should be understood that although the terms first, second, third, etc., may be used in this specification to describe various information, such information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another. For example, without departing from the scope of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "in response to determination".
[0024] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of this specification, and to make the above-mentioned objects, features and advantages of the embodiments of this specification more apparent and understandable, the technical solutions of the embodiments of this specification on page 2 / 11 of CN 121072504 A in conjunction with the accompanying drawings will be further described in detail below.
[0025] At present, Chain of Thought (COT) is increasingly used in question generation models. With the help of chain of thought, question generation models can gradually decompose the question stem information in the question and perform logical deduction to obtain the solution step information, and generate the answer to the question based on the solution step information. In order for the question generation model to obtain the ability to reason based on chain of thought, the sample data used to train the question generation model also needs to include the solution step information obtained by reasoning based on chain of thought logic. However, in related technologies, the optimization and adjustment of the thought chain logic and content generation are intertwined and coupled, making it difficult to optimize the thought chain logic independently. Taking math word problems as an example, when thought chain logic optimization and content generation are not decoupled, the process is as follows: First, text data containing math word problems and their solutions is collected. The steps in these solution texts are closely integrated with the questions, without deliberate logical optimization. Then, this data is input into a language model for training, and the model, during the training process...When attempting to understand a problem and generate an answer, the model can only rely on learned statistical patterns and language models to generate the answer. The resulting answer may lack logical rigor, such as missing intermediate steps or having disorganized steps. When evaluating the model, the focus is mainly on whether the solution matches the correct answer and the fluency of the language. There is a lack of specific evaluation and optimization methods for the logic of the thought chain. After discovering problems, it is difficult to directly adjust the logic; improvement can only be achieved indirectly through retraining or fine-tuning parameters.
[0026] Based on this, this application proposes a method for obtaining sample data, decoupling the logic optimization of the thought chain from content generation. First, target information points are defined using a thought chain template to achieve the sorting, adjustment, and optimization of the thought chain logic. Then, based on the thought chain template, the solution step information corresponding to the current input question is generated, and sample data is generated based on the current input question and solution step information to train the first question generation model based on thought chain reasoning, thus realizing content generation based on the optimized thought chain logic. The implementation details of the solution in this application embodiment are illustrated below with reference to the accompanying drawings.
[0027] As shown in Figure 1, the method for obtaining sample data in this embodiment of the application includes:
[0028] Step S12: Obtaining a thought chain template, which is used to define target information points. The target information points are used to describe the information extracted from the input question for thought chain reasoning;
[0029] Step S14: In response to obtaining the current input question, generating solution step information corresponding to the current input question based on the thought chain template; the solution step information is used to describe the reasoning steps used when performing thought chain reasoning on the current input question based on the information described by the target information points;
[0030] Step S16: Generating sample data based on the current input question and solution step information; the sample data is used to train a first question generation model based on thought chain reasoning.
[0031] In step S12, a thought chain template can be obtained. The thought chain template can be pre-generated and stored. The thought chain template is used to define target point information, which is used to describe the information extracted from the input question for thought chain reasoning. The number of target information points can be greater than or equal to 1. When the input question is a question, the target information points may include the language of the question (e.g., Chinese, English, etc.), subject (e.g., mathematics, physics, chemistry, etc.), knowledge points (e.g., algebra and geometry in mathematics, mechanics and electromagnetism in physics, etc.), question type (e.g., multiple choice, fill-in-the-blank, problem-solving, etc.), question difficulty (e.g., easy, medium, hard), and whether the question contains charts, etc.
[0032] In some embodiments, multiple candidate information points can be obtained, and the target information point can be determined from these multiple candidate information points. For example, multiple candidate information points can be obtained by manual selection or by determination by a language model, and the material including these multiple candidate information points can be called thinking chain material. Thinking chain material can be regarded as a set of multiple candidate information points.The thought chain template can be customized to select some or all of the candidate information points from the thought chain material for use in thought chain reasoning, thereby optimizing the type of target information points used in the thought chain reasoning process.
[0033] In some embodiments, the thought chain template can also be used to define an arrangement strategy for multiple target information points. In its specification, page 3 / 11, CN 121072504 A, the arrangement strategy refers to the way of organizing and arranging multiple target information points in an orderly manner to ensure the logic and coherence of the thought chain reasoning process. For example, when using a thought chain template to solve a problem and obtain the answer, assuming the target information points include the language, subject, knowledge point, question type, question difficulty, and whether the question contains charts or graphs as described in the previous examples, the information point arrangement strategy can be as follows: First, extract key information points such as subject, question type, and knowledge point to determine the core content and solution direction of the problem, prioritizing them according to the importance and relevance of the information. Then, arrange the information points in order from known to unknown and from simple to complex, based on the logical structure and solution steps of the problem. Simultaneously, arrange them hierarchically according to the relationship between information points, extracting higher-level information points first and then gradually refining them to lower-level information points. Furthermore, flexibly arrange the information points based on the characteristics of the problem and the solution method; for example, extracting geometric features first for geometry problems and extracting the main idea of the article first for Chinese reading comprehension problems. During the arrangement process, the difficulty of the problem can also be considered, quickly extracting key information points for simple problems and analyzing each information point in detail for complex problems. Finally, guided by the characteristics of different subjects and their thinking methods, such as emphasizing logical reasoning for math problems and textual comprehension for Chinese problems, the arrangement of target information points can be further optimized.
[0034] In step S14, the solution step information corresponding to the current input question can be generated based on the thinking chain template. The solution step information is used to describe the reasoning steps used when performing thinking chain reasoning on the current input question based on the information described by the target information points. The following is an example of the thinking chain in a mathematical word problem scenario. Suppose there is a mathematical word problem with the question stem: "Xiaoming has 10 apples. He gave 3 to Xiaohong and 2 to Xiaohua. How many apples does Xiaoming have left?" The solution step information generated according to the thinking chain template in the aforementioned embodiment can be as follows:
[0035] First, I extract the subject information of this question - mathematics, and determine the subject area to which the question belongs;
[0036] Then I clarify the question type - word problem, and know that it is a question type that needs to solve practical problems through logical reasoning and calculation;
[0037] Then I extract the knowledge point - quantitative relationship, and understand that this question mainly involves the increase and decrease relationship between quantities;
[0038] After that, the information points are arranged in a logical order from known to unknown and from simple to complex, starting from Xiaoming's original number of apples.Starting with the known condition of 10 apples, we consider the change in quantity by giving 3 to Xiaohong, and finally examine the remaining situation after giving 2 to Xiaohua, gradually deduce the final number of apples remaining.
[0039] At the same time, based on the hierarchical relationship of information points, we first process the macro information such as high-level disciplines, question types, and knowledge points, and then gradually refine it to the micro information such as the specific changes in the number of apples.
[0040] This question is relatively easy, so we can quickly extract the key information points without conducting complex analysis.
[0041] Finally, based on the characteristics of logical reasoning in mathematics, we deduce the answer according to the above steps:
[0042] Xiaoming originally had 10 apples. After giving 3 to Xiaohong, he had 7 left. Then he gave 2 to Xiaohua, and finally had 5 left.
[0043] In this way, the problem-solving steps present the problem-solving process like a chain, breaking down the originally simple subtraction problem into a clear series of thinking steps, thus arriving at the correct answer.
[0044] In some embodiments, multiple candidate information points can be obtained, the information described by these multiple candidate information points can be extracted from the current input question, the information described by the target information point can be filtered from the information described by the multiple candidate information points, and the solution step information corresponding to the current input question can be generated based on the information described by the target information point. This embodiment divides the process of generating solution step information into two stages. In the first stage, information extraction is performed. In this stage, for any candidate information point, regardless of whether the candidate information point is selected as the target information point, the information described by the candidate information point is extracted from the current input question. In the second stage, the information described by the target information point is directly filtered from the extracted information based on the thinking chain template. For example, assuming the current input question is a math application problem as described in the aforementioned embodiment, the candidate information points include the language, subject, knowledge point, question type, question difficulty, and whether the question contains a chart. The target information points only include the subject, knowledge point, question type, and question difficulty. In the first stage, the information described by each candidate information point can be extracted, including: {language: Chinese; subject: mathematics; knowledge point: subtraction; question type: application problem; question difficulty: primary school; whether the question contains a chart: no}. In the second stage, the information described by the target information point is filtered out, including: {subject: mathematics; knowledge point: subtraction; question type: application problem; question difficulty: primary school}.
[0045] The above embodiment comprehensively extracts all the information described by the candidate information points from the current input question in the information extraction stage, which can ensure the integrity of the information and avoid affecting the generation quality of subsequent problem-solving steps due to the omission of key information. When there is an overlap between the target information points corresponding to different thinking chain templates, the information extracted at one time can be used for multipleThe reuse of thought chain templates can reduce repetitive extraction work and improve overall processing efficiency. If the thought chain template is subsequently adjusted or a new thought chain template is added, since the extracted candidate information points are relatively comprehensive, it is usually not necessary to re-extract information. It is only necessary to filter the target information points according to the new thought chain template, which effectively reduces the information extraction cost caused by changes in the thought chain template.
[0046] In some embodiments, multiple candidate knowledge points can be organized into a graph structure (such as a knowledge graph). The graph structure includes multiple nodes, which correspond to multiple candidate information points respectively. Nodes can be connected by edges, and the edge between any two nodes is used to represent the relationship between the candidate information points corresponding to these two nodes (such as causal relationship, sequential order or other contextual connection relationship). The graph structure can clearly and intuitively show the relationship between candidate information points and reflect the hierarchical structure of information points, so as to efficiently filter out target information points. Figure 2 shows a schematic diagram of a graph structure representing multiple candidate knowledge points in some embodiments. The nodes in the graph structure include language nodes, subject nodes, knowledge point nodes, question type nodes, chart nodes and known condition nodes. The lines connecting nodes represent edges, and the relationships between nodes are shown in the text content on the edges. "Description language" indicates the type of language used to describe a subject or knowledge point; "Contains" indicates the knowledge points contained in the subject, or whether the known conditions include a diagram; "Application" indicates the application of the knowledge point in a specific question type; "Information type" indicates that the diagram is one of the specific information types under this question type; "Question difficulty" indicates the specific difficulty of the question under this question type; "Known information" indicates the known information in the question under this difficulty.
[0047] In some embodiments, the graph structure includes at least one reasoning link, where a reasoning link is a path composed of connected nodes. The information points corresponding to each node on the same reasoning link collectively constitute the core elements required to solve the problem, and there is a direct relationship between adjacent nodes. Reasoning can be performed step by step through the information points on this path to obtain the reasoning result of the thought chain.
[0048] In some embodiments, the shortest reasoning link can be determined from at least one reasoning link, and the candidate information points corresponding to each node on the shortest reasoning link are all determined as target information points. Continuing with the previous example, the reasoning links in the graph structure shown in Figure 2 include:
[0049] Reasoning link 1: Language node → Subject node → Knowledge point node → Question type node → Chart node;
[0050] Reasoning link 2: Language node → Subject node → Knowledge point node → Question type node → Difficulty node → Known condition node;
[0051] Reasoning link 3: Language node → Subject node → Knowledge point node → Question type node → Difficulty node → Known condition node → Chart node.
[0052] Assuming that only the information points corresponding to the subject node, knowledge point node, question type node, difficulty node, and known condition node are needed to solve the problem and obtain the answer, the subject node, knowledge point node, question type node, difficulty node, and known condition node form the shortest reasoning link, and the subject node, knowledge point node, question type node, difficulty node, and known condition node can be determined as the target node.
[0053] The above method of selecting target information points is only an exemplary illustration. In other examples, the candidate information points corresponding to each node in the graph structure can also be determined as target information points, or target information points can be selected in other ways. These will not be listed here.
[0054] In embodiments where the number of target information points is greater than 1, if the thinking chain template also includes an arrangement strategy for the information described by multiple target information points, the information described by multiple target information points can also be arranged based on the arrangement strategy to obtain the problem-solving step information corresponding to the current input problem. For example, target information points can be sorted according to the logical dependencies between them. For instance, when solving math word problems, the known conditions are listed first, then the problem to be solved is determined, and the information points are arranged in the order of quantitative relationships. Related target information points can also be grouped, such as dividing chemistry experiment problems into an experiment preparation group (experimental purpose, materials), an experiment process group (steps, phenomena), and an experiment summary group (conclusions), and then arranging them according to the logical order of the experiment. The content of target information points can also be integrated to make them coherent, such as integrating the main idea of the article and the main idea of each paragraph in a Chinese reading comprehension question to form a coherent narrative. In addition, target information points can be sorted according to their importance, such as presenting physical concepts and formulas first, and then presenting known conditions and data in a physics problem.
[0055] In some embodiments, the problem-solving step information can also be used to define a post-processing strategy for the problem-solving step information. Post-processing can include at least one of the following: expanding, abbreviating, optimizing the expression, and formatting the problem-solving step information. Expanding refers to expanding and supplementing the generated problem-solving step information without changing the original meaning, making it more detailed and complete. Abbreviation refers to simplifying and compressing the generated problem-solving steps information, retaining key content and core points. Optimization refers to polishing and adjusting the language of the generated problem-solving steps information to make it clearer, more accurate, and more fluent. For example, adjusting sentence structure and replacing words. Formatting refers to organizing and presenting the generated problem-solving steps information according to a certain format to make it more standardized and neat. For example, lists, paragraphs, tables, etc. can be used. Post-processing can be achieved through a language model. After generating the problem-solving steps information, post-processing can also be performed on the problem-solving steps information based on post-processing strategies.
[0056] In step S16, sample data can be generated based on the current input question and problem-solving steps information.The first question generation model is used to train reasoning based on thought chain. In some embodiments, the sample data may also include answer information corresponding to the currently input question.
[0057] In some embodiments, the quality of the thought chain template may also be checked based on the sample data. Specifically, a second question generation model may be trained based on the sample data, and the verification data may be input into the trained second question generation model so that the trained second question generation model generates answer information corresponding to the verification data, and the quality of the thought chain template is verified based on the accuracy of the answer information generated by the second question generation model. Since the reasoning step information is determined based on the thought chain template, the quality of the thought chain template will affect the quality of the reasoning step information, and the sample data includes the reasoning step information, so the quality of the reasoning step information is closely related to the quality of the sample data. Since the second question generation model is trained based on the sample data, the quality of the sample data will affect the accuracy of the answer information generated by the second question generation model. In summary, the quality of the thought chain template will affect the accuracy of the answer information generated by the second question generation model. This embodiment trains the second question generation model through sample data and obtains the accuracy of the answer information generated in the second language, which can effectively evaluate the quality of the thought chain template.
[0058] In some embodiments, the quality of the thought chain template is related not only to the accuracy of the answer information generated by the second question generation model, but also to the number of lexical units included in the problem-solving step information generated based on the thought chain template. If the number of lexical units in the problem-solving step information is too large, then the problem-solving step information may include a lot of redundant information, increasing the complexity of processing, and may make the thought chain difficult to understand and process. Therefore, the number of lexical units included in the problem-solving step information can be obtained, and the quality of the thought chain template can be verified based on the accuracy of the answer information generated by the second question generation model and the number of lexical units included in the problem-solving step information. Assume that the problem-solving steps generated based on the thought chain template A are based on problem-solving step information XA, and the sample data including problem-solving step information XA is denoted as sample data SA. The second question generation model trained based on sample data SA is denoted as the second question generation model MA. And assume that the problem-solving steps generated based on the thought chain template B are based on problem-solving step information XB, and the sample data including problem-solving step information XB is denoted as sample data SB. The second question generation model trained based on sample data SB is denoted as the second question generation model MB. Then, if the accuracy of the answer information generated by the second question generation model MA is close to the accuracy of the answer information generated by the second question generation model MB, and the number of words included in problem-solving step information XA is less than the number of words included in problem-solving step information XB, then the thought chain template A...The quality is higher than that of the thought chain template B. Among them, the accuracy of the answer information generated by the second question generation model MA is close to that of the answer information generated by the second question generation model MB, which means that the difference between the accuracy of the answer information generated by the second question generation model MA and the accuracy of the answer information generated by the second question generation model MB is less than a preset threshold.
[0059] The following uses a specific application scenario as an example to illustrate the overall process of the embodiment of this specification.
[0060] Related technologies mix content generation with the logical optimization of the thought chain, resulting in a high risk of error propagation and difficulty in quality control. In addition, related technologies lack quantitative evaluation indicators for problem-solving step information (such as logical skip detection, causal rationality verification), and data quality depends on subjective judgment.
[0061] The embodiment of this specification proposes a sample data generation scheme, which decouples the logical optimization of the thought chain from the content generation and adds an iterative mechanism to improve the overall quality of the sample data. Referring to Figure 3, the overall process of this scheme is as follows:
[0062] (1) Data collection. Data collection is the starting point of the scheme and is mainly responsible for the selection and preprocessing of data sources. The specific steps include:
[0063] Data collection: Obtain content from public teaching resources, textbooks, courseware and other high-value data sources.
[0064] Data cleaning: Preprocess the collected data to remove redundancy, noise and invalid information.
[0065] The core outputs of this step include:
[0066] Teaching syllabus: Used to summarize a logical and complete subject knowledge system outline.
[0067] Textbooks and questions: Based on knowledge points, form standardized teaching materials, including test bank and question design.
[0068] (2) Knowledge base construction. This step uses the data collection results to build an organized knowledge system and question benchmark. The main steps include:
[0069] Data classification: Classify the content collected in step (1) and establish subject blocks and knowledge point blocks.
[0070] Version management: Support dynamic updates of the knowledge base to meet the introduction and compatibility of new knowledge.
[0071] The core outputs of this step include:
[0072] Subject architecture: Establish a knowledge grid structure, with each node corresponding to a specific subject, chapter, and sub-knowledge point.
[0073] Knowledge point base: Extract content items related to core knowledge points from textbooks.
[0074] Seed question bank: Construct a basic question bank containing the knowledge point tags corresponding to the questions in the knowledge base.
[0075] (3) Labeling / synthesis. This step achieves data expansion and quality control through intelligent labeling and rule-based synthesis extension. The main process includes:
[0076] Intelligent labeling: Automatically label the seed questions in the knowledge point base using natural language processing technology to obtain the knowledge points included in the seed questions.
[0077] Synthetic Augmentation: New questions are synthesized based on the labeled seed questions and the labeled knowledge points, while generating answers and reasoning processes related to the new questions.
[0078] When synthesizing new questions, more data synthesis and expansion technologies can be introduced to construct richer task data for scarce domains or deep reasoning scenarios. For example, based on the acquired knowledge points, complex reasoning scenarios can be expanded by generating potential causal chains or supplementing adversarial data. Generating potential causal chains means constructing a chain of causal relationships between events or phenomena, showing the ins and outs and logical order of things. Supplementing adversarial data is to increase the difficulty and complexity of the questions by adding some data or conditions that are easy to confuse or misunderstand. In addition, cross-domain and multi-disciplinary task data can be added based on the disciplinary architecture produced in the previous step, such as collecting and standardizing data from fields such as medical reasoning and engineering analysis in real-world scenarios to achieve multi-task level expansion. Multiple possible answers can also be generated for a single question, including correct / incorrect options and options that cause reasoning conflicts, thereby enhancing the model's adaptability by increasing the diversity of data. The above methods can enrich the adaptability of sample data, support complex and multi-domain tasks, and enhance the model's ability to solve uncertain and open-ended problems.
[0079] The core outputs of this step include:
[0080] Question: including question stem and answer, realizing automatic matching of question stem and answer, which is the basic unit of the dataset.
[0081] Thinking chain material: extracting candidate information points that have the potential to be used for reasoning tasks and adding them to the thinking chain material as the focus of subsequent design.
[0082] (4) Thinking chain rewriting. This step optimizes the thinking chain logic by introducing a thinking chain rewriting mechanism. The main process includes:
[0083] Thinking chain material screening: screening out target information points suitable for reasoning chain optimization from the thinking chain material obtained in the previous module to ensure the adaptability of complex reasoning tasks.
[0084] Thinking chain rewriting: using template generation, language model-assisted generation and manual intervention, constructing a thinking chain template that may have multi-step causal logic.
[0085] The core outputs of this step include:
[0086] Sample data: High-quality reasoning questions and answer data containing reasoning chains.
[0087] Thinking chain template: A complete set of standardized thinking chain design rules for consistent generation.
[0088] (5) Verification and archiving. This step is used to comprehensively evaluate the thinking chain template to ensure the quality of the final output. The main processes include:
[0089] Data verification: Verify the logic and rigor of the problem-solving steps through quality assessment and automated testing.
[0090] Data archiving: Archive the verified sample data for large-scale use.
[0091] During the data verification process, a dynamic verification mechanism can be introduced to evaluate and optimize in real time for different task scenarios. For example, dynamic quality indicators can be formulated according to the actual needs of users, such as adding verification standards for domain complexity or additional checks on reasoning depth. Questions can also be divided into multiple difficulty levels, and the solution steps for questions of different difficulty levels can be verified step by step. In addition, logical consistency verification is specifically performed on the solution steps, such as by automatically detecting whether there is circular logic or broken chain. The above methods can improve the customization and targeting of the verification process and can realize dynamic adjustment to the task adaptation scenario (such as verification basis for specific reasoning model tasks).
[0092] In the verification archiving stage, in addition to standard testing, closed-loop feedback optimization can be carried out in combination with actual user usage to ensure long-term iterative updates of sample data. For example, a feedback collection platform can be set up to record the performance of the question generation model in actual tasks and user improvement suggestions. For erroneous reasoning problems or invalid problems found by users, the corresponding data can be re-screened and optimized. Feedback can also be collected regularly and the sample data can be dynamically updated to always keep the latest standards. Through the above methods, the practicality and scalability of sample data can be enhanced, and the data quality of sample data can be continuously improved according to actual needs, forming a self-optimizing closed loop, reducing dependence on fixed rule templates, reducing maintenance costs, realizing the long-term sustainable development of the dataset, and ensuring that it always meets actual needs.
[0093] The core outputs of this step include: Specification 8 / 11 pages 11 CN 121072504 A
[0094] High-quality sample data: The sample data meets relevant quality standards.
[0095] Verification and evaluation report: Includes quality evaluation of sample data and evaluation of the effect of reasoning process, ensuring usability and reliability.
[0096] This embodiment realizes the whole chain processing from source data collection to quality verification through systematic process design, and finally generates sample data suitable for high-quality reasoning tasks, ensuring the high quality and repeatability of the dataset. This solution supports the rapid and large-scale construction of high-quality sample data, improves the reasoning ability and task adaptability of artificial intelligence models, and has significant advantages, especially in complex problem solving, causal reasoning and logical judgment tasks.
[0097] The solutions in the embodiments of this specification have the following advantages:
[0098] (1) The logic optimization and content generation of the thinking chain are decoupled and iteratively optimized. In the logic optimization stage of the thinking chain, the focus is on the logic optimization of the thinking chain, and in the content generation stage, the focus is on the correctness of knowledge. An iterative feedback mechanism is introduced to optimize each link in reverse according to the verification results, forming a closed loop for continuous improvement of data quality.
[0099] (2) The three-dimensional knowledge base architecture design constructs a gridded knowledge system (subject architecture - knowledge point base - seed question bank),Dynamic version management and classification layering technology are adopted to achieve triple protection of knowledge coverage, depth and timeliness. Through knowledge point tag mapping and question benchmark library, the model illusion problem is effectively avoided.
[0100] (3) Rule-driven synthesis augmentation technology. A dual-track data expansion scheme of "intelligent annotation + rule synthesis" is proposed: automatic annotation based on natural language processing ensures basic quality, and combined with the synthesis rule design of prompting engineering (such as causal association, multi-perspective generation) improves data diversity on the premise of ensuring correctness.
[0101] (4) Templating rewriting of thinking chain. A standardized rewriting operation template library is developed to realize the modular construction of thinking chain. Through the three core operations of information filtering (target information point extraction), combination (information point arrangement), and expansion and abbreviation (granular control), the problem-solving steps information including multi-step causal reasoning chain is systematically generated, breaking through the logical discreteness defect of traditional end-to-end generation.
[0102] (5) Full-link quality verification system. A multi-dimensional evaluation index (QA accuracy, logical rigor, process interpretability) is established, combined with a dual verification mechanism of automated testing and manual verification. Establish an evaluation report feedback system to trace quality defects to specific modules for targeted optimization.
[0103] (6) Modular industrial-grade pipeline design. An industrialized pipeline architecture for the production of educational reasoning datasets has been realized. Five functional modules (collection → knowledge base → annotation → rewriting → verification) form a standardized production unit. Each module can be upgraded independently (such as updating synthesis rules) and can be quickly recombined through API interfaces to support agile adaptation to different subject scenarios.
[0104] (7) The embodiments of this specification ensure that each link is customized for the target domain through a full-process processing framework from original teaching resources to final verification and archiving, rather than simply relying on the reasoning mode of the source domain. A flexible thinking chain rewriting mechanism and dynamic verification mechanism are introduced to improve the adaptability and reliability of cross-domain datasets, reduce dependence on source domain data, reduce risks caused by data quality problems, simplify the construction process of cross-domain datasets, and avoid the high technical threshold of complex transfer learning algorithms.
[0105] (8) In the annotation / synthesis module, natural language processing technology is used for intelligent annotation, and new questions and answers are generated through synthesis augmentation technology. This method not only improves the diversity of data but also covers more complex reasoning scenarios, avoiding the limitations of rule templates.
[0106] This specification also provides a model training method, which trains a question generation model based on reasoning based on thought chains using sample data obtained in any of the foregoing embodiments. The question generation model can be the first question generation model in the foregoing embodiments. For specific implementation details of this embodiment, please refer to the embodiment on page 9 / 11 of the specification of the sample data acquisition method, CN 121072504 A, which will not be repeated here.
[0107] This specification also provides a question generation method, which includes: acquiring knowledge points for generating questions, generating a question design strategy based on the acquired knowledge points, and inputting the question design strategy into a first question generation model, so that the first question generation model generates questions based on the question generation strategy. The generated questions include question stem information, solution step information, and answer information. The first question generation model can be trained based on sample data acquired in any of the foregoing embodiments.
[0108] Referring to Figure 4, this embodiment of the specification also provides a sample data acquisition device, the device comprising:
[0109] a template acquisition module 102, which acquires a thought chain template, the thought chain template being used to define target information points, the target information points being used to describe information extracted from the input question for thought chain reasoning;
[0110] an information generation module 104, which, in response to acquiring the current input question, generates solution step information corresponding to the current input question based on the thought chain template; the solution step information is used to describe the reasoning steps used when performing thought chain reasoning on the current input question based on the information described by the target information points;
[0111] a sample data generation module 106, which generates sample data based on the current input question and the solution step information; the sample data is used to train a first question generation model based on thought chain reasoning.
[0112] This embodiment of the specification also provides a model training device, which uses a training module to train a language model based on thought chain reasoning. The language model may be the first question generation model in the foregoing embodiments. The sample data used to train the language model can be the sample data acquired by the sample data acquisition device in the foregoing embodiments. For details of the specific implementation of this embodiment, please refer to the embodiments of the sample data acquisition method described above, which will not be repeated here.
[0113] This specification embodiment also provides a question generation device, which includes: a knowledge point acquisition module, used to acquire knowledge points for generating questions; a strategy generation module, used to generate a question design strategy based on the acquired knowledge points; and a question generation module, used to input the question design strategy into a first question generation model, so that the first question generation model generates questions based on the question generation strategy. The generated questions include question stem information, problem-solving step information, and answer information. The first question generation model can be trained based on the sample data acquired in any of the foregoing embodiments.
[0114] This specification embodiment also provides a computer device, which includes at least a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in any of the foregoing embodiments.
[0115] Figure 5 shows a more specific hardware structure diagram of a computer device provided in this specification embodiment.The device may include: a processor 202, a memory 204, an input / output interface 206, a communication interface 208, and a bus 210. The processor 202, memory 204, input / output interface 206, and communication interface 208 are interconnected within the device via the bus 210.
[0116] The processor 202 may be implemented using a general-purpose central processing unit (CPU), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., to execute relevant programs to implement the technical solutions provided in the embodiments of this specification. The processor 202 may also include a graphics card, such as an Nvidia Titan X graphics card or a 1080Ti graphics card.
[0117] The memory 204 may be implemented using read-only memory (ROM), random access memory (RAM), static storage devices, dynamic storage devices, etc. The memory 204 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 204 and is called and executed by the processor 202.
[0118] The input / output interface 206 is used to connect the input / output module to realize information input and output. The input / output module can be configured as a component in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. The input device can include a keyboard, mouse, touch screen, microphone, various sensors, etc., and the output device can include a display, speaker, vibrator, indicator light, etc.
[0119] The communication interface 208 is used to connect the communication module (not shown in the figure) to realize communication interaction between this device and other devices. The communication module can realize communication through wired means (e.g., USB, network cable, etc.) or through wireless means (e.g., mobile network, Wi-Fi, Bluetooth, etc.).
[0120] Bus 210 includes a pathway for transmitting information between various components of the device (e.g., processor 202, memory 204, input / output interface 206, and communication interface 208).
[0121] It should be noted that although the above-described device only shows processor 202, memory 204, input / output interface 206, communication interface 208, and bus 210, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may also only include components for implementation...The components necessary for the embodiments of this specification are not necessarily all the components shown in the figures.
[0122] Embodiments of this specification provide a computer program product, including a computer program that, when executed by a processor, implements the methods described in any of the embodiments of this specification.
[0123] Embodiments of this specification also provide a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the methods described in any of the foregoing embodiments.
[0124] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology for information storage. Information may be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices or any other non-transfer medium that can be used to store information that can be accessed by a computer device. As defined herein, computer-readable media do not include transient media, such as modulated data signals and carrier waves.
[0125] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments. In particular, for the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple. For relevant parts, refer to the description of the method embodiments. The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate. When implementing the embodiments of this specification, the functions of each module can be implemented in one or more software and / or hardware. Some or all of the modules can also be selected to achieve the purpose of the embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0126] The above descriptions are only specific implementations of the embodiments of this specification. It should be noted that those skilled in the art can make several improvements and modifications without departing from the principles of the embodiments of this specification. These improvements and modifications should also be considered within the protection scope of the embodiments of this specification. Instruction manual, page 11 / 11, CN 121072504 A, Figure 1; Instruction manual drawing, page 1 / 3, CN 121072504 A, Figure 2.Figure 3 Sheet 2 / 3 of the drawings of the specification 16 CN 121072504 A Figure 4 Figure 5 Sheet 3 / 3 of the drawings of the specification 17 CN 121072504 A Abstract A sample data acquisition and model training method, medium, device and program product, the method comprising: acquiring a thinking chain template, the thinking chain template being used for defining a target information point, the target information point being used for describing information extracted from an input question for thinking chain reasoning; in response to the acquired current input question, generating question solving step information corresponding to the current input question based on the thinking chain template; the problem solving step information is used for describing a reasoning step adopted when thinking chain reasoning is carried out on the current input problem based on the information described by the target information point; generating sample data based on the current input question and the question solving step information; the sample data is used for training a firstquestion generation model for reasoning based on a thinking chain.
Claims
1. A method for obtaining sample data, the method comprising: obtaining a thinking chain template, the thinking chain template being used to define a target information point, the target information point being used to describe information extracted from an input question for thinking chain reasoning; in response to obtaining a current input question, generating, based on the thinking chain template, problem solving step information corresponding to the current input question, the problem solving step information being used to describe reasoning steps adopted when performing thinking chain reasoning on the current input question based on information described by the target information point; generating sample data based on the current input question and the problem solving step information, the sample data being used to train a first question generation model based on thinking chain reasoning.
2. The method of claim 1, wherein the generating, based on the thinking chain template, problem solving step information corresponding to the current input question comprises: obtaining a plurality of candidate information points; extracting information described by the plurality of candidate information points from the current input question; selecting information described by the target information point from information described by the plurality of candidate information points; and generating, based on information described by the target information point, problem solving step information corresponding to the current input question.
3. The method of claim 2, wherein the plurality of candidate information points are organized into a graph structure, the graph structure comprising a plurality of nodes, each of the plurality of nodes corresponding to a candidate information point, and the method further comprises: selecting, based on the graph structure, the target information point from the plurality of candidate information points.
4. The method of claim 3, the plurality of nodes forming at least one chain of reasoning link; The selecting, based on the graph structure, the target information point from the plurality of candidate information points comprises: determining a shortest reasoning link in the at least one reasoning link; and determining each candidate information point corresponding to a node on the shortest reasoning link as a target information point.
5. The method of claim 2, wherein the number of target information points is greater than one; and wherein the thinking chain template further comprises an arrangement strategy for the information described by the plurality of target information points. The generating, based on information described by the target information point, problem solving step information corresponding to the current input question comprises: arranging, based on the arrangement strategy, information described by the plurality of target information points to obtain problem solving step information corresponding to the current input question; and / or The thinking chain template further comprises a post-processing strategy for the problem solving step information, and before the generating sample data based on the current input question and the problem solving step information, the method further comprises: post-processing the problem solving step information based on the post-processing strategy.
6. The method of claim 1, further comprising: training a second question generation model based on the sample data; inputting verification data into the trained second question generation model to enable the trained second question generation model to generate answer information corresponding to the verification data, the verification data comprising at least a question stem information of a question; obtaining a number of word units included in the problem solving step information; based on an accuracy rate of the answer information generated by the second question generation model and the number of word units included in the problem solving step information, performing quality verification on the thinking chain template.
7. A method for training a model, the method comprising: obtaining sample data based on the method of any one of claims 1 to 6. Train a question generation model based on thought chain reasoning based on the sample data.
8. A computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of any one of claims 1 to 7.
9. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 7 when executing the computer program.
10. A computer program product comprising a computer program which, when executed by a processor, implements the method of any one of claims 1 to 7.