Student programming answer prediction method combining semantic understanding and structured modeling

By combining semantic understanding and structured modeling methods, and utilizing large language models and graph neural networks to process non-standardized code and Chinese questions in programming education, this approach solves the problem of insufficient prediction accuracy in existing technologies and achieves a low-cost, high-efficiency prediction solution.

CN121235222BActive Publication Date: 2026-04-10ZHEJIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG UNIV
Filing Date
2025-12-01
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing knowledge tracing models struggle to effectively handle non-standardized code and lack sufficient semantic understanding of question texts in programming education scenarios, leading to decreased prediction accuracy. Furthermore, they are costly to train and have high model complexity, making them difficult to deploy efficiently in large-scale educational settings.

Method used

Combining semantic understanding and structured modeling methods, this approach integrates large language models with graph neural networks, utilizes pre-trained models for translation and fine-tuning, constructs a knowledge graph, performs message propagation and feature updates, and finally employs a multilayer perceptron for nonlinear mapping to improve prediction accuracy.

Benefits of technology

It significantly improves the ability to understand non-standardized code and Chinese questions, enhances prediction accuracy, reduces computational costs and storage overhead, and makes the model feasible on large-scale online education platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121235222B_ABST
    Figure CN121235222B_ABST
Patent Text Reader

Abstract

The application discloses a student programming answer prediction method combining semantic understanding and structured modeling, collects student programming homework data and pre-processes the data to obtain data samples, translates the data samples to obtain an English feature set; uses low-rank adaptation to fine-tune a pre-trained semantic understanding model, constructs input features, and predicts an answer correctness probability; performs graph neural network structured modeling based on the association relationship between problems and concepts, performs message propagation and feature updating to obtain an embedding set, inputs the embedding set and student embedding into a prediction layer to obtain a probability of answering a question correctly; and inputs the probability of answering a question correctly and the probability of answering a question correctly after fusion into a multilayer perceptron for nonlinear mapping to predict the probability of answering a question correctly. The application solves the problems of difficulty in effectively processing non-standardized codes submitted by students, insufficient semantic understanding of question texts and low prediction accuracy in programming knowledge tracking, and provides a scientific basis for personalized teaching and learning resource scheduling.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of knowledge tracing, and in particular to a student programming answer prediction method combining semantic understanding and structured modeling. BACKGROUND

[0002] In recent years, the rapid development of artificial intelligence is deeply changing the form of the education field. In the traditional teaching mode, homework correction mainly relies on teachers to manually correct the homework submitted by students, and to artificially analyze the knowledge mastery state of students. However, the popularity of the Internet has gradually changed students from traditional paper homework to online mode, and students can submit homework or participate in examinations on online education platforms and intelligent tutoring systems, which makes the historical data of student answers can be efficiently collected and tracked and modeled. These data features include student answer behavior, learning duration, video viewing progress, interactive feedback, and multi-dimensional data. How to efficiently use these data and accurately assess the knowledge mastery level of students has become a key factor in improving the quality of education and realizing personalized learning.

[0003] Knowledge tracing, as a branch of data mining in the field of education, knowledge tracing (KT) has emerged and developed rapidly in this context. The purpose of knowledge tracing is to analyze students' answer behavior and homework submission records, predict their future mastery of knowledge points, and provide a scientific basis for personalized teaching, intelligent recommendation, and learning resource scheduling.

[0004] In the early stage, the research of knowledge tracing mainly relies on statistical models and traditional machine learning algorithms, such as Bayesian knowledge tracing (BKT). These methods usually only use the correct or incorrect sequence information of learning answers, and the model structure is relatively simple, which has limited ability in capturing long-term learning behavior, complex dependence between knowledge points, and processing large-scale data. With the rapid iteration of deep learning technology, deep knowledge tracing models (such as DKT, DKVMN) are proposed, which mainly model the answer sequence of students by using long short-term memory neural networks (LSTM), so that the dependence relationship between the student's answers can be captured, and the knowledge state of the student can be more accurately predicted.

[0005] However, although numerous deep learning methods effectively improve the prediction accuracy of knowledge tracing tasks, these methods are limited to flat data, which mainly covers simple classification data and numerical data. If these methods are migrated to the field of programming knowledge tracing, there are still obvious deficiencies. Existing mainstream knowledge tracing models can achieve good accuracy on flat data using a small number of features, but they have low interpretability, and their prediction accuracy begins to decrease significantly when applied to data sets with massive text such as programming knowledge tracing. The main reason is that in programming knowledge tracing, the rules of student learning state are mainly hidden in the student's historical submitted code, rather than simple data features.

