Fine-grained emotion-driven knowledge tracking method based on large language model embedding
By combining large language models with statistical analysis methods, emotional factors are extracted from students' non-emotional behavior data, and an emotional gain representation is constructed. This solves the problem that existing technologies cannot capture emotional influences, and enables more refined knowledge state assessment and prediction.
Patent Information
- Application Number
- CN202511492069.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-20
- Publication Date
- 2026-01-06
AI Technical Summary
Existing knowledge tracking methods cannot effectively capture the differentiated impact of different emotions on knowledge absorption, thus failing to provide personalized learning guidance.
By combining large language models and statistical analysis methods, emotional factors are extracted from students' non-emotion-oriented behavioral data. Emotional states are generated using emotion recognition algorithms, and emotional gain representations are constructed by combining feedforward networks and gating mechanisms to predict the probability of students answering questions correctly at the next moment.
It improves the accuracy and universality of emotional feature extraction without the need for additional emotional data collection, dynamically reflects the impact of emotions on learning performance, and enhances the predictive accuracy of knowledge mastery levels.
Smart Images

Figure CN121280197A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent educational analytics, specifically to a fine-grained emotion-driven knowledge tracking method based on large language model embedding. Background Technology
[0002] With the development of the internet and the widespread adoption of online education platforms, knowledge tracking has gradually become an important research topic in intelligent education. Faced with a vast amount of online educational resources, a crucial task for online learning platforms is to model the user's learning process and further provide personalized learning guidance. Knowledge tracking plays a key role in this process by continuously monitoring and evaluating students' interactions with online educational materials to track their knowledge status.
[0003] Emotions, as supplementary information in the learning process, can assist students' cognitive processing. However, existing knowledge tracking methods only treat emotions as singular emotional information, failing to capture the differentiated impact of various emotions on knowledge absorption. Therefore, how to integrate fine-grained emotions into the student learning process and analyze their impact on knowledge mastery is a new and challenging problem. Summary of the Invention
[0004] To address the problems existing in the prior art, this invention provides a fine-grained emotion-driven knowledge tracking method based on large language model embedding, which can achieve a more refined assessment of students' knowledge status and solve the problems mentioned in the background above.
[0005] To achieve the above objectives, the present invention provides the following technical solution: a fine-grained emotion-driven knowledge tracking method based on large language model embedding, comprising the following steps:
[0006] S1, Data Preprocessing;
[0007] S2. Constructing affective factors: Using large language models and statistical analysis methods, quantifiable affective factors are extracted from students' non-affective behavioral data.
[0008] S3. Identify emotional factors and generate emotional states using an emotion recognition algorithm;
[0009] S4. Embedded representation is performed by combining students' historical sequence information and emotional state, and emotional gain is obtained through feedforward network and gating mechanism.
[0010] S5. Combine emotional gain with knowledge status, and predict the probability of the student answering the exercise correctly in the next moment through the output layer;
[0011] S6. Construct training and testing sets for students' historical learning sequences, and use loss calculation to train the model to obtain the optimal model.
[0012] Preferably, in step S1, data preprocessing includes data segmentation, data cleaning, and data serialization. Data segmentation refers to dividing the data according to different types and extracting student ID, skill, question ID, answer duration, and answer result into the same file. Data cleaning includes encoding mapping, index resetting, data missing handling, and student serialization. Data serialization refers to performing fixed-length serialization on the cleaned data to form input data that can be input into the model.
[0013] Preferably, step S2 specifically includes:
[0014] S21. Input the answer data for each knowledge point, including the number of correct answers, answer time, and answer results, into the large language model GLM-4-Flash so that the large language model can output the student's confidence and anxiety level for each knowledge point.
[0015] S22. Using statistical analysis methods, the centered first moment of the knowledge point accuracy rate is mapped to student confidence, and the centered first moment of the answering time is mapped to student anxiety, in order to alleviate the illusion problem of the large language model and enhance the reliability of subsequent emotion recognition. The calculation method for the student emotion factor "affect" is as follows:
[0016]
[0017] in, This represents the number of knowledge points in the knowledge point set, where k represents the index in the knowledge point set. This represents the sentiment factor corresponding to the k-th knowledge point. This represents the average value of the emotional factor within the set of knowledge points.
[0018] S23. The confidence and anxiety levels obtained by the large language model and statistical analysis methods are weighted and processed, wherein the weights are determined by trainable parameters, to obtain the final sentiment factors conf and anx.
[0019] Preferably, step S4 specifically includes:
[0020] S41. The emotional state embedding is concatenated with the question embedding and the answer result embedding, and the theoretical emotional gain is calculated using the hyperbolic tangent function, expressed as:
[0021]
[0022] in, This represents the embedding vector of the question. This represents the embedding vector of the answer result. Represents the emotional state embedding vector. This represents a vector concatenation operation. Represents a trainable matrix, This represents the bias vector. It is an activation function;
[0023] S42. The emotional state embedding, question embedding, and answer result embedding are concatenated, and the knowledge absorption weight γ is calculated using the Sigmoid function. Then, the knowledge absorption weight γ is combined with the theoretical emotional gain gain obtained in step S41 to calculate the emotional gain LG that reflects the student's actual situation, expressed as:
[0024]
[0025] Preferably, in step S41, the emotional factors obtained in step S23 are processed by an emotional feature alignment method and a bidirectional gated recurrent unit (BiGRU) to identify the student's emotional state and generate a corresponding embedding vector.
[0026] Preferably, step S6 specifically includes:
[0027] S61. Concatenate the knowledge state with the embedding vector of the next time step's exercises, perform a linear transformation, and then process the vector using the Sigmoid activation function to generate the student's prediction of the next time step's exercises. The prediction... The calculation method is as follows:
[0028]
[0029] in, This represents the question embedding vector at the next time step. This represents the student knowledge state vector adjusted for affective gain. This represents the activation function. Represents a trainable matrix, Represents the bias vector;
[0030] S62. In the method, the student's historical practice sequence data is divided into a training set and a test set, wherein the training set is used for model training and the test set is used for model evaluation; correctly answered questions in the training data are marked as positive samples; the difference between the predicted output and the true label is calculated using the binary cross-entropy function, the calculation method of which is expressed as follows:
[0031]
[0032] in, This represents the true answer label for the t-th exercise. Let represent the predicted probability of the model for the t-th exercise, and T represent the total number of exercises in the training data.
[0033] The beneficial effects of this invention are:
[0034] 1) A method for extracting emotional factors from students' non-emotionally oriented behavioral data is proposed: This invention combines statistical analysis with a large language model to automatically extract emotion-related features from students' behavioral data, thereby reducing data acquisition costs without the need for additional emotional data collection and improving the universality and scalability of the method.
[0035] 2) A method for modeling the fusion of emotion and knowledge state is proposed: Compared with existing knowledge tracking methods, this invention constructs a student's emotion gain representation based on emotion recognition, and combines a feedforward network and a gating mechanism for modeling. This can dynamically reflect the positive or negative impact of emotion on learning performance, thereby making the knowledge state assessment more consistent with the actual learning scenario and improving the accuracy and rationality of knowledge mastery prediction. Attached Figure Description
[0036] Figure 1 This is a schematic diagram of the process steps of the method of the present invention. Detailed Implementation
[0037] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0038] Example 1
[0039] Fine-grained sentiment-driven knowledge tracking methods based on large language model embedding, such as Figure 1 As shown, the process includes: 1. Preprocessing the data to form standardized data that meets the model input requirements; 2. Extracting emotional factors from students' non-emotionally driven behavioral data on knowledge points, and combining statistical analysis methods with a large language model to identify and model the emotional factors to obtain students' emotional states; 3. Integrating the emotional states with knowledge state representations to construct emotional gains and generate knowledge state representations with fine-grained emotional influences; 4. Predicting based on the knowledge state representations and question embeddings, outputting the probability of students answering correctly at the next moment, and evaluating students' knowledge mastery level through model training.
[0040] Assessing a student's knowledge status using deep learning methods includes the following steps:
[0041] 1) Data Preprocessing: The Assistments2017 dataset contains 940,000 responses from 686 students, covering 102 knowledge points. To better assess students' knowledge status, we first need to perform the following operations on the data:
[0042] 1-1) The data is segmented according to different types. In response to the problem that this invention needs to solve, we extract five types of data: student ID, skill, question ID, answer duration, and answer result.
[0043] 1-2) Perform data cleaning on the five types of data respectively, including encoding mapping, index reset, data missing handling and student serialization;
[0044] 1-3) Perform fixed-length serialization on the cleaned data to generate data that can be directly input into the model;
[0045] 2) By combining statistical analysis methods and large language models, sentiment factors are extracted from non-emotionally driven behavioral data such as the number of correct answers, answering time, and answer results for each knowledge point:
[0046] 2-1) Input the number of correct answers, answering time and answering results of students on each knowledge point into the large language model GLM-4-Flash. The large language model outputs the corresponding confidence and anxiety levels. The confidence and anxiety levels are used as emotional factors for subsequent emotional modeling and knowledge state fusion.
[0047] 2-2) To alleviate the illusion problem of large language models, we also used statistical analysis to map the centralized first moment of the knowledge point accuracy rate to the student's confidence level and the centralized first moment of the answer time to the student's anxiety level, so as to enhance the reliability of subsequent emotion recognition.
[0048] 3) The obtained emotional factors are processed by emotional feature alignment technology and bidirectional gating loop unit to identify the emotional factors as positive or negative emotions for subsequent integration with students' knowledge status;
[0049] 4) To construct the impact of students' different emotions on their answers to this question, it is necessary to model the students' emotional gain for this question based on the emotional states obtained in 3).
[0050] 4-1) Based on the emotional state, establish the student's emotional gain under the current question, embed the emotional state into a representation, and concatenate it with the question embedding and the answer result embedding. The theoretical emotional gain is obtained by using the tanh activation function.
[0051] 4-2) Considering students' knowledge absorption capacity, a knowledge absorption weight is set, and the weight is multiplied by the theoretical emotional gain to obtain an emotional gain that conforms to the real learning scenario.
[0052] 5) Integrate students' knowledge status with emotional gain, and make positive or negative adjustments according to emotional status to obtain a knowledge representation of the emotional influence. Embed the representation with the questions and skills of the next time step, process it through a linear layer, and output the probability of the student answering the next question correctly through the sigmoid function to complete the model training and realize the prediction of future learning performance.
[0053] Example 2
[0054] Fine-grained sentiment-driven knowledge tracking methods based on large language model embedding, such as Figure 1 As shown, the scheme for assessing the knowledge status of different students includes the following implementation steps:
[0055] 1) Data Preprocessing: The Assistments2017 dataset contains 940,000 responses from 686 students, covering 102 knowledge points. To better assess students' knowledge status, we first need to perform the following operations on the data:
[0056] 1-1) The data is segmented according to different types. In response to the problem that this invention needs to solve, we extract five types of data: student ID, skill, question ID, answer duration, and answer result.
[0057] 1-2) Perform data cleaning on the data in 1-1), including encoding mapping, index reset, missing data handling, and student serialization;
[0058] 1-2-1) Data missing handling: Perform data missing handling on the skills and question IDs in the dataset, remove the interaction data with missing skills and question IDs, and arrange the data in chronological order;
[0059] 1-2-2) Encoding Mapping: Encode knowledge points and questions as consecutive integer IDs, starting from 1;
[0060] 1-2-3) Student serialization: Extract the answer sequence of each student's data, including question ID, knowledge point ID, answer result, and answer time, and store it in the form of a tuple, and write it to file 1;
[0061] 1-2-4) Reset the index: Reset the index of student IDs in file 1 to ensure the continuity and consistency of sample sequence numbers, and write the processed data into file 2;
[0062] 1-3) Perform fixed-length serialization on the cleaned data in 1-2). For student answer sequences with a length exceeding 500, divide them into several continuous subsequences with a fixed length of 500. For sequences with a length less than 500, use zero padding to expand them into sequences with a length of 500.
[0063] 2) Extract sentiment factors from non-emotionally driven behavioral data such as the number of correct answers, answering time, and answer results for each knowledge point:
[0064] 2-1) Configure the necessary runtime environment for the GLM-4-Flash large language model on the local computer, including GPU driver, Python language environment, and run the large language model;
[0065] 2-2) We input the number of correct answers, answer time, and answer results for each knowledge point into the large language model GLM-4-Flash. The large model outputs the student's confidence level (denoted as llm_conf) and anxiety level (denoted as llm_anx) for each knowledge point.
[0066] ### Instruction: Gives the number of correct answers, answer time, answer results for each knowledge point, and returns the JSON format of thesentiment factor
[0067] ### Input: { Relevant information about knowledge concepts}
[0068] ### Response: { Sentiment Factor};
[0069] 2-3) To alleviate the illusion problem of large language models, we also use statistical analysis to map the centralized first moment of knowledge point accuracy to student confidence (denoted as static_conf), and the centralized first moment of answering time to student anxiety (denoted as static_anx), to enhance the reliability of subsequent emotion recognition. The student emotion factor 'affect' is calculated as follows:
[0070]
[0071] in, This represents the number of knowledge points in the knowledge point set, where k represents the index in the knowledge point set. This represents the sentiment factor corresponding to the k-th knowledge point. This represents the average value of the emotional factor within the set of knowledge points.
[0072] 2-4) The confidence and anxiety levels obtained by the large language model and statistical analysis methods are weighted through trainable parameters to obtain the final sentiment factors conf and anx, which are then used in the subsequent sentiment modeling and knowledge state fusion process.
[0073] 3) By using emotional feature alignment and bidirectional gated loop unit technology, the emotional factors obtained in 2) are identified as positive or negative emotional states, so as to be integrated with the students' knowledge status in the future;
[0074] 3-1) Sentiment Feature Alignment Technique: The sentiment factors obtained in the previous step are concatenated and subjected to linear transformation to obtain the sentiment alignment feature, which is calculated as follows:
[0075]
[0076] in, This represents the students' emotional confidence level regarding each knowledge point. Anxiety level sentiment factor representing the level of anxiety at each knowledge point. Represents a trainable matrix, This represents the bias vector. This represents a vector concatenation operation;
[0077] 3-2) The sentiment factors conf and anx are concatenated with the sentiment alignment feature feat obtained in 3-1) and input into the bidirectional gated recurrent unit BiGRU to obtain a sentiment feature representation with context awareness.
[0078] 3-3) The tensors obtained from 3-1) and 3-2) are processed by the softmax function to generate the final sentiment state representation;
[0079] 4) In order to construct the impact of students' different emotions on the answer results of the question, it is necessary to model the theoretical emotional gain of students on the question based on the emotional state obtained in 3). Considering the students' knowledge absorption capacity, a knowledge absorption weight is set and multiplied by the theoretical emotional gain to finally obtain the emotional gain that conforms to the real learning scenario.
[0080] 4-1) Constructing the theoretical sentiment gain: Concatenate the sentiment state embedding obtained in 3) with the question and answer result embeddings, and calculate the theoretical sentiment gain using the tanh function, expressed as:
[0081]
[0082] in, This represents the embedding vector of the question. This represents the embedding vector of the answer result. Represents the emotional state embedding vector. Represents a trainable matrix, This represents the bias vector. It is an activation function;
[0083] 4-2) The emotional state embedding, question embedding, and answer result embedding are concatenated, and the knowledge absorption weight γ is calculated using the Sigmoid function. Then, the knowledge absorption weight γ is combined with the theoretical emotional gain gain obtained in step S41 to calculate the emotional gain LG that reflects the student's actual situation. The calculation method is expressed as follows:
[0084]
[0085]
[0086] in, Represents a trainable matrix, This represents the bias vector. This represents the Sigmoid activation function;
[0087] 5) The student's knowledge state representation is fused with the emotional gain obtained in 4) to generate a knowledge state representation with fine-grained emotional influence. Specifically, the knowledge state representation is adjusted according to the student's emotional state. When the student is in a positive emotional state, the knowledge state representation is positively adjusted, and when the student is in a negative emotional state, the knowledge state representation is negatively adjusted, so as to obtain the final knowledge state representation after the fusion of emotional influence.
[0088] 6) Based on the knowledge state representation obtained in the previous step, construct a student answer performance prediction model, divide the student's historical learning sequence into a training set and a test set, and train the model by calculating the loss function to optimize the prediction performance.
[0089] 6-1) The knowledge state obtained in 5) is concatenated with the embedded information of the next time step's exercise. After a linear transformation, the sigmoid function is used to predict the student's prediction of the next time step's exercise. The calculation formula is as follows:
[0090]
[0091] in, This represents the question embedding vector at the next time step. This represents the student knowledge state vector adjusted for affective gain. Represents a trainable matrix, Represents the bias vector;
[0092] 6-2) Model Training: The student's historical practice sequence data is divided into a training set and a test set, with the training set accounting for 80% and the test set accounting for 20%. Correctly answered questions from the data are used as positive samples. The model is evaluated using functions built into the Scikit-learn package, and the binary cross-entropy function is used as the loss function to measure the difference between the predicted probability and the true label. The calculation formula is as follows:
[0093]
[0094] in, This represents the true answer label for the t-th exercise. Let represent the predicted probability of the model for the t-th exercise, and T represent the total number of exercises in the training data.
[0095] This concludes all the steps in the fine-grained emotion-driven knowledge tracking method based on large language model embedding described in this invention for evaluating students' knowledge status.
[0096] This invention enables the automatic extraction of emotional factors from students' non-emotionally driven behavioral data without relying on additional sentiment-annotated data, significantly reducing the cost of emotional data collection. Furthermore, by combining statistical analysis methods with a large language model, the accuracy and generalization ability of emotional feature extraction are improved, making the method adaptable to various educational scenarios and learning platforms. This invention further proposes a mechanism for fusing emotional and knowledge state modeling. By constructing a representation of students' emotional gain and introducing feedforward networks and gating structures for dynamic modeling, it can effectively capture the positive or negative moderating effects of emotional factors on the knowledge acquisition process, thereby improving the rationality of knowledge state assessment and the accuracy of prediction.
[0097] Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A fine-grained sentiment-driven knowledge tracing method based on large language model embedding, characterized in that, The method comprises the following steps: S1, data preprocessing; S2, constructing an emotional factor, using a large language model and a statistical analysis method to extract quantifiable emotional factors from the non-emotionally oriented behavior data of students; S3, identifying the emotional factors through an emotional recognition algorithm to generate an emotional state; S4, embedding the student historical sequence information and the emotional state, and obtaining an emotional gain through a feedforward network and a gating mechanism; S5, combining the emotional gain with the knowledge state, and predicting the probability of the student's correct answer to the next question through the output layer; S6, constructing a training set and a test set of the student's historical learning sequence, and training the model through loss calculation to obtain an optimal model.
2. The fine-grained sentiment-driven knowledge tracing method based on large language model embedding according to claim 1, characterized in that: In step S1, data preprocessing includes data segmentation, data cleaning, and data serialization processing; the data segmentation refers to dividing the data according to different types, extracting student ID, skill, question ID, answer time, and answer result into the same file; the data cleaning includes encoding mapping, index resetting, data missing processing, and student serialization; the data serialization processing refers to the fixed-length serialization processing of the cleaned data to form input data that can be input into the model.
3. The fine-grained sentiment-driven knowledge tracing method based on large language model embedding according to claim 1, characterized in that: In step S2, the following steps are included: S21, input the answer data for each knowledge point, including the number of correct answers, answer time, and answer result into the large language model GLM-4-Flash, so that the large language model outputs the student's confidence and anxiety in each knowledge point; S22, use statistical analysis methods to map the centering first moment of knowledge point accuracy to student confidence and the centering first moment of answer time to student anxiety, to alleviate the illusion problem of the large language model and enhance the reliability of subsequent emotional recognition, wherein the calculation method of the student emotional factor affect is: wherein, represents the number of knowledge points in the knowledge point set, k represents the index in the knowledge point set, represents the sentiment factor corresponding to the kth knowledge point, represents the average value of the sentiment factor within the range of the knowledge point set; S23, weight the confidence and anxiety obtained by the large language model and the statistical analysis method, wherein the weight is determined by a trainable parameter, to obtain the final emotional factors conf and anx.
4. The fine-grained sentiment-driven knowledge pursuit method based on large language model embedding according to claim 1, characterized in that: The step S4 specifically includes: S41, splice the emotional state embedding, question embedding, and answer result embedding, and calculate the theoretical emotional gain gain through the hyperbolic tangent function, represented as: wherein, denotes a question embedding vector, denotes an answer embedding vector, denotes an emotion state embedding vector, denotes a vector concatenation operation, denotes a trainable matrix, denotes a bias vector, is an activation function; S42, splice the emotional state embedding, question embedding, and answer result embedding, and calculate the knowledge absorption weight γ through the Sigmoid function, then combine the knowledge absorption weight γ with the theoretical emotional gain gain obtained in step S41 to calculate the emotional gain LG that conforms to the student's real situation, represented as:
5. The fine-grained sentiment-driven knowledge tracing method based on large language model embedding according to claim 4, characterized in that: In step S41, the emotional factors obtained in step S23 are processed through an emotional feature alignment method and a bidirectional gated recurrent unit (BiGRU) to identify the emotional state of the student and generate the corresponding embedding vector.
6. The fine-grained sentiment-driven knowledge pursuit method based on large language model embedding according to claim 1, characterized in that: In step S6, the following steps are included: S61, the knowledge state is spliced with the next time exercise embedding vector, processed through linear transformation and Sigmoid activation function, to generate the student's prediction for the next time exercise, wherein the prediction The calculation method is as follows: wherein, denotes the next time topic embedding vector, denotes the student knowledge state vector adjusted by the sentiment gain, denotes an activation function, denotes a trainable matrix, denotes a bias vector. S62, in the method, student historical exercise sequence data is divided to form a training set and a test set, wherein the training set is used for model training, and the test set is used for model evaluation; the exercises answered correctly by the student in the training data are marked as positive samples; the difference between the predicted output and the true label is calculated by a binary cross-entropy function, and the calculation method is represented as: wherein, denotes the true answer label of the t-th exercise, denotes the predicted probability of the model for the t-th exercise, and T denotes the total number of exercises in the training data.