A personalized mathematical question generation method and system based on adaptive iterative preference optimization
By employing a lightweight reinforcement learning and a two-stage risk routing iterative preference optimization framework, a personalized math problem generation strategy is constructed. This addresses the challenges of dynamically adjusting problem difficulty and handling long context processing delays in existing technologies, enabling efficient and low-cost learner-specific problem generation.
Patent Information
- Application Number
- CN202611342426.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-01
- Publication Date
- 2026-11-24
AI Technical Summary
Existing automated math problem generation methods cannot dynamically adjust the difficulty of problems based on a single student's historical answers, resulting in problems that are either too easy or too difficult. This makes it impossible to achieve a precise match with students' specific abilities, and the long context processing leads to reasoning delays and huge computational overhead.
We employ a lightweight reinforcement learning history compressor and a two-stage risk routing iterative preference optimization framework. Through selective history compression and an implicit reward model, we construct a personalized question generation strategy and use a large language model to generate math questions that are precisely aligned with students' abilities.
It achieves high-precision learner-specific difficulty matching, reduces computational overhead and annotation costs, improves the efficiency and accuracy of question generation, and solves the problem that traditional static difficulty classification cannot provide individualized instruction.
Smart Images

Figure CN123159418A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence and adaptive education technology, specifically involving a method and system for generating mathematical problems by combining a large language model with reinforcement learning cue word compression and online adaptive iterative preference optimization to achieve automatic alignment of learner-specific difficulty. Background Technology
[0002] Mathematical problems are the core foundation for student ability assessment, deficit diagnosis, and reinforcement exercises in personalized adaptive learning systems and digital teaching platforms. With the rise of Large Language Models (LLM), using automated methods (MPG) to generate a wide variety of mathematical problems to reduce teacher workload and provide massive teaching resources has become a current research focus in educational technology.
[0003] However, existing methods for generating automated math problems face two serious drawbacks in practical application in teaching: (1) Neglecting student-specific difficulty: Most existing technologies treat the difficulty of math problems as a static, fixed, and global model attribute (e.g., hard-coded classification as easy, medium, and difficult). However, in actual teaching scenarios, problem difficulty has a strong learner-specific nature. The perceived difficulty of the same geometric proof or multi-step algebraic calculation problem may be completely opposite for students with different levels of knowledge. Existing technologies cannot dynamically adjust the difficulty of problems based on a single student's historical answers, which can easily lead to problems where problems are too easy and lose their practice value, or problems are too difficult and cause students to feel frustrated and disconnect from interaction.
[0004] (2) Long context processing and reasoning overhead: In order to capture the students’ true knowledge state, large models often need to read extremely long historical practice sequences. This not only causes the attention mechanism to be attracted by a large amount of conceptually irrelevant interference information (resulting in the Lost in the Middle phenomenon), but also introduces extremely high time delay and memory KV-Cache computation overhead into the reasoning process.
[0005] Therefore, how to efficiently and accurately generate mathematical problems online that perfectly match the ability boundaries of specific students (i.e., have a moderate challenge that combines mathematical logic and language expression) under the constraints of strictly controlling the cost of cloud API annotation and low inference latency is a technical bottleneck that current adaptive teaching systems urgently need to solve. Summary of the Invention
[0006] To address the aforementioned shortcomings of existing technologies, this invention provides a personalized math problem generation method based on adaptive iterative preference optimization. By introducing a lightweight reinforcement learning history compressor and a two-stage risk routing iterative direct preference optimization framework, the matching accuracy between the difficulty of generated problems and specific student profiles is greatly improved while maintaining low computational overhead.
[0007] The objective of this invention is achieved through the following technical measures.
[0008] A personalized math problem generation method based on adaptive iterative preference optimization, characterized by the following steps: (1) Concept-aware selective history compression steps: Use a lightweight encoder to extract semantic feature vectors of learners’ original practice history text and target knowledge concepts; run a finite-time-domain sequence decision expansion strategy based on reinforcement learning algorithm fine-tuning training to construct personalized question generation prompts; (2) Candidate math problem generation steps: Input the personalized problem generation prompt words into the current large language model problem generator strategy, and output a set of candidate math problems with differentiated difficulty for the target knowledge concept through autoregressive decoding and parallel sampling; (3) Steps for constructing a student-specific difficulty preference dataset: Construct a two-stage risk adaptive routing labeling mechanism, use an implicit reward model to calculate the implicit reward score of each candidate math question, form a provisional preference pair with the highest and lowest scores, and calculate the reward difference as an implicit preference determinism measure; at the same time, extract the top-level hidden state of the current policy model, input it into a deep ensemble model composed of multiple independently initialized preference heads to calculate cognitive uncertainty; perform two-stage screening based on the cognitive uncertainty and the implicit preference determinism measure, and output the difficulty preference dataset; (4) Online update steps for generating strategies: Calculate the direct preference optimization loss function using the difficulty preference dataset, update the strategy gradient of the large language model question generator, and use the update strategy after each round of training convergence as the reference model and sampling model for the next round of iteration. Through repeated iterations, the difficulty of the generated mathematical questions is adaptively aligned with the dynamic knowledge state of a specific learner.
[0009] Furthermore, in step (1), a finite-time-domain sequence decision expansion strategy based on reinforcement learning algorithm fine-tuning training is run to construct personalized question generation prompts, specifically: Extract learners' original practice history text and target knowledge concepts The semantic feature vector, where Indicates the first The text of the history practice questions. This indicates the corresponding historical knowledge concept tags. Indicates the correctness of the historical answer. This indicates the total number of historical practice records; With target knowledge concept Matching historical indexes constitute a mandatory retention set The mandatory retention set Historical records are always preserved in full text. For those not belonging to the target knowledge concept The historical records are selectively rewritten into phrase summaries, and a Softmax function with mask constraints is applied for probability mapping and sampling. At each decision step, a record index that best reflects the learner's dynamic ability characteristics is sampled and removed from the phrase summary state. Restore to full text state The process involves gradually selecting full-text records until the set compression rate budget threshold is reached. The output includes full-text format. With pre-computation phrase summary format Compact historical text in hybrid form ,Will Target knowledge concept and question types Enter prompt word template Get personalized question prompts .
[0010] Set compression ratio budget threshold This indicates the proportion of historical records replaced with phrase summaries; the total number of historical practice records is... At that time, the number of records allowed to be retained in full text format .
[0011] The Softmax function with mask constraints is applied for probability mapping and sampling, and its expression is: ; in, Indicates the first The sampled historical record index needs to be restored in full text form. This indicates the previously selected set of historical record indexes. , Indicates the first , Extended rating of historical records Indicates the first Step to the first The addition mask value applied to the historical record; when hour, ,otherwise ;in, ; in, Indicates a trainable network with parameters Multilayer perceptron networks, and They represent the first The semantic feature vectors of historical records and target knowledge concepts. Indicates the normalized time axis position. Used to measure the The contribution of restoring historical records to the alignment of target knowledge concept difficulty after being converted to full text.
[0012] In step (3), the implicit reward model is derived from the direct preference optimization objective, and its implicit reward score is calculated by multiplying the conditional log-likelihood probability ratio of the current generator policy and the frozen reference policy model by the alignment adjustment temperature hyperparameter; specifically, ; in, Indicates the first Before online iteration, the large language model question generator strategy for personalized input prompts. Generate specific candidate responses Personalized difficulty preference estimation score, Indicates the first The reference strategy model that was frozen before the online iteration. The current strategy for large language model question generators The alignment temperature hyperparameter is adjusted to control the deviation.
[0013] In step (3), the implicit preference determinism measure is specifically: ; in, This indicates that the large language model question generator strategy is related to the input prompt words. The constructed implicit preference determinism measure with provisional self-labels assigns provisional winning labels to candidate math problems with the highest and lowest implicit reward scores. and provisional phase-out label Form a provisional preference pair.
[0014] The step of extracting the top-level hidden state of the current policy model and inputting it into a deep ensemble model composed of multiple independently initialized preference heads to calculate cognitive uncertainty specifically involves extracting the top-level hidden state representation of the current policy model and inputting it into a deep ensemble model composed of multiple independently initialized multilayer perceptron preference heads to calculate preference confidence probability. ,in This represents the current integrated preference head index; and the cognitive uncertainty of the provisional preference pair is quantitatively assessed using a predictive mutual information formula: ; in, For binary classification entropy function, This represents the total number of independently initialized multilayer perceptron preference heads integrated.
[0015] The process of performing a two-stage screening based on the cognitive uncertainty and the implicit preference certainty measure to output a difficulty preference dataset is as follows: First, filter out cognitive uncertainty in descending order. In front The proportion of high uncertainty candidate subsets, among which This represents the proportion of routes with high uncertainty set; then, a second selection is made from these to identify the measure of implicit preference certainty. And in front The proportion of high-risk mismatches, among which This indicates the set high-risk gap routing threshold ratio; the high-risk mismatches are routed to an external strong language model for high-reliability preference correction and annotation, generating the corresponding true winning questions. Elimination Questions For the remaining low- to medium-risk pairs, the implicit reward model self-labels will be retained for the time being. Finally, a high-quality learner-specific difficulty preference dataset will be aggregated and output online. .
[0016] The direct preference optimization loss function is calculated using the aforementioned difficulty preference dataset, specifically as follows: ; in, This represents the overall scalar loss value for direct preference optimization. Represents the target strategy model. Represents the reference strategy model. This represents the mathematical expectation operator for the input preference dataset. This indicates a random sampling operation of data pairs from a specified probability distribution or dataset. and These respectively indicate the input prompt words. The target strategy model outputs the true winning problem under the given conditions. Similar to the actual elimination questions The autoregressive conditional log-likelihood probability. and These represent the conditional log-likelihood probabilities of the reference policy model under the same input; This represents the standard Sigmoid activation function.
[0017] A personalized math problem generation system based on adaptive iterative preference optimization, characterized by comprising: Concept-aware selective history compression module: Used to extract semantic feature vectors of learners’ original practice history text and target knowledge concepts using a lightweight encoder, and run a finite-time-domain sequence decision expansion strategy based on reinforcement learning algorithm fine-tuning training to construct personalized question generation prompt words; Candidate math question generation module: Input the personalized question generation prompts into the current large language model question generator strategy, and output a set of candidate math questions with differentiated difficulty for the target knowledge concept through autoregressive decoding and parallel sampling; Difficulty preference dataset construction module: Construct a two-stage risk adaptive routing labeling mechanism, adopt an implicit reward model, calculate the implicit reward difference for the provisional preference pairs composed of candidate math questions as the implicit preference certainty measure, and perform cognitive uncertainty calculation. Using the two-stage risk adaptive routing labeling mechanism, perform two-stage screening based on the cognitive uncertainty and the implicit preference certainty measure, and output the difficulty preference dataset. Online update module: Calculates the direct preference optimization loss function using the difficulty preference dataset, updates the policy gradient of the large language model question generator, and uses the update policy after each round of training convergence as the reference model and sampling model for the next round of iteration. Through repeated iterations, the difficulty of the generated math questions is adaptively aligned with the dynamic knowledge state of a specific learner.
[0018] The beneficial effects of this invention are as follows: (1) Highly accurate learner-specific difficulty matching: By directly aligning with preference learning, the generated math problems are highly aligned with the specific student's zone of proximal development in terms of reasoning complexity and calculation steps, which fundamentally solves the drawback of traditional static difficulty classification that cannot be tailored to individual needs. (2) Extreme compression and efficient computation: The RL-driven compressor compresses the prompt text significantly while preserving the student's ability representation signal, which effectively improves the end-to-end question generation speed and overcomes the attention loss and KV-cache latency bottleneck of long context. (3) Extremely low annotation cost: The two-stage routing strategy proposed in this invention routes only 40% of the high-risk samples with the greatest potential for gradient improvement to the expensive strong external API, while the rest retain implicit self-labels. Under the constraint of saving more than 60% of the annotation cost, it achieves the top alignment level consistent with the full external annotation, which is of great value for low-cost online industrial deployment. Attached Figure Description
[0019] Figure 1 is a flowchart of the overall process of the personalized math problem generation method and system based on adaptive iterative preference optimization of the present invention. Detailed Implementation
[0020] The technical solutions of the present invention will now be described in detail with reference to the accompanying drawings and embodiments. It is obvious that the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the protection scope of the present invention.
[0021] As attached Figure 1 As shown, the math problem generation process in this embodiment mainly includes the following steps: First, a lightweight compressor using a reinforced language training strategy is used to selectively compress the original practice history text records using concept awareness, resulting in personalized prompts. These prompts are then input into a calibrated problem generator to obtain a candidate math problem set. Next, a student-specific difficulty preference dataset is constructed. Finally, online updates and iterative alignment are performed, repeatedly generating the corresponding candidate math problems and difficulty preference dataset until convergence is achieved. The specific process is as follows: (1) Conceptual perception selective historical compression First, a lightweight encoder is used to extract the learner's original practice history text. ,in Indicates the first The text of the history practice questions. This indicates the corresponding historical knowledge concept tags. Indicates the correctness of the historical answer. This indicates the total number of historical practice records.
[0022] In this embodiment, the original exercise history text exemplarily contains the following problems: Problem 1: A truck and a car depart from two cities... approaching each other...; Problem 2: Each box contains 11 pencils... there are 6 boxes in total... how many pencils are there in total...? Running a finite-time sequence decision extension policy trained using the reinforcement learning population relative policy optimization (GRPO) algorithm. ,in The trainable network parameters for the strategy; matching target knowledge concepts The historical records (defined as the target knowledge points expected to be generated for students in this request) are forcibly extracted and unconditionally added to a fixed set that must retain the full text. .
[0023] For those not belonging to the target knowledge concept The historical records are subjected to selective fragment summaries rewriting. The rewriting strategy is as follows: Using a pre-defined punctuation-free summary prompt template, the basic large model first jointly rewrites it into extremely short, abstract natural language plain text tag phrases of no more than 10 tokens in the offline stage. The punctuation-free summary prompt template is fixed and hard-coded as follows: "You are a compression module for math education systems. Your tasks is to jointly compress a math problem statement and its associated knowledgeconcept into ONE extremely short natural-language phrase. CriticalRequirements: Output ONLY one short phrase. Maximum length: 10 tokens. Usenatural language words only. Do not include numbers or punctuation at the end." In this embodiment, the target knowledge concept is: multiplication. Therefore, for Problem 1, which does not involve multiplication, it is presented as a phrase summary after light compression: relative motion in opposite directions. Problem 2, which involves multiplication, is preserved in its full form.
[0024] After rewriting, the system will generate phrase tags. With historical text that retains the full text Both are stored in the system's historical text cache stack.
[0025] In order to achieve the specified compression ratio budget threshold (in It is defined as the proportion of compressed phrase summaries in the historical sequence; this threshold can be used to limit the final number of items allowed to be retained. Under the constraint that the first record is in full text format and the rest are replaced with phrase tags, the system maximizes the retention of key difficulty control signals that reflect the student's ability level. The system trains and runs online a lightweight sequential expansion strategy based on a pre-trained BERT encoder and a multilayer perceptron (MLP). ,in These are the trainable network parameters for this extended strategy.
[0026] Next, the BERT encoder is used to extract the first... semantic feature vector of historical records and the semantic feature vector of the target knowledge concept and normalize the time axis position. The corresponding extended score is obtained by splicing. : ; in, Indicates a trainable network with parameters Multilayer perceptron mapping network, This represents the relative time span between the current historical record and the latest record. Based on this, the system applies a Softmax function with mask constraints to perform probability mapping and sampling for historical records that are not yet selected. ; in, Indicates the first The step-by-step decision sampling requires the restoration of the full-text historical record index. This represents the set of historical indexes that have been selected previously; and introduces an addition mask operator. To achieve non-repeating dynamic sampling control in the sequential decision-making process. Specifically, when... At that time, the decision state machine is forced to be hard-coded. Otherwise set This ensures that the probability of the Softmax score of an entry that has been extracted or forcibly retained converges to absolute zero.
[0027] The system iteratively executes the above Softmax sampling action, and at each step, it samples the record index that best reflects the learner's dynamic ability characteristics and removes it from the phrase summary state. Restore to full text state This continues until the number of newly recovered texts meets the upper limit of the step size decision. Up to now, among them This represents the set element counting operator. In practical engineering calculations, to minimize end-to-end inference time, the system chooses to reuse the already extracted feature vectors. and In each internal decision-making step, the perceptron network score is not assigned. Perform repeated calculations.
[0028] This extended strategy The optimization is achieved through Group Relative Policy Optimization (GRPO): in the warm-up phase, the optimal alignment problem generated by the strong external model is first used as the standard solution. Supervised fine-tuning (SFT) is performed on the basic problem generator model to obtain the state model. Subsequently, Instead of being updated, it serves as an evaluation model for extended action sequences. The generated hybrid historical text Scoring and outputting predicted standard questions. Mean log-likelihood reward : ; in, This represents the final generated extended selection action sequence; Indicates an extended action sequence With solidified collection The final subset of record indexes, preserved in full text form, is constructed by combining the union of the two sets. This indicates the personalized prompts generated under the constraints of this subset. Indicates standard title The first in Each word element. The higher the reward, the better the selected mixed-format historical text supports the question generator's prediction of questions aligned with the target difficulty.
[0029] The system's unbiased within-group normalized dominance value Driven by introducing shear hyperparameters The policy gradient loss objective is updated via backpropagation: ; in, This represents the scalar loss of the group relative to the strategy optimization. For numerical truncation shearing operators; This represents the total number of parallel sampling action groups in a single GRPO optimization. This represents the upper bound of the decision step size for expanding the selection (defined as follows). ), This indicates that the current optimization strategy and the old sampling strategy are compared at the [number]th ... The importance ratio of step movements: ; in, This represents the parameters of the old strategy used to generate the old motion trajectory. This is to prevent the strategy from deviating too far from the boundary truncation constant hyperparameter. Indicates the first The sampling action sequence in the first The selected historical index.
[0030] After the update is complete and the policy converges, the output includes the full text. With pre-computation phrase summary format Compact historical text in hybrid form , where the index subset It defines the boundaries of the full-text record. It compresses the historical text. Target concept and question types Assemble the prompt word template into the question The system generates personalized prompts with extremely high information density while avoiding interference from long contexts. .
[0031] (2) Generation of multiple candidate math problems Generate prompts for the personalized questions. Input the current large language model question generator strategy Among them Indicates the first The large language model strategy network parameters before the first round of online iteration. This indicates the current online iteration round; autoregressive decoding and parallel sampling are performed by setting sampling hyperparameters, and the output is... A set of candidate mathematical problems targeting the stated knowledge concept and possessing differentiated difficulty levels. The sampling hyperparameters include the decoding temperature coefficient. probability cutoff threshold Total number of parallel candidate samples and maximum generation length Among them, the sampling temperature coefficient Scaling factor used to adjust the randomness of autoregressive decoding; probability cutoff threshold. Used to limit the cumulative probability range of candidate words retained in each decoding step, and the total number of parallel candidate samples. Used to limit the number of candidate math problems generated under the same prompt word, and the maximum generated length. Used to limit the upper limit of output terms for each candidate math problem response.
[0032] Independent parallel sampling generation A set of candidate math problem responses, each with differences in textual semantic description and varying levels of mathematical logical depth. .
[0033] In this embodiment, the system sets the core decoding hyperparameter to a decoding temperature coefficient of 0.7; and the probability matrix truncation threshold. The value is 0.9, defined as retaining the top 90% of token candidates based on cumulative probability; the total number of candidate samples sampled. =16.
[0034] In this example, the generated candidate math problems are as follows: Problem y1: There are 18 boxes, and each box contains 6 pencils. How many pencils are there in total? Problem y2: There are 18 boxes, and each box contains 24 pencils. The pencils are distributed equally among 12 students. How many pencils can each student take? In this implementation, the large language question generator strategy is a strategy model trained by "online adaptive iterative preference optimization (AIPO / Iterative DPO)" after the pre-trained model has been warmed up (Warm-up SFT).
[0035] (3) Construction of a dataset of students’ specific difficulty preferences In each round of direct preference optimization online training, to efficiently refresh the preference dataset and strictly control API call costs, the system invokes a two-stage risk-adaptive routing annotation mechanism. This includes four reward signal sources, obtained through prompts to the LLM itself. Obtained through an external scalar reward model This is achieved by providing hints to external LLMs. and the implicit reward model built through DPO. The four reward signals ultimately converge into an adaptive reward mechanism, in which the implicit reward model (IRM) plays a central role—it does not require training a separate reward model, but directly utilizes the generator policy. The reward signal is constructed by comparing the probability ratio of the current version to the reference version for the same response.
[0036] First, the system invokes the implicit reward model (IRM) derived from the direct preference optimization objective, utilizing the current generator policy. Reference strategy model with freezing The outputs from each parameter are jointly calculated to obtain the question for each candidate response. Corresponding implicit reward score : ; in, The large language model question generator strategy is based on input prompt words. Generate specific candidate responses Personalized difficulty preference estimation score; The temperature hyperparameter is adjusted to control the deviation of the large model generation.
[0037] The large language model question generator strategy is an autoregressive language model based on the Transformer architecture, which uses a pre-trained large language model as initial parameters and is trained through supervised fine-tuning and reinforcement learning.
[0038] Based on this, the system automatically assigns provisional winning labels to the two math problems with the highest and lowest implicit reward scores under the current prompt word. and provisional phase-out label This allows for the rapid assembly of the current provisional preference pairs in the generative strategy model; and by calculating the difference in the implicit reward scores, an implicit preference determinism metric is output. : ; in, This indicates that the large language model question generator strategy is related to the input prompt words. Construct a provisional self-labeled implicit preference determinism measure (i.e., subjective preference gap).
[0039] To prevent large language models from falling into the "blindly confident and mismatched" reward overoptimization phenomenon caused by outlier (OOD) data distribution, the system attaches a parallel layer above the large model's representation layer. Each is independently initialized and in the historical preference dataset A deep ensemble uncertainty estimator is constructed using fine-tuned multilayer perceptron (MLP) preference heads. In this embodiment, a pre-trained LLM is used directly as the initial policy model. The uncertainty estimator is initialized and pre-trained on a small number of labeled preferences, and the total number of ensemble heads is set. =8.
[0040] The system concatenates the prompt and the two responses with positional enhancements to extract the hidden state at the last token position in the current model. As the input representation, it drives the simultaneous forward propagation of 8 preference heads to output the preference confidence probability. ,in The output of the corresponding preference header index is defined as the first... Each preference head determines the confidence probability that a provisional winning question is better than an elimination question. Each preference head outputs a confidence probability: ; in, Indicates the first An independent multilayer perceptron bias head predicts the first response. Superior to the second response The probability estimate, The corresponding standard Sigmoid activation function at the top layer of the network, Corresponding to the The mapping weight parameters of each preference head.
[0041] During the inference phase, the generated provisional preference pairs are... The input is concatenated in sequence, and the corresponding preference confidence probability output by each preference header is denoted as... The cognitive uncertainty score of the provisional label pair under the global preference distribution is calculated using the Predictive Mutual Information formula. : ; In the formula, The standard binary classification entropy function is defined as follows: By calculating the difference between the mean entropy and the mean entropy of the multi-head ensemble prediction probability, a quantitative measure of the cognitive uncertainty of the model can be achieved. This represents the total number of independently initialized multilayer perceptron preference heads integrated.
[0042] Next, the system executes the core two-stage routing logic: Phase 1 (Uncertainty Screening): The system evaluates the cognitive uncertainty scores of all provisional sample pairs sampled within the current batch. Sort in descending order and select those with the highest cognitive uncertainty. A proportionate subset of samples is defined as samples with potential generalization failure risk. This indicates the proportion of high-uncertainty routing thresholds set.
[0043] The second stage (gradient value routing): Within the subset of samples, the system determines the implicit preference score for provisional sample pairs. Perform a second descending sort to further filter out the ones with the largest gaps. A proportional sample. Among them This indicates the percentage of high-risk gap routing thresholds set.
[0044] Because this part of the sample satisfies the conditional relationship ,in, This represents the direct preference optimization loss relative to the policy parameters. The gradient norm, This represents the Sigmoid function. This represents the implicit reward gap. It is defined as follows: the absolute value of the policy gradient in direct preference optimization is proportional to the Sigmoid mapping value of the subjective gap score. That is, the more confident the sample is subjectively and the more uncertain they are cognitively, the greater their contribution to the network's gradient update and the more information they contain after expert correction. The system marks these as high-risk mismatches and asynchronously routes them through the gateway to an external, highly reliable, and robust language model for expert-level win / loss label rewriting and correction, obtaining the corrected true winning question. Elimination Questions The remaining large number of low- to medium-risk sample pairs that did not match the target data directly retain the self-labels of the implicit reward model. Through this adaptive mechanism, the system aggregates and outputs a high-information-density preference dataset online. .
[0045] In this embodiment, it is preferable to set an uncertain routing threshold ratio. =70%, preferably setting the gap routing threshold ratio. =40%.
[0046] (4) Online update and iteration alignment To obtain a high-quality online difficulty preference dataset for the current round. Then, the system initiates gradient backpropagation. The LoRA parameters of the large problem generation model are fine-tuned by minimizing the following Direct Preference Optimization (DPO) loss function: ; in, This represents the overall scalar loss value for direct preference optimization; Represents the target strategy model. Represents the reference strategy model. This represents the mathematical expectation operator for the input preference dataset; This indicates that a data pair is randomly sampled from a specified dataset; and These represent the actual winning questions output under the current target question generator strategy model to be optimized by gradient. Similar to the actual elimination questions The autoregressive conditional log-likelihood probability. and These represent the actual winning questions output by the reference strategy model. Similar to the actual elimination questions The autoregressive conditional log-likelihood probability.
[0047] After a single round of parameter fine-tuning and optimization, the system will solidify and update the latest large language model parameters to the new strategy. At the same time, it will be used as a reference model to be cloned and frozen in the next iteration. .
[0048] The system repeatedly executes steps (2) to (4) above. With the advancement of iteration rounds (preferably, the upper limit of iteration is set to 3 rounds), the generated large model can continuously obtain the negative feedback gradient of its own output and real ability online, thereby thoroughly correcting the language organization complexity and multi-step mathematical logic calculation depth of the generated mathematical problems, and outputting mathematical problems that perform extremely well in length-controlled win rate (LC) and are precisely aligned with the current real knowledge state of a single specific student.
[0049] The specific implementation steps and model engineering described above are all achieved through the collaborative operation of the Python programming language, the PyTorch deep learning development framework, the Hugging Face Transformers large model toolchain, and an independently mounted Nvidia H800 computing server environment. Content not described in detail in this manual constitutes prior art known to those skilled in the art.
[0050] It should be noted that the above description of the examples of the present invention is for the purpose of explaining the technical features of the present invention in detail. Various improvements and modifications made without departing from the present invention are also protected by the present invention; therefore, the scope of protection of the present invention should be determined by the content defined in the claims of this application.
Claims
1. A personalized math problem generation method based on adaptive iterative preference optimization, characterized in that, Includes the following steps: (1) Concept-aware selective history compression steps: Use a lightweight encoder to extract semantic feature vectors of learners’ original practice history text and target knowledge concepts; run a finite-time-domain sequence decision expansion strategy based on reinforcement learning algorithm fine-tuning training to construct personalized question generation prompts; (2) Candidate math problem generation steps: Input the personalized problem generation prompt words into the current large language model problem generator strategy, and output a set of candidate math problems with differentiated difficulty for the target knowledge concept through autoregressive decoding and parallel sampling; (3) Steps for constructing a student-specific difficulty preference dataset: Construct a two-stage risk adaptive routing labeling mechanism, use an implicit reward model to calculate the implicit reward score of each candidate math question, form a provisional preference pair with the highest and lowest scores, and calculate the reward difference as an implicit preference certainty measure; at the same time, extract the top-level hidden state of the current policy model and input it into a deep ensemble model composed of multiple independently initialized preference heads to calculate cognitive uncertainty; use the two-stage risk adaptive routing labeling mechanism to perform two-stage screening based on the cognitive uncertainty and the implicit preference certainty measure, and output the difficulty preference dataset; (4) Online update steps for generating strategies: Calculate the direct preference optimization loss function using the difficulty preference dataset, update the strategy gradient of the large language model question generator, and use the update strategy after each round of training convergence as the reference model and sampling model for the next round of iteration. Through repeated iterations, the difficulty of the generated mathematical questions is adaptively aligned with the dynamic knowledge state of a specific learner.
2. The method according to claim 1, characterized in that, In step (1), a finite-time-domain sequence decision expansion strategy based on reinforcement learning algorithm fine-tuning training is run to construct personalized question generation prompts, specifically: Extract learners' original practice history text and target knowledge concepts The semantic feature vector, where Indicates the first The text of the history practice questions. This indicates the corresponding historical knowledge concept tags. Indicates the correctness of historical answers. This indicates the total number of historical practice records; With target knowledge concept Matching historical indexes constitute a mandatory retention set The mandatory retention set Historical records are always preserved in full text. For those not belonging to the target knowledge concept The historical records are selectively rewritten into phrase summaries, and a Softmax function with mask constraints is applied for probability mapping and sampling. At each decision step, a record index that best reflects the learner's dynamic ability characteristics is sampled and removed from the phrase summary state. Restore to full text state The process involves gradually selecting full-text records until the set compression rate budget threshold is reached. The output includes full-text format. With pre-computation phrase summary format Compact historical text in hybrid form ,Will Target knowledge concept and question types Enter prompt word template Get personalized question prompts .
3. The method according to claim 2, characterized in that, Set compression ratio budget threshold This indicates the proportion of historical records replaced with phrase summaries; the total number of historical practice records is... At that time, the number of records allowed to be retained in full text format .
4. The method according to claim 2, characterized in that, The Softmax function with mask constraints is applied for probability mapping and sampling, and its expression is: ; in, Indicates the first The sampled historical record index needs to be restored in full text form. This indicates the previously selected set of historical record indexes. , Indicates the first , Extended rating of historical records Indicates the first Step to the first The addition mask value applied to the historical record; when hour, ,otherwise ;in, ; in, Indicates a trainable network with parameters Multilayer perceptron networks, and They represent the first The semantic feature vectors of historical records and target knowledge concepts. Indicates the normalized time axis position. Used to measure the The contribution of restoring historical records to the alignment of target knowledge concept difficulty after being converted to full text.
5. The method according to claim 2, characterized in that, In step (3), the implicit reward model is derived from the direct preference optimization objective, and its implicit reward score is calculated by multiplying the conditional log-likelihood probability ratio of the current generator policy and the frozen reference policy model by the alignment adjustment temperature hyperparameter; specifically, ; in, Indicates the first Before online iteration, the large language model question generator strategy for personalized input prompts. Generate specific candidate responses Personalized difficulty preference estimation score, Indicates the first The reference strategy model that was frozen before the online iteration. The current strategy for large language model question generators The alignment temperature hyperparameter is adjusted to control the deviation.
6. The method according to claim 5, characterized in that, In step (3), the implicit preference determinism measure is specifically: ; in, This indicates that the large language model question generator strategy is related to the input prompt words. The constructed implicit preference determinism measure with provisional self-labels assigns provisional winning labels to candidate math problems with the highest and lowest implicit reward scores. and provisional phase-out label Form a provisional preference pair.
7. The method according to claim 6, characterized in that, The step of extracting the top-level hidden state of the current policy model and inputting it into a deep ensemble model composed of multiple independently initialized preference heads to calculate cognitive uncertainty specifically involves extracting the top-level hidden state representation of the current policy model and inputting it into a deep ensemble model composed of multiple independently initialized multilayer perceptron preference heads to calculate preference confidence probability. ,in This represents the current integrated preference head index; and the cognitive uncertainty of the provisional preference pair is quantitatively assessed using a predictive mutual information formula: ; in, For binary classification entropy function, This represents the total number of independently initialized multilayer perceptron preference heads integrated.
8. The method according to claim 7, characterized in that, The process involves a two-stage screening based on the cognitive uncertainty and the implicit preference certainty measure, outputting a difficulty preference dataset. Specifically, First, filter out cognitive uncertainty in descending order. In front The proportion of high uncertainty candidate subsets, among which This indicates the proportion of high-uncertainty routing thresholds set; Then, a second selection is made to identify the measure of implicit preference certainty. And in front The proportion of high-risk mismatches, among which This indicates the set high-risk gap routing threshold ratio; the high-risk mismatches are routed to an external strong language model for high-reliability preference correction and annotation, generating the corresponding true winning questions. Elimination Questions For the remaining low- to medium-risk pairs, the implicit reward model self-labels will be retained for the time being. Finally, a high-quality learner-specific difficulty preference dataset will be aggregated and output online. .
9. The method according to claim 8, characterized in that, The direct preference optimization loss function is calculated using the aforementioned difficulty preference dataset, specifically as follows: ; in, This represents the overall scalar loss value for direct preference optimization. Represents the target strategy model. Represents the reference strategy model. This represents the mathematical expectation operator for the input preference dataset. This indicates a random sampling operation of data pairs from a specified probability distribution or dataset. and These respectively indicate the input prompt words. The target strategy model outputs the true winning problem under the given conditions. Similar to the actual elimination questions The autoregressive conditional log-likelihood probability. and These represent the actual winning questions output by the reference strategy model. Similar to the actual elimination questions The autoregressive conditional log-likelihood probability; This represents the standard Sigmoid activation function.
10. A personalized math problem generation system based on adaptive iterative preference optimization, implementing the method of any one of claims 1 to 9, characterized in that, include: Concept-aware selective history compression module: Used to extract semantic feature vectors of learners’ original practice history text and target knowledge concepts using a lightweight encoder, and run a finite-time-domain sequence decision expansion strategy based on reinforcement learning algorithm fine-tuning training to construct personalized question generation prompt words; Candidate math question generation module: Input the personalized question generation prompts into the current large language model question generator strategy, and output a set of candidate math questions with differentiated difficulty for the target knowledge concept through autoregressive decoding and parallel sampling; Difficulty preference dataset construction module: Construct a two-stage risk adaptive routing labeling mechanism, adopt an implicit reward model, calculate the implicit reward difference for the provisional preference pairs composed of candidate math questions as the implicit preference certainty measure, and perform cognitive uncertainty calculation. Using the two-stage risk adaptive routing labeling mechanism, perform two-stage screening based on the cognitive uncertainty and the implicit preference certainty measure, and output the difficulty preference dataset. Online update module: Calculates the direct preference optimization loss function using the difficulty preference dataset, updates the gradient of the large language model question generator strategy, and uses the update strategy after each round of training convergence as the reference model and sampling model for the next round of iteration. Through repeated iterations, the difficulty of the generated math questions is adaptively aligned with the dynamic knowledge state of a specific learner.