[0006] Therefore, the existing technology has begun to pay attention to this problem and carry out research, for example, reference 1 (Code-DKT: A Code-based Knowledge Tracing Model for Programming Tasks[J], arXiv [Cs.SE], 2022) proposes Code-DKT: a code-based programming task knowledge tracing model, which extends the traditional DKT model by introducing code content features and attention mechanisms, thereby significantly outperforming the original method in predicting the correctness of student programming homework answers. Although this method performs well on its programming data set compared to deep knowledge tracing models, these methods mainly rely on high-quality, perfect code data for training, making it difficult to deal with the situation of students submitting code with syntax errors, incompleteness, or non-standardization in real classroom environments. At the same time, the existing methods do not fully utilize the information of the question text, especially for Chinese questions or question descriptions rich in professional terms, making it difficult for the model to fully understand the question, thereby affecting the prediction performance.

[0007] In summary, although existing knowledge tracing methods have achieved certain results in dealing with flat data or high-quality code data, there are still obvious deficiencies in actual programming education scenarios: existing models have limited understanding of code with syntax errors, incompleteness, or non-standardization, and do not fully utilize the information of the question text (especially Chinese questions), making it difficult for the model to fully understand the question, thereby affecting the prediction accuracy. In addition, the training cost of existing methods is high, and the model complexity is large, making it difficult to efficiently deploy in large-scale education scenarios. SUMMARY

[0008] In view of the above deficiencies of the prior art, the present application provides a student programming answer prediction method combining semantic understanding and structured modeling, which uses a programming knowledge tracing method combining a large language model and a graph neural network to solve the problems of difficulty in effectively processing non-standardized code submitted by students, insufficient understanding of question text semantics, and prediction accuracy decline in programming knowledge tracing.

[0009] To achieve the above-mentioned object of the application, an embodiment provides a student programming answer prediction method combining semantic understanding and structured modeling, comprising the following steps:

[0010] Step 1: Collecting student programming homework data and preprocessing to obtain data samples, and translating the data samples to obtain an English feature set;

[0011] Step 2: Fine-tuning a pre-trained semantic understanding model using a low-rank adaptation method, constructing input features based on the English feature set and the data samples, and predicting the answer correct probability through the fine-tuned semantic understanding model;

[0012] Step 3: Structured modeling based on the association relationship between questions and concepts through a graph neural network, and message propagation and feature updating through a multi-layer graph convolution network to obtain an embedding set, and fusing the embedding set and student embedding to input into a prediction layer to obtain the probability of the student answering the question correctly;

[0013] Step 4: Concatenating the answer correct probability and the probability of the student answering the question correctly into a fusion feature vector, inputting the fusion feature vector into a multi-layer perceptron for nonlinear mapping, and outputting the final prediction probability of answering correctly.

[0014] In one embodiment, the collecting student programming homework data and preprocessing to obtain data samples comprises:

[0015] Collecting multi-modal homework data containing question information, student submitted code, student ID, and programming language category, and performing data cleaning to obtain data samples.

[0016] In one embodiment, the translating the data samples to obtain an English feature set comprises:

[0017] Selecting a pre-trained large language model with multi-language translation capability, designing a translation prompt word for guiding the large language model to translate Chinese questions and fields rich in professional terms into English to obtain an English feature set, the English feature set being represented as: , For the code submitted by the i th student on the j th question, for the question information translated into English, for the student ID, for the question ID; for the programming language category;

[0018] The translation prompt word comprises an instruction for the model to perform a translation task and an instruction to retain technical terms in the original text.

[0019] In one embodiment, the low-rank adaptation method is used to fine-tune the pre-trained semantic understanding model, including: freezing the pre-training weights of the semantic understanding model, introducing a trainable low-rank matrix beside the weights for parameter updating, and fine-tuning the pre-trained semantic understanding model.

[0020] In one embodiment, the input features are constructed based on the English feature set and the data sample, and the fine-tuned semantic understanding model is used to predict the correct answer probability, including:

[0021] A task instruction prompt word is designed, which requires the semantic understanding model to predict the correct answer probability according to the given programming problem description, student code and related metadata; wherein the metadata includes student ID and programming language type;

