Error question correction method and system based on large language model and medium
By extracting the initial feature vectors and semantic similarity of student tests, optimizing the weights of the large language model, and generating personalized error correction suggestions, the system solves the problems of insufficient accuracy and limited suggestions in online education platform error correction systems, achieving high-precision and scenario-sensitive error correction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-28
- Publication Date
- 2026-03-17
Smart Images

Figure CN120953018B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of error correction technology based on large language models, specifically to error correction methods, systems, and media based on large language models. Background Technology
[0002] Error correction is a process that uses technology to detect errors in students' answers, identify them, and provide targeted analysis and correction suggestions. Its aim is to help students understand the reasons for their mistakes and master the correct knowledge. Large Language Models (LLMs) are deep learning-based artificial intelligence systems capable of processing and generating human language text. They possess powerful semantic understanding, logical reasoning, and content generation capabilities, and can capture language patterns through large-scale data training and adapt to complex tasks. Large Language Models can deeply understand the semantic relationship between the question stem and the student's answer, dynamically adjusting the evaluation logic based on characteristics such as subject area and question difficulty. They can not only accurately detect incorrect answers but also generate diverse and ranked error correction suggestions based on contextual features.
[0003] Existing online education platforms' error correction methods neglect differences in subject matter and difficulty levels, resulting in insufficient accuracy, limited suggestions, and a lack of dynamic adaptability in their models. This makes it difficult to meet the precise needs of diverse learning scenarios, leading to insufficient accuracy in large language models and a lack of personalized error correction suggestions. Summary of the Invention
[0004] In a first aspect, embodiments of this application provide a method for error correction based on a large language model, the method comprising the following steps:
[0005] Extract initial feature vectors from each student's questions in the current test, where different dimensions of the initial feature vectors represent different scenario attributes in the questions;
[0006] The text vectors of the question stem, standard answer, and student answer are obtained separately. By analyzing the similarity between the text vectors of the question stem and standard answer and the student answer, the similarity is concatenated with the initial feature vector using a pre-trained large language model to obtain the high-dimensional semantic vector of each question, so as to calculate the wrong question detection score of each question.
[0007] By analyzing the average distribution and dispersion of the incorrect test scores of each student in the current test, the judgment threshold of each student in the current test is determined, so as to divide all the questions of each student in the current test into non-correction questions and questions that need correction.
[0008] The correctness of the grading results for all questions in the current test for each student is marked, and the differences between the marked results and the non-correction questions and the questions that need to be corrected are analyzed in order to optimize the weights in the pre-trained large language model and obtain the optimized large language model.
[0009] Based on the question stems, student answers, and initial feature vectors of each student in the current test, error correction suggestions are obtained for each question that needs correction by optimizing the large language model.
[0010] Preferably, the different scenario attributes include: subject area, grade level, question type classification, question difficulty, specific requirements for question description, teaching syllabus requirements, and teacher-defined grading instructions or requirements.
[0011] Preferably, the method for obtaining the high-dimensional semantic vectors of each question is as follows:
[0012] The similarity between the text vectors of the question stem and the standard answer and the student's answer, as well as the feature vector, are input into the embedding layer of the pre-trained large language model, and the output vector is used as the high-dimensional semantic vector of each question.
[0013] Preferably, the error detection score for each question is: the normalized value of the inner product of the weight matrix of the pre-trained large language model and the high-dimensional semantic vector when the high-dimensional semantic vector of each question is used as input to the pre-trained large language model.
[0014] Preferably, the expression for the judgment threshold of each student in the current test is: T i =norm(μ i +κ×σ i In the formula, T i μ represents the threshold value for the i-th student in the current test; i σ i Let represent the mean score of all incorrect answers for the i-th student in the current test, and let represent the standard deviation of all incorrect answers for the i-th student; κ represents the preset sensitivity parameter; and norm() represents the normalization function.
[0015] Preferably, the step of dividing all questions for each student in the current test into non-correction questions and questions requiring correction includes:
[0016] Questions with error detection scores below the judgment threshold are marked as questions requiring correction, while the rest are marked as questions not requiring correction.
[0017] Preferably, optimizing the weights in the pre-trained large language model to obtain an optimized large language model includes:
[0018] The difference between the labeled results and the uncorrected and corrected questions is used as the input to the loss function, and the output loss function is denoted as the correction loss function. This is used to optimize the weights in the pre-trained language model, specifically:
[0019] The updated weight value ω(i) of the k-th scene attribute for the j-th question in the current test for the i-th student within the pre-trained large language model. ′ j,k The expression is: In the formula, ω(i) j,k This represents the value of the k-th scene attribute of the j-th question in the current test for the i-th student before the corresponding weight is updated in the pre-trained large language model; η represents the preset learning rate. Represents the correction loss function; express In ω(i) j,k The partial derivatives on the surface; exp[] represents the exponential function with the natural constant as the base; iterate through all scene attributes, update the weights in the pre-trained large language model, and use the pre-trained large language model with updated weights as the optimized large language model.
[0020] Preferably, the step of obtaining error correction suggestions for each question requiring error correction using an optimized large language model includes:
[0021] The stems, student answers, and initial feature vectors of each question requiring correction in the current test are used as inputs to optimize the large language model. The large language model is optimized by using prompt word engineering to output all correction suggestions and optimized feature vectors for each question requiring correction.
[0022] All correction suggestions for each error-requiring question are used as input to a pre-trained language model. The model outputs the semantic vectors of each correction suggestion. The normalized similarity between the semantic vector of each correction suggestion and the optimized feature vector is calculated and used as the comprehensive score of each correction suggestion. The top few comprehensive scores of all correction suggestions are sorted in descending order and used as the correction suggestions for each error-requiring question.
[0023] Secondly, embodiments of this application provide a large language model-based error correction system, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements any of the above-described large language model-based error correction methods.
[0024] Thirdly, embodiments of this application also provide a large language model-based error correction medium, wherein the medium stores a computer program, and when the computer program is executed by a processor, it implements the error correction method based on the large language model described above.
[0025] As can be seen from the above embodiments, the error correction method based on a large language model provided in this application has at least the following beneficial effects:
[0026] This application integrates semantic similarity and scene features, utilizes the BERT model to extract text vectors and calculate similarity, combines initial feature vectors to generate high-dimensional semantic vectors, and outputs error detection scores from a large language model. This achieves dual verification of the relevance and correctness of student answers, adapting to evaluation standards across different subjects and difficulty levels, significantly improving the accuracy and scene sensitivity of error detection, and providing a more precise basis for personalized error correction. Furthermore, this application dynamically generates personalized judgment thresholds by analyzing the mean, standard deviation, and preset sensitivity parameters of students' error detection scores in the current test, classifying questions into those requiring correction and those not, adapting to the distribution of error detection scores across different difficulties and scenarios, flexibly adjusting the strictness of error correction, and significantly reducing misjudgments and omissions in complex scenarios. The error detection is more aligned with practical needs. Furthermore, this application analyzes the differences between manual annotation results and model judgment results, uses backpropagation of the loss function to calculate gradients, dynamically adjusts the weights of each scene attribute in the pre-trained large language model, and normalizes and updates them to obtain an optimized large language model. This model can accurately adapt to the feature importance of different learning scenarios, significantly reducing false positives and false negatives, and improving the accuracy and scene adaptability of error detection. Finally, this application uses the large language model combined with semantic similarity for error detection, optimizes the model weights based on manual annotation feedback, and finally generates and sorts personalized error correction suggestions. This enables error detection to accurately adapt to different subjects, difficulty levels, and other scenarios, significantly improving detection accuracy and the relevance of error correction suggestions, achieving high-precision, scene-sensitive, and personalized error correction. Attached Figure Description
[0027] To more clearly illustrate the technical solutions and advantages in the embodiments of this application 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 application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0028] Figure 1 A flowchart illustrating the steps of a method for correcting errors based on a large language model, provided in one embodiment of this application;
[0029] Figure 2 This is a flowchart illustrating the process of dividing non-correction and correction topics according to an embodiment of this application. Detailed Implementation
[0030] To further illustrate the technical means and effects adopted by this application to achieve the intended inventive purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation methods, structures, features, and effects of the error correction method, system, and medium based on a large language model proposed in this application. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.
[0032] The following, in conjunction with the accompanying drawings, details the specific scheme of the error correction method, system, and medium based on a large language model provided in this application.
[0033] Please see Figure 1 The diagram illustrates a flowchart of a method for error correction based on a large language model according to an embodiment of this application. The method includes the following steps:
[0034] S1: Extract initial feature vectors from each question in the current test for each student, where different dimensions of the feature vectors represent different scenario attributes in the questions.
[0035] Existing online education platforms' error correction models generally employ fixed rules or generic models, neglecting the significant differences in students' answering characteristics across various learning scenarios, leading to insufficient correction accuracy. For example, the scoring logic for data proof questions differs greatly from that of Chinese composition questions, and the common error types of lower-grade students differ significantly from those of higher-grade students. Generic models struggle to accommodate these scenario characteristics. Therefore, it is necessary to extract specific feature vectors for particular scenarios and form differentiated scenario representations through dynamic weight fusion. This addresses the limitations of traditional one-size-fits-all methods, generating an overall feature vector that represents the current learning scenario, providing differentiated input for subsequent steps. The core objective is to enable the model to have scenario awareness. On one hand, through differentiated representation of scenario features, the error detection and correction process can adapt to the specific requirements of different subjects, difficulties, and student levels, improving correction accuracy. On the other hand, through adaptive weight updates, a closed loop is formed, allowing the system to continuously learn and adapt to new scenarios during use, ultimately achieving high-precision and personalized error correction capabilities.
[0036] Specifically, an initial feature vector is first extracted from each question in the current test for each student. The different dimensions of the initial feature vector represent different scenario attributes in the question. In this embodiment, all scenario attributes include: subject area, grade level, question type, question difficulty, specific requirements of the question description, teaching syllabus requirements, and teacher-defined grading instructions or requirements.
[0037] For structured scenario attributes, such as subject area, grade level, question type, and question difficulty, rule-based coding methods, such as one-hot coding, can be used. For unstructured scenario attributes, such as specific requirements in question descriptions, syllabus requirements, and teacher-defined grading instructions or requirements, natural language processing techniques, such as the BERT model, can be used. By standardizing or embedding dimensions, the extracted initial feature vectors can be ensured to represent the core attributes of a specific learning scenario.
[0038] One-hot encoding and the BERT model are both well-known techniques, and the specific process of extracting the initial feature vector using them will not be elaborated here.
[0039] S2: Obtain the text vectors of the question stem, standard answer, and student answer for each question. Analyze the similarity between the text vectors of the question stem, standard answer, and student answer. Use a pre-trained large language model to concatenate the similarity with the initial feature vector to obtain the high-dimensional semantic vector of each question, and calculate the error detection score for each question.
[0040] Current online education platforms generally rely on semantic similarity or fixed rules for error detection, neglecting the significant impact of different learning scenarios on the evaluation criteria. For example, math questions emphasize logical rigor, while language arts questions focus more on semantic completeness; high-difficulty questions may allow points for partially correct steps, while basic questions require highly accurate answers. Judging correctness solely through generic semantic similarity leads to a disconnect between the scoring criteria and the specific needs of the scenario, failing to accurately identify complex errors such as correct reasoning but incorrect expression or missing key steps. Therefore, it is necessary to combine scenario features and semantic similarity to construct a detection model that better meets actual needs.
[0041] Specifically, in this embodiment, the text vectors of the question stem, standard answer, and student answer are obtained respectively. By analyzing the similarity between the text vectors of the question stem and standard answer and the student answer, the similarity is concatenated with the initial feature vector using a pre-trained large language model to obtain the high-dimensional semantic vector of each question, so as to calculate the wrong question detection score for each question. The specific process is as follows:
[0042] First, this embodiment obtains the text vectors of the question stem, standard answer, and student answer for each question. By analyzing the similarity between the text vectors of the question stem and standard answer and the student answer, and concatenating them with the initial feature vectors, a high-dimensional semantic vector for each question is obtained, specifically:
[0043] In this embodiment, the BERT model is used to extract the text vectors of each question in the current test for each student. The process of extracting text vectors using a pre-trained BERT model is a well-known technique, and its specific process will not be described in detail.
[0044] Furthermore, this embodiment calculates the similarity between the text vectors of each question stem and the standard answer and the student's answer, respectively, to measure the degree of similarity between the student's answer and the standard answer;
[0045] It should be noted that there are many commonly used methods for measuring the similarity between vectors. In this embodiment, the cosine similarity between the text vectors of each question stem and standard answer and the student's answer is used as the similarity between the text vectors of each question stem and standard answer and the student's answer. In practical applications, as other implementation methods, implementers may also use other methods such as BERT dot product to measure the similarity between vectors according to specific circumstances. This embodiment does not impose any special restrictions.
[0046] The method for calculating cosine similarity is a well-known technique, and its specific calculation method and formula will not be elaborated here.
[0047] Furthermore, in this embodiment, the high-dimensional semantic vector of each question is obtained by concatenating the similarity between the text vectors of the question stem and the standard answer and the student's answer with the initial feature vector. Specifically:
[0048] In this embodiment, the similarity of the text vectors between the question stem and the standard answer and the student's answer, as well as the feature vector, are input into the embedding layer of the pre-trained Large Language Model (LLM), and the output vector is used as the high-dimensional semantic vector of each question.
[0049] Among them, the Large Language Model (LLM) is a deep learning model trained on massive amounts of text data. It is a well-known technology, and its specific operating principles and processes will not be elaborated here.
[0050] Furthermore, in this embodiment, the high-dimensional semantic vectors of each question are used as input to the pre-trained large language model to calculate the error detection score for each question, specifically as follows:
[0051] When the high-dimensional semantic vector of each question is used as input to the pre-trained large language model, the normalized value of the inner product of the weight matrix of the pre-trained large language model and the high-dimensional semantic vector is used as the error detection score for each question.
[0052] The smaller the score for incorrect answers, the higher the probability that the answer meets the requirements of the question, the question stem, and the standard answer; conversely, the higher the score, the higher the probability that the answer is incorrect.
[0053] It should be noted that there are many commonly used normalization methods. In this embodiment, the maximum-minimum normalization method is used to process the inner product result. In practical applications, as other implementation methods, implementers can also use the z-score normalization method to normalize the data according to the specific situation. This embodiment does not impose any special restrictions.
[0054] Among them, the maximum-minimum normalization method is a well-known technique, and its specific principles will not be elaborated here.
[0055] It should be noted that, unless otherwise specified, all normalization calculations or processing in this embodiment adopt the maximum-minimum value normalization method.
[0056] This embodiment compares student answers based on semantic relevance. Comparing the question stem anchors the core requirements of the question, determining whether the student's answer is relevant—that is, whether it responds to the key information in the question stem and follows the conditions or specifications set by the question. This avoids invalid answers that are irrelevant or deviate from the limitations being mistakenly judged as valid. Comparing the answers verifies the correctness of the student's answers in terms of knowledge content, logical deduction, or results, determining whether they conform to the core points or reasonable conclusions of the subject matter and standard answers. This avoids incorrect answers due to knowledge errors or logical flaws being mistakenly judged as correct. These two methods complement each other: the former ensures the relevance of the answers, and the latter ensures their correctness. Together, they constitute a dual verification process in error detection—whether the answer was given according to requirements and whether it was answered correctly—ensuring the comprehensiveness and accuracy of the detection results.
[0057] By integrating scene features and semantic similarity, this approach breaks through the limitations of traditional single-dimensional detection, enabling error detection to adapt to different learning scenarios and evaluation criteria. For example, for challenging high school math problems, the model can automatically increase the semantic matching weight of key solution steps, reducing misjudgments caused by non-standard expressions; for basic middle school Chinese problems, it focuses on the matching degree of complete semantics. The final error detection score reflects both the semantic accuracy of the answer and the specific requirements of the scenario, providing a more accurate basis for subsequent adaptive threshold determination and personalized error correction, thus achieving the goal of high-precision and scenario-sensitive error detection.
[0058] Thus, this embodiment integrates semantic similarity and scene features, uses the BERT model to extract text vectors and calculate similarity, combines the initial feature vectors to generate high-dimensional semantic vectors, and finally outputs the error detection score by the large language model. This method achieves dual verification of the relevance and correctness of students' answers, can adapt to the evaluation standards of different subjects and difficulty scenarios, significantly improves the accuracy and scene sensitivity of error detection, and provides a more accurate basis for personalized error correction.
[0059] S3: By analyzing the average distribution and dispersion of the incorrect test scores of all questions in each student's current test, the judgment threshold of each student's current test is determined, so as to classify all questions of each student's current test into non-correction questions and questions that need correction.
[0060] Traditional error detection methods often use fixed thresholds, which cannot adapt to the dynamic changes in the score distribution of questions in different learning scenarios. For example, high-difficulty questions may have lower overall scores, and using a uniform threshold can easily lead to overcorrection; while basic questions generally have higher scores, and a fixed threshold may miss errors. Therefore, it is necessary to dynamically generate thresholds based on the actual distribution characteristics of the current batch of data to avoid the shortcomings of fixed thresholds and ensure that the threshold matches the data distribution. Specifically:
[0061] In this embodiment, by analyzing the average distribution and dispersion of the incorrect test scores for all questions in each student's current test, a judgment threshold for each student's current test is determined. This threshold is used to classify all questions in each student's current test into non-correction questions and questions requiring correction. Specifically:
[0062] As a specific implementation method, in this embodiment, the judgment threshold T of the i-th student in the current test is... i The expression is: T i =norm(μ i +κ×σ i ); where μ i σ i Let represent the mean score of all incorrect answers for the i-th student in the current test, and let represent the standard deviation of all incorrect answers for the i-th student; κ represents the preset sensitivity parameter; and norm() represents the normalization function.
[0063] It should be noted that the preset sensitivity parameter is set manually, and the value range of the preset sensitivity parameter is generally between -3 and 3. In this embodiment, the preset sensitivity parameter is set to 1. In actual application, the implementer can also set it according to the specific situation. This embodiment does not impose any special restrictions.
[0064] Furthermore, in this embodiment, questions with error detection scores less than the judgment threshold are denoted as questions requiring correction, and the remaining questions are denoted as questions not requiring correction. Among them, questions not requiring correction are questions that do not need correction, i.e., correct questions, while questions requiring correction are questions that need to be corrected. The judgment threshold is used to characterize the probability of a question being correct.
[0065] Preferably, the flowchart of the process for classifying non-correction questions and correction questions provided in this embodiment is as follows: Figure 2 As shown.
[0066] Fixed standard answers to incorrect questions are typically suitable for simple scenarios where the answer is either right or wrong, such as mathematical formula calculations. However, in more complex learning scenarios, such as logical omissions in humanities discussions, incomplete steps in science, and issues with the standardization of language expression, the correctness of answers is often hierarchical and difficult to define using an absolute binary standard. This embodiment dynamically generates judgment thresholds, allowing them to automatically adapt to the specific characteristics of the current learning scenario, such as whether a batch of questions is generally difficult or easy, avoiding misjudgments by fixed thresholds in complex scenarios. Configurable sensitivity parameters meet the different users' needs for the strictness of error correction; for example, pre-exam training can increase sensitivity to reduce redundant error correction, while basic practice can decrease sensitivity to strengthen detailed correction. The judgment boundaries are dynamically adjusted based on the distribution characteristics of the data itself, reducing missed or false judgments caused by data fluctuations and ensuring that the incorrect question detection results are more in line with the needs of actual scenarios.
[0067] Thus, this embodiment abandons fixed thresholds and dynamically generates personalized judgment thresholds by analyzing the mean, standard deviation, and preset sensitivity parameters of students' scores on incorrect questions in the current test, classifying questions into those requiring correction and those not. This method can adapt to the score distribution of different difficulties and scenarios, flexibly adjust the strictness of error correction, significantly reduce misjudgments and omissions in complex scenarios, and make error detection more in line with actual needs.
[0068] S4: Mark the correctness of all questions in the current test for each student, analyze the difference between the marked results and the non-corrected questions and the questions that need correction, so as to optimize the weights in the pre-trained large language model and obtain the optimized large language model.
[0069] In different learning scenarios, the impact of scenario features on error detection varies significantly, and initial weights are difficult to adapt to complex scenarios. As grading data accumulates, the model needs to adjust the importance of each feature in real time based on the grading error of the current batch to avoid scenario adaptation bias caused by fixed weights, thereby solving the problem of non-adaptive models in existing technologies. Therefore, this embodiment labels the correctness of all questions graded for each student in the current test, analyzes the differences between the labeled results and non-correction questions and questions requiring correction, and optimizes the weights in the pre-trained large language model to obtain an optimized large language model. Specifically:
[0070] In this embodiment, firstly, the correctness of the grading results of all questions in the current test for each student is manually marked. The difference between the manual marking results and the correctness of the non-correction questions and the questions that need correction determined by the pre-trained large language model and threshold judgment is compared. The difference between the marking results and the non-correction questions and the questions that need correction is used as the input of the loss function. The output loss function is called the grading loss function, which reflects the error correction accuracy under the current scenario feature weight configuration and is the basis for weight adjustment.
[0071] Furthermore, the weights in the pre-trained language model are optimized, specifically as follows:
[0072] As a specific approach, in this embodiment, the updated value ω(i) of the k-th scene attribute of the j-th question in the current test for the i-th student corresponds to the weight within the pre-trained large language model. ′ j,k The expression is: In the formula, ω(i) j,k This represents the value of the k-th scene attribute of the j-th question in the current test for the i-th student before the corresponding weight is updated in the pre-trained large language model; η represents the preset learning rate. The exp[] represents the correction loss function; exp[] represents the exponential function with the natural constant as the base. express In ω(i) j,k The partial derivatives on the surface are used to iterate through all scene attributes and update the weights in the pre-trained large language model. The pre-trained large language model with updated weights is used as the optimized large language model.
[0073] The weights are amplified or reduced by exponential operation. When the gradient is positive, the value of exp[] is less than 1, and the weight decreases; when the gradient is negative, the value of exp[] is greater than 1, and the weight increases.
[0074] It should be noted that the preset learning rate is set manually, and the general range of the learning rate is 0.01 to 0.1. In this embodiment, the preset learning rate is 0.01. In actual application, as other implementation methods, implementers can also set it according to specific circumstances. This embodiment does not impose any special restrictions.
[0075] It should be noted that the loss function used in this embodiment is cross-entropy. In practical applications, as other implementation methods, implementers may also use other loss functions such as mean squared error. This embodiment does not impose any special restrictions.
[0076] Cross-entropy is a well-known metric, and its specific expression and application principles will not be elaborated further.
[0077] This embodiment calculates the correction loss function through backpropagation. For ω(i) j,k gradient If the gradient is greater than zero, it means that increasing the weight will increase the loss, indicating that the current weight of this feature is too high and its importance needs to be reduced; conversely, it means that increasing the weight will reduce the loss, indicating that this feature is more critical to error correction and its weight needs to be increased.
[0078] Furthermore, the updated weights are normalized to ensure that the sum of the weights of all scene features is always 1, thus maintaining the physical meaning of the feature vectors. The updated and normalized weights are then applied to the next round of scene feature fusion, enabling the model to prioritize more critical features in the current scene during subsequent error detection.
[0079] Thus, this embodiment analyzes the differences between manual correction and annotation results and model judgment results, uses the loss function to backpropagate and calculate gradients, dynamically adjusts the weights of each scene attribute in the pre-trained large language model, and updates them in a normalized manner. This method enables the model to adaptively optimize based on actual correction feedback, accurately adapt to the feature importance of different learning scenarios, significantly reduce false positives and false negatives, and improve the accuracy of error detection and scene adaptability.
[0080] S5: Based on the question stems, student answers, and initial feature vectors of each question requiring correction in the current test for each student, use the optimized large language model to obtain correction suggestions for each question requiring correction.
[0081] Existing online education platforms often suffer from a lack of diverse suggestions in their error feedback, providing only correct or incorrect answers or fixed solutions, which fails to meet the personalized needs of different learning scenarios. For example, correcting errors in math word problems may require step-by-step explanations, while English essay correction focuses more on grammar suggestions. Without targeted prioritization, students struggle to quickly identify the most suitable areas for improvement. Therefore, it is necessary to generate diverse and prioritized suggestions based on scenario characteristics to address the shortcomings of traditional grading and improve the practicality and adaptability of error correction. Therefore, this embodiment further utilizes an optimized large language model to obtain error correction suggestions for each question requiring correction based on the question stem, student's answer, and initial feature vector of each student in the current test. Specifically:
[0082] As a specific implementation method, in this embodiment, the question stems, student answers, and initial feature vectors of each student in the current test are used as inputs to optimize the large language model. The large language model is optimized by using prompt word engineering to output all correction suggestions and optimized feature vectors for each question that needs to be corrected.
[0083] The prompt word engineering is a well-known technology, and its specific principles and technologies will not be elaborated here.
[0084] Furthermore, all correction suggestions for each question requiring error correction are used as input to the pre-trained language model, which outputs the semantic vectors of each correction suggestion. The normalized value of the similarity between the semantic vector of each correction suggestion and the optimized feature vector is calculated as the comprehensive score of each correction suggestion. The top number of comprehensive scores of all correction suggestions are sorted in descending order and used as the correction suggestions for each question. The pre-trained language model is the BERT model.
[0085] It should be noted that the preset quantity is set manually. In this embodiment, the preset quantity is 5. In actual application, as other implementation methods, implementers can also set it according to specific circumstances. This embodiment does not impose any special restrictions.
[0086] Thus, this embodiment extracts scene features and dynamically adjusts weights and thresholds, uses a large language model combined with semantic similarity to detect incorrect questions, optimizes model weights based on human annotation feedback, and finally generates and sorts personalized error correction suggestions. This method enables incorrect question detection to accurately adapt to different subjects, difficulty levels, and other scenarios, significantly improving detection accuracy and the relevance of error correction suggestions, and achieving high-precision, scene-sensitive, and personalized error correction.
[0087] Based on the same inventive concept as the above methods, this application also provides an error correction system based on a large language model, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements any one of the above error correction methods based on a large language model.
[0088] Based on the same inventive concept as the above method, this application also provides an error correction medium based on a large language model, wherein the medium stores a computer program, and when the computer program is executed by a processor, it implements the error correction method based on a large language model described above.
[0089] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, specific embodiments of this specification have been described above. Additionally, the processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired results. In some implementations, multitasking and parallel processing are possible or may be advantageous.
[0090] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
[0091] The above description is only a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.
Claims
1. A method for error correction of wrong questions based on a large language model, characterized in that, The method comprises the following steps: extracting an initial feature vector from each question in the current test of each student, wherein different dimensions of the initial feature vector represent different scene attributes in the question; obtaining a text vector of each question stem, standard answer and student answer, analyzing the similarity of the text vectors between the question stem and the standard answer and the student answer respectively, using a pre-trained large language model to splice the similarity and the initial feature vector to obtain a high-dimensional semantic vector of each question to calculate the wrong question detection score of each question; determining the judgment threshold of the current test of each student by analyzing the average distribution and dispersion degree of the wrong question detection scores of all questions in the current test of each student, so as to divide all questions in the current test of each student into non-correcting questions and correcting questions; annotating the correctness of the correction results of all questions in the current test of each student, analyzing the difference between the annotation results and the non-correcting questions and the correcting questions to optimize the weight in the pre-trained large language model to obtain an optimized large language model; obtaining the correction suggestions of each correcting question based on the question stem, the student answer and the initial feature vector of each correcting question in the current test of each student using the optimized large language model.
2. The method of claim 1, wherein the method further comprises: The different scene attributes include: subject field, school stage grade, question type classification, question difficulty, specific requirements of question description, teaching outline requirements, teacher-defined correction instructions or requirements. 3.The method of claim 1, wherein, The method for obtaining the high-dimensional semantic vector of each question is: inputting the similarity of the text vectors between the question stem and the standard answer and the student answer and the initial feature vector into the embedding layer of the pre-trained large language model, and outputting the vector as the high-dimensional semantic vector of each question.
4. The method of claim 1, wherein the method further comprises: The wrong question detection score of each question is: when the high-dimensional semantic vector of each question is input into the pre-trained large language model, the normalized value of the inner product result of the weight matrix of the pre-trained large language model and the high-dimensional semantic vector.
5. The method of claim 1, wherein the method further comprises: The expression of the determination threshold of the current test of each student is: ; wherein, represents the determination threshold of the current test of the i-th student; , respectively represent the mean value and the standard deviation of the wrong question detection scores of all questions in the current test of the i-th student; represents a preset sensitivity parameter; and norm() represents a normalization function.
6. The method of claim 1, wherein the method further comprises: The division of all questions in the current test of each student into non-correcting questions and correcting questions comprises: questions with an error detection score less than the judgment threshold are recorded as correcting questions, and the remaining questions are recorded as non-correcting questions.
7. The method of claim 1, wherein the method further comprises: The optimization of the weight in the pre-trained large language model to obtain the optimized large language model comprises: the difference between the annotation results and the non-correcting questions and the correcting questions is input into the loss function, and the output loss function is recorded as the correction loss function to optimize the weight in the pre-trained language model, specifically: The value of the kth scene attribute of the jth question in the current test of the ith student in the pre-trained large language model after updating the corresponding weight The expression is: ; In the formula, The value of the kth scene attribute of the jth question in the current test of the ith student in the pre-trained large language model before updating the corresponding weight is represented by The preset learning rate is represented by The grading loss function is represented by The partial derivative of on is represented by The partial derivative of on is represented by The exponential function with natural constant as base is represented by exp[ ]; update the weight in the pre-trained large language model by traversing all scene attributes; and the pre-trained large language model with weight update is used as the optimized large language model.
8. The method of claim 1, wherein the method further comprises: The use of the optimized large language model to obtain the correction suggestions of each correcting question comprises: the question stem, the student answer and the initial feature vector of each correcting question in the current test of each student are input into the optimized large language model, wherein the optimized large language model is guided by the prompt word engineering, and all correction suggestions and optimized feature vectors of each correcting question are output. The semantic vectors of all correction suggestions of each error correction question are taken as inputs of a pre-trained language model, and the semantic vectors of all correction suggestions are output. 9.A mistake correction system based on a large language model, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, and characterized in that, The processor implements the computer program to realize the error correction method based on a large language model according to any one of claims 1-8.
10. A medium for error correction of wrong questions based on a large language model, wherein a computer program is stored in the medium, characterized in that, The computer program is executed by the processor to realize the error correction method based on a large language model according to any one of claims 1-8.
Citation Information
Patent Citations
Error correction large model iterative training method fusing user semantics and past error correction records
CN119337864A
Intelligent analysis method for junior middle school English reading understanding test questions based on large model
CN119514553A