A prompt learning knowledge tracking method and system applied to smart education
By using BERT-based pre-training tasks and prompt template prompt optimization methods in knowledge tracking, the problems of high training cost and insufficient performance under small sample data in the existing technology are solved, and efficient performance under small sample data volume is achieved. Knowledge tracking performance.
Patent Information
- Application Number
- CN202410913874.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-07-09
AI Technical Summary
It is difficult for the existing technology to balance training sample performance and training cost in knowledge tracking. It is especially difficult to achieve the expected prediction performance under small sample data volumes, and the training cost of solutions based on traditional fine-tuning is high.
A BERT-based framework is used to design a pre-training task suitable for students to practice sequence semantic understanding, and a prompt template is designed to describe the prediction problem as the same sequence expression as the mask training task in the pre-training stage, based on the pre-training model. Prompt tuning, performs the same masking task, and implements knowledge tracking.
In the scenario of small sample data volume, the model performance is comparable to or even surpasses the traditional fine-tuning scheme, while greatly reducing the investment in training samples and model parameters, effectively balancing performance and training cost.
Smart Images

Figure CN118485081B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of data processing technology, and in particular, relates to a method and system for prompting learning knowledge tracking applied to smart education. Background Art
[0002] Knowledge tracking is an important application of smart education, which aims to model and analyze students' learning behaviors, accurately track changes in students' knowledge status, and predict students' performance in future exercises. Due to the development of deep learning, its efficient training and better performance have almost completely replaced earlier statistical learning and even traditional machine learning methods. So far, the research on deep knowledge tracking has formed a complete research system from model design, modeling optimization, training techniques to data set analysis. However, there are still some major defects and loopholes that can be further optimized.
[0003] Some early deep learning methods used simple neural network layers to complete learning tasks. The existing technology provides some methods that try to consider some explicit behavioral features by adding educational theory, forgetting theory, etc., but these methods face the difficulty of modeling long sequences. The simple networks such as RNN used by them are difficult to accurately track students' knowledge changes. In the existing technology, the self-attention mechanism was proposed and played a key role in the Transformer model. The attention mechanism can handle variable-length sequences well, reduce dependence on external information, and is better at capturing the internal correlation of data or features. Some methods such as SAKT (2019) and AKT (2020) use the sequence modeling idea of the attention mechanism. However, due to the inherent sparsity of educational data, each student's learning interaction only involves a small part of the exercises, which leads to data sparsity problems. Therefore, it is difficult for the above methods to make full use of student interaction data to obtain sufficient feature information. With the introduction of large language models (LLMs), such as BERT (2018) and GPT (2018), pre-training mechanisms have been widely used in various natural language (NLP) tasks. Accordingly, many new knowledge tracing studies consider introducing pre-training strategies. The typical approach is to first train an upstream model that can represent changes in student knowledge or the relationship between different entities to learn deeper feature representations. Then, the model is connected to downstream networks such as classifiers for knowledge tracing tasks and fine-tuned to adapt to downstream tasks. At present, some methods combine the structure and training techniques of these large prediction models to mine the common features of student practice sequences, including BEKT (2021), BiDKT (2022), etc. Other methods mainly use graph structures to model the relationship between learning entities (exercises, concepts, etc.) to pre-train and obtain richer exercise embedding representations, which are used to improve the performance of downstream models, such as PEBG (2021), SGKT (2022), HIN-KT (2023), etc.
[0004] The addition of pre-training strategy can effectively alleviate the performance bottleneck caused by data sparsity, and has shown great advantages in improving prediction performance. However, the current knowledge tracking solution is based on a two-stage training paradigm of pre-training + fine-tuning, which requires more data input, more complex model structure and training cost. Specifically, the upstream model is first pre-trained on a large number of data samples by a new objective function, with the aim of learning the general representation of knowledge. The objective function of this stage is different from that of the specific downstream task, so additional training cost is required. After the pre-training is completed, the output of the upstream model will be transmitted to the downstream model used to complete the knowledge tracking prediction task, which is equivalent to splicing two models. Subsequently, the entire model is retrained under the objective function of the downstream task, which means that the pre-trained model must also be fine-tuned. In this way, whether in terms of training samples, model complexity or training cost, it requires more investment than previous methods. Therefore, in scenarios with limited resources and time, this deployment solution is often difficult to meet the requirements. At present, the best performing knowledge tracking method can achieve 80% prediction accuracy on existing public data sets, which can fully meet the performance requirements for tasks such as personalized recommendation in smart education systems. If you blindly pursue better prediction performance, it often takes longer and costs more to deploy.
[0005] In order to solve the problem of high cost of traditional pre-training, the latest large language models, such as GPT-3 (2020), use the technique of prompt learning, striving to match or even surpass the fitting performance of traditional fine-tuning on a large amount of training data on small sample data. Prompt learning refers to adding specific prompts (such as task descriptions, examples, etc.) to the model input to guide the model to understand and perform specific tasks without directly modifying the model's parameters, thereby avoiding retraining the entire model. Prompt learning is particularly suitable for situations where data is scarce, that is, when the amount of data is small, prompt learning can often better utilize the "knowledge" learned by the pre-trained model and show better performance. At present, many solutions in the field of NLP have adopted prompt learning to solve problems such as text classification, including PET (2021), KPT (2022), CIPLUD (2023), etc.
[0006] Through the above analysis, the problems and defects of the existing technology are as follows: the existing technology cannot effectively balance the performance of training samples and the training cost in knowledge tracking, and the training cost is high. At the same time, when it is necessary to reduce the training cost and choose to deploy the model on a small sample data volume, the existing solution based on traditional fine-tuning is difficult to achieve the expected prediction performance. Summary of the invention
[0007] In order to overcome the problems existing in the related art, the disclosed embodiments of the present invention provide a method and system for tracking learning knowledge applied to smart education.
[0008] The technical solution is as follows: a prompt learning knowledge tracking method applied to smart education, comprising:
[0009] S1, the BERT-based framework design is suitable for pre-training tasks for students to practice sequence semantic understanding, and obtains rich semantic representations of students' learning behaviors;
[0010] S2, design a prompt template to describe the prediction problem as the same sequence formulation as the mask training task in the pre-training stage;
[0011] S3, performs prompt tuning based on the pre-trained model, performs the same masking task, and realizes knowledge tracking in the scenario of small sample data volume.
[0012] Before step S1, data construction is required, including:
[0013] In the pre-training stage, the LKM model takes the student's compound learning sequence as input; the student's compound learning sequence consists of four types of data: exercise sequence, concept sequence, answer sequence and exercise difficulty sequence;
[0014] The LKM module model accepts embedded input and first converts the sequence into an embedded representation. Elements , the composite embedding is denoted as the training embedding , Concept Embedding , answer embedding , Difficulty Embedding and position embedding vector sum of concepts Embed for practice The average embedding of all concepts involved, let represents the model dimension, then According to the calculation formula of sine and cosine position encoding in Transformer, the expression is:
[0015] ;
[0016] In the formula, For the moment Corresponding position embedding No. elements, For the current moment, is the element used to index the embedding vector, is the model dimension;
[0017] The LKM model outputs the hidden layer vectors located at [CLS] and all [MASK] positions, which are used to calculate the loss function to optimize pre-training;
[0018] In the prompt tuning stage, the LKM model is pre-trained and used to process the student sequence; the PE model is used to encode the prompt sequence, which is concatenated with the embedded representation of the prompt template and input into the hidden layer of the LKM model. Only the hidden layer vectors of all [MASK] positions are output to complete KT prediction and prompt tuning.
[0019] In step S1, the BERT-based framework is designed to be suitable for students to practice sequence semantic understanding pre-training tasks, including:
[0020] Firstly, we build a large knowledge model LKM composed of 8 layers of Transformer Encoder. According to the temporal characteristics and dependencies of student sequences, we design two training tasks: front-back order prediction FBO and random word mask RTM. Under multi-task joint training, LKM fully learns the semantic representation of student learning sequences, and at the same time, it mines the intrinsic patterns and characteristics of students' practice behaviors at both coarse-grained and fine-grained levels.
[0021] Random word mask RTM is used to combine the previous and subsequent interactions of students to determine the interaction behavior of students at a certain moment, i.e., fine-grained features. For the FBO task, each original learning sequence is divided into two segments from the middle, called segment-a and segment-b. All segments are recombined into a new sequence. If the recombined sequence can be restored to a certain original sequence, the new sequence is marked as a positive sample; otherwise, it is marked as a negative sample.
[0022] For the FBO task, the [CLS] and [SEP] special tokens given in BERT are introduced. The [CLS] token is located at the front of the entire sequence and is used for sequence semantic representation and FBO order prediction. It is followed by segment-a and segment-b, and a [SEP] token is inserted between the two segments for segment division.
[0023] For the RTM task, the masking idea of BERT is introduced; 15% of the tokens in the sample sequence are selected as the candidate set, and the idea of masking 15% of the tokens is applicable to the training tokens and answer tokens;
[0024] After constructing the embedding of the sample sequence, it is input into the LKM model and after 8 layers of Transformer attention calculation, we get:
[0025] (a) Hidden layer vector representation of the [CLS] position;
[0026] (b) Vector representation corresponding to all 15% of the mask bits.
[0027] The 15% of words include:
[0028] ①80% of the words are replaced with [MASK] special words;
[0029] ②10% of the words are randomly replaced with any word, excluding special words [CLS], [SEP] and [MASK];
[0030] ③The remaining 10% of the words remain unchanged and the original information can be recognized.
[0031] Step (a) is used for the FBO task to determine whether the represented sequence is a positive sample or a negative sample and calculate the FBO loss, that is, the binary cross entropy loss, which is expressed as:
[0032] ;
[0033] In the formula, It is the abbreviation of FBO Loss. is the total number of samples, For the The actual labels of the samples, For the The probability that a sample is predicted as a positive sample;
[0034] Step (b) is used for the RTM task to determine whether the original content of the masked position can be restored. For training word meta-masking, the multivariate cross entropy loss is calculated, which is expressed as:
[0035] ;
[0036] In the formula, is the multivariate cross entropy loss function, To index the masked tokens in the summation formula, is the total number of masked tokens, To practice indexing in summation formulas, is the total number of exercises, For practice Classified into The probability of the categories, For practice Classified into The labels of the categories; if It is categories, then otherwise ;
[0037] For the answer word mask, the binary cross entropy loss is calculated, and the expression is:
[0038] ;
[0039] In the formula, is the binary cross entropy loss function, for The student's answer label at the moment, for Always predict the probability that the student will answer correctly;
[0040] Accordingly, the RTM loss is obtained, expressed as:
[0041] ;
[0042] In the formula, It is the abbreviation of RTM Loss;
[0043] Minimize the two losses and complete the LKM training task. The expression is:
[0044] ;
[0045] In the formula, is the loss function.
[0046] In step S2, a prompt template is designed to describe the prediction problem as a sequence representation that is the same as the mask training task in the pre-training phase, including:
[0047] First, pseudo-words are introduced. Instead of using word-grams with specific meanings to represent templates, abstract virtual word-grams are used to construct input forms that can guide the model to complete downstream tasks.
[0048] Subsequently, these pseudo-words are encoded by the new encoder to complete the fusion with the original input;
[0049] Finally, the fused cue encoding is input into the pre-trained LKM to obtain the corresponding output.
[0050] In step S2, the design prompt template further includes:
[0051] For the hard prompt template used for natural semantic expression, construct a prompt sequence, expressed as a mapping , the expression is:
[0052] ;
[0053] In the formula, Learning sequence for students The process of constructing a prompt sequence using a hard template, is the semantic representation of the entire sequence, Learning sequence for students, For the exercises that the student will do at time T in the future, is the mask word;
[0054] To avoid encoding inconsistency, pseudo-words are directly introduced for the knowledge tracking task to obtain pseudo-sequences:
[0055] ;
[0056] In the formula, is a pseudo sequence composed of pseudo-words, is the first pseudo-word, is the second pseudo-word, For the Pseudo-words;
[0057] Each location Indicates word units, prompting the sequence to be remapped It is expressed as:
[0058] ;
[0059] Get a knowledge-guided sequence of prompts:
[0060] ;
[0061] In the formula, Learning sequence for students The process of constructing a prompt sequence using a soft template;
[0062] The training word is designed to assist model training; the training word to be predicted is masked, but the answer word is not masked; the auxiliary prompt sequence is expressed as:
[0063] ;
[0064] In the formula, For practice The knowledge concepts involved For practice The answer tag.
[0065] In step S3, prompt tuning is performed based on the pre-trained model, including:
[0066] First, the prompt encoder PE model is introduced to encode the prompt sequence; the prompt encoder PE model is constructed by a 4-layer Transformer Encoder; first, for each pseudo-word Constructing the initial embedding representation , and then sent to the PE model to obtain its hidden layer output , as the feature representation of the word; for the original student sequence, the embedding layer in the pre-trained LKM is used to obtain the corresponding composite embedding representation according to the previous method; for the key words in the prompt template, including , and obtain the corresponding embedding representation , and then, following the prompt input construction method similar to that in current NLP tasks, the above embeddings are concatenated to obtain the final prompt input representation:
[0067] ;
[0068] In the formula, is the embedding representation corresponding to the prompt sequence, is the embedding representation of the [CLS] lemma, For students’ interactive embedding at time 1, For students in Momentary interactive embedding, For practice The embedding representation of for The embedding representation of is the embedding representation of the [MASK] word, Pseudo-word The embedding representation of Pseudo-word Embedded representation of ;
[0069] The above embedded representation is input into the pre-trained LKM hidden layer, and the final hidden layer output is obtained; similar to the mask task RTM in the pre-training stage, the [MASK] representations that mark the practice position and the answer position are taken out respectively, and the cross entropy loss function is calculated to complete the multi-prompt model tuning.
[0070] After step S3, parameter configuration is performed to achieve the knowledge tracking goal and balance the prediction performance and training cost.
[0071] Another object of the present invention is to provide a prompt learning knowledge tracking system applied to smart education, the system implements the prompt learning knowledge tracking method applied to smart education, and the system includes:
[0072] The pre-training module is used to design pre-training tasks suitable for students to practice sequence semantic understanding based on the BERT framework, and obtain rich semantic representations of students' learning behaviors;
[0073] The prompt template design module is used to design the prompt template and describe the prediction problem as a sequence representation that is the same as the mask training task in the pre-training stage;
[0074] The prompt tuning module is used to perform prompt tuning based on the pre-trained model, perform the same masking task, and realize knowledge tracking in the scenario of small sample data volume.
[0075] Combining all the above-mentioned technical solutions, the beneficial effects of the present invention are as follows: the present invention proposes an ideal prompt learning solution, which can effectively balance performance and training cost, and strive to achieve a reasonable and reliable performance with fewer training samples and fewer model parameters. Therefore, the present invention intends to apply the training paradigm of prompt learning to solve the training cost problem currently faced by knowledge tracking in pre-training. The present invention aims to design prompt templates to package downstream prediction tasks into mask tasks similar to the pre-training process, such as the training mechanism of BERT, to achieve overall training consistency. The invention is expected to achieve model performance comparable to or even exceeding traditional fine-tuning solutions in small sample scenarios, while greatly reducing the investment in training samples and model parameters. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] The accompanying drawings herein are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description, serve to explain the principles of the present disclosure;
[0077] Figure 1 is a flow chart of a method for tracking learning knowledge applied to smart education provided by an embodiment of the present invention;
[0078] Figure 2 It is a large knowledge model LKM diagram provided by an embodiment of the present invention;
[0079] Figure 3 is a general structural diagram of the PLKT model provided by an embodiment of the present invention;
[0080] Figure 4 This is a conceptual schematic diagram of applying the prompt learning to knowledge tracking in the prompt template example provided in the embodiment of the present invention;
[0081] Figure 5 It is a hard template diagram based on natural text expression among the different prompt templates provided in the embodiment of the present invention;
[0082] Figure 6 It is a soft template diagram using pseudo-words to express different prompt templates provided by the embodiment of the present invention;
[0083] Figure 7 It is a soft template diagram guided by knowledge concepts among different prompt templates provided by the embodiment of the present invention;
[0084] Figure 8 It is a soft template diagram used to assist prompt tuning among the different prompt templates provided in the embodiment of the present invention. DETAILED DESCRIPTION
[0085] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention, so the present invention is not limited by the specific implementation disclosed below.
[0086] The innovation of the present invention is that the present invention introduces a new training technology - prompt learning to solve the problem of knowledge tracking. First, a knowledge model LKM is designed, and an optimized pre-training task is used to fully understand the semantic characteristics of the student's learning sequence. This scheme designs a prompt template to express the prediction process of knowledge tracking as a training task similar to that in the pre-training stage. In the downstream prompt tuning stage, the prediction task is completed based on a multi-prompt training strategy, and the model tuning is assisted. It has been proved that this method performs well in few-sample learning scenarios and can well balance considerations based on prediction performance and deployment costs.
[0087] The present invention aims to complete the knowledge tracking task in two stages, pre-training and prompt tuning. First, the BERT-based framework designs effective pre-training tasks that are suitable for students to practice sequence semantic understanding, so as to obtain a rich semantic representation of students' learning behavior. In addition, it is necessary to design available prompt templates to describe the prediction problem as a sequence representation similar to the pre-training stage. Finally, prompt tuning is carried out directly on the basis of the pre-training model without introducing new downstream models such as classifiers, while avoiding a large number of parameter updates. Based on the above explanation, the present invention designs a knowledge tracking model based on knowledge-guided prompt learning, PLKT, which is based on the knowledge-guided prompt template, packages the prediction task into a cloze form similar to the pre-training stage, and performs the same mask task in the prompt tuning stage. The present invention can achieve comparable or even surpass the current SOTA knowledge tracking method based on pre-training in scenarios with small sample data volumes.
[0088] Embodiment 1, as Figure 1 As shown, the prompt learning knowledge tracking method applied to smart education provided by the embodiment of the present invention includes:
[0089] S1, the BERT-based framework design is suitable for pre-training tasks for students to practice sequence semantic understanding, and obtains rich semantic representations of students' learning behaviors;
[0090] S2, design a prompt template to describe the prediction problem as the same sequence formulation as the mask training task in the pre-training stage;
[0091] S3, performs prompt tuning based on the pre-trained model, performs the same masking task, and realizes knowledge tracking in the scenario of small sample data volume.
[0092] It is understandable that knowledge tracking can be achieved even with the entire data set, but the present invention has more significant advantages in the case of a small sample data volume.
[0093] The present invention comprehensively considers the training cost and performance. It allows the deployer to freely balance time, resources and performance requirements according to the actual situation. For example, when the ultimate and optimal performance is required, you can choose to deploy the model on the entire sample set and increase the amount of tuning parameters to ensure that the final prediction performance meets the needs of actual applications; similarly, if you are sensitive to the deployment cost and keep the performance "available", you can choose to deploy the model on a small sample data volume and appropriately reduce the tuning parameters to meet the "available and relatively reliable performance at a limited cost. In contrast, other current solutions rely on a large number of samples to achieve relatively excellent performance, which the deployer cannot choose, and is further limited by cost considerations.
[0094] This invention is the first to apply the idea of prompt learning to the knowledge tracking task in the smart education scenario, "migrating" advanced technologies from other fields to knowledge tracking, and proposing targeted improvement solutions - namely, prompt template design and prompt tuning process. Therefore, this solution fills this technical gap, not only promoting the development of the smart education field, proposing excellent solutions for knowledge tracking tasks, but also providing good and reliable exploration and inspiration for related technical improvements in other fields.
[0095] In the field of smart education, knowledge tracking is an important task and has played a significant role in promoting the development of the education field. With the development of deep learning, the current solutions for knowledge tracking have the trend of "large data volume", "complex model parameters" and "high training and deployment costs". In order to continuously improve the prediction performance, people often ignore the huge costs faced by deploying models, including time and money (such as hardware resources consumed by deploying models). Therefore, how to effectively balance the two (i.e. cost and performance) and allow developers to freely deploy models of different magnitudes is a goal that has been pursued and not yet achieved in this field. This solution is based on the above considerations, migrating successful technical solutions in other fields to knowledge tracking, and optimizing and improving them in combination with their characteristics. It has been proved that this solution can be an effective solution to overcome the above-mentioned deployment difficulties in the industry.
[0096] Natural language processing and smart education are two independent fields with little overlap. Therefore, most researchers working on smart education rely too much on traditional technical solutions to improve the performance of knowledge tracking tasks, such as increasing the amount of data and the complexity of the model. This will produce a technical bias, that is, the neglect or exclusion of effective technical achievements in other fields. The consequence is that the technology in this field is driven to develop in a single and extreme direction, while ignoring the possibility of actual deployment. Therefore, this solution can well overcome this technical bias and innovatively apply the advanced technical idea of prompt learning to knowledge tracking. The proposed solution can well balance performance and the reliability and practicality of deployment.
[0097] Example 2, as a preferred implementation, the technical features involved in the prompt learning knowledge tracking method applied to smart education provided in the embodiment of the present invention include:
[0098] 1.1 Dataset description and input composition.
[0099] In the field of knowledge tracing research, almost all public datasets provide the following data items:
[0100] 1. User / Student ID: A number that uniquely identifies the subject;
[0101] 2. Exercise ID: a number. Each exercise ID can uniquely identify an exercise question.
[0102] 3. Concept ID: a number. Each concept ID can uniquely identify a knowledge concept (knowledge point);
[0103] 4. Answer status: The number 1 or 0 indicates the answer status record corresponding to each exercise;
[0104] 5. Additional records (side information): may include factors such as response time, number of attempts, type of questions, etc. The specific content may vary depending on the data set.
[0105] Among the above data items, exercise ID, concept ID, and answer status are essential to complete the knowledge tracking task. Among them, there is a corresponding relationship between exercises and concepts, and a specific exercise question may involve one or more knowledge concepts. In addition, due to system records, user preferences, etc., the exercise sequence of different users may be different. In combination with the relevant steps involved in the present invention, the input data used is listed below:
[0106] (1) Exercise sequence: Each sequence consists of a series of exercise IDs, arranged in the order in which the exercises were completed. Each exercise in the sequence comes from the exercise record of the same user / student;
[0107] (2) Concept sequence: corresponds to the exercise sequence and consists of a set of concept IDs corresponding to each exercise;
[0108] (3) Answer sequence: record whether the answer to each exercise is correct or not, 1 if correct, 0 if not;
[0109] (4) Exercise difficulty sequence: This data is generated based on the data set and represents the difficulty coefficient (error rate) corresponding to each exercise, that is, the number of times it was done wrong in the entire data set divided by the total number of attempts. Its range is [0,1], and the larger the value, the higher the difficulty coefficient. For example, the difficulty coefficient is calculated as follows:
[0110] ;
[0111] 2. Knowledge tracking task definition.
[0112] The purpose of knowledge tracking is to predict the performance of a student on a future exercise, i.e., whether the answer is correct or not, or the probability of answering correctly, given all the past exercise interaction records of a student (often expressed as exercise behavior or exercise sequence). Exercises and knowledge concepts, respectively expressed as: and . Let the set Indicates practice All the concepts involved. express The correctness of the answer at any time. Considering the difficulty information, let Indicates practice The average difficulty level of the students in the past The learning sequence within a period is expressed as ,in Indicates that the student is in Based on the above settings, the knowledge tracking task can be described as: given an exercise sequence , predicting that the student will For a certain exercise The probability of answering correctly is:
[0113] ;
[0114] (III) Overall structure of the PLKT model.
[0115] The entire PLKT model can be divided into a pre-training part and a prompt tuning part. Similar to training a large language model (LLM) in NLP tasks, the purpose of PLKT pre-training is to train a "large knowledge model" (LKM). The large knowledge model LKM is Figure 2 The overall structure of the PLKT model is shown in Figure 3 As shown;
[0116] Similar to BERT, LKM is based on the Transformer architecture, and its main purpose is to fully learn the potential patterns and features in the student's learning sequence. These features are "abstract" and can describe the changes in the student's knowledge mastery. Before tuning, the prediction task needs to be "packaged" into a structure similar to the input in the pre-training phase, and the predicted answer bits are masked, that is, a mask sequence based on "cloze" is constructed. Then a "prompt encoder" (PE-Prompt Encoder) module with the same Transformer architecture is used to encode it to meet the input requirements of the model. In the prompt tuning stage, the embedding of the student's learning sequence is input into the trained LKM together with the prompt encoding, and the mask task is performed again to obtain the predicted value of the mask bit to complete the knowledge tracking.
[0117] Example 3, as a preferred implementation, the prompt learning knowledge tracking method applied to smart education provided by the embodiment of the present invention includes:
[0118] Step 1: Data construction.
[0119] The entire PLKT scheme is mainly divided into two processes, pre-training and prompt tuning, and the data flow process of the two stages is similar.
[0120] The pre-training phase involves training a LKM module. LKM takes the student compound learning sequence as input. The student compound learning sequence consists of four types of data: exercise sequence, concept sequence, answer sequence, and exercise difficulty sequence. Since the model accepts embedded input, it is necessary to first convert the sequence into an embedded representation, such as Figure 2 The stage where the original sequence is converted into an embedded representation is outlined in red. Specifically, for the Elements , the composite embedding is denoted as the training embedding , Concept Embedding , answer embedding , Difficulty Embedding and position embedding vector sum of concepts Embed for practice The average embedding of all concepts involved, let represents the model dimension, then According to the calculation formula of sine and cosine position encoding in Transformer, the expression is:
[0121] ;
[0122] In the formula, For the moment Corresponding position embedding No. elements, For the current moment, is the element used to index the embedding vector, for example, when hour, Represents the third element, is the model dimension;
[0123] The LKM model outputs the hidden layer vectors located at [CLS] and all [MASK] positions, which are used to calculate the loss function to optimize pre-training;
[0124] In the prompt tuning stage, the model involves both LKM and a PE module. The LKM has been pre-trained to process the student sequence, while the PE is used to encode the prompt sequence. In this stage, the embedding of the student sequence is consistent with the pre-training process, and after being concatenated with the embedding representation of the prompt template, it is input into the hidden layer of the LKM model, such as Figure 3 The pink and blue highlighted parts. The model only outputs the hidden layer vectors of all [MASK] positions to complete KT prediction and prompt tuning. The specific training process is described in detail below.
[0125] Step 2: pre-training.
[0126] In this stage, we first build a large knowledge model (LKM) consisting of 8 layers of Transformer Encoder, such as Figure 2As shown. To complete pre-training, it is necessary to design reasonable training tasks (i.e., objective functions) to drive training, just like the MLM and NSP tasks used in BERT. In the present invention, two tasks are designed based on the temporal characteristics and dependencies of student sequences: forward backward order prediction (FBO) and random token masking (RTM). The purpose of FBO is to learn the overall macroscopic coarse-grained features of the student learning sequence, that is, to be able to distinguish the characteristics and patterns exhibited by students at different stages of learning; the purpose of RTM is to combine the context (i.e., the students' previous and subsequent interactive behaviors) to determine the possible interaction rows (exercise and answer situations) of students at a certain moment, that is, fine-grained features. For the FBO task, the main idea is to divide each original learning sequence into two segments from the middle, called segment-a and segment-b, and then recombine all the segments into a new sequence. If the reorganized sequence can be restored to a certain original sequence, the new sequence is marked as a positive sample; otherwise, it is marked as a negative sample. Therefore, for this task, it is necessary to introduce the [CLS] and [SEP] special tokens given in BERT. The approach is: the [CLS] symbol is located at the front of the entire sequence, used for sequence semantic representation and for FBO order prediction, followed by segment-a and segment-b, and a [SEP] symbol is inserted between the two segments for segment division.
[0127] For the RTM task, it introduces the masking idea of BERT. Specifically, 15% of the tokens in the sample sequence are selected as the "candidate set". The idea of masking 15% of the tokens is applicable to the training tokens and the answer tokens; because in the RTM task, the multivariate cross entropy loss calculation of the training tokens is involved, while the binary cross entropy loss is used to calculate the answer tokens.
[0128] For these 15% of words:
[0129] ① 80% of the words are replaced with [MASK] special words;
[0130] ② 10% of the words are randomly replaced with any word (of the same type), excluding special words such as [CLS], [SEP] and [MASK];
[0131] ③The remaining 10% of the words remain unchanged to improve the robustness of the model, that is, to be able to "recognize" the original information.
[0132] For this 15% "candidate set", the present invention only requires the practice and answer information, that is, only the practice words and answer words are subjected to the above operations, while words such as concepts and difficulty will serve as side information to assist the model in understanding the sequence semantics.
[0133] After constructing the embedding of the sample sequence, it is input into the LKM model and after 8 layers of Transformer attention calculation, we get:
[0134] (a) Hidden layer vector representation of the [CLS] position;
[0135] (b) Vector representation corresponding to all (15%) mask bits.
[0136] Among them, step (a) will be used for the FBO task, that is, to determine whether the represented sequence is a positive sample or a negative sample, and the FBO loss, that is, the binary cross entropy loss, can be calculated based on this, and the expression is:
[0137] ;
[0138] In the formula, It is the abbreviation of FBO Loss. is the total number of samples, For the The actual labels of the samples, For the The probability that a sample is predicted as a positive sample;
[0139] Step (b) will be used for the RTM task, that is, whether the model can restore the original content of the mask position. Even though the large knowledge model LKM relies more on the context of the sequence to identify these original information, it gives the large knowledge model LKM a certain error correction ability.
[0140] For practicing word metamasking, we calculate the multivariate cross entropy loss, which is expressed as:
[0141] ;
[0142] In the formula, is the multivariate cross entropy loss function, To index the masked tokens in the summation formula, is the total number of masked tokens, To practice indexing in summation formulas, is the total number of exercises, For practice Classified into The probability of the categories, For practice Classified into The labels of the categories; if It is categories, then otherwise ;
[0143] For the answer word mask, the binary cross entropy loss is calculated, and the expression is:
[0144] ;
[0145] In the formula, is the binary cross entropy loss function, for The student's answer label at the moment, for Always predict the probability that the student will answer correctly;
[0146] Accordingly, the RTM loss is obtained, expressed as:
[0147] ;
[0148] In the formula, It is the abbreviation of RTM Loss;
[0149] Minimize the two losses and complete the LKM training task. The expression is:
[0150] ;
[0151] In the formula, is the loss function.
[0152] It can be understood that the above formulas are all used to calculate the cross entropy loss. The original application scenario of the present invention is natural language processing. The present invention draws on the cross entropy loss calculation method proposed by BERT and innovatively applies it to the knowledge tracking direction.
[0153] Step three: prompt template design.
[0154] For traditional NLP tasks, it is easy to use a prompt template based on language description to package the problem to be solved. Take the sentiment classification problem as an example. Suppose you want to classify a text sequence, that is, the movie Titanic received unanimous praise (Themovie Titanic The sentiment of the garnered universal acclaim is classified into the category "Excellent". The classification problem can be packaged with the prompt template "This is a / an [MASK] movie.", as shown in the prompt template example of prompt learning in a text classification task. In this way, the same mask task as the pre-training stage is carried out on the prompt sequence to obtain the sentiment output of the [MASK] position. Naturally, there should be a prompt scheme that can also package knowledge tracking into a cloze mask task. One hypothesis can be expressed as follows Figure 4The hint template example shows an idea of applying hint learning to knowledge tracing, that is, constructing a hint template "for new exercises The prediction of a new exercise is xxx In this way, you only need to get the output of the [MASK] position to get the prediction, without resorting to downstream models such as a new classifier.
[0155] It can be understood that a typical approach to sentiment classification is to use a corresponding model (such as pre-training) to output the semantic (embedded) representation of the sentence to be classified, and then use a classifier to map this embedding to an m-dimensional vector (m represents the number of emotions), and then use Softmax to obtain the probability value corresponding to each emotion. The largest one is the final sentiment category.
[0156] However, considering that in traditional NLP tasks, both the original input and the constructed prompt template are expressed in natural language. Therefore, for LLM, the prompt template can be easily encoded without worrying about the mismatch with the original input. However, from the perspective of knowledge tracking, the original input of the LKM model is not in the form of natural language, but a student sequence, although the two are similar in the way of constructing embeddings. Therefore, LKM cannot encode the prompt template expressed in natural language, which will result in inconsistency between the encoding space of the original input and the prompt input.
[0157] In order to solve the above encoding problems, the present invention proposes a pseudo-word-based soft prompt template guided by knowledge. First, "pseudo-words" are introduced, that is, instead of using words with specific meanings (such as words in natural text) to represent the template, a series of abstract "virtual" words are used. These words have no specific meaning, but they can construct an input form that can guide the model to complete downstream tasks. Subsequently, these pseudo-words will be encoded by a new encoder to complete the fusion with the original input. Finally, the fused prompt code is input into the pre-trained LKM to obtain the corresponding output.
[0158] Exemplarily, specific details of prompt template construction are given below.
[0159] In view of the encoding inconsistency problem that occurs when hard prompt templates used for natural semantic expression are directly applied to knowledge tracking tasks, a prompt sequence is constructed for the hard prompt templates used for natural semantic expression, such as Figure 5 Different prompt templates are based on hard templates expressed in natural text. This process can be expressed as a mapping , the expression is:
[0160] For the hard prompt template used for natural semantic expression, construct a prompt sequence, expressed as a mapping , the expression is:
[0161] ;
[0162] In the formula, Learning sequence for students The process of constructing a prompt sequence using a hard template, is the semantic representation of the entire sequence, Learning sequence for students, For the exercises that the student will do at time T in the future, is the mask word;
[0163] To avoid inconsistent encoding, after introducing pseudo-words, we get a pseudo-sequence , where each position Indicates word units; where is a pseudo sequence composed of pseudo-words, is the first pseudo-word, is the second pseudo-word, For the pseudo-words; then, Figure 6 Different prompt templates use pseudo-word representations as shown in the soft template. The prompt sequence can be remapped It is expressed as:
[0164] ;
[0165] In the formula, Learning sequence for students The process of constructing a prompt sequence using a soft template;
[0166] The above prompts do not utilize the conceptual information involved in the exercise. It may be difficult for the model to infer the corresponding answer to the exercise based on the context. For the different concepts actually involved in each exercise, only the knowledge concept information is considered to better guide the prompt learning and enhance the effect of prompt learning; add the conceptual information of the exercise to the mapping Therefore, consider adding conceptual information to the exercise, such as Figure 7 As shown in the soft templates guided by knowledge concepts in different prompt templates, a prompt sequence guided by knowledge can be obtained:
[0167] ;
[0168] Considering that the mask task in the pre-training stage takes into account both the practice and answer words, the present invention will also design a template for the practice words to assist model training. Figure 8As shown in the soft templates used for auxiliary prompt tuning in different prompt templates, the predicted training words are masked, but the answer words are not masked. Accordingly, the auxiliary prompt sequence representation can be obtained:
[0169] ;
[0170] In the formula, For practice The knowledge concepts involved For practice The answer tag.
[0171] Step 4: Prompt tuning. During the tuning process, the present invention uses two knowledge-guided soft prompt sequences to complete "multi-prompt tuning", namely Figure 7 and Figure 8 The purpose is to complete the knowledge tracking prediction task while practicing the word meta-mask recovery task, guide the model to move closer to the pre-training stage, and assist its training.
[0172] First, we need to introduce a prompt encoder (PE) module to encode the prompt sequence. The prompt encoder PE model is similar to the large knowledge model LKM. The prompt encoder PE model is constructed by a 4-layer Transformer Encoder. Similar to the process of building embeddings for the word units in the original learning sequence, we first need to embed each pseudo word unit. Constructing the initial embedding representation , and then sent to the PE module to obtain its hidden layer output , as the feature representation of the word. For the original student sequence, the embedding layer in the pre-trained LKM is used to obtain the corresponding composite embedding representation according to the previous method. For the key words in the prompt template, including , and , then the corresponding embedding representation is obtained similarly , and Afterwards, according to the prompt input construction method similar to that in current NLP tasks, the present invention innovatively concatenates the above embeddings to obtain the final prompt input representation:
[0173] ;
[0174] In the formula, is the embedding representation corresponding to the prompt sequence, is the embedding representation of the [CLS] lemma, For students’ interactive embedding at time 1, For students in Momentary interactive embedding, For practice The embedding representation of for The embedding representation of is the embedding representation of the [MASK] word, Pseudo-word The embedding representation of Pseudo-word Embedded representation of ;
[0175] The above embedded representation is input into the pre-trained LKM hidden layer (ignore the embedding layer), and the final hidden layer output is obtained. Similar to the mask task (RTM) in the pre-training stage, the [MASK] representations that identify the practice position and the answer position are taken out respectively, and the cross entropy loss function is calculated to complete the multi-prompt model tuning. Unlike full-scale fine-tuning, the present invention freezes the hidden layer parameters in the pre-trained LKM model during the tuning process, and only updates the parts related to embedding and prompting, that is, the PE module. In this way, the training cost can be greatly reduced while ensuring available performance.
[0176] Example 4, as a preferred implementation, the prompt learning knowledge tracking method applied to smart education provided by the embodiment of the present invention also includes:
[0177] Parameter configuration. In order to achieve the knowledge tracking goal in the best way and balance the prediction performance and training cost, the present invention adopts the following (hyper) parameter configuration during the deployment process:
[0178] ① Embedding layer dimension: 256;
[0179] ②(Attention) hidden layer dimension: 256;
[0180] ③ Number of LKM module Transformer stacking layers: 8;
[0181] ④ Number of PE module Transformer stacking layers: 4;
[0182] ⑤ Maximum sequence length limit: 200;
[0183] ⑥Parameter tuning strategy: 5-fold cross validation;
[0184] ⑦Training set / test set ratio: 4:1;
[0185] ⑧ Gradient descent mini-batch size: 64;
[0186] ⑨Learning rate: 5e-4.
[0187] Embodiment 5, the present invention also provides a prompt learning knowledge tracking system applied to smart education, comprising:
[0188] The pre-training module is used to design pre-training tasks suitable for students to practice sequence semantic understanding based on the BERT framework, and obtain rich semantic representations of students' learning behaviors;
[0189] The prompt template design module is used to design usable prompt templates and describe the prediction problem as a sequence representation that is the same as the mask training task in the pre-training stage;
[0190] The prompt tuning module is used to perform prompt tuning based on the pre-trained model, perform the same masking task, and realize knowledge tracking in the scenario of small sample data volume.
[0191] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0192] The most direct advantage of the present invention is that it allows the deployment personnel to freely balance the required performance (accuracy) and the computational cost. Specifically, if the computing resources are sufficient, the model can be trained on the complete data set and all parameters can be updated. At this time, the present invention can achieve the best performance; if the computing resources are limited, you can choose to train the model on a small sample data set and freeze some parameters. At this time, the present invention will show a very high energy efficiency ratio, while ensuring excellent performance, it can minimize the computational cost. Below, a series of technical means such as comparative experiments, exploratory experiments, and ablation experiments will be used to verify the above advantages and the rationality of the present invention.
[0193] (A) Comparative experiment.
[0194] The purpose of this experiment is to compare the performance of the present invention with the latest SOTA knowledge tracking method. For the sake of fairness, all experimental projects are deployed on four public educational datasets, namely ASSIST09, ASSIST17, EdNet, and Statics2011. The selected comparison methods include three typical knowledge tracking models: DKT (2015), DKVMN (2017) and AKT (2020), as well as four latest pre-trained knowledge tracking models: PEBG (2021), BEKT (2021), HIN-KT (2023) and OPKT (2024). Since PEBG and HIN-KT are independent pre-trained models, they cannot complete the knowledge tracking task alone. Therefore, in the comparative experiment, they are combined with the two baseline models of DKT and DKVMN for evaluation. Since knowledge tracking is essentially a binary classification (prediction) task, the area under the curve (AUC) is used as the evaluation criterion. Its validity range is [0, 1]. When its value is greater than 0.5, the model can be considered effective. The closer it is to 1, the better the model. Table 1 shows the statistical table of the results of the comparative experiment.
[0195] Table 1. Comparative experiment:
[0196]
[0197] In Table 1, the bold numbers are the best AUC performance achieved on the data set, and the underlined numbers represent suboptimal performance. According to the results shown, it can be concluded that the PLKT method performs excellently, with an average performance of 0.8016 AUC, ranking second, second only to the OPKT method. However, OPKT uses a large number of structures based on BERT encoders, and adopts a full-scale fine-tuning strategy, which has greater computational complexity and training cost. Despite this, its average performance is only 1.67 percentage points higher than PLKT. For the BEKT model, it also adopts an encoder structure and training objectives similar to BERT, and adopts full-scale fine-tuning to complete the prediction task, but its average performance is inferior to the PLKT method; for the remaining pre-trained models, their performance on the four data sets is not as good as the PLKT method, which proves the energy efficiency advantage of the present invention.
[0198] (B) Variable template length experiment.
[0199] Since traditional natural language hard templates cannot be applied in the field of knowledge tracking, the present invention uses a soft template composed of a series of pseudo-words with variable length. Therefore, this experiment aims to explore the most reasonable template length setting for each data set, reflecting the flexibility advantage of the present invention. The experimental steps are to set the template length from 2 to 20, with an interval of 2, conduct multiple experiments, and record the results. The statistical data is shown in Table 2.
[0200] Table 2. Experiments with different template lengths:
[0201]
[0202] According to the statistical results, it can be concluded that for different data sets, the template length that can achieve the best performance is different. Specifically, the template lengths of the PLKT scheme that achieve the best AUC performance on the four data sets are 8, 12, 12, and 6 respectively. Compared with the templates expressed in text, the prompt template based on pseudo-words is not affected by fixed patterns such as the order of text, and is more flexible. The model can find the best template encoding through methods such as gradient descent.
[0203] (III) Exploratory experiments with small sample scenarios.
[0204] Hint learning shows significant superiority in NLP methods, especially in small sample scenarios. Therefore, this experiment aims to explore the performance difference between the PLKT method and other pre-training schemes in small sample scenarios. Description of the experimental process: Data sampling is performed on the dataset used, and the sampling object is the student sequence. The sampling principle is random sampling, and it should be ensured that the extracted sequence can cover all exercises and conceptual information. To meet the above principles, the minimum sampling ratio is limited to 20%, and sampling is performed every 20% of the gear. Therefore, for each dataset, 20%, 40%, 60%, 80%, and 100% (equivalent to the full set) are sampled respectively. In order to reduce the impact of chance on the experimental results, the experiment is repeated 5 times under each sampling setting, and the average result is taken as the final reference value. The statistical results are shown in Table 3.
[0205] Table 3. Small sample exploratory experiment:
[0206]
[0207] According to the statistical results in Table 3, the PLKT method performs very well in small sample scenarios and is significantly better than all the comparison methods. First, when extracting only 20% of the data set, the PLKT of the present invention shows a higher AUC performance starting point, which is 0.6654, 0.6266, 0.6935 and 0.6211 on four data sets, respectively. This shows that the multi-prompt tuning adopted by the prompting technique can quickly adapt to downstream tasks. When the extraction ratio is 40%, PLKT achieves the largest performance improvement percentage compared with the other methods, which are 16.47%, 12.68%, 7.13% and 21.16% respectively. In the process of continuing to increase the sample size to 60%, the other schemes began to show a clear performance growth trend, which proves the disadvantage that the traditional fine-tuning scheme must strictly rely on a large number of training samples.
[0208] 100% means using all data, 20%, 40%, etc. means using only a small sample size. Therefore, this experiment proves that this solution has advantages in the case of a small sample size. Compared with the existing pre-training knowledge tracking method, this solution has significant advantages in the case of a small sample size and can still achieve satisfactory performance.
[0209] At the same time, the performance of the PLKT method has reached a satisfactory level, which is comparable to the other solutions trained on the entire data set. When the training sample continues to increase, the performance improvement of PLKT begins to slow down, and the OPKT and BEKT methods slightly outperform PLKT, but cannot widen the gap. The above observations and analysis can prove that the present invention can achieve excellent basic performance in small sample scenarios. At the same time, the present invention can be comparable to the current SOTA solution, while showing significantly reduced data dependence.
[0210] (IV) Layer freezing experiment.
[0211] In the process of tuning, in order to fully balance the performance and training cost, the present invention freezes the parameters of LKM, and only updates the parts related to the prompt. Therefore, in this experiment, the impact of the amount of frozen parameters in LKM on the final performance will be considered. The experimental scheme is to freeze the Transformer layers in LKM one by one from the deep layer to the shallow layer (i.e., a layer close to the embedding). When the number of frozen layers is 8 (i.e., all LKM parameters are frozen), it is PLKT itself; when the number of frozen layers is 0 (i.e., no parameters are frozen), it will degenerate into a full amount of fine-tuning form, and the entire LKM will be trained again during the tuning process. The experimental results are shown in Table 4.
[0212] Table 4. LKM layer freezing experiment:
[0213]
[0214] It can be observed that the optimal performance cannot be achieved when all layers are frozen or all layers are kept updated. For the former, some important parameters cannot be updated during the tuning process, resulting in insufficient training (i.e., underfitting); for the latter, all layers will be updated during the tuning process to fit the training data used, resulting in a decrease in the generalization ability of new data (i.e., overfitting). For the four data sets, the best number of frozen layers is 5, 3, 4, and 4, which is nearly half the number of parameters of LKM. The above proves that not all full-scale fine-tuning can effectively adjust parameters and improve model performance, while ignoring the overfitting. In addition, the analysis of the effect of the number of frozen layers on performance shows that despite freezing all parameters (i.e., the PLKT method itself), the performance achieved is still satisfactory. On the four data sets, compared with the best AUC results, the performance loss percentage caused by freezing all parameters is only 0.94%, 1.59%, 1.16%, and 0.8%, respectively, which does not affect the overall performance.
[0215] Through the above experiments, we can see that compared with the traditional pre-training strategy adopted by the current knowledge tracking model, the present invention abandons the fine-tuning stage in the downstream task and replaces it with a prompt tuning strategy, which is currently lacking in the field of knowledge tracking.
[0216] The present invention designs a knowledge-guided pseudo-word-based soft prompt template and a multi-prompt tuning training task; the tuning process of the present invention does not require the entire pre-trained model to be retrained, but only needs to update the parameters related to the prompt, which greatly reduces the training cost; the present invention can be comparable to the performance of the latest existing knowledge tracking methods. Especially in small sample scenarios, the present invention can achieve better performance while significantly reducing the training cost, and surpass existing methods. Comprehensive consideration of performance and training cost allows implementers to flexibly deploy solutions.
[0217] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principles of the present invention should be covered within the protection scope of the present invention.
Claims
1. A prompt learning knowledge tracking method applied to smart education, characterized in that: The method includes: S1, the BERT-based framework design is suitable for pre-training tasks for students to practice sequence semantic understanding, and obtains rich semantic representations of students' learning behaviors; S2, design a prompt template to describe the prediction problem as the same sequence formulation as the mask training task in the pre-training stage; S3, performs prompt tuning based on the pre-trained model, performs the same masking task, and realizes knowledge tracking in the scenario of small sample data volume; In step S2, a prompt template is designed to describe the prediction problem as a sequence representation that is the same as the mask training task in the pre-training phase, including: First, pseudo-words are introduced. Instead of using word-grams with specific meanings to represent templates, abstract virtual word-grams are used to construct input forms that can guide the model to complete downstream tasks. Subsequently, these pseudo-words are encoded by the new encoder to complete the fusion with the original input; Finally, the fused cue encoding is input into the pre-trained LKM to obtain the corresponding output; In step S2, the design prompt template further includes: For the hard prompt template used for natural semantic expression, a prompt sequence is constructed, which is expressed as a mapping p h , the expression is: In the formula, Learning sequence for students The process of constructing a prompt sequence using a hard template, [CLS] is the semantic representation of the entire sequence, For students' learning sequence, e T is the exercise that the student needs to do at time T in the future, [MASK] is the mask word; To avoid encoding inconsistency, pseudo-words are directly introduced for the knowledge tracking task to obtain pseudo-sequences: In the formula, is a pseudo sequence composed of pseudo-words, pt1 is the first pseudo-word, pt2 is the second pseudo-word, pt l is the lth pseudo-word; Each position pt j Represents the jth word, prompting the sequence to be remapped using p s It is expressed as: Get a knowledge-guided sequence of prompts: In the formula, Learning sequence for students The process of constructing a prompt sequence using a soft template; The training word is designed to assist model training; the training word to be predicted is masked, but the answer word is not masked; the auxiliary prompt sequence is expressed as: In the formula, c(e T ) for exercise e T The knowledge concepts involved, T For practice T 's answer tag; In step S3, prompt tuning is performed based on the pre-trained model, including: First, the prompt encoder PE model is introduced to encode the prompt sequence; the prompt encoder PE model is constructed by a 4-layer Transformer Encoder; first, for each pseudo-word pt i Construct the initial embedding representation pt j , and then sent to the PE model to obtain its hidden layer output h j , as the feature representation of the word; for the original student sequence, the embedding layer in the pre-trained LKM is used to obtain the corresponding composite embedding representation according to the previous method; for the key words in the prompt template, including e T ,c(e T ), r T , and get the corresponding embedding representation e t , c t , r t , and then, following the prompt input construction method similar to that in current NLP tasks, the above embeddings are concatenated to obtain the final prompt input representation: p s =[x cls ,x1…x T-1 ,e T ,c T ,x mask ,h1…h l ] In the formula, p s is the embedding representation corresponding to the prompt sequence, x cls is the embedding representation of the [CLS] word, x1 is the interactive embedding of the student at the first moment, and x T-1 is the student’s interaction embedding at time T-1, e T For practice T The embedding representation of T is c(e T ), x mask is the embedding representation of the [MASK] word unit, h1 is the embedding representation of the pseudo word unit pt1, and h l Pseudo-word pt l Embedded representation of ; The above embedded representation is input into the pre-trained LKM hidden layer, and the final hidden layer output is obtained; similar to the mask task RTM in the pre-training stage, the [MASK] representations that mark the practice position and the answer position are taken out respectively, and the cross entropy loss function is calculated to complete the multi-prompt model tuning.
2. The method for tracking knowledge in prompt learning applied to smart education according to claim 1, characterized in that: Before step S1, data construction is required, including: In the pre-training stage, the LKM model takes the student's compound learning sequence as input; the student's compound learning sequence consists of four types of data: exercise sequence, concept sequence, answer sequence and exercise difficulty sequence; The LKM module model accepts embedded input and first converts the sequence into an embedded representation. For the tth element x t , the composite embedding is represented as the exercise embedding e t , concept embedding t 、Answer embedding t , Difficulty Embedding d t and position embedding p t The vector and concept embedding c t Embed for practice t The average embedding of all concepts involved, let d represent the model dimension, then p t According to the calculation formula of sine and cosine position encoding in Transformer, the expression is: In the formula, p t (i) is the position embedding p corresponding to time t t The i-th element of , t is the current moment, i is the element used to index the embedding vector, and d is the model dimension; The LKM model outputs the hidden layer vectors located at [CLS] and all [MASK] positions, which are used to calculate the loss function to optimize pre-training; In the prompt tuning stage, the LKM model is pre-trained and used to process the student sequence; the PE model is used to encode the prompt sequence, which is concatenated with the embedded representation of the prompt template and input into the hidden layer of the LKM model. Only the hidden layer vectors of all [MASK] positions are output to complete KT prediction and prompt tuning.
3. The method for tracking knowledge in prompt learning applied to smart education according to claim 1, characterized in that: In step S1, the BERT-based framework is designed to be suitable for students to practice sequence semantic understanding pre-training tasks, including: Firstly, we build a large knowledge model LKM composed of 8 layers of Transformer Encoder. According to the temporal characteristics and dependencies of student sequences, we design two training tasks: front-back order prediction FBO and random word mask RTM. Under multi-task joint training, LKM fully learns the semantic representation of student learning sequences, and at the same time, it mines the intrinsic patterns and characteristics of students' practice behaviors at both coarse-grained and fine-grained levels. Random word mask RTM is used to combine the previous and subsequent interactions of students to determine the interaction behavior of students at a certain moment, i.e., fine-grained features. For the FBO task, each original learning sequence is divided into two segments from the middle, called segment-a and segment-b. All segments are recombined into a new sequence. If the recombined sequence can be restored to a certain original sequence, the new sequence is marked as a positive sample; otherwise, it is marked as a negative sample. For the FBO task, the [CLS] and [SEP] special tokens given in BERT are introduced. The [CLS] token is located at the front of the entire sequence and is used for sequence semantic representation and FBO order prediction. It is followed by segment-a and segment-b, and a [SEP] token is inserted between the two segments for segment division. For the RTM task, the masking idea of BERT is introduced; 15% of the tokens in the sample sequence are selected as the candidate set, and the idea of masking 15% of the tokens is applicable to the practice tokens and answer tokens; After constructing the embedding of the sample sequence, it is input into the LKM model and after 8 layers of Transformer attention calculation, we get: (a) Hidden layer vector representation of the [CLS] position; (b) Vector representation corresponding to all 15% of the mask bits.
4. The method for tracking knowledge in prompt learning applied to smart education according to claim 3, characterized in that: The 15% of words include: ①80% of the words are replaced with [MASK] special words; ②10% of the words are randomly replaced with any word, excluding special words [CLS], [SEP] and [MASK]; ③The remaining 10% of the words remain unchanged and the original information can be recognized.
5. The method for tracking learning knowledge applied to smart education according to claim 3, characterized in that: Step (a) is used for the FBO task to determine whether the represented sequence is a positive sample or a negative sample and calculate the FBO loss, that is, the binary cross entropy loss, which is expressed as: Where, L F is the abbreviation of FBO Loss, N is the total number of samples, y i is the actual label of the i-th sample, p i is the probability that the i-th sample is predicted as a positive sample; Step (b) is used for the RTM task to determine whether the original content of the masked position can be restored. For training word meta-masking, the multivariate cross entropy loss is calculated, which is expressed as: Where, L multi is the multivariate cross entropy loss function, t is the index masked token in the summation formula, M is the total number of masked tokens, c is the index exercise in the summation formula, m is the total number of exercises, and y t,c For practice t The probability of being classified into the cth category, p t,c For practice t The label classified into the cth category; if e t is the cth category, then p t,c =1 otherwise p t,c =0; For the answer word mask, the binary cross entropy loss is calculated, and the expression is: Where, L binary is the binary cross entropy loss function, r t is the student's answer label at time t, p t is the probability of predicting the student's correct answer at time t; Accordingly, the RTM loss is obtained, expressed as: L R =L multi +L binary Where, L R It is the abbreviation of RTM Loss; Minimize the two losses and complete the LKM training task. The expression is: L=L R +L F Where L is the loss function.
6. The method for tracking knowledge in prompt learning applied to smart education according to claim 1, characterized in that: After step S3, parameter configuration is performed to achieve the knowledge tracking goal and balance the prediction performance and training cost.
7. A prompt learning knowledge tracking system applied to smart education, characterized in that: The system implements the prompt learning knowledge tracking method applied to smart education as claimed in any one of claims 1 to 6, and the system includes: The pre-training module is used to design pre-training tasks suitable for students to practice sequence semantic understanding based on the BERT framework, and obtain rich semantic representations of students' learning behaviors; The prompt template design module is used to design the prompt template and describe the prediction problem as a sequence representation that is the same as the mask training task in the pre-training stage; The prompt tuning module is used to perform prompt tuning based on the pre-trained model, perform the same masking task, and realize knowledge tracking in the scenario of small sample data volume.