[0022] The input features including the student-submitted code, English feature set, student ID and programming language type are constructed, and the fine-tuned semantic understanding model is used to predict the correct answer probability in combination with the designed task instruction prompt word.

[0023] In one example, the graph neural network is structured based on the association between the question and the concept, including:

[0024] Taking the question and the concept as nodes, and establishing edges according to the semantic association between the question and the concept, a knowledge graph is established;

[0025] The semantic information of the question node and the concept node is converted into vector representation, and the initial feature vector is obtained after encoding; the initial feature vectors of the question node and the concept node are spliced to establish an initial node feature matrix;

[0026] According to the semantic association between the question and the concept, an original binary adjacency matrix is constructed, a unit matrix is added to the binary adjacency matrix, and symmetric normalization processing is performed to obtain a standardized adjacency matrix, thereby realizing the structural modeling of the graph neural network.

[0027] In one example, the embedding set is obtained by message propagation and feature updating through a multi-layer graph convolution network, including:

[0028] Based on the established graph neural network structure, the node features are updated at the first layer, and the update formula is: The embedding set is obtained by propagation through the layer: ;

[0029] wherein, is the node feature matrix of the first layer, is a learnable weight matrix, normalized adjacency matrix With node features Multiplication enables the aggregation of neighbor information. It is a non-linear activation function.

[0030] In one embodiment, the step of fusing the embedding set and the student embedding and inputting the result into the prediction layer to obtain the probability that the student answers the question correctly includes:

[0031] Extract the question embeddings and concept embeddings from the embedding set respectively;

[0032] Based on a specific problem, find all the concepts involved to build a concept set, and then aggregate the concept set through average pooling or attention mechanisms to obtain the aggregated concept embeddings;

[0033] The student embedding, question embedding, and aggregated concept embedding are fused together and input into the prediction layer to obtain the probability that the student answers the question correctly.

[0034] In one embodiment, when predicting the probability that a student answers a question correctly, the following loss function is established to optimize the update and output the probability that the student answers a question correctly:

[0035] ,

[0036] in, The loss function for the graph neural network structure; The number of training samples, i.e., the number of student-question pairs; For the first The student and the first Matching of each topic; This is a real label; This represents the students predicted by the graph neural network. Answer the question correctly. The probability of.

[0037] In one embodiment, when performing nonlinear mapping through a multilayer perceptron to output the final predicted probability of a student's answer, the following loss function is established to train and update the multilayer perceptron, outputting the final predicted probability of a correct answer:

[0038] ,

[0039] in, The loss function is the prediction probability of the final correct answer. The number of training samples, i.e., the number of student-question pairs; This is a real label; The student predicted by the multilayer perceptron Answer the question correctly. The probability of.

[0040] The application further provides a student programming answer prediction device combining semantic understanding and structured modeling, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, and the processor implements the student programming answer prediction method combining semantic understanding and structured modeling when executing the computer program.

[0041] Compared with the prior art, the application has beneficial effects at least including:

[0042] (1) In the data preprocessing stage, a large language model with translation capability is used to translate Chinese question information and professional terms into English to generate an English feature set, ensuring that the subsequent model can better understand the question. A large language model pre-trained with a large amount of code is fine-tuned to further understand the syntax errors, incomplete or non-standard structures that may be contained in the student's code in real situations, which makes up for the shortcomings of existing knowledge tracking models in real programming knowledge tracking, significantly improving the accuracy of model prediction.

[0043] (2) The application creatively uses a graph neural network to encode the Chinese text description of the question and the concept into an initial feature vector to construct a knowledge graph, which enables the model to capture the complex dependency relationship between knowledge points, making up for the shortcomings of traditional sequence modeling methods, and further fusing the outputs of the large language model and the graph neural network, significantly improving the accuracy of the model in predicting the correctness of the student's answer, and providing a scientific basis for personalized teaching and learning resource scheduling.

[0044] (3) The application proposes to use a multi-layer perceptron to combine and secondarily predict the prediction results of the large language model and the graph neural network, which fuses the prediction results of the large language model and the graph neural network, enabling the multi-layer perceptron to compare the real label with the prediction results of the two, and learn how to complement the advantages and disadvantages of the two, further improving the overall prediction accuracy.

