Method and device for generating problem solving strategy
By combining a problem-solving strategy generation model and a large language model with kernel function similarity calculation, the difficulty of training data is dynamically adjusted to generate a problem-solving strategy knowledge graph. This solves the problem of low efficiency in generating problem-solving strategies for students and achieves efficient and accurate automatic generation of problem-solving strategies.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NEW ORIENTAL EDUCATION & TECH GRP CO LTD
- Filing Date
- 2026-03-31
- Publication Date
- 2026-05-05
AI Technical Summary
In existing technologies, students often struggle to find solutions to academic problems, and the cost of manually annotating solutions is high, resulting in low efficiency in generating solutions.
A problem-solving strategy generation model is adopted. The difficulty of training data is dynamically adjusted through the training sample pool. Combined with a large language model and kernel function similarity calculation, a problem-solving strategy knowledge graph is generated to optimize the accuracy and diversity of problem-solving strategies. The generation process is optimized by using the evidence lower bound loss function and supervised learning.
It achieves low-cost and efficient automatic generation of problem-solving strategies, improves the accuracy of problem-solving strategies and their ability to adapt to complex problems, and avoids the problems of overfitting and forgetting simple problems.
Smart Images

Figure CN121981284A_ABST
Abstract
Description
Technical Field
[0001] At least one embodiment of this disclosure relates to the field of data processing, and more specifically, to a method and apparatus for generating problem-solving strategies. Background Technology
[0002] A problem-solving strategy description is a description of the main ideas and methods used to solve a problem. For a specific subject, a problem-solving strategy description is generally a closed and finite set of solution steps. It has relative universality when solving problems within a specific grade level of a subject and can prevent problems beyond the syllabus. If one flexibly understands and masters multiple problem-solving strategies and methods, and uses different subsets of the strategy sequence in combination, one can provide a description of the solution approach for complex problems.
[0003] When faced with a problem, students often struggle to find a solution strategy, requiring teaching experts to manually annotate a large number of problems with solution strategies, which is very costly.
[0004] Therefore, there is a need to design a low-cost method to automatically generate problem-solving strategies for various subjects in the field of education. Summary of the Invention
[0005] According to one aspect of this disclosure, a method for generating problem-solving strategies is provided, comprising:
[0006] Input the problem into the problem-solving strategy to generate the model;
[0007] A problem-solving strategy generation model predicts a sequence of problem-solving strategies. This model is trained using a training sample pool in the following manner:
[0008] In response to the current prediction accuracy of the problem-solving strategy generation model being greater than or equal to a predetermined threshold, the ratio of the number of first samples used for the next training of the problem-solving strategy generation model to the total number of samples in the training sample pool is increased, where the first sample is the sample that causes the current prediction result of the problem-solving strategy generation model to be incorrect.
[0009] In some embodiments, the method further includes:
[0010] In response to the current prediction accuracy of the problem-solving strategy generation model being less than a predetermined threshold, the ratio of the number of first samples used for the next training of the problem-solving strategy generation model to the total number of samples in the training sample pool is reduced.
[0011] In some embodiments, the training sample pool also includes a second sample, which is a sample that makes the current prediction result of the problem-solving strategy generation model correct.
[0012] In some embodiments, the current prediction accuracy is determined based on the number of the first sample and the number of the second sample.
[0013] In some embodiments, in response to the current prediction accuracy of the problem-solving strategy generation model being greater than or equal to a predetermined threshold, increasing the ratio of the number of first samples used for the next training of the problem-solving strategy generation model to the total number of samples in the training sample pool includes:
[0014] The current accuracy mean is calculated based on the moving average or weighted average of previous and current prediction accuracy.
[0015] The proportion is determined based on the current average accuracy, the upper limit of the proportion, and the lower limit of the proportion.
[0016] In some embodiments, the training sample pool is constructed as follows:
[0017] By using prompt words and a large language model, one or more preliminary problem-solving strategies with a connection order are extracted from multiple sample questions for each sample question.
[0018] Based on one or more preliminary problem-solving strategies, merge at least one preliminary problem-solving strategy with a similarity higher than a similarity threshold to obtain a merged problem-solving strategy;
[0019] Based on the connection order of one or more preliminary problem-solving strategies, the merged problem-solving strategies with the connection order are determined as the sample problem-solving strategy sequence;
[0020] The training sample pool is obtained based on each sample question and the corresponding sample problem-solving strategy sequence.
[0021] In some embodiments, based on one or more preliminary problem-solving strategies, merging at least one preliminary problem-solving strategy with a similarity higher than a similarity threshold to obtain a merged problem-solving strategy includes:
[0022] Each preliminary problem-solving strategy is expanded by grammatical components to obtain multiple expanded problem-solving strategies corresponding to each preliminary problem-solving strategy;
[0023] For each initial problem-solving strategy and its corresponding multiple expansion problem-solving strategies, a paragraph embedding vector is calculated, and average pooling and regularization are performed to generate a regularized problem-solving strategy mixture vector corresponding to each initial problem-solving strategy.
[0024] A kernel-function-based similarity calculation is performed on all regularized problem-solving strategy mixture vectors to obtain the similarity between the problem-solving strategy mixture vectors. dimensional similarity matrix The number of mixed vectors for problem-solving strategies is N, and the similarity matrix... Each element in Let N represent the similarity between the i-th problem-solving strategy mixture vector and the i-th problem-solving strategy mixture vector, where N, i, and j are positive integers.
[0025] Based on the similarity matrix calculate dimensional degree matrix degree matrix Let be a diagonal matrix, and let the first line of the diagonal be the first line of the diagonal matrix. element Defined as a similarity matrix The Middle Summing all elements in a row;
[0026] Using the similarity matrix Sum-degree matrix To build Normalized Laplace matrix of dimension ;
[0027] For the normalized Laplace matrix Perform eigenvalue decomposition and solve for the normalized Laplacian matrix. The eigenvalues and corresponding eigenvectors of the elements in the dataset;
[0028] Before selection The smallest non-zero eigenvalues corresponding to eigenvectors ,in The number of clusters for the pre-defined problem-solving strategy will be determined by the following: The eigenvectors are arranged in columns to form a feature matrix. For the characteristic matrix Each row is normalized to obtain the embedding matrix. ;
[0029] Embedding matrix Each line in is considered as Given a data point in a 3D space, obtain N data points, and use a clustering algorithm to... Clustering is performed on the data points, and The data points are divided into non-overlapping groups. Clusters of problem-solving strategies ;
[0030] Repeat the following steps until only one problem-solving strategy remains in each problem-solving strategy cluster: Each time, use the large language model to summarize every predetermined number of problem-solving strategies in each problem-solving strategy cluster to obtain the summarized problem-solving strategies to replace the predetermined number of problem-solving strategies.
[0031] The remaining problem-solving strategy within each problem-solving strategy cluster is taken as the merged problem-solving strategy for each cluster.
[0032] In some embodiments, determining a merged problem-solving strategy with a connection order as a sample problem-solving strategy sequence based on the connection order of one or more preliminary problem-solving strategies includes:
[0033] In response to There is a connection order between any preliminary problem-solving strategy included in the first problem-solving strategy cluster and any preliminary problem-solving strategy included in the second problem-solving strategy cluster. The connection order is used as the connection order between the first problem-solving strategy after merging the first problem-solving strategy cluster and the second problem-solving strategy after merging the second problem-solving strategy cluster.
[0034] Based on the connection order, determine the sequence of sample problem-solving strategies.
[0035] In some embodiments, the problem-solving strategy generation model is trained through the following steps:
[0036] A problem-solving strategy knowledge graph is constructed using sample problem-solving strategy sequences;
[0037] Each sample question is input into the question encoder model to predict the posterior probability of the preliminary predicted solution strategy sequence for each sample question, wherein each solution strategy in the preliminary predicted solution strategy sequence is included in the solution strategy knowledge graph.
[0038] The prior probability of the preliminary prediction of the problem-solving strategy sequence is obtained based on the frequency of occurrence of the problem-solving strategy. The frequency of occurrence of the problem-solving strategy is the number of times the problem-solving strategy is predicted in the prediction sequence of all sample questions divided by the total number of sample questions.
[0039] Each preliminary predicted problem-solving strategy sequence is input into the problem decoder model to infer the predicted problem corresponding to each preliminary predicted problem-solving strategy sequence;
[0040] A loss function is constructed based on the semantic similarity between each sample question and its corresponding predicted question, the posterior probability and prior probability of the preliminary predicted problem-solving strategy sequence;
[0041] The problem encoder model is trained and converged based on the loss function, serving as a problem-solving strategy generation model.
[0042] In some embodiments, the loss function is calculated using the following formula:
[0043] ,
[0044] in, Sample Questions With prediction questions The expected value of the semantic similarity between them. It is the probability distribution of the problem encoder model predicting the solution strategy sequence H based on the input problem X, where h represents the probability distribution of the problem-solving strategy sequence H. A sequence of problem-solving strategies sampled from the middle. To preliminarily predict the posterior probability of the problem-solving strategy sequence and prior probability of Divergence; These are the weighting coefficients.
[0045] According to another aspect of this disclosure, an apparatus for generating problem-solving strategies is provided, comprising: a memory for storing instructions; and a processor for reading the instructions from the memory and executing a method according to at least one embodiment of this disclosure.
[0046] According to another aspect of this disclosure, a non-temporary storage medium is provided having instructions stored thereon, wherein, when executed by a processor, the instructions cause the processor to perform a method according to at least one embodiment of this disclosure.
[0047] According to one aspect of this disclosure, a computer program product is provided having instructions stored thereon, wherein, when executed by a processor, the instructions cause the processor to perform a method according to at least one embodiment of this disclosure. Attached Figure Description
[0048] To more clearly illustrate the technical solutions in the embodiments of this disclosure 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 only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0049] Figure 1 A schematic diagram illustrating an application scenario of a method for generating problem-solving strategies according to at least one embodiment of the present disclosure is shown.
[0050] Figure 2 A flowchart is shown of a method for generating a problem-solving strategy according to at least one embodiment of the present disclosure.
[0051] Figure 3 A flowchart illustrating a method for constructing a training sample pool according to at least one embodiment of the present disclosure is shown.
[0052] Figure 4A A template example of prompt words according to at least one embodiment of the present disclosure is shown.
[0053] Figure 4B A schematic diagram of a knowledge graph of example problem-solving strategy sequences generated using a large language model according to at least one embodiment of the present disclosure is shown.
[0054] Figure 5A flowchart is shown illustrating at least one preliminary problem-solving strategy with a similarity higher than a similarity threshold, based on one or more preliminary problem-solving strategies according to at least one embodiment of the present disclosure, to obtain a merged problem-solving strategy.
[0055] Figure 6 A schematic diagram is shown illustrating an example of grammatical component paraphrasing of each preliminary problem-solving strategy according to at least one embodiment of the present disclosure.
[0056] Figure 7 A schematic diagram illustrating an example of generating a hybrid vector of problem-solving strategies according to at least one embodiment of the present disclosure is shown.
[0057] Figure 8 A schematic diagram is shown illustrating the similarity calculation of paragraph embedding vectors based on kernel functions according to at least one embodiment of the present disclosure.
[0058] Figure 9 A flowchart is shown of a method for training a problem-solving strategy generation model according to at least one embodiment of the present disclosure.
[0059] Figure 10 A block diagram of an apparatus for generating a problem-solving strategy according to at least one embodiment of the present disclosure is shown. Detailed Implementation
[0060] Referring now to specific embodiments of the present disclosure, examples of which are illustrated in the accompanying drawings. Although the present disclosure will be described in conjunction with specific embodiments, it will be understood that it is not intended to limit the present disclosure to the described embodiments. Rather, it is intended to cover variations, modifications, and equivalents included within the spirit and scope of the present disclosure as defined by the appended claims. It should be noted that the method steps described herein can be implemented by any functional block or functional arrangement, and any functional block or functional arrangement can be implemented as a physical entity or a logical entity, or a combination of both.
[0061] To address at least one or more of the aforementioned problems, at least one embodiment of this disclosure designs an automatic generation algorithm for problem-solving strategies for various subjects in the field of education.
[0062] At least one embodiment of this disclosure utilizes a Large Language Model (LLM) to automatically extract problem-solving strategy steps from questions. Combined with kernel function similarity calculation and spectral clustering algorithms, it addresses the redundancy problem caused by differences in problem-solving strategy descriptions, thereby generating an atomic, mutually exclusive, and independent problem-solving strategy knowledge graph and improving the accuracy of strategy merging. A constrained variational inference framework is designed to alleviate class imbalance by using the prior distribution of problem-solving strategies (combined with the frequency of occurrence of problem-solving strategies), while simultaneously optimizing the accuracy and diversity of problem-solving strategies. The Evidence Lower Bound (ELBO) loss function is used to jointly optimize the relevance (semantic similarity) and completeness (prior distribution constraints) of problem-solving strategies. A dynamic proportional balancing algorithm (automatic curriculum learning) adjusts the difficulty distribution (or proportion) of the training data, allowing the model to gradually adapt to more complex questions and avoid forgetting second samples. Supervised learning (fine-tuning LLM) and reinforcement learning (reward mechanism) are combined to optimize problem-solving strategy generation, achieving end-to-end automatic generation.
[0063] Figure 1 A schematic diagram illustrating an application scenario of a method for generating problem-solving strategies according to at least one embodiment of the present disclosure is shown.
[0064] like Figure 1 As shown, in step 101, the problem is obtained. In step 102, a problem is input into the problem-solving strategy generation model. In step 103, the problem-solving strategy generation model outputs a sequence (or set) of problem-solving strategies for that problem. For example, a fifth-grade math problem: "The cost price of a certain commodity is 200 yuan. After selling it at an 80% discount, there is still a 20% profit. Find the listed price of the commodity." Inputting this math problem into the problem-solving strategy generation model, the model outputs a predicted result, namely, clarifying the profit relationship (profit = selling price - cost, profit margin = profit / cost × 100%), setting the listed price variable x, establishing an equation (based on "profit 20%", it needs to satisfy 0.8x = 200 × (1 + 20%)), and solving the equation. This serves as the problem-solving strategy sequence, where each step of the problem-solving strategy is, for example, "clarifying the profit relationship, setting the listed price variable x, establishing an equation, and solving the equation." The problem-solving strategies in this sequence usually have a connected order, so the problem-solving strategy sequence can be considered as including other problem-solving strategy sequences.
[0065] Figure 2 A flowchart is shown of a method for generating a problem-solving strategy according to at least one embodiment of the present disclosure.
[0066] In step 201, the problem is input into the problem-solving strategy generation model.
[0067] In step 202, the problem-solving strategy generation model predicts the sequence of problem-solving strategies for the question.
[0068] The problem-solving strategy generation model is trained using a training sample pool in the following manner: In response to the current prediction accuracy of the problem-solving strategy generation model being greater than or equal to a predetermined threshold, the ratio of the number of first samples used for the next training of the problem-solving strategy generation model to the total number of samples in the training sample pool is increased. The first sample is the sample that causes the current prediction result of the problem-solving strategy generation model to be incorrect. This first sample can also be called a "hard sample".
[0069] Note that "current" here can be understood as the current training batch, and the next training can be understood as the next training batch. A training batch refers to dividing the data into multiple small chunks (called batches) and inputting them sequentially into the AI model during training. Each batch is the amount of data processed by the AI model in one iteration of training; for example, processing 1000 samples each time.
[0070] For example, the first sample could be a fifth-grade math problem: "The cost price of a certain commodity is 200 yuan. After selling it at an 80% discount, there is still a 20% profit. Find the listed price of the commodity." The correct prediction sequence of the solution strategy should be "clarify the profit relationship, set the listed price variable x, establish an equation, and solve the equation." However, the current prediction output of the solution strategy generation model for this math problem is "clarify the profit relationship, establish an equation, and solve the equation." Therefore, the current prediction result can be considered incorrect, and this math problem is the first sample (difficult sample).
[0071] Thus, by dynamically adjusting the difficulty distribution (or proportion) of the training data used to train the problem-solving strategy generation model based on its current prediction accuracy, when the current prediction accuracy is high, the proportion of the first sample (which is more likely to predict incorrect problem-solving strategy sequences) in the next training process is increased. This forces the problem-solving strategy generation model to encounter more challenging samples, ensuring its continuous learning and expansion of its ability boundaries, enhancing its generalization ability. This allows the model to gradually adapt to more complex sample problems (which are more likely to predict incorrect problem-solving strategy sequences), ultimately enabling it to predict the correct problem-solving strategy sequences for these sample problems. Simultaneously, this approach avoids excessive retraining of already correctly predicted samples, saving computational resources.
[0072] In some embodiments, the method further includes: in response to the current prediction accuracy of the problem-solving strategy generation model being less than a predetermined threshold, reducing the ratio of the number of first samples used for the next training of the problem-solving strategy generation model to the total number of samples in the training sample pool.
[0073] The training sample pool also includes a second sample, which is the sample that makes the current prediction result of the problem-solving strategy generation model correct. Here, the training samples in the training sample pool can be divided into the second sample and the first sample. This second sample can also be called a "simple sample".
[0074] For example, the second sample could be a fifth-grade math problem: "The cost price of a certain commodity is 200 yuan. After selling it at an 80% discount, there is still a 20% profit. Find the listed price of the commodity." The correct prediction sequence of the solution strategy should be "clarify the profit relationship, set the listed price variable x, establish an equation, and solve the equation." However, the current prediction output of the solution strategy generation model for this math problem is "clarify the profit relationship, set the listed price variable x, establish an equation, and solve the equation." Therefore, the current prediction result can be considered correct, and this math problem is the second sample (simple sample).
[0075] Note that a correct prediction is defined as one where the AI model's prediction is exactly the same as the true value (or known label) or the prediction is close to the true value within an acceptable range (usually determined by being less than an error threshold). A incorrect prediction is defined as one where the AI model's output deviates significantly from the actual situation (usually determined by being greater than or equal to an error threshold). A correct prediction does not necessarily require the AI model's prediction to be exactly the same as the true value.
[0076] In some embodiments, the current prediction accuracy is determined based on the number of the first sample and the number of the second sample.
[0077] For example, using This represents the number of second samples that enabled the problem-solving strategy generation model to correctly predict the current (batch). This represents the number of the first samples that caused the problem-solving strategy generation model to make a misprediction in the current (batch). This can be expressed by the formula... To determine the current (batch) prediction accuracy.
[0078] Here, increasing the ratio of the number of first samples used for the next training of the problem-solving strategy generation model to the total number of samples in the training sample pool is equivalent to decreasing the ratio of the number of second samples used for the next training of the problem-solving strategy generation model to the total number of samples in the training sample pool, while decreasing the ratio of the number of first samples used for the next training of the problem-solving strategy generation model to the total number of samples in the training sample pool is equivalent to increasing the ratio of the number of second samples used for the next training of the problem-solving strategy generation model to the total number of samples in the training sample pool.
[0079] The first sample is typically a sample that the problem-solving strategy generation model cannot currently predict correctly (such as low-frequency strategies, complex question types, or questions that cross knowledge points). If the proportion of the first sample is continuously increased before the problem-solving strategy generation model's capabilities are sufficient, it will lead to frequent prediction errors, drastic fluctuations in training loss, and even getting stuck in a local minimum. If the problem-solving strategy generation model continues to perform poorly on the first sample, forced training may cause the model to "forget" the simple strategies it has already learned, resulting in a regression in its capabilities.
[0080] In this way, by reducing the training input of the first sample, the problem-solving strategy generation model can refocus more on optimizing the second sample, gradually restoring its understanding of the basic strategy. The problem-solving strategy generation model will not "collapse" due to continuous prediction errors, thus maintaining the stability of the training process and avoiding gradient explosion or divergence problems.
[0081] For example, when a model is first trained, it has a high accuracy rate for simple questions but a low accuracy rate for complex questions. If the current accuracy rate (e.g., 90%) is higher than a threshold (e.g., 70%), the proportion of the first sample (difficult samples) is increased (e.g., from 20% to 30%), meaning the proportion of the second sample (easy samples) is decreased (from 80% to 70%). Assume the total sample pool contains 1000 questions. Before adjustment, the second sample had 800 questions (80%), and the first sample had 200 questions (20%). After adjustment, the second sample has 700 questions (70%), and the first sample has 300 questions (30%).
[0082] For example, if the model's accuracy drops sharply (e.g., to 50%), falling below a threshold (e.g., to 70%), and the training loss fluctuates drastically, the proportion of the first sample (difficult sample) can be reduced (e.g., from 50% to 20%), while the proportion of the second sample (easy sample) can be increased (from 50% to 80%).
[0083] In summary, by dynamically adjusting the difficulty distribution (or proportion) of the training data based on the current prediction accuracy of the problem-solving strategy generation model, the model can gradually adapt to more complex problems while avoiding forgetting simple samples.
[0084] In some embodiments, in response to the current prediction accuracy of the problem-solving strategy generation model being greater than or equal to a predetermined threshold, increasing the ratio of the number of first samples used for the next training of the problem-solving strategy generation model to the total number of samples in the training sample pool includes: calculating the current mean accuracy based on a moving average or weighted average of the previous prediction accuracy and the current prediction accuracy; and determining the ratio based on the current mean accuracy, an upper limit, and a lower limit of the ratio.
[0085] For example, calculate the current average accuracy using an exponential moving average. tThis represents the current mean accuracy of the artificial intelligence model, used to characterize the model's current level of stability. t =α⋅Accuracy t +(1−α)⋅ t-1 Accuracy t : The current prediction accuracy at the current time step (e.g., the prediction accuracy of the model in the t-th validation). α is a smoothing factor (0 < α ≤ 1), which controls the weight of recent data. The larger α is, the more significant the impact of recent data, and the faster the exponential moving average responds to changes; the smaller α is, the higher the weight of historical data, and the more stable but lagging the exponential moving average is. t-1 : The mean accuracy calculated at the previous time step (i.e., the previous time) (i.e., the mean of the previously calculated prediction accuracy, which can be replaced by the first prediction accuracy value initially).
[0086] use This represents the ratio of the number of first samples in the next training iteration of the problem-solving strategy generation model to the total number of samples in the training sample pool, i.e., the target proportion of the first samples.
[0087] An inverse proportional function or linear correction is used to determine the target proportion of the first sample to be sampled from all samples in the next training iteration. To ensure training stability, this paper sets upper and lower limits for the proportion of the first sample. (For example ). Wherein, the magnification factor is defined as This is used to adjust the sensitivity to prediction errors. When the accuracy of the artificial intelligence model... When the percentage is very high (e.g., greater than or about 90%), it means that the existing training data is too simple for the AI model. The formula will automatically increase the proportion of the first sample to be sampled from all samples in the next training session, forcing the AI model to train more first samples from the next training session.
[0088] Next, based on the calculation The next training set is drawn from the training sample pool, which includes the second sample and the first sample, to train the artificial intelligence model. The number of the first sample is defined as follows: The number of the second sample is defined as: . The total number of samples in each training batch.
[0089] For example, the current model has a high prediction accuracy ( =0.9), γ=1.5, =clip((1−0.9)⋅1.5,0.2,0.7)=clip(0.15,0.2,0.7)=0.2. Assuming the training sample pool has 1000 samples, the first sample size is 1000×0.2=200, and the second sample size is 1000×0.8=800.
[0090] For example, suppose γ = 1.5, =0.75, =clip((1−0.75)⋅1.5,0.2,0.7)=0.375.
[0091] Assuming the number of samples in the training sample pool is 1000, the first sample size is 1000 × 0.375 = 375, and the second sample size is 1000 × 0.625 = 625.
[0092] The aforementioned artificial intelligence model can be based on a large language model (LLM).
[0093] The ratio of the first sample to the total samples in the training sample pool is dynamically adjusted based on the model's current prediction accuracy. At high accuracy, the proportion of the first sample is increased, forcing the model to break out of its comfort zone and improving its adaptability to complex problems. At low accuracy, the proportion of the first sample is decreased, prioritizing the consolidation of basic capabilities and preventing the model from overfitting or crashing. Compared to traditional fixed-ratio training, this significantly improves the model's robustness and generalization ability, especially suitable for problem scenarios with multiple difficulty levels. By retaining the second sample, the stability of basic knowledge is preserved during the first sample training, preventing the model from "forgetting" basic strategies and forming a training loop that combines easy and difficult tasks. This automatic dynamic adjustment mechanism ensures that the AI model is always in a state of "moderate challenge," avoiding "overfitting" or "learning stagnation" due to overly simple training data, while ensuring that the AI model can continuously learn more complex and broader tasks. This mechanism is particularly important in educational scenarios because students' learning needs often require AI models to have the ability to adapt to complex problems and generate diverse strategies.
[0094] The aforementioned training sample pool can be constructed by teaching experts manually annotating a large number of questions with problem-solving strategies. However, manual annotation can be extremely costly in terms of manpower, resources, and time, and may result in errors. According to at least one embodiment of this disclosure, a method for automatically generating a training sample pool of problem-solving strategies is also provided, which will be described in detail below.
[0095] Figure 3 A flowchart illustrating a method for constructing a training sample pool according to at least one embodiment of the present disclosure is shown.
[0096] The method for constructing the training sample pool includes steps 301, 302, 303, and 304.
[0097] In step 301, a large language model is used to extract one or more preliminary problem-solving strategies with a connection order for each sample question from multiple sample questions by using prompt words.
[0098] First, a large number of sample questions of different types can be collected manually, and the information of the sample questions, including grade level information, subject information, question type, question stem, knowledge point, question analysis, and final answer, can be labeled (any manual or automated method is acceptable) and stored in a database for further use.
[0099] Then, using prompt words and a large language model, one or more preliminary problem-solving strategies with a connected order are extracted from multiple sample questions. Prompt words can be determined based on information from a large number of sample questions: grade level, subject, question type, question stem, knowledge points, question explanation, and final answer. These seven pieces of information constitute the key elements of the prompt words. The grade level and subject information prevent the problem-solving strategies extracted by the large language model from exceeding the scope of that grade level and subject. This reduces a massive amount of manual annotation work.
[0100] Figure 4A A template example of prompt words according to at least one embodiment of the present disclosure is shown.
[0101] like Figure 4A As shown, the prompt indicates that the generated problem-solving strategy should be organized according to five core stages: "understanding the question → identifying the test point → constructing the thought process → breaking down the steps → verification." The prompt also includes requirements for the problem-solving strategy, such as requiring it to be a "general method / logical thinking" rather than a specific hidden condition in the question stem.
[0102] Using the prompt word templates designed above, problem-solving strategy sequences can be extracted from sample questions through a large language model, and a sample problem-solving strategy knowledge graph can be constructed.
[0103] Figure 4B A schematic diagram of a knowledge graph of example problem-solving strategy sequences generated using a large language model according to at least one embodiment of the present disclosure is shown.
[0104] like Figure 4B As shown, for example, the solution strategy sequence for a math problem extracted from sample questions using a large language model is: determining the number of drawers, calculating the total number of objects, calculating the minimum guaranteed value, and deriving the conclusion.
[0105] If the problem-solving strategy texts generated by the large language model are directly used as training samples for the problem-solving strategy knowledge graph, the following problems may occur. Since the large language model may extract slightly different descriptions of the same problem-solving strategy text, for example, the texts of "auxiliary variable method," "indirect variable method," and "indirect unknown method" actually express problem-solving strategies—that is, simplifying the problem, reducing difficulty, or revealing hidden relationships by introducing auxiliary variables or indirectly setting unknowns—this will lead to the continuous expansion of the problem-solving strategy knowledge graph and the generation of considerable redundancy. Therefore, to solve this redundancy problem, it is desirable to merge multiple similar or identical problem-solving strategies generated by the large language model.
[0106] return Figure 3 In step 302, based on one or more preliminary problem-solving strategies, at least one preliminary problem-solving strategy with a similarity higher than a similarity threshold is merged to obtain a merged problem-solving strategy.
[0107] For example, in some embodiments, step 302 includes steps 3021-3030.
[0108] Figure 5 A flowchart is shown illustrating at least one preliminary problem-solving strategy with a similarity higher than a similarity threshold, based on one or more preliminary problem-solving strategies according to at least one embodiment of the present disclosure, to obtain a merged problem-solving strategy.
[0109] like Figure 5 As shown, in step 3021, each preliminary problem-solving strategy is expanded by grammatical component synonyms to obtain multiple expanded problem-solving strategies corresponding to each preliminary problem-solving strategy.
[0110] In this step, a large language model can be used to interpret and expand the meaning of the grammatical components of each extracted preliminary problem-solving strategy. Specifically, the large language model is first used to perform grammatical analysis on each preliminary problem-solving strategy (e.g., analyze the subject, predicate, object, adverbial, etc.), and then perform synonym expansion based on the main grammatical components contained in each preliminary problem-solving strategy. The length of the synonym expansion text for each preliminary problem-solving strategy can be specified by using prompt words, but it is not limited to this.
[0111] Figure 6 A schematic diagram is shown illustrating an example of grammatical component paraphrasing of each preliminary problem-solving strategy according to at least one embodiment of the present disclosure.
[0112] For example, regarding the initial problem-solving strategy of "determining the number of drawers," we can first perform grammatical analysis to obtain the predicate "determine" and the object "number of drawers." Then, we can expand the predicate and object using synonyms. For example, the predicate "determine" can be expanded into "verify," "count," "determine," etc. The object "number of drawers" can be expanded into "how many drawers are there," "the specific number of drawers," "the total number of drawers," etc. Expanding the initial problem-solving strategy "determine the number of drawers" using grammatical components yields multiple expanded problem-solving strategies, such as "verify how many drawers there are," "count out the specific number of drawers," "determine the total number of drawers," etc.
[0113] In step 3022, paragraph embedding vectors are calculated for each preliminary problem-solving strategy and its corresponding multiple expansion problem-solving strategies, and mean pooling and normalization are performed to generate a normalized problem-solving strategy hybrid vector corresponding to each preliminary problem-solving strategy.
[0114] Figure 7 A schematic diagram illustrating an example of generating a hybrid vector of problem-solving strategies according to at least one embodiment of the present disclosure is shown.
[0115] like Figure 7 As shown, after performing grammatical component analysis and, for example, synonym expansion of grammatical components less than or equal to 3 times on the initial problem-solving strategy, the expanded problem-solving strategy is obtained. By using an embedding model, paragraph embedding (PE) vectors are calculated for each initial problem-solving strategy and multiple expanded problem-solving strategies. After calculation, average pooling and L2 regularization are performed to facilitate subsequent similarity calculation.
[0116] Embedding models are machine learning models that transform complex data (such as text, images, and audio) into dense vectors in a high-dimensional vector space. Their core purpose is to capture the semantic or structural information of the data through mathematical representation, making similar data appear closer together in the vector space. For example, embedding models use deep learning architectures (such as Transformers and Convolutional Neural Networks (CNNs)) to map discrete data (such as words and pixels) into continuous vectors. For instance, the Bidirectional Encoder Representations from Transformers (BERT) model can convert sentences containing initial or expanded problem-solving strategies into 768-dimensional vectors, with each dimension capturing different semantic features (such as actions and topics).
[0117] Then, average pooling and regularization are applied to the paragraph embedding vectors to generate a regularized mixed vector of problem-solving strategies corresponding to each initial problem-solving strategy. Average pooling is a dimension-wise arithmetic average of all word vectors in a paragraph, converting variable-length paragraphs into fixed-length vectors. For example, if the input paragraph sentence contains 5 words, and each word vector is 768-dimensional (as in BERT output), then average pooling yields a 768-dimensional paragraph vector. The paragraph lengths of problem-solving strategies may vary; average pooling compresses the variable-length sequence into a fixed dimension for easier subsequent processing. L2 regularization normalizes the paragraph vectors obtained after average pooling to a unit length, optimizing the distance metric. This unifies the scale, making the mixed vector of problem-solving strategies obtained after average pooling and regularization more suitable for similarity calculation.
[0118] For example, third-party open-source or closed-source embedding models (such as Sentence-BERT, Text2Vec, etc.) can be used to compute paragraph embedding vectors of the text. Each initial problem-solving strategy and its corresponding multiple expansion problem-solving strategies are used as independent text input embedding models. For example, assuming the embedding dimension is d, the initial problem-solving strategy embedding vector is v0, and the expansion problem-solving strategy embedding vectors are v1, v2, and v3. During average pooling, all embedding vectors are averaged to obtain the problem-solving strategy mixture vector. n represents the total number of initial and expanded problem-solving strategies (e.g., 1 initial strategy + 3 expanded strategies), v i This is the i-th embedding vector (including the initial problem-solving strategy embedding vector and the expanded problem-solving strategy embedding vector). Average pooling merges strategies with different representations into a unified semantic representation, reducing redundancy and enhancing robustness. During regularization, the mixed problem-solving strategy vector is normalized to a unit vector to facilitate subsequent similarity calculations (such as cosine similarity). First, the L2 norm of the vector is calculated: , where d is the total number of vectors, and then regularization is performed: Regularization ensures that the mixture vector of all problem-solving strategies lies on the unit sphere, avoiding the impact of vector length differences on similarity calculation. Each problem-solving strategy (including the initial problem-solving strategy and its expanded problem-solving strategy) corresponds to a regularized mixture vector v. norm .
[0119] Next, return Figure 3 In step 3023, a kernel-function-based similarity calculation is performed on all regularized problem-solving strategy mixture vectors to obtain the similarity between the problem-solving strategy mixture vectors. dimensional similarity matrix The number of mixed vectors for problem-solving strategies is N, and the similarity matrix... Each element in Let N represent the similarity between the i-th problem-solving strategy mixture vector and the j-th problem-solving strategy mixture vector, where N, i, and j are positive integers.
[0120] Since kernel functions have advantages such as nonlinearity and avoiding the curse of dimensionality, they have good robustness. Therefore, we consider performing similarity calculation of paragraph embedding vectors based on kernel functions.
[0121] Figure 8 A schematic diagram is shown illustrating the similarity calculation of paragraph embedding vectors based on kernel functions according to at least one embodiment of the present disclosure.
[0122] Figure 8 The kernel function used in this context is, for example, the Radial Basis Function Kernel (RBF). The definition of the RBF kernel function is as follows: ,in , These are respectively low-dimensional problem-solving strategies mixed vectors. The mapping function to higher-dimensional space, here and All functions have been standardized to 0-1. The kernel function does not require explicit calculation. , , Directly outputting the inner product in high-dimensional space allows for a more effective characterization of the mixed vector of problem-solving strategies. The non-linear similarity results between them.
[0123] The similarity matrix can be used to represent the mixture vector of each pair of problem-solving strategies calculated above. , dimension The problem-solving strategy involves a mixture of vectors with number N and a similarity matrix. Each element in This represents the similarity between the mixed vector of the nth problem-solving strategy and the mixed vector of the tth problem-solving strategy. The elements of the matrix are defined as follows: (This means that all row index i and column index j satisfy 1≤i≤N and 1≤j≤N).
[0124] Next, return Figure 3 In step 3024, based on the similarity matrix calculate dimensional degree matrix
[0125] For example, based on the obtained problem-solving strategy similarity matrix First, calculate the degree matrix. Degree matrix For one A diagonal matrix, the first element on its diagonal. element Defined as a similarity matrix The Middle Summing all elements in a row, i.e. .
[0126] Next, in step 3025, the similarity matrix is used. Sum-degree matrix To build Normalized Laplace matrix of dimension .
[0127] For example, constructing a normalized Laplacian matrix for problem-solving strategies. The Laplacian matrix is an algebraic representation of a graph. By transforming the vertices, edges, and weights of a graph into matrix form, it captures the local and global structural information of the graph. Preferably, a symmetric normalized Laplacian matrix is used to address the numerical instability of the combined Laplacian matrix in graphs with large degree differences. Its calculation formula is as follows: ,in, for The identity matrix, It is the inverse square root of the degree matrix (the square root of the reciprocals of the diagonal elements). The Laplace matrix L can represent the graph structure information of the problem-solving strategy sequence in the feature space. Unnormalized Laplace matrix L unnormalized =D−A might be unfair to nodes with high degrees (such as high-frequency strategies), causing clustering to favor highly connected regions. Normalization eliminates the influence of node degree, ensuring fair treatment of clusters of different sizes (such as high-frequency strategy clusters and low-frequency strategy clusters). The normalized Laplacian matrix is more stable, reducing the interference of noisy strategies (such as low-frequency, isolated strategies) on the overall clustering.
[0128] Next, in step 3026, the normalized Laplace matrix is... Perform eigenvalue decomposition and solve for the normalized Laplacian matrix. The eigenvalues and corresponding eigenvectors of the elements in the dataset.
[0129] For example, the eigenvalues λ of the normalized Laplacian matrix L satisfy 0 ≤ λ ≤ 2. The smallest eigenvalue λ0 = 0 corresponds to the connectivity of the graph. If the graph is connected, the eigenvector with λ0 = 0 is an all-1 vector, indicating that all nodes belong to the same cluster. If the graph is not connected (i.e., there are multiple subgraphs), there will be multiple eigenvalues with λ = 0, corresponding to an all-1 vector for each subgraph. Smaller eigenvalues λ i(Close to 0) indicates that the corresponding cluster is tightly connected and has high separation between clusters. For example, if λ1 is the second smallest eigenvalue (Fiedler value), its magnitude reflects the overall difficulty of graph segmentation. The smaller λ1 is, the easier it is to segment the graph into two clusters. Larger eigenvalues λ... i (Close to 2) indicates that the corresponding cluster has loose internal connections or strong interactions between clusters. In problem-solving strategy clustering, the magnitude of the eigenvalues reflects the compactness of the strategy clusters. Smaller eigenvalues correspond to highly correlated problem-solving strategy clusters, while larger eigenvalues may correspond to redundant or noisy strategies.
[0130] Next, in step 3027, select the previous... The smallest non-zero eigenvalues corresponding to eigenvectors This forms a low-dimensional embedding space. In problem-solving strategy clustering, the low-dimensional embedding of feature vectors preserves the semantic structure of the original strategy graph. The number of clusters for the pre-defined problem-solving strategy will be determined by the following: The eigenvectors are arranged in columns to form a feature matrix. Since each row is a low-dimensional representation of each problem-solving strategy, therefore, for the feature matrix... Each row is normalized to obtain a low-dimensional vector representation of each problem-solving strategy, thus forming a combination of these strategies. Embedding Matrix Among them, the embedding matrix The first in direction That is, the first A problem-solving strategy in Low-dimensional vector representation in a dimensional feature space.
[0131] Low-dimensional embedding of feature vectors ensures that the strategies of each cluster have high cohesion (high similarity within clusters) and low coupling (low similarity between clusters), satisfying the requirements of "atomicity, mutual exclusion, and independence" for problem-solving strategy knowledge graphs. Embedding matrices are used to transform discrete symbols (such as words, characters, or categories) into continuous, dense vectors (i.e., embedding vectors) so that neural networks can process them efficiently. For example, selecting the first k=2 feature vectors can map the problem-solving strategies onto a two-dimensional plane, visually representing the cluster structure.
[0132] In this way, similar problem-solving strategies are close in distance in the low-dimensional space, which facilitates subsequent K-Means clustering. Redundant problem-solving strategies will be mapped to nearby low-dimensional points, making them easier to merge into the same cluster.
[0133] Then, in step 3028, the embedding matrix is... Each line in is considered as Given a data point in a 3D space, obtain N data points, and use a clustering algorithm to... Clustering is performed on the data points, and Data points were divided into Clusters of problem-solving strategies .this Clusters of problem-solving strategies They do not interact with each other.
[0134] For example, the K-Means clustering algorithm can be used to analyze this... The data points are clustered. Specifically, the cluster centers are iteratively optimized by repeatedly adjusting their positions to make samples within the same cluster as similar as possible, and samples in different clusters as different as possible, thereby reducing... Data points were divided into non-overlapping clusters Then, output the clustering results, where each cluster... It includes several problem-solving strategies with high similarity.
[0135] Next, in step 3029, the following steps are repeated until only one problem-solving strategy remains in each problem-solving strategy cluster: Each time, the large language model is used to summarize every predetermined number of problem-solving strategies within each cluster to obtain a summarized problem-solving strategy, which replaces the predetermined number of problem-solving strategies. That is, even if the summarized problem-solving strategies within each cluster are merged and summarized again, the summarized content will not change. Thus, a unique description of all problem-solving strategies within each cluster can be considered obtained.
[0136] Next, in step 3030, the remaining problem-solving strategy within each problem-solving strategy cluster is taken as the merged problem-solving strategy for each problem-solving strategy cluster.
[0137] For example, for each cluster, grouping 10 problem-solving strategies at a time, designing prompt words and using a Large Language Model (LLM) to merge the problem-solving strategies in that group. The merging criterion is to summarize problem-solving strategies with the same meaning within the group into one problem-solving strategy. Then, continue selecting problem-solving strategies from that cluster and combining them with the remaining strategies with different meanings to form new problem-solving strategy groups (e.g., still in groups of 10). Continue using prompt words to summarize the new problem-solving strategy groups. The above steps are repeated until all clusters are processed, and until the LLM can no longer merge problem-solving strategies with the same meaning, that is, only one problem-solving strategy remains, and there are no other problem-solving strategies to merge.
[0138] Thus, by automatically generating preliminary problem-solving strategies from the original questions using a Large Language Model (LLM), the cost of manual annotation is significantly reduced, while covering diverse problem-solving paths. The robustness of strategy expression is enhanced through synonym expansion and embedding vector computation (such as paragraph embedding + regularization). Clustering is employed to group problem-solving strategies into non-overlapping clusters, extracting core strategies and eliminating redundancy. This addresses the problem of the ever-expanding and redundant number of problem-solving strategies caused by multiple different results extracted from the text description of the same strategy. Multiple identical or similar problem-solving strategies generated by the LLM are merged into a unique sample strategy. A structured and reusable problem-solving knowledge graph is extracted from the original unordered strategies, providing high-quality supervision signals for subsequent model training.
[0139] In step 303, based on the connection order of one or more preliminary problem-solving strategies, the merged problem-solving strategies with the connection order are determined as a sample problem-solving strategy sequence.
[0140] In some embodiments, step 303, which determines a merged problem-solving strategy with a connection order as a sample problem-solving strategy sequence based on the connection order of one or more preliminary problem-solving strategies, includes: responding to There exists a connection order between any preliminary problem-solving strategy included in the first problem-solving strategy cluster and any preliminary problem-solving strategy included in the second problem-solving strategy cluster. This connection order is used as the connection order between the first problem-solving strategy after merging the first problem-solving strategy cluster and the second problem-solving strategy after merging the second problem-solving strategy cluster. Based on the connection order, the sample problem-solving strategy sequence is determined.
[0141] For example, if two clusters contain interconnected (i.e., ordered) initial problem-solving strategies, then a (directed) edge is added between the two merged problem-solving strategies derived from these two clusters to indicate their order of connection. If no two problem-solving strategies within the two clusters are connected, then the two merged problem-solving strategies derived from these two clusters are not connected.
[0142] For example, cluster A includes preliminary problem-solving strategies such as: listing equations, writing down equations, and describing the relationships between variables; cluster B includes preliminary problem-solving strategies such as: solving equations, finding the values of variables, and solving for the values of variables. The inter-cluster connection is "listing equations" in cluster A → "solving equations" in cluster B (solving equations must follow listing equations). Assuming that the preliminary problem-solving strategies of "listing equations, writing down equations, and describing variables" in cluster A ultimately result in the merged first problem-solving strategy of "listing equations," and the preliminary problem-solving strategies of "solving equations, finding the values of variables" in cluster B ultimately result in the merged second problem-solving strategy of "solving equations," then the sample problem-solving strategy sequence, with the connection order of the merged first and second problem-solving strategies, is determined to be "listing equations" → "solving equations."
[0143] In step 304, a training sample pool is obtained based on each sample question and its corresponding sample problem-solving strategy sequence. Here, "correspondence" refers to the correspondence between the sample question and the final merged sample problem-solving strategy sequence during the process of extracting one or more preliminary problem-solving strategies with a connection order from multiple sample questions using a large language model through prompt words.
[0144] For example, using a large language model with prompt words, one or more preliminary problem-solving strategies with a connected sequence can be extracted from a sample problem: "The purchase price of a certain commodity is 200 yuan. After selling it at an 80% discount, a profit of 20% is still made. Find the listed price of the commodity." These strategies are: "Clarify the profit relationship → Set the listed price variable x → Establish the equation and solve the equation." The final sample problem-solving strategy after merging the preliminary problem-solving strategy "Clarify the profit relationship" with its semantically extended problem-solving strategy is "Determine the profit relationship." The final sample problem-solving strategy after merging the preliminary problem-solving strategy "Clarify the profit relationship" with its semantically extended problem-solving strategy is "Determine the listed price variable x." The final sample problem-solving strategy after merging the preliminary problem-solving strategy "Set the listed price variable x" with its semantically extended problem-solving strategy is "Set up the equation." The final sample problem-solving strategy after merging the preliminary problem-solving strategy "Establish the equation" with its semantically extended problem-solving strategy is "Solve the equation." Thus, the sample problem and the corresponding sample problem-solving strategy sequence are "Determine the profit relationship → Determine the listed price variable x → Set up the equation → Solve the equation," which constitute the training sample pool.
[0145] In this way, by analyzing the connection order between clusters, the problem-solving strategy sequence is transformed from discrete phrases into an ordered process, simulating the logical chain of human "step-by-step problem-solving" and enhancing the model's ability to model the sequence of problem-solving steps.
[0146] This is the approach from the problem to the solution strategy, which can explain what kind of problem can lead to what kind of solution strategy. In order to further determine the strong mapping relationship between the problem and the solution strategy by determining that the solution strategy can be used to deduce the problem, that is, that they are each other's unique solutions, the following method can be used to train the solution strategy generation model while determining the accuracy and completeness of the mapping relationship between each sample problem and the sample solution strategy sequence.
[0147] Figure 9 A flowchart of a method 900 for training a problem-solving strategy generation model according to at least one embodiment of the present disclosure is shown.
[0148] Specifically, the problem-solving strategy generation model is trained through the following steps.
[0149] In step 901, a problem-solving strategy knowledge graph is constructed using the sample problem-solving strategy sequence.
[0150] For example, the set of mappings between questions and problem-solving strategies is composed of Definition. The question uses... The title indicates that... Corresponding problem-solving strategy sequence and ,use Indicates the first The number of problem-solving strategies in the sequence of problem-solving strategies, that is... This set is a subset of the entire problem-solving strategy knowledge graph. The mapping data pairs between problems and problem-solving strategy sequences are as follows: .
[0151] Thus, by constructing a knowledge graph of problem-solving strategies, the model can be flexibly adapted to different subjects (mathematics, physics, programming, etc.) or question types (multiple choice questions, proof questions, etc.), requiring only updates to the knowledge graph content.
[0152] In step 902, each sample question is input into the question encoder model to predict the posterior probability of the preliminary predicted solution strategy sequence for each sample question, wherein each solution strategy in the preliminary predicted solution strategy sequence is included in the solution strategy knowledge graph.
[0153] The role of the question encoder model is to map the question information (and its associated information) into a preliminary predicted sequence of problem-solving strategies. Specifically, it is used to map the input question information text into an approximate posterior probability distribution of the preliminary predicted sequence of problem-solving strategies. .
[0154] For example, the neural network of the question encoder model can adopt a generative structure to realize the probability distribution of the problem-solving strategy sequence related to the question information.
[0155] For example, for input questions In other words, the function of the question encoder model is to Under the conditions, generate by A sequence of problem-solving strategies consisting of several problem-solving strategies, if all problem-solving strategies in the problem-solving strategy knowledge graph have One, then it's equivalent to from Choose from a combination of problem-solving strategies Any sequence from the combinations. The problem encoder model will take the problem as input. Mapped to an approximate posterior distribution of one or more preliminary predicted problem-solving strategy sequences In other words, the output is defined as a sequence of problem-solving strategies.
[0156] The problem-solving strategies will be computed through forward and backward propagation. Since this paper is a validation of the problem-solving strategy sequence, given a problem, any problem-solving strategy sequence that the encoder may output will be constrained by the previously constructed problem-solving strategy knowledge graph (that is, constraints will be added to the variational framework) to avoid invalid sampling, and only those sequences in the problem-solving strategy knowledge graph will be retained.
[0157] In the forward computation, the question input to the encoder is... The output of the problem encoder model is the prediction of the problem-solving strategy sequence, which can be expressed as: The predicted sequence of problem-solving strategies after filtering by the problem-solving strategy knowledge graph is as follows: ,in The length is assumed to be ,So The generation process is as follows: Initialization: Set the initial input, assuming it is... <bos>; loop from Model prediction: Based on the input from the previous step, the model outputs the Logits (the output probability distribution of the encoder's large model) for the current step. Noise generation: Generates Gumbel noise for the current step. Calculate the sampling: , obtained It is a soft vector. Calculate... Then, this paper forcibly transforms it into a one-hot vector (taking argmax). In other words, it simulates discrete sampling, and what is passed to the next step is pure 0 and 1.
[0158] In the error backpropagation calculation, a simple backpropagation calculation using the Straight-Through Estimator (STE) mode is employed. When calculating the gradient, this paper's approximation does not perform argmax; it directly uses... The gradient. In terms of effectiveness, forward propagation uses a "hard" approach (to ensure the accuracy of sequence generation), while backpropagation uses a "soft" approach (to ensure that gradients can be propagated back to update the model).
[0159] In step 903, the prior probability of the preliminary predicted problem-solving strategy sequence is obtained based on the occurrence frequency of the problem-solving strategy, where the occurrence frequency of the problem-solving strategy is the number of times the problem-solving strategy is predicted in the predicted sequence of all sample questions divided by the total number of sample questions.
[0160] For example, an unsupervised prior probability distribution for initially predicting a sequence of problem-solving strategies can be obtained based on the frequency of occurrence of problem-solving strategies. ,Will The model is a parameterized distribution, combined with the prior design of the original method.
[0161] Unsupervised basic priors: Preserve "class imbalance optimization", let ( (This represents the frequency with which the problem encoder model predicts a certain problem-solving strategy), and then the initial prior probability is obtained through softmax normalization. Here, the product represents the initial prior probability of the problem-solving strategy sequence.
[0162] Prior correction (minor annotations or dynamic updates): Introducing variational parameters By controlling the weights of "annotation correction" and "dynamic update", the final prior is: .in It uses a small number of labeled "problem-policy sequence pairs" and estimates the empirical frequency (e.g., MLE). ),and It is then dynamically updated during training, based on the model generation. Statistical moving average, such as , For the first The experience frequency of steps, This is the moving average coefficient.
[0163] In step 904, each preliminary predicted problem-solving strategy sequence is input into the problem decoder model to infer the predicted problem corresponding to each preliminary predicted problem-solving strategy sequence.
[0164] The goal of the question decoder model is to predict the sequence of problem-solving strategies. Remapping back to the input question Similar Reconstruction Question Text Construct mapping pairs: Similar to the problem encoder model, it still uses an open-source large language model to evaluate the rationality of problem-solving strategy sequences.
[0165] In this way, the problem is encoded as the posterior probability distribution of the problem-solving strategy, capturing the implicit relationship between the problem and the strategy. Predicted problems are generated based on the strategy knowledge graph, forming a reverse verification mechanism of "strategy → problem" to ensure the rationality of the strategy.
[0166] In step 905, a loss function is constructed based on the semantic similarity between each sample question and the corresponding predicted question, the posterior probability and prior probability of the preliminary predicted problem-solving strategy sequence.
[0167] For example, the lower bound of evidence (ELBO) loss is defined between the input and the output, i.e. Between these points, the formula for the loss function is expressed as: Training employs gradient descent, optimizing the architecture parameters by maximizing ELBO, where: For the sample question With the predicted topic The expected value of the semantic similarity between them is used to measure the accuracy of the problem-solving strategy; It is the predicted probability distribution of the problem-solving strategy sequence H by the problem encoder model given the input problem X, where h represents the probability distribution from the input problem X to the input problem X. A sequence of problem-solving strategies sampled from the middle. The posterior probability of the preliminary predicted problem-solving strategy sequence with prior probability of Divergence is used to constrain problem-solving strategies to conform to the prior distribution, ensuring completeness. To balance the weighting coefficients of the two terms, semantic similarity can be calculated using the Bidirectional Encoder Representations from Transformers (BERT) score.
[0168] Q(H|X) is the predicted distribution (i.e., variational distribution) of the problem-solving strategy sequence H given the problem X by the problem encoder model. It represents the probability distribution of the problem-solving strategy sequence H that the problem encoder model believes to be given the problem X. h is a problem-solving strategy sequence (i.e., a possible strategy path) sampled from Q(H|X). This refers to the predicted questions inferred by the model based on policy h (i.e., the questions the model believes should be generated under policy h). sim(x, )Measure and predict the topic The semantic similarity to the real question x (e.g., through cosine similarity, cross-entropy, etc.). The question encoder model maximizes sim(x, The expected value of the problem encourages the generated problem-solving strategy H to infer predicted problems that are highly similar to the real problem x. KL(Q(H|X)‖P(H)) is the Kullback-Leibler Divergence, which measures the difference between the distribution of problem-solving strategies predicted by the problem encoder model, Q(H|X), and the prior distribution, P(H). P(H) is the prior probability of a problem-solving strategy, usually based on the frequency of strategy occurrence in the training data (e.g., high-frequency strategies are more likely to be preferred). The smaller the KL divergence, the closer Q(H|X) is to P(H), meaning the strategy generated by the model is more consistent with prior knowledge (e.g., simpler or more common strategy paths). The problem encoder model avoids generating overly complex or common-sense strategies by minimizing the KL divergence. η is used to balance sim(x, The contributions of η and KL(Q‖P) are considered. If η is large, the question encoder model will focus more on the prior rationality of the strategy (i.e., it will favor high-frequency strategies). If η is small, the question encoder model will focus more on the accuracy of predicting questions (i.e., it will pay more attention to sim(x, E (expectation) represents the semantic similarity sim(x, ) of all possible problem-solving strategies h (sampled from Q(H|X)). This means that the problem encoder model must not only generate a specific policy h, but also average the performance of all possible policy paths. The role of () is to drive the strategy h generated by the question encoder model so that it can infer predicted questions that are highly similar to the real questions x. For example, if a certain strategy h leads to... The semantic difference with x is relatively large (sim(x, If the semantic similarity is low, the strategy will be weakened. Maximizing ELBO aims to ensure the question encoder model simultaneously satisfies two conditions: high semantic similarity: the generated strategy h can infer predicted questions that are close to the real question x. Low KL divergence: The generated policy h follows the prior distribution P(H) (i.e., the rationality of the policy). By maximizing ELBO, the question encoder model finds a balance between accuracy and rationality.
[0169] Suppose the problem x is "The length of a rectangle is twice its width, and its area is 18. Find the perimeter."
[0170] The solution strategy sequence h1 is: first find the width (let the width be x, then the length is 2x, the area is 2x²=18, and we can solve for x=3), then calculate the perimeter 2(3+6)=18.
[0171] The solution strategy sequence h2 is as follows: directly assume the length is a and the width is b, set up the system of equations a=2b and ab=18, solve for a=6 and b=3, and then calculate the perimeter.
[0172] If sim(x, Predicted questions through question encoder model inference Measured by the degree of matching with the actual question x, then: if h1's Completely identical to x, sim(x, If h2 is the maximum value. There are differences from x (e.g., the problem description is more complex), sim(x, The probability of failure will decrease. The problem encoder model will tend to choose h1 because it satisfies both high sim and low KL divergence (if h1 is a high-frequency strategy).
[0173] Therefore, the variational inference framework (ELBO) is used to design the loss function, which compares the similarity between the actual question and the predicted question (sim(x, To ensure the consistency between the generated strategy and the semantics of the question, the difference between the posterior and prior distributions (based on strategy frequency) of the strategy is constrained by KL divergence (KL(Q||P)), avoiding the generation of low-probability but seemingly reasonable strategies. The coefficient η balances the semantic and probabilistic objectives, adapting to different task requirements, and achieving the optimal balance between generation accuracy (semantic matching) and reasonableness (probability distribution), avoiding the model from "making things up".
[0174] In step 906, a problem encoder model is trained and converged based on the loss function, which serves as a problem-solving strategy generation model.
[0175] For example, after batch inputting questions, the question encoder model outputs the logit (the raw output value of the last layer of the AI model, before normalization). The question encoder model then outputs a sequence of problem-solving strategies using methods such as TOP-P sampling (i.e., sorting the logit output by probability from high to low, retaining the smallest set of candidate words with a cumulative probability greater than P, and then sampling from this set), TOP-K sampling (i.e., when generating text, retaining only the K candidate words (tokens) with the highest probability from the logit output by the model, and then sampling from these candidate words (randomly selected according to the probability distribution)), or temperature sampling (i.e., scaling the logit by adjusting the temperature parameter T before performing a softmax transformation). The loss function ELBO is calculated and backpropagated to optimize the encoder's classification head, adapter layer, and learnable threshold parameters. If the loss function ELBO no longer decreases, the algorithm is considered to have converged.
[0176] Thus, after the training of the above-mentioned constrained variational inference framework converges, for a given problem, the problem-solving strategy sequence can be obtained by using only the problem encoder model as the problem-solving strategy generation model, which serves as the final verification result of the problem-solving strategy sequence corresponding to the final problem.
[0177] The technical solution according to at least one embodiment of this disclosure constructs an efficient and adaptive problem-solving strategy generation system through a multi-dimensional innovative method. First, the ratio of the first sample to the total samples in the training sample pool is dynamically adjusted based on the model's current prediction accuracy. At high accuracy, the proportion of the first sample is increased, forcing the model to break out of its comfort zone and improving its adaptability to complex problems. At low accuracy, the proportion of the first sample is reduced, prioritizing the consolidation of basic capabilities and preventing the model from overfitting or collapsing. Compared to traditional fixed-ratio training, this significantly improves the model's robustness and generalization ability, especially suitable for problem scenarios with multiple difficulty levels. By retaining the second sample, the stability of basic knowledge is preserved during the first sample training, preventing the model from "forgetting" basic strategies and forming a training loop that combines "easy and difficult" approaches. Second, a large language model (LLM) is used to automatically generate preliminary problem-solving strategies from the original problems, significantly reducing manual annotation costs while covering diverse problem-solving paths. The robustness of strategy expression is enhanced through synonym expansion and embedding vector calculation (such as paragraph embedding + regularization). Clustering is employed to group problem-solving strategies into non-overlapping clusters, extracting core strategies, eliminating redundancy, and refining a structured, reusable problem-solving knowledge graph from the original unordered strategies. This provides high-quality supervision signals for subsequent model training. By analyzing the connection order between clusters, the problem-solving strategy sequence is transformed from discrete phrases into an ordered process, simulating the logical chain of human "step-by-step problem-solving" and enhancing the model's ability to model the sequence of problem-solving steps. Finally, the question is encoded as a posterior probability distribution of the problem-solving strategy to capture the implicit relationship between the question and the strategy. Predicted questions are generated based on the strategy knowledge graph, forming a "strategy → question" reverse verification mechanism to ensure the rationality of the strategy. A variational inference framework (ELBO) is used to design the loss function, comparing the similarity between the real question and the predicted question (sim(x, To ensure the consistency between the generated strategy and the semantics of the question, the difference between the posterior and prior distributions (based on strategy frequency) of the strategy is constrained by KL divergence (KL(Q||P)), avoiding the generation of low-probability but seemingly reasonable strategies. The coefficient η balances the semantic and probabilistic objectives, adapting to different task requirements, and achieving the optimal balance between generation accuracy (semantic matching) and reasonableness (probability distribution), avoiding the model from "making things up".
[0178] This solution can be applied to various fields, including but not limited to: the construction of intelligent question banks in the education field, which can automatically generate structured problem-solving strategies, assist teachers in designing teaching content, dynamically adjust the training difficulty according to students' abilities, and provide targeted problem-solving guidance; in the industrial field, the problem-solving strategies can be extended to automated code generation to assist programming tasks, and the problem-solving logic can be applied to the design of fault diagnosis processes to improve system reliability.
[0179] In summary, this solution, through three core innovations—dynamic training strategy, high-quality data generation, and a probability-knowledge dual-driven model—precisely adapts to training difficulty, significantly improves the prediction accuracy of complex problems, utilizes large language models and clustering techniques to construct high-quality training data at low cost, provides structured problem-solving strategies and knowledge graphs to offer clear decision-making paths, and facilitates manual verification and correction. It constructs an adaptive, high-precision, and low-cost problem-solving strategy generation system, promoting the intelligent application of artificial intelligence (AI) in education, scientific research, industry, and other fields.
[0180] Figure 10 A block diagram of an apparatus for generating a problem-solving strategy according to at least one embodiment of the present disclosure is shown.
[0181] The apparatus for generating problem-solving strategies may include a processor (H1); a storage medium (H2) coupled to the processor (H1) and storing computer-executable instructions therein for performing the steps of various methods of at least one embodiment of the present disclosure when executed by the processor.
[0182] The processor (H1) may include, but is not limited to, one or more processors or microprocessors.
[0183] Storage media (H2) may include, but are not limited to, random access memory (RAM), read-only memory (ROM), flash memory, EPROM memory, EEPROM memory, registers, computer storage media (e.g., hard disks, floppy disks, solid-state drives, removable disks, CD-ROMs, DVD-ROMs, Blu-ray discs, etc.).
[0184] In addition, the device that generates the problem-solving strategy may also include (but is not limited to) a data bus (H3), an input / output (I / O) bus (H4), a display (H5), and input / output devices (H6) (e.g., keyboard, mouse, speaker, etc.).
[0185] The processor (H1) can communicate with external devices (H5, H6, etc.) via the I / O bus (H4) through a wired or wireless network (not shown).
[0186] The storage medium (H2) may also store at least one computer-executable instruction for performing the steps of various functions and / or methods in the embodiments described in this technology when executed by the processor (H1).
[0187] In one embodiment, the at least one computer-executable instruction may also be compiled into or comprise a software product, wherein one or more computer-executable instructions are executed by a processor to perform the steps of the various functions and / or methods in the embodiments described herein.
[0188] In one embodiment, a computer-readable storage medium is provided on which instructions are stored, such as computer-readable instructions. When the computer-readable instructions are executed by a processor, the various methods described above can be performed. The computer-readable storage medium includes, but is not limited to, volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. For example, the computer-readable storage medium can be connected to a computing device such as a computer, and then, when the computing device executes the computer-readable instructions stored on the computer-readable storage medium, the various methods described above can be performed.
[0189] The block diagrams of devices, apparatuses, devices, and systems disclosed herein are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as "comprising," "including," "having," etc., are open-ended terms meaning "including but not limited to," and are used interchangeably with them. The terms "or" and "and" as used herein refer to the terms "and / or," and are used interchangeably with them unless the context clearly indicates otherwise. The term "such as" as used herein refers to the phrase "such as but not limited to," and is used interchangeably with it.
[0190] Furthermore, the steps and apparatus in the various embodiments of this disclosure are not limited to any one embodiment. In fact, new embodiments can be conceived by combining relevant steps and apparatus in the various embodiments of this disclosure based on the concepts of this disclosure, and these new embodiments are also included within the scope of this disclosure.< / bos>
Claims
1. A method for generating problem-solving strategies, characterized in that, include: Input the problem into the problem-solving strategy to generate the model; The problem-solving strategy generation model predicts the sequence of problem-solving strategies for the given question. The problem-solving strategy generation model is trained using a training sample pool in the following manner: In response to the current prediction accuracy of the problem-solving strategy generation model being greater than or equal to a predetermined threshold, the ratio of the number of first samples used for the next training of the problem-solving strategy generation model to the total number of samples in the training sample pool is increased, wherein the first sample is a sample that causes the current prediction result of the problem-solving strategy generation model to be incorrect, and wherein the training sample pool is constructed in the following manner: By using prompt words and a large language model, one or more preliminary problem-solving strategies with a connection order are extracted from multiple sample questions for each sample question. Based on the one or more preliminary problem-solving strategies, at least one preliminary problem-solving strategy with a similarity higher than a similarity threshold is merged to obtain a merged problem-solving strategy; Based on the connection order of the one or more preliminary problem-solving strategies, the merged problem-solving strategies with the connection order are determined as a sample problem-solving strategy sequence; The training sample pool is obtained based on each sample question and the corresponding sequence of sample problem-solving strategies.
2. The method according to claim 1, further comprising: In response to the current prediction accuracy of the problem-solving strategy generation model being less than the predetermined threshold, the ratio of the number of first samples used for the next training of the problem-solving strategy generation model to the total number of samples in the training sample pool is reduced.
3. The method according to claim 1, wherein, The training sample pool also includes a second sample, which is a sample that makes the current prediction result of the problem-solving strategy generation model correct.
4. The method according to claim 3, wherein, The current prediction accuracy is determined based on the number of the first sample and the number of the second sample.
5. The method according to claim 1, wherein, The step of increasing the ratio of the number of first samples used for the next training of the problem-solving strategy generation model to the total number of samples in the training sample pool in response to the current prediction accuracy of the problem-solving strategy generation model being greater than or equal to a predetermined threshold includes: The current accuracy mean is calculated based on a moving average or weighted average of the previous prediction accuracy and the current prediction accuracy. The ratio is determined based on the current average accuracy, the upper limit of the ratio, and the lower limit of the ratio.
6. The method according to claim 1, wherein, The step of merging at least one preliminary problem-solving strategy with a similarity higher than a similarity threshold to obtain a merged problem-solving strategy, based on the one or more preliminary problem-solving strategies, includes: Each preliminary problem-solving strategy is expanded using grammatical components to obtain multiple expanded problem-solving strategies corresponding to each preliminary problem-solving strategy; For each preliminary problem-solving strategy and its corresponding plurality of expanded problem-solving strategies, a paragraph embedding vector is calculated, and average pooling and regularization are performed to generate a regularized problem-solving strategy hybrid vector corresponding to each preliminary problem-solving strategy. A kernel-function-based similarity calculation is performed on all the regularized problem-solving strategy mixture vectors to obtain the similarity between the problem-solving strategy mixture vectors. dimensional similarity matrix The number of mixed vectors for the problem-solving strategies is N, and the similarity matrix... Each element in Let N represent the similarity between the i-th problem-solving strategy mixture vector and the i-th problem-solving strategy mixture vector, where N, i, and j are positive integers. According to the similarity matrix calculate dimensional degree matrix The degree matrix Let be a diagonal matrix, and let the first line of the diagonal be the first line of the diagonal matrix. element Defined as the similarity matrix The Middle Summing all elements in a row; Using the similarity matrix and the degree matrix To build Normalized Laplace matrix of dimension ; For the normalized Laplace matrix Perform eigenvalue decomposition to solve for the normalized Laplacian matrix. The eigenvalues and corresponding eigenvectors of the elements in the dataset; Before selection The smallest non-zero eigenvalues corresponding to eigenvectors ,in The number of clusters for the preset problem-solving strategy is determined by the number of clusters. The eigenvectors are arranged in columns to form a feature matrix. For the feature matrix Each row is normalized to obtain the embedding matrix. ; The embedding matrix Each line in is considered as Given a data point in a 3D space, N data points are obtained. A clustering algorithm is then used to analyze these data points. Clustering is performed on the data points, and the... The data points are divided into non-overlapping groups. Clusters of problem-solving strategies ; Repeat the following steps until only one problem-solving strategy remains in each problem-solving strategy cluster: Each time, use the large language model to summarize every predetermined number of problem-solving strategies in each problem-solving strategy cluster to obtain a summarized problem-solving strategy to replace the predetermined number of problem-solving strategies. The remaining problem-solving strategy within each problem-solving strategy cluster is taken as the merged problem-solving strategy for each problem-solving strategy cluster.
7. The method according to claim 6, wherein, The step of determining the merged problem-solving strategies with a connection order as the sample problem-solving strategy sequence based on the connection order of the one or more preliminary problem-solving strategies includes: In response to the The connection order between any preliminary problem-solving strategy included in the first problem-solving strategy cluster and any preliminary problem-solving strategy included in the second problem-solving strategy cluster is used as the connection order between the first problem-solving strategy after merging the first problem-solving strategy cluster and the second problem-solving strategy after merging the second problem-solving strategy cluster. The sequence of sample problem-solving strategies is determined based on the connection order.
8. The method according to claim 1, wherein, The problem-solving strategy generation model is trained through the following steps: The problem-solving strategy sequence from the samples is used to construct a problem-solving strategy knowledge graph; Each sample question is input into the question encoder model to predict the posterior probability of the preliminary predicted solution strategy sequence for each sample question, wherein each solution strategy in the preliminary predicted solution strategy sequence is included in the solution strategy knowledge graph. The prior probability of the preliminary predicted problem-solving strategy sequence is obtained based on the occurrence frequency of the problem-solving strategy, wherein the occurrence frequency of the problem-solving strategy is the number of times the problem-solving strategy is predicted in the prediction sequence of all sample questions divided by the total number of sample questions. Each of the preliminary predicted problem-solving strategy sequences is input into the problem decoder model to infer the predicted problem corresponding to each preliminary predicted problem-solving strategy sequence; A loss function is constructed based on the semantic similarity between each sample question and its corresponding predicted question, the posterior probability and the prior probability of the preliminary predicted problem-solving strategy sequence; The problem encoder model is trained and converged based on the loss function, and serves as the problem-solving strategy generation model.
9. The method according to claim 8, wherein, The loss function is calculated using the following formula: , in, For the sample question With the predicted topic The expected value of the semantic similarity between them. It is the predicted probability distribution of the problem-solving strategy sequence H by the problem encoder model given the input problem X, where h represents the probability distribution from the input problem X to the input problem X. A sequence of problem-solving strategies sampled from the middle. The posterior probability of the preliminary predicted problem-solving strategy sequence and prior probability of Divergence; These are the weighting coefficients.
10. An apparatus for generating problem-solving strategies, comprising: Memory, used to store instructions; A processor for reading instructions from the memory and executing the method as described in any one of claims 1-9.
Citation Information
Patent Citations
Question solving step generation method and device
CN114693486A
Homework question and answer method and device, client, equipment and medium
CN117891906A
Question solving model training method and device
CN118798364A
Training sample data generation method and device, readable storage medium and program product
CN120277419A
Large model training data synthesis method, system and device and storage medium
CN120409710A