Mathematical reasoning data synthesis method and system based on agent simulation teaching scene
By simulating teaching scenarios with intelligent agents, analyzing the weaknesses of large language models, and simulating multiple teaching scenarios, high-quality mathematical reasoning data is synthesized. This solves the problems of high construction costs and low quality density in existing technologies, and improves the mathematical reasoning ability of large language models.
Patent Information
- Application Number
- CN202510302608.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-14
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2045-03-14
AI Technical Summary
Existing technologies suffer from high construction costs, low quality density, and severe data homogenization when synthesizing mathematical reasoning data, and cannot effectively integrate multi-level human learning experiences.
We adopt an agent-based approach to simulate teaching scenarios. By analyzing errors in a large language model through multi-role agents, we simulate various teaching scenarios and synthesize high-quality mathematical reasoning data. This includes teacher agents analyzing weaknesses, student agents solving problems, teaching assistant agents reflecting, and note-taking agents organizing data, thus forming a high-quality mathematical reasoning dataset.
It improves the quality, density, and diversity of data, avoids resource waste, solves the problems of high construction costs and data homogenization, and significantly enhances the mathematical reasoning ability of large language models.
Smart Images

Figure CN120297407B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of large language model technology, and in particular to a method and system for synthesizing mathematical reasoning data based on an intelligent agent simulating a teaching scenario. Background Technology
[0002] Large Language Models (LLMs) have excelled in fields such as natural language processing and text generation, particularly demonstrating exceptional capabilities in semantic understanding. However, despite their significant progress in multiple domains, LLMs still face numerous challenges in mathematical reasoning tasks. Mathematical reasoning ability, as a crucial indicator of the intelligence level of LLMs, reflects their performance in understanding and solving complex reasoning tasks.
[0003] Early research found that using "question-answer pairs" (QA pairs) with detailed solution processes, i.e., data containing chain-of-thought (CoT), helps large language models learn how to perform step-by-step reasoning. However, obtaining CoT data through manual annotation is inefficient, time-consuming, and difficult to scale. Therefore, with the continuous development of large language models, high-performance large language models (such as GPT-4) are mainly used to synthesize CoT data related to mathematical reasoning, and supervised fine-tuning (SFT) is employed to further enhance the mathematical reasoning ability of large language models, thereby helping weaker large language models improve their mathematical reasoning capabilities. For example, rewriting existing CoT data using GPT-4 can achieve data expansion in a short time. It is evident that training large language models with high-quality mathematical reasoning data can further improve their mathematical reasoning capabilities.
[0004] Synthetic data is non-human-created data that mimics real-world data. It is generated through computational algorithms and simulations based on generative artificial intelligence techniques. As an effective data augmentation method, it can expand existing data, thereby enriching it. Its quality directly determines the extent to which it can improve the domain capabilities of large language models. Therefore, in order to enhance the mathematical reasoning ability of large language models, researching how to synthesize high-quality mathematical reasoning data is particularly important.
[0005] To obtain high-quality mathematical reasoning data, some methods analogize the training of large language models to the human learning process. By mimicking the process of humans learning from mistakes, a method called LEMA (Learning from Mistakes) has been proposed to improve the reasoning ability of large language models in mathematical problem-solving. Specifically, firstly, the erroneous parsings generated by the large language model are collected, then corrected using GPT-4, and finally, {problem, original erroneous parsings + corrected parsings} are provided as mathematical reasoning data to the model for learning.
[0006] Other methods, such as MetaMathQA, rewrite the questions and solutions in existing question-response pairs into different formats to generate mathematical reasoning data, which to some extent mimics the human learning process through diverse practice. Essentially, this method uses a powerful large language model to rewrite existing CoT data, such as answer enhancement, question enhancement, and reverse question enhancement, thereby increasing the data scale.
[0007] While these analogies to human learning inference data synthesis methods have achieved excellent results, the construction of mathematical reasoning data requires simultaneous consideration of multiple factors such as scale, relevance, accuracy, and diversity. These methods overemphasize data scale while neglecting the quality dimension, leading to high construction costs, low quality density, and severe data homogenization problems. Specifically:
[0008] (1) Human learning is a complex process, and a simple analogy with a certain learning strategy or method cannot fully convey the multi-level experience in the human learning process. The “Cone of Experience” educational theory believes that human learning consists of three levels: the practice level of learning through practice, the observation level of learning through observation, and the abstract level of learning through abstraction. High-quality learning requires the integration of all three levels at the same time. However, existing reasoning data synthesis methods are generally limited to the observation level and cannot achieve the integration of the three levels, which leads to serious data homogenization problems.
[0009] (2) Existing methods for synthesizing inference data treat each known CoT data point equally, resulting in the same number of inference data points synthesized from each known CoT data point. For example, if there are 500 known CoT data points, the final number of inference data points may be 500 × 10 = 5000; this is unreasonable. Because problems that can be accurately solved by large language models do not require a large amount of additional data synthesis, this would lead to a waste of resources and result in high construction costs and low quality density. Summary of the Invention
[0010] To address the aforementioned problems, this invention provides a mathematical reasoning data synthesis method and system based on intelligent agent-simulated teaching scenarios, which solves the problems of high construction costs, low quality density, and severe data homogenization in current reasoning data synthesis methods that are analogous to human learning.
[0011] On one hand, the present invention provides a method for synthesizing mathematical reasoning data based on an intelligent agent simulating a teaching scenario, the method comprising:
[0012] Obtain the publicly available Mind Chain dataset, perform reasoning on the large language model whose mathematical reasoning ability needs to be improved on the Mind Chain dataset, and obtain the error rate of the large language model on each question;
[0013] A multi-role intelligent agent is created, and the teacher intelligent agent is used to analyze the parsing errors of the large language model to obtain a weak point dataset; based on the error rate and the preset dataset size, the expected inference data volume for each problem is obtained.
[0014] For each problem in the weak point dataset, the multi-role intelligent agent is used to simulate multiple teaching scenarios, and the dialogue data in the multiple teaching scenarios is converted into data in the same format as the thinking chain dataset, until each problem accumulates the corresponding expected amount of reasoning data, and the expanded mathematical reasoning dataset is synthesized.
[0015] Furthermore, the first The mathematical reasoning dataset after the second expansion for:
[0016] ;
[0017] ;
[0018] in, Represents the first in the mathematical reasoning dataset The problem corresponding to each piece of data; Represents the first in the mathematical reasoning dataset Parsing of each data item; Indicates the size of the preset mathematical reasoning dataset; This represents the note-taking intelligent agent; Indicates parsing Enhancement; This refers to the questions raised during discussions across various teaching scenarios. Design concept; Indicates the teaching assistant agent's review of the problem. Key information in the text; Reflections and Issues on the Design of a Vulnerability Dataset Similar new questions; Indicates the question Enhancement; Indicates parsing An extension of.
[0019] Furthermore, the method also includes:
[0020] The large language model is trained under supervised fine-tuning on the expanded mathematical reasoning dataset to obtain the trained large language model.
[0021] The process is repeated iteratively, with the previously trained large language model being used for reasoning on the thought chain dataset to obtain an expanded mathematical reasoning dataset. This process continues until the preset expected number of expansions is reached, at which point the target mathematical reasoning dataset and the large language model with improved mathematical reasoning capabilities are output.
[0022] Furthermore, the target mathematical reasoning dataset for:
[0023] ;
[0024] in, Indicates the first The expanded mathematical reasoning dataset; Indicates the preset expected number of expansions; This indicates the union operation.
[0025] Furthermore, the large language model is trained under supervised supervision on the expanded mathematical reasoning dataset, with the loss function... for:
[0026] ;
[0027] in, Indicates the size of the preset mathematical reasoning dataset; Represents the first in the mathematical reasoning dataset Parsing of each data item; Represents the first in the mathematical reasoning dataset The problem corresponding to each piece of data; This represents the update parameters of the large language model.
[0028] Furthermore, obtaining the expected amount of inference data includes:
[0029] The size coefficient of the corresponding problem is obtained based on the error rate and the size of the dataset.
[0030] Based on the error rate and the size coefficient, the expected amount of inference data for each problem is obtained.
[0031] Furthermore, the scale coefficient The calculation method is as follows:
[0032] ;
[0033] in, Indicates the size of the preset mathematical reasoning dataset; Indicates the first Error rate of the corresponding problem in the data; This indicates the size of the thought chain dataset.
[0034] Furthermore, the expected inference data volume The calculation method is as follows: ;in, Indicates the scale factor; Indicates the error rate.
[0035] Furthermore, the vulnerability dataset for:
[0036] ;
[0037] in, Representing a large language model; Represents the teacher's intelligent agent; This indicates the first [item] in the thought chain dataset. The problem corresponding to each piece of data; Representing a large language model In answering question # Error parsing of the problem corresponding to each data point.
[0038] On the other hand, the present invention provides a mathematical reasoning data synthesis system based on an intelligent agent simulating a teaching scenario, including a memory, a processor, and a computer program stored in the memory. The processor executes the computer program to implement the steps of any of the above-described methods.
[0039] In summary, this invention provides a method and system for synthesizing mathematical reasoning data based on an intelligent agent simulating a teaching scenario. Compared with existing technologies, the technical solution conceived in this invention can achieve the following beneficial effects:
[0040] (1) This invention creates a multi-role intelligent agent and uses the teacher intelligent agent to analyze the parsing error of the large language model to obtain a weak point dataset. The focus of data synthesis is placed on the problems that the large language model fails to solve accurately. It focuses on the problems that are challenging for the large language model, accumulates practical experience, pays more attention to the quality dimension rather than just the data scale, avoids a large amount of extra data synthesis, does not cause resource waste, and solves the problems of high construction cost and low quality density.
[0041] (2) First, this invention focuses on problems that large language models cannot answer correctly, accumulating practical experience; second, this invention uses multi-role intelligent agents to simulate various teaching scenarios such as classes, discussions, and problem-solving, providing dialogue data from various teaching scenarios to the model for observation and learning, accumulating observation experience; third, this invention accumulates abstraction experience by designing similar new problems and expanding the error analysis of problems; by integrating the three levels, the source of data is not only the observation level, but also includes the practical and abstract levels, thereby obtaining richer and higher quality data and avoiding the problem of data homogenization. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0043] Figure 1 This invention provides a schematic diagram of the method steps for synthesizing mathematical reasoning data based on an intelligent agent-simulated teaching scenario. Figure 1 ;
[0044] Figure 2 This is a schematic diagram illustrating the principle of a mathematical reasoning data synthesis method and system based on an intelligent agent-simulated teaching scenario provided by the present invention.
[0045] Figure 3 This invention provides a schematic diagram of the method steps for synthesizing mathematical reasoning data based on an intelligent agent-simulated teaching scenario. Figure 2 ;
[0046] Figure 4 This is a schematic diagram showing the performance comparison of a mathematical reasoning data synthesis method and system based on an intelligent agent-simulated teaching scenario provided by the present invention on different datasets. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings and embodiments. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0048] It should be noted that, in the description of the embodiments of the present invention, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a method, step, or apparatus that includes a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to the method, step, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the method, step, or apparatus that includes said element.
[0049] To address the high construction costs, low quality density, and severe data homogenization issues present in current analogy-based methods for synthesizing reasoning data, this invention provides a mathematical reasoning data synthesis method and system based on an intelligent agent simulating a teaching scenario. Based on the "Cone of Experience" educational theory, the method focuses on problems that large language models have failed to accurately solve, while also incorporating practical, observational, and abstract experiences required for human learning to obtain a mathematical reasoning dataset.
[0050] On the one hand, such as Figure 1 and Figure 2 As shown, specifically, the method of the present invention includes:
[0051] Step 101: Obtain the publicly available MindChain dataset, perform reasoning on the large language model whose mathematical reasoning ability needs to be improved on the MindChain dataset, and obtain the error rate of the large language model on each question.
[0052] The publicly available CoT dataset, also known as the "question-solution pair" dataset, can be represented as follows: , ;in, Represents the first in the CoT dataset The problem corresponding to each piece of data; Represents the first in the CoT dataset Parsing of each data item; This indicates the size of the CoT dataset. This dataset is used to optimize large language models to improve their reasoning and derivation capabilities.
[0053] For example, a piece of data in the CoT dataset It can be:
[0054] { "Xiaoming bought 5 bags of beef weighing 4 jin (approximately 2 catties); the price of the beef was 50 yuan per jin. How much did he pay?" He bought 5 x 4 = 20 jin of beef; therefore, he paid 20 x 50 = 1000 yuan.
[0055] Specifically, for the publicly available CoT dataset, it can be the training set in the MATH dataset or the training set in the GSM8K dataset.
[0056] For example, a piece of data in the MATH training set for:
[0057] { "The distance between two cities on a map is 15 inches. If the scale is 0.25 inches = 3 miles, how many miles apart are the actual cities?" "If 0.25 inches represents 3 miles, then 1 inch represents 12 miles, and 15 inches represents 180 miles. Therefore, the actual distance between cities is 180 miles."
[0058] Large language models that need to improve mathematical reasoning ability In the MindChain dataset Inference is performed on the above to obtain the error rate of the large language model on each question.
[0059] Large language models that need to improve mathematical reasoning ability In the MindChain dataset The process involves multiple inferences. Specifically, for each question, the large language model is required to answer the questions multiple times consecutively, and the error rate of the large language model for that question is calculated.
[0060] As an example, the present invention uses the CoT dataset. conduct The second expansion yields an expanded mathematical reasoning dataset and a large language model trained under supervised fine-tuning.
[0061] Among them, the The expanded mathematical reasoning dataset for: ; Represents the first in the mathematical reasoning dataset The problem corresponding to each piece of data; Represents the first in the mathematical reasoning dataset Parsing of each data item; Indicates the size of the preset mathematical reasoning dataset; Indicates the number of expansions. .
[0062] For the first expansion, the original large language model was used. For the first For this expansion, the large language model used is the model obtained by supervised fine-tuning training after the previous expansion.
[0063] In other words, the large language model currently in use is the model obtained by supervised fine-tuning training after the previous expansion. If there was no previous expansion, the original large language model is used directly.
[0064] Step 102: Create a multi-role intelligent agent, use the teacher intelligent agent to analyze the parsing errors of the large language model, and obtain the weak point dataset; based on the error rate and the preset dataset size, obtain the expected inference data volume for each problem.
[0065] As an example, this invention utilizes a powerful large language model to represent four types of intelligent agents: namely, teacher intelligent agents... Student intelligent agent Teaching assistant intelligent agent ing Assistant ( A ), and the note-taking AI agent For example, a powerful large language model could be the GPT-4 model.
[0066] To address the issue of parsing errors in large language models, a teacher agent is introduced to obtain the problem and the error parsing of the large language model. The teacher agent is required to analyze the knowledge weaknesses of the large language model to obtain a dataset of weaknesses, and then synthesize a mathematical reasoning dataset based on the dataset of weaknesses.
[0067] As an example, a vulnerability dataset for:
[0068] ;
[0069] in, Representing a large language model; Represents the teacher's intelligent agent; This represents the first [item] in the Mind Chain dataset. The problem corresponding to each piece of data; Representing a large language model In answering question # Error parsing of the problem corresponding to each data point.
[0070] Specifically, the expected inference data volume can be obtained by: obtaining the size coefficient of the corresponding problem based on the error rate and the dataset size; and obtaining the expected inference data volume for each problem based on the error rate and the size coefficient.
[0071] As an example, the scale factor The calculation method is as follows:
[0072] ;
[0073] in, Indicates the size of the preset mathematical reasoning dataset; Indicates the first Error rate of the corresponding problem in the data; This indicates the size of the MindChain dataset.
[0074] As an example, the expected amount of inference data for each problem The calculation method is as follows: ;in, Indicates the scale factor; Indicates the error rate.
[0075] By using teacher agents to analyze parsing errors in large language models, a weak point dataset is obtained. The focus of data synthesis is placed on problems that large language models fail to solve accurately. This approach concentrates on challenging problems for large language models, accumulates practical experience, and emphasizes quality rather than just data scale. This avoids the need for extensive additional data synthesis, prevents resource waste, and solves the problems of high construction costs and low quality density.
[0076] Step 103: For each question in the weak point dataset, use a multi-role intelligent agent to simulate multiple teaching scenarios, and convert the dialogue data in the multiple teaching scenarios into data in the same format as the thinking chain dataset, until each question has accumulated the corresponding expected amount of reasoning data, and synthesize the expanded mathematical reasoning dataset.
[0077] It should be noted that this invention utilizes a powerful large language model to act as an intelligent agent, driving the agent to play roles such as teacher, student, teaching assistant, and note-taker. First, the large language model to be improved is used for reasoning, and the teacher agent analyzes its weaknesses in mathematical reasoning to accumulate practical experience. Then, focusing on problems that are challenging for the large language model to be improved, multi-role agents simulate various teaching scenarios such as class, discussion, problem-solving, reflection, and review, and provide relevant information as data to the large language model to be improved for observation and learning, accumulating observational experience. Next, a reflection phase is designed to accumulate abstract experience for the large language model to be improved. Finally, the note-taker agent organizes all dialogue information into a specific format, ultimately synthesizing a mathematical reasoning dataset.
[0078] Specifically, based on practical scenarios, teacher agents, student agents, and teaching assistant agents are used to simulate observation scenarios and abstract scenarios in turn. Finally, the note-taker agent is used to convert the dialogue data in multiple teaching scenarios into data in the format of "question-analysis pairs" to obtain a mathematical reasoning dataset with the expected amount of reasoning data.
[0079] As an example, multi-role intelligent agents are used to simulate various teaching scenarios, including simulated observation scenarios and simulated abstract scenarios.
[0080] Simulated observation scenarios are used to accumulate observation layer experience, which is one of the most important types of experience. Before this stage begins, the teacher agent has already identified challenging questions in the dataset for the model.
[0081] Therefore, the main task of simulating the observation scenario is to design instructional activities targeting these weaknesses, which are then executed by the agent. It should be noted that the large language model does not participate in this stage; all instructional activities are entirely simulated and executed by the agent.
[0082] It should be noted that each question They will all be processed individually until they accumulate to a certain point. Synthetic data.
[0083] Firstly, teachers teach through class... Guide students to answer questions and obtain... Compared to the CoT dataset, this process provides a more detailed solution and can be considered a more comprehensive analysis. The enhancement.
[0084] As an example, Indicates parsing The enhancements are as follows:
[0085] .
[0086] Secondly, students solve problems individually. ,get The present invention uses predefined student features to indicate that their analyses will provide diverse perspectives on the same problem, essentially a method of enhancing diversity, and can be viewed as an enhancement of the analysis... An extension of.
[0087] As an example, Indicates parsing The extension. Specifically:
[0088] .
[0089] Thirdly, teachers guide students to initiate discussions about Discussion ,get and The discussion topics included how to rewrite the problem, problem design ideas, etc., which can be regarded as a discussion of the problem. The enhancements and the problems encountered in discussions across various teaching scenarios. The design concept.
[0090] As an example, Indicates the question The enhancements are as follows:
[0091] .
[0092] As an example, This refers to the questions raised during discussions across various teaching scenarios. The design concept is as follows:
[0093] .
[0094] Simulating abstract scenarios helps accumulate abstract experience for the larger language model that needs improvement. The purpose of simulating abstract scenarios is to enable student agents to reflect on and observe the teaching activities within those scenarios.
[0095] Specifically, it requires teaching assistant intelligent agents A review The key information in the question was obtained. Then, based on the vulnerability dataset Design Reflections With the question A similar new question was obtained. .
[0096] As an example, Indicates the teaching assistant agent's review of the problem. The key information in the text. Specifically: .
[0097] As an example, Design and Problems Based on Weakness Datasets A similar new question. Specifically: .
[0098] Finally, the note-taking agent is used to organize all dialogue information in the observed and abstract scenarios into a "question-parse pair" format until each question accumulates the corresponding expected amount of reasoning data, and then synthesizes the expanded mathematical reasoning dataset.
[0099] As an example, the first The mathematical reasoning dataset after the second expansion for:
[0100] ;
[0101] ;
[0102] in, Represents the first in the mathematical reasoning dataset The problem corresponding to each piece of data; Represents the first in the mathematical reasoning dataset Parsing of each data item; Indicates the size of the preset mathematical reasoning dataset; This represents the note-taking intelligent agent; Indicates parsing Enhancement; This refers to the questions raised during discussions across various teaching scenarios. Design concept; Indicates the teaching assistant agent's review of the problem. Key information in the text; Reflections and Issues on the Design of a Vulnerability Dataset Similar new questions; Indicates the question Enhancement; Indicates parsing An extension of.
[0103] As an example, such as Figure 3 As shown, the method also includes steps 104 and 105.
[0104] Step 104: Supervised fine-tuning training of the large language model on the expanded mathematical reasoning dataset to obtain the trained large language model;
[0105] This invention will use the CoT dataset conduct The second expansion yields an expanded mathematical reasoning dataset and a large language model trained under supervised fine-tuning.
[0106] It should be noted that supervised fine-tuning training is achieved by maximizing the log-likelihood probability given a training dataset, for large language models. In progress Secondary expansion and After the second supervised fine-tuning training, In other words, It is exist The model obtained from the training.
[0107] Among them, the The second supervised fine-tuning training refers to: the first... Large language model obtained through sub-supervised fine-tuning training In the The expanded mathematical reasoning dataset The training was then supervised and fine-tuned.
[0108] As an example, the loss function for supervised fine-tuning training for:
[0109] ;
[0110] in, Indicates the size of the preset mathematical reasoning dataset; Represents the first in the mathematical reasoning dataset Parsing of each data item; Represents the first in the mathematical reasoning dataset The problem corresponding to each piece of data; This represents the update parameters of the large language model.
[0111] Step 105: Repeat the iteration continuously, perform reasoning on the Mind Chain dataset after the last training of the large language model, and obtain the expanded mathematical reasoning dataset until the preset expected number of expansions is reached, and output the target mathematical reasoning dataset and the large language model with improved mathematical reasoning ability.
[0112] In other words, for the MindChain dataset conduct After this expansion, the target mathematical reasoning dataset is obtained. As an example, after completing all... After secondary expansion and supervised fine-tuning training, the target mathematical reasoning dataset for:
[0113] ;
[0114] in, Indicates the first The expanded mathematical reasoning dataset; Indicates the preset expected number of expansions; This indicates the union operation.
[0115] To verify that the mathematical reasoning data obtained from the intelligent agent-simulated teaching scenario in this invention has higher quality, Llama-2-7b was selected as the large language model whose mathematical reasoning ability needs to be improved. Different reasoning data synthesis strategies were used to generate reasoning data from the training sets of the GSM8K and MATH datasets; that is, the selected dataset was the union of the training sets of the GSM8K and MATH datasets. Then, supervised fine-tuning of Llama-2-7b was performed. Table 1 lists the accuracy of the trained model on the test sets of the two public datasets, GSM8K and MATH.
[0116] Table 1. Performance of Llama-2-7b after training on the GSM8K and MATH datasets.
[0117]
[0118] As shown in the table, when using a fixed dataset size of 60K, compared with MetaMathQA, the method of this invention improves performance by 10.3% in GSM8K and by 6.3% in MATH. Compared with XwinMathQA, the method of this invention improves performance by 4.5% in GSM8K and by 2.4% in MATH.
[0119] This advantage can be attributed to the high quality, density, and rich diversity of the data synthesized in this invention, as it focuses on the challenging problems of the model and utilizes multi-role agents to simulate a variety of teaching scenarios.
[0120] Furthermore, to verify that this invention achieves higher quality under different data volumes, Llama-2-7b was selected as the large language model. Simultaneously, different data synthesis strategies were employed to generate data only from the training set of the MATH dataset; that is, a training set containing only the MATH dataset was chosen. Then, supervised fine-tuning was performed on Llama-2-7b.
[0121] like Figure 4 As shown, the performance of the method proposed in this invention is compared with that of the comparative method SkyworkMathQA under different data scales. With smaller data scales, the performance of the method proposed in this invention is similar to that of the comparative method SkyworkMathQA; however, as the data scale increases, the method proposed in this invention shows a significant advantage.
[0122] On the other hand, this invention proposes a mathematical reasoning data synthesis system based on an intelligent agent-simulated teaching scenario, comprising a memory, a processor, and a computer program stored in the memory. The processor executes the computer program to implement any of the above-mentioned methods. The technical features of the system are consistent with those of the method, and will not be repeated here.
[0123] In summary, the multi-agent environment based on the "cone of experience" to simulate teaching scenarios proposed in this invention visualizes various learning experiences by analogy to human learning, providing high-quality synthetic data for mathematical reasoning using large language models. The agents used in this invention are driven by large language models and, through carefully designed instructions, can simulate various teaching scenarios, covering lectures, discussions, problem design, and problem-solving. Under the same data scale, the synthetic data generated using the strategy proposed in this invention significantly enhances mathematical reasoning capabilities due to its richness and diversity.
[0124] It should be noted that, for the sake of simplicity, the foregoing embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0125] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0126] In the several embodiments provided in this application, it should be understood that the disclosed methods or systems can be implemented in other ways. For example, the embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0127] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0128] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0129] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage device. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.
[0130] Those skilled in the art will understand that all or part of the circuits in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0131] The foregoing description is merely an exemplary embodiment of this disclosure and should not be construed as limiting the scope of this disclosure. Any equivalent changes and modifications made in accordance with the teachings of this disclosure shall still fall within the scope of this disclosure. Those skilled in the art will readily conceive of embodiments of this disclosure upon considering the specification and practicing the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not described herein. The specification and embodiments are to be considered exemplary only, and the scope and spirit of this disclosure are defined by the claims.
[0132] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0133] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for synthesizing mathematical reasoning data based on an intelligent agent simulating a teaching scenario, characterized in that, The method includes: Obtain the publicly available Mind Chain dataset, perform reasoning on the large language model whose mathematical reasoning ability needs to be improved on the Mind Chain dataset, and obtain the error rate of the large language model on each question; A multi-role intelligent agent is created, and the teacher agent is used to analyze the parsing errors of the large language model to obtain a vulnerability dataset. Based on the error rate and the preset dataset size, the expected inference data volume for each problem is obtained; the vulnerability dataset... for: ;in, Representing a large language model; Represents the teacher's intelligent agent; This indicates the first [item] in the thought chain dataset. The problem corresponding to each piece of data; Representation of large language models In answering question # The problem corresponding to each piece of data Error analysis; For each problem in the weak point dataset, the multi-role intelligent agent is used to simulate multiple teaching scenarios, and the dialogue data in the multiple teaching scenarios is converted into data in the same format as the thinking chain dataset, until each problem accumulates the corresponding expected amount of reasoning data, and the expanded mathematical reasoning dataset is synthesized. The expected inference data volume is obtained by: obtaining a size coefficient for the corresponding problem based on the error rate and the dataset size; and obtaining the expected inference data volume for each problem based on the error rate and the size coefficient. The calculation method is as follows: ;in, Indicates the scale factor; Indicates the error rate.
2. The method for synthesizing mathematical reasoning data based on an intelligent agent simulating a teaching scenario according to claim 1, characterized in that, No. The mathematical reasoning dataset after secondary expansion for: ; ; in, Represents the first in the mathematical reasoning dataset The problem corresponding to each piece of data; Represents the first in the mathematical reasoning dataset Parsing of each data item; Indicates the size of the preset mathematical reasoning dataset; This represents the note-taking intelligent agent; Indicates parsing Enhancement; This refers to the questions raised during discussions across various teaching scenarios. Design concept; Indicates the teaching assistant agent's review of the problem. Key information in the text; Reflections and Issues on the Design of a Vulnerability Dataset Similar new questions; Indicates the question Enhancement; Indicates parsing An extension of.
3. A method for synthesizing mathematical reasoning data based on an intelligent agent simulating a teaching scenario, as described in claim 1 or 2, characterized in that, The method further includes: The large language model is trained under supervised fine-tuning on the expanded mathematical reasoning dataset to obtain the trained large language model. The process is repeated iteratively, with the previously trained large language model being used for reasoning on the thought chain dataset to obtain an expanded mathematical reasoning dataset. This process continues until the preset expected number of expansions is reached, at which point the target mathematical reasoning dataset and the large language model with improved mathematical reasoning capabilities are output.
4. The method for synthesizing mathematical reasoning data based on an intelligent agent simulating a teaching scenario according to claim 3, characterized in that, The target mathematical reasoning dataset for: ; in, Indicates the first The expanded mathematical reasoning dataset; Indicates the preset expected number of expansions; This indicates the union operation.
5. The method for synthesizing mathematical reasoning data based on an intelligent agent simulating a teaching scenario according to claim 3, characterized in that, The large language model is trained under supervised fine-tuning on an expanded mathematical reasoning dataset, with the loss function... for: ; in, Indicates the size of the preset mathematical reasoning dataset; Represents the first in the mathematical reasoning dataset Parsing of each data item; Represents the first in the mathematical reasoning dataset The problem corresponding to each piece of data; This represents the update parameters of the large language model.
6. The method for synthesizing mathematical reasoning data based on an intelligent agent simulating a teaching scenario according to claim 1, characterized in that, The scale coefficient The calculation method is as follows: ; in, Indicates the size of the preset mathematical reasoning dataset; Indicates the first Error rate of the corresponding problem in each data point; This indicates the size of the thought chain dataset.
7. A mathematical reasoning data synthesis system based on an intelligent agent simulating a teaching scenario, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Large model automatic evolution system and method with active learning ability
CN118195032A
Prompt game learning-based planning method during generation of large language model agent
CN118468920A