[0045] (4) The student programming answer prediction method provided by the application greatly reduces the computing cost and storage overhead of the graphics card; in addition, this method is not only suitable for Chinese questions, but also can be extended to other language types if the model has the ability to understand foreign languages. Therefore, this low-cost solution enables the method to be deployed and applied in real large-scale online education platforms, thereby improving the feasibility and scalability of the application in real scenarios. BRIEF DESCRIPTION OF DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, brief introductions will be given to the drawings needed to be used in the embodiments or prior art descriptions.

[0047] Figure 1 A flowchart of a student programming answer prediction method combining semantic understanding and structured modeling is provided for an embodiment of the present application.

[0048] Figure 2 A framework diagram of a student programming answer prediction method combining semantic understanding and structured modeling is provided for an embodiment of the present application. DETAILED DESCRIPTION

[0049] To make the objectives, technical solutions, and advantages of the present application clearer, the following combines the drawings and specific embodiments for a further detailed description.

[0050] Embodiments of the present application are further described in detail. It should be understood that the specific embodiments described herein are merely intended to explain the present application and do not limit the scope of protection of the present application.

[0051] As shown in the accompanying drawings, Figure 1 The student programming answer prediction method combining semantic understanding and structured modeling provided by the present application includes the following steps:

[0052] S1, collect student programming homework data and preprocess to obtain data samples, and translate the data samples to obtain an English feature set. Specifically as follows:

[0053] 1. Data collection and deep cleaning: First, the present method systematically collects student homework submission data from large-scale online education platforms. These data are multi-modal, including but not limited to question information, student-submitted code, student ID, submission time, and corresponding programming language type. In order to ensure the quality and stability of subsequent model training, this step will strictly deep clean the original data. This includes identifying and deleting invalid or duplicate submission records, such as users submitting the same or slightly modified code multiple times. At the same time, any data samples lacking key fields (such as student ID, question ID, or code content) will be identified and excluded.

[0054] 2. Cross-language semantic alignment and feature expansion: In order to solve the limitation of Chinese questions for model understanding, the present application creatively uses a pre-trained large language model (LLM) with multi-language translation capability. In this embodiment, OpenAIGPT-4 is selected to translate the Chinese or professional term-rich question description into high-quality English. This process is achieved through a carefully designed prompt, for example: "Translate the following Chinese programming question description into clear and professional English, preserving technical terms <Chinese question text>". The translated English question information is added as a new feature column to the dataset, together with the original data to form a more comprehensive feature set, obtaining an English feature set:

[0055] ,

[0056] wherein, is the code submitted by the th student on the th problem, is the translated problem information in English, is the student ID, is the problem ID; is the programming language category; this step ensures that the subsequent model can handle and understand multilingual inputs, avoiding the decline in prediction performance due to language barriers.

[0057] wherein, the translation process using LLM includes: selecting a model OpenAI GPT-4 trained with multilingual text and having translation capability, to ensure accurate translation of Chinese and professional terms;

[0058] Taking each problem text as input, represents the Chinese problem information without translation, and the translated problem information is , for example: translate the following Chinese programming problem description into clear and professional English, and keep the technical terms: Given a Fahrenheit temperature Fº, this problem requires writing a program to calculate the corresponding Celsius temperature Cº. The calculation formula is: Cº=5*(Fº-32) / 9. It is guaranteed that the input and output are within the integer range.

[0059] 3. Scientific data set division: Finally, in order to verify the generalization ability and robustness of the model, this method divides the deeply cleaned and preprocessed data set into training set, validation set and test set according to a certain proportion. During the division process, special attention will be paid to ensure that the distribution of different students and different problems in each subset remains balanced, avoiding data leakage or bias, and laying a solid foundation for reliable training and performance evaluation of the model.

[0060] S2, using low rank adaptation method to fine tune the pre-trained semantic understanding model, based on English feature set and data sample to construct input feature, through the fine tuned semantic understanding model to predict the probability of answering correctly. Specifically as follows:

[0061] 1. Basic model selection: Choose a Decoder-only LLM (such as CodeLlama-7B) pre-trained with a large amount of code as the core semantic understanding model this time. This model has strong programming semantic and problem description understanding ability, and is suitable for providing good initialization for downstream prediction.

[0062] 2. Split the cleaned dataset into training and test sets, select the training set as the dataset for fine-tuning the LLM, then build the input features of the fine-tuned LLM: select the key features in each job record, including the student-submitted code , topic information , student ID , and programming language category ; and design task instruction prompts, first place the topic description at the beginning to make the model clear about the task goal and constraints; then add the student code part to allow the model to directly compare the code logic with the topic; finally, supplement the student number and programming language and other auxiliary features to allow the model to consider language characteristics and sample differentiation when judging, for fine-tuning, specifically: design clear task instructions for LLM to guide the model to predict the correctness of the answer: given a programming problem description, a student's code submission, and related metadata, predict the probability that the answer is correct; through task instruction prompts, the model focuses on the interaction between topic semantics and code logic when reasoning.

[0063] 3. Fine-tuning mechanism:

[0064] Select Decoder-only LLM and CodeLlama-7B pre-trained with a large amount of code for low-rank adaptation (LoRA) fine-tuning to reduce computational and storage overhead. This method only inserts a low-rank matrix next to part of the weights for training. The fine-tuning process can be represented by the following formula:

[0065] ,

[0066] where is the original weight of LLM, which is kept frozen; 、 is the low-rank matrix learned by LoRA, with rank This method can reduce the size of parameters while still maintaining strong representation ability for LLM. After LoRA fine-tuning, the LLM encodes the input to get the hidden vector representation : ;

[0067] 6. After fine-tuning, input the test set records into the fine-tuned LLM, and output the student's answer probability through the Prompt :

[0068] ,

[0069] where is the Sigmoid function, which maps the output to the [0, 1] interval as the predicted answer probability.

[0070] S3, based on the association between the problem and the concept, the graph neural network is structured and modeled, and the embedding set is obtained through multi-layer graph convolution network message propagation and feature update. The embedding set and the student embedding are fused and input into the prediction layer to obtain the probability of the student answering the question. Specifically as follows:

[0071] 1. Node feature initialization:

[0072] First, the semantic information of the problem and concept nodes is converted into vector representation. For the problem and the concept , their text descriptions are text and text respectively. The initial feature vector is obtained by encoding the Chinese pre-trained language model BERT-wwm:

[0073] Bert-wwm(text ),

[0074] Bert-wwm(text ;

[0075] All problem and concept nodes are concatenated to form the initial feature matrix , where is the total number of nodes, is the feature dimension. The matrix is the first layer input of GNN :

[0076] ,

[0077] where is the total number of nodes, is the vector dimension.

[0078] 2. Graph structure and standardized adjacency matrix construction

[0079] The graph structure is composed of problem nodes and concept nodes, and the problem is connected with the concept it involves. Let the adjacency matrix be , and the degree matrix be , where . To ensure numerical stability and avoid feature amplification, the symmetric normalized adjacency matrix is obtained:

[0080] ,

[0081] where is the identity matrix, which ensures that each node is at least connected to itself.

[0082] 3. Graph convolution layer propagation mechanism

[0083] Based on the established graph neural network structure, the node features are updated at the i-th layer, and the update formula is: The embedding set is obtained by propagating through the i-th layer: ;

[0084] wherein, is the node feature matrix of the i-th layer, is a learnable weight matrix, is a normalized adjacency matrix is multiplied by the node feature to realize neighbor information aggregation, is a nonlinear activation function such as ReLU.

[0085] 4. Node embedding extraction and concept aggregation

[0086] The question embedding and the concept embedding are extracted from the matrix Z: ;

[0087] For the concept set involved in the question , the aggregation function is defined as: , to obtain the aggregated concept embedding, wherein is the average pooling: , or the attention mechanism: .

[0088] 5. The student's embedding , the question embedding and the aggregated concept embedding are spliced together as the input of the final prediction model: , wherein represents the vector splicing operation.

[0089] Finally, a fully connected layer and a Sigmoid activation function are used to predict the probability of the student answering the question correctly:

[0090] ,

[0091] wherein, and are the weight and bias terms of the prediction model.

[0092] When predicting the probability of the student answering the question correctly, the following loss function optimization update is established to output the probability of the student answering the question correctly:

[0093] ,

[0094] ​​​​in, The loss function for the graph neural network structure; The number of training samples, i.e., the number of student-question pairs; For the first The student and the first Matching of each topic; This is a real label; This represents the students predicted by the graph neural network. Answer the question correctly. The probability of.

[0095] S4. Concatenate the probability of answering correctly with the probability of the student answering the question correctly to form a fused feature vector. Input this fused feature vector into a multilayer perceptron for nonlinear mapping, and output the final predicted probability of answering correctly. Details are as follows:

[0096] The probability of correct answer prediction obtained after LLM fine-tuning is: , indicating students On the issue The probability of answering the question correctly is obtained by Sigmoid mapping, resulting in a value in the interval [0,1].

[0097] The probability of a student answering a question correctly, obtained through GNN, is: ;

[0098] The predicted probabilities from LLM and GNN are vectorized and concatenated to form a fusion vector: ;

[0099] This vector, used as input to a multilayer perceptron (MLP), incorporates information from the fusion of semantic understanding and structured knowledge modeling capabilities. Through forward propagation and nonlinear mapping, the final predicted probability is obtained. :

[0100] First layer: ,

[0101] Second layer: ,

[0102] No. layer: ,

[0103] in, and The first Layer weight matrix and bias vector; The activation function is (the intermediate layer can be either ReLU or Tanh function, and the output layer is a Sigmoid function mapped to [0,1]). Number of MLP layers Students For the question the final answer probability. This value integrates the ability of LLM to understand the semantics of the code and the question and the ability of GNN to model the knowledge structure.

[0104] When the nonlinear mapping is performed by the multilayer perceptron, the final prediction probability of the student's answer is output, and the following loss function is established to train and update the multilayer perceptron to output the final prediction probability of the correct answer:

[0105] ,

[0106] wherein, is the loss function of the final prediction probability of the correct answer; is the number of training samples, that is, the number of student and question pairs; is the true label; represents the probability of the student answering the question correctly predicted by the multilayer perceptron.

[0107] The gradient calculation is performed on the weights and biases in the MLP using the backpropagation algorithm: The parameters are updated using an optimizer such as Adam or SGD: wherein is the learning rate. Repeat the forward propagation, calculate the loss function and update the parameters until the loss converges or the preset number of iterations is reached. The validation set can be used to monitor overfitting and adjust the learning rate or the number of layers.

[0108] During prediction and evaluation, the forward propagation is used to obtain for the test set samples, and the accuracy, AUC or F1-score is calculated to evaluate the prediction performance.

[0109] On the other hand, the embodiment of the present application also provides a student programming answer prediction device combining semantic understanding and structured modeling, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the student programming answer prediction method combining semantic understanding and structured modeling when executing the computer program.

[0110] In order to illustrate the feasibility and effectiveness of the student programming answer prediction method combining semantic understanding and structured modeling provided by the present application, the student programming answer prediction method is applied to a real university programming course dataset BePKT, and Table 1 shows the AUC of the present patent scheme and the traditional knowledge tracking model.

[0111] Table 1

[0112]

[0113] Table 1 shows that through the above steps, the user can obtain the final answer correctness prediction results of each student on each question, and can perform model evaluation or further analysis as needed. The entire process is simple to operate, can be repeatedly executed, and is convenient for application in different data sets and teaching scenarios.

[0114] In summary, the present application provides an efficient prediction method for programming knowledge tracking, which can approach the black box effect of existing knowledge tracking models in real programming data sets, and cannot handle problems with syntax errors, incomplete code or non-standard code. Through the present application, subsequent research can fully utilize the semantic information rich in students' historical code and the characteristics of the question text, and improve the interpretability and accuracy of the model prediction. At the same time, the present application provides a solution with low training cost and complexity, so that the method can be efficiently deployed and applied in large-scale online education platforms, thereby improving the adaptability and scalability of the knowledge tracking model in real classroom scenarios.

[0115] The specific embodiments described above describe the technical solutions and advantages of the present application. It should be understood that the above description is only the most preferred embodiment of the present application and is not intended to limit the present application. Any modifications, supplements and equivalent replacements made within the principle range of the present application shall be included in the protection scope of the present application.

Claims

1. A student programming answer prediction method combining semantic understanding and structured modeling, characterized in that, The method comprises the following steps: Step 1: Collecting student programming homework data and preprocessing to obtain data samples, and translating the data samples to obtain an English feature set; Step 2: Fine-tuning a pre-trained semantic understanding model using a low-rank fitting method, constructing input features based on the English feature set and the data samples, and predicting the correct answer probability through the fine-tuned semantic understanding model; Step 3: Structurally modeling the graph neural network based on the association relationship between the question and the concept, and performing message propagation and feature updating through a multi-layer graph convolution network to obtain an embedding set, and inputting the embedding set and the student embedding into the prediction layer to obtain the probability of the student answering the question correctly, wherein the structurally modeling the graph neural network based on the association relationship between the question and the concept comprises: taking the question and the concept as nodes, establishing edges according to the semantic association between the question and the concept, and establishing a knowledge graph; converting the semantic information of the question node and the concept node into vector representation, and obtaining the corresponding initial feature vector after encoding; concatenating the initial feature vectors of the question node and the concept node to establish an initial node feature matrix; constructing an original binary adjacency matrix according to the semantic association relationship between the question and the concept, adding an identity matrix to the binary adjacency matrix, and performing symmetric normalization processing to obtain a standardized adjacency matrix, thereby realizing the structural modeling of the graph neural network; Step 4: Concatenating the correct answer probability and the probability of the student answering the question to obtain a fusion feature vector, inputting the fusion feature vector into a multi-layer perceptron for nonlinear mapping, and outputting the final prediction probability of the correct answer, specifically: First layer: , Second layer: , First layer: , where, and are the first layer weight matrix and bias vector, respectively; is the activation function, ReLU function or Tanh function for the intermediate layers, and Sigmoid function for the output layer mapping to [0, 1], is the number of layers of the MLP, denotes the student 's final answer probability for a question .

2. The student programming answer prediction method of claim 1, wherein, The collecting student programming homework data and preprocessing to obtain data samples comprises: Collecting multi-modal homework data containing question information, student submitted code, student ID, and programming language types, and performing data cleaning to obtain data samples.

3. The student programming answer prediction method of claim 2, wherein, The translating the data samples to obtain an English feature set comprises: A pre-trained large language model with multi-language translation capability is selected, and a translation prompt word is designed to guide the large language model to translate the Chinese title and the field rich in professional terms into English to obtain an English feature set, which is expressed as: , is the code submitted by the th student on the th question, is the translated question information, is the student ID, is the question ID; and is the programming language category. The translation prompt word comprises: an instruction for the model to perform a translation task, and an instruction to retain technical terms in the original text.

4. The student programming answer prediction method of claim 1, wherein, The fine-tuning the pre-trained semantic understanding model using a low-rank fitting method comprises: freezing the pre-training weights of the semantic understanding model, introducing a trainable low-rank matrix beside the weights for parameter updating, and fine-tuning the pre-trained semantic understanding model.

5. The student programming answer prediction method of claim 4, wherein, The constructing input features based on the English feature set and the data samples, and predicting the correct answer probability through the fine-tuned semantic understanding model comprises: Designing a task instruction prompt word, wherein the task instruction prompt word requires the semantic understanding model to predict the correct answer probability based on the given programming question description, the student's code, and the related metadata; wherein the metadata includes the student ID and the programming language type; Constructing input features containing the student's submitted code, the English feature set, the student ID, and the programming language type, combining the designed task instruction prompt word, and predicting the correct answer probability through the fine-tuned semantic understanding model.

6. The student programming answer prediction method of claim 1, wherein, The inputting the embedding set and the student embedding into the prediction layer to obtain the probability of the student answering the question correctly comprises: Extracting question embeddings and concept embeddings from the embedding set, respectively; Based on a specific question, find all the concepts involved to establish a concept set, aggregate the concept set through average pooling or attention mechanism, and obtain the aggregated concept embedding; After fusing the student embedding, question embedding, and aggregated concept embedding, input them into the prediction layer to obtain the probability of the student answering the question correctly.

7. The student programming answer prediction method of claim 6, wherein, When predicting the probability of the student answering the question correctly, the following loss function is established to optimize and update the output of the probability of the student answering the question correctly: , in, The loss function for the graph neural network structure; The number of training samples, i.e., the number of student-question pairs; For the first The student and the first Matching of each topic; This is a real label; This represents the students predicted by the graph neural network. Answer the question correctly. The probability of.

8. The student programming answer prediction method of claim 1, wherein, When performing nonlinear mapping through a multilayer perceptron to output the final prediction probability of the student answering the question, the following loss function is established to train and update the multilayer perceptron to output the final prediction probability of answering the question correctly: , in, The loss function is the prediction probability of the final correct answer. The number of training samples, i.e., the number of student-question pairs; This is a real label; The student predicted by the multilayer perceptron Answer the question correctly. The probability of. 9.A student programming answer prediction device combining semantic understanding and structured modeling, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the student programming question answering prediction method combining semantic understanding and structured modeling according to any one of claims 1-8 when executing the computer program.

Citation Information

Patent Citations

  • Programming knowledge tracking method fusing code and score information

    CN118569447A

  • Learning condition analysis method and system based on large language model, terminal and medium

    CN120806747A