The recent COVID-19 pandemic has raised needs for social distancing, leading many organizations to develop virtual and remote services to prevent widespread infection of the disease. Accordingly, educational systems have developed remote learning environments including Massive Open Online Courses and Intelligent Tutoring Systems (ITSs). Knowledge tracing, modeling a student's knowledge state based on the history of their learning activities records, is a fundamental task for creating ITS that aims to provide personalized learning experiences to each student. Traditionally, Bayesian Knowledge Tracing [4, 5, 10, 15-17, 19, 20, 24, 26] and Collaborative Filtering based models [11, 22] were common approaches for knowledge tracing. However, with the widespread adoption of Deep Learning (DL) in many machine learning problems, DL based models [2, 6, 9, 12-14, 18, 21, 23, 25, 27] have become the de facto standard for knowledge tracing by capturing complex relations among interactions in students' learning activities records. The strength of the DL based models has become amplified with the advent of large scale public benchmark dataset in Artificial Intelligence in Education. EdNet [3] is such a publicly available dataset which is the largest in scale with more than 131M learning activities records from around 780K students.
In this paper, we propose SAINT+, a successor of SAINT [2] which enhances knowledge tracing with temporal feature embeddings, and empirically verify the effectiveness of the model on EdNet dataset. SAINT is a Transformer [25] based knowledge tracing model that separately processes information of exercise and student response. Specifically, a stream of exercises that a student consumes is fed to an encoder, and a decoder gets a corresponding response sequence and encoder output sequence, computing the final output sequence of the model. SAINT+ augments SAINT by integrating two temporal feature embeddings: elapsed time, the time taken for a student to answer, and lag time, the time interval between adjacent learning activities. Empirical evaluations conducted on EdNet dataset show that SAINT+ improves SAINT, the current state-of-the-art knowledge tracing model on EdNet dataset, by 1.25% in area under receiver operating characteristic curve (AUC). Also, the experimental results show that incorporating the temporal features into the decoder input achieves the best AUC compared to incorporating them into the encoder input, and both the encoder and decoder input, verifying the hypothesis that separately processing exercise information and student response information is appropriate for knowledge tracing.
Knowledge tracing is a fundamental task for many computer-aided educational applications and has been studied extensively in the field of AIEd. Traditional approaches addressed knowledge tracing based on Bayesian Knowledge Tracing (BKT) [4, 5, 10, 15-17, 19, 20, 24, 26] and Collaborative Filtering (CF) [11, 22] . Basically, BKT is the Hidden Markov Model where a latent variable represents evolving student knowledge. BKT assumes the latent student knowledge as a set of binary variables: either the student mastered the knowledge or not. Each latent variable is updated based on observations of the student correctly applying the knowledge which are also binary: either the student correctly or incorrectly answered a given exercise. On the other hand, CF based approaches model students and exercises as low-rank matrices. Each vector in the student matrix and exercise matrix represents latent traits of each student and latent knowledge required for each exercise, respectively. The probability of a student correctly answers to an exercise is calculated by applying the sigmoid function to the dot product between the corresponding student and exercise vectors.
The advances of Deep Learning (DL) have given rise to neural network based knowledge tracing models. DKT [18] is the first DL based knowledge tracing model. DKT models students' evolving knowledge state through Recurrent Neural Network (RNN) which compresses their past learning activities in a hidden layer. Like many RNN based models that commonly leverage attention mechanism, NPA [12] models student knowledge through Bidirectional Long-Short Term Memory (Bi-LSTM) network equipped with an attention layer that weighs more importance to relevant parts of their learning history for prediction. EKT [9] is also a Bi-LSTM knowledge tracing model with an attention layer. However, EKT addresses the cold start problem in knowledge tracing by exploiting not only students' learning activities records but also text descriptions of exercises. Not all DL based knowledge tracing models are based on RNN architecture. DKVMN [27] is a memory-augmented neural network knowledge tracing model where the key matrix stores knowledge concepts and the value matrix stores students' mastery levels of corresponding concepts. CKT [21] is a knowledge tracing model that applies hierarchical convolutional operations to extract learning rate features from student's learning activities history. Applying self-attention mechanism in Transformer [25] architecture, which is de facto standard to many sequential prediction tasks, to knowledge tracing is also an actively studied area. SAKT [14] is the first knowledge tracing model with self-attention layers. In each self-attention layer of SAKT, each query is an exercise embedding vector, and key and value are interaction embedding vectors. SAINT [2] is the first Transformer based knowledge tracing model which leverages encoder-decoder architecture composed of stacked self-attention layers. Unlike SAKT, SAINT gets separated streams of exercises and responses as inputs where a sequence of exercises are fed to the encoder, and a sequence of encoder outputs and responses are fed to the decoder. AKT [6] also adopts self-attention layers for knowledge tracing. The attention weights in AKT are decayed exponentially based on the context-aware relative distance measure. Moreover, AKT uses the Rasch model based exercise and exercise-response embeddings to avoid overparameterization and overfitting. Recently, several works [13, 23] attempt to incorporate graph structure to the knowledge tracing model. [13] formulate knowledge tracing as a time series nodelevel classification task in graph structure and proposes GKT which extracts representation of each knowledge concept by aggregating representations of neighboring concepts. HGKT [23] applies graph neural network to get hierarchical exercise graph which better represent groups of similar exercises.
We formulate knowledge tracing as a task of predicting the probability of a student's answer being correct to a particular exercise given their previous interaction histories. Formally, the student's learning activity is recorded as an interaction sequence 1 , . . . , . Each interaction = ( , ) is a tuple of exercise information , the -th exercise given to the student with related metadata, such as the type of the exercise, and response information , the student's response to the exercise along with related metadata including the correctness of the response, the duration of time the student took to respond and the time interval between the current and previous interactions. The student's response correctness ∈ {0, 1} is equal to 1 if the student answered the -th exercise correctly and 0 if not. Thus, knowledge tracing aims to estimate the probability,
In this subsection, we give a brief review of SAINT, a Separated Self-AttentIve Neural Knowledge Tracing. We refer the paper [2] for those who want to lean detailed aspects of SAINT. SAINT is a knowledge tracing model based on Transformer [25] architecture which consists of an encoder and a decoder. It separates a stream of student interactions into two sequences: an exercise sequence and a response sequence. Then, the encoder takes a sequence of exercise embeddings = [ 1 , 2 , . . . , ] as input and pass an output sequence = [ 1 , 2 , . . . , ] to the decoder. The decoder additionally takes a shifted response embedding sequence = [ , 1 , 2 , . . . , −1 ] as input, whose first element is a start token embedding, to produce the final output sequenceˆ= [ˆ1,ˆ2, . . . ,ˆ]. Eachˆis an estimated probability of the student's answer to the -th exercise being correct given the current exercise information and the past interactions 1 , 2 , . . . , −1 .
The most fundamental part of SAINT is a multi-head attention layer. Let ℎ be the number of heads. When input query matrix , key matrix , and value matrix are given, we compute = , = , and = for each 1 ≤ ≤ ℎ, where , , and are weight matrices of query, key and value, respectively. Then, the scaled dot-product attention computes each head matrix, and the final output is a linear transformation of concatenated head matrices,
where is a dimension of the query and key vectors, and is a weight matrix. Note that the masking mechanism overwrites the region above the diagonal of the matrix with −∞ so that the corresponding region of the softmax output becomes zero. This prevents the current position from attending to subsequent positions. In other words, SAINT uses no future information from the sequence while training.
The encoder block consists of sequentially aligned copies of encoder layers. A single encoder layer is a multi-headed self-attention layer with an upper triangular mask followed by a feed forward network (FFN) which is defined by
where 1 , 2 and 1 , 2 are weights and biases, respectively. Suppose is given as input to an encoder layer. Then, the output sequence is computed as follows:
Here, the input sequence for the foremost encoder layer is an exercise embedding sequence while each subsequent layer takes the feed forward output of the previous layer. Note that we apply layer normalization [1] and skip connection [7] to every sub-layer.
The decoder is a sequence of identical decoder layers, which consists of two multi-head attention layers with upper triangular masks followed by a feed forward network as well. Suppose is an input sequence to a decoder layer. If the layer is the foremost, is the response embedding sequence . Otherwise, it is the output sequence from the previous decoder layer. The first layer is a multi-headed self-attention layer which only takes . Then, its output 1 serves as queries for the second attention whose keys and values are the encoder output . The computation can be summarized as follows: ( 2 )).
The output of the last decoder layer is passed to a fully connected layer to produce the final output of the model.
SAINT takes sequences of exercise embeddings and response embeddings, where each entry in the exercise embedding sequence is the sum of vectors of an exercise ID, an exercise category and the position, and each entry in the response embedding sequence is the sum of vectors of a response correctness and the position. SAINT+ augments response embeddings with two temporal feature embeddings: elapsed time, the duration of time a student took to respond, and lag time, the time interval between the current and previous interactions (Figure 1 ). The embedding vectors for elapsed time and lag time are added to the response embeddings ( Figure 2 ). In the following subsections, we provide detailed explanations of the two temporal feature embeddings.
Elapsed time is an amount of time that a student spent on solving a given exercise. For example, in Figure 1 , et 1 = 2 − 1 (resp. et 2 = 4 − 3 ) is the elapsed time for the exercise 1 (resp. exercise 2). If the student does not have enough knowledge and skills for the exercise, it would be hard to respond correctly within the recommended time limit. Hence, elapsed time provides strong evidence for a student's proficiency in knowledge and skills, and student's understanding of concepts associated with the exercise.
We propose two different approaches to embed elapsed times as latent vectors: continuous embedding and categorical embedding. In continuous embedding, a latent embedding vector for an elapsed time et is computed as v et = et · w elapsed_time , where w elapsed_time is a single learnable vector. For categorical embedding, unique latent vectors are assigned to each integer seconds. We set the maximum elapsed time as 300 seconds and any time more than that is capped off to 300 seconds.
Lag time is the time gap between interactions, an important factor that affects complex phenomena occurring in students' learning process. For instance, students tend to forget what they have learned as time passes. If a lot of time passed after a student answers an exercise about certain concepts, it would be hard to respond to similar exercises correctly, even if they provided the correct answer to the exercise before. On the other hand, students need time to refresh. By taking a rest, their brains organize and arrange what they have learned, and prepare for the next learning session. We define lag time as the time interval between the moment a student encountered the current exercise and the moment the student consumed the previous exercise. For instance, in Figure 1 , lag time for the exercise 2 (resp. exercise 3) is lt 2 = 3 − 2 (resp. lt 3 = 5 − 4 ).
Similar to the elapsed time embedding, we use continuous embedding and categorical embedding for lag time. In continuous embedding, a latent embedding vector for a lag time lt is computed as v lt = lt · w lag_time , where w lag_time is a trainable vector. For categorical embedding, lag times are discretized as integer minutes 0, 1, 2, 3, 4, 5, 10, 20, 30, . . . , 1440. As a result, there are a total of 150 trainable unique latent vectors assigned to each integer minute.
EdNet [3] is the largest publicly available benchmark dataset in education domain consisting of interaction logs collected by Santa 1 . We conduct experiments on an updated version of EdNet-KT1, which contains problem-solving logs from January 1st, 2019 to June 1st, 2020. Details of the dataset statistics are provided in Table 1 . Also, the distributions of elapsed time and lag time of the dataset are shown in Figure 3 . We use interaction logs of the most recent 100K students as test set and 80% (resp. 20%) of the remaining dataset are used as training (resp. validation) set. # of interactions 60294498 # of students 678128 # of exercises 14418
We compare SAINT+ against benchmark knowledge tracing models, DKT [18] , DKVMN [27] , SAKT [14] and SAINT [2] :
• DKT is a simple RNN-based model that uses concept and response correctness as input features, and models student's knowledge status as RNN's hidden state vectors. We choose an LSTM [8] architecture. Also, we consider each unique exercise id as a concept associated with the exercise. • DKVMN is a memory augmented neural network based model where the key matrix stores knowledge concepts and the value matrix stores students' mastery levels of the corresponding concepts. We use each exercise id as a concept of the corresponding exercise. • SAKT is the first knowledge tracing model that utilizes Transformer's self-attention architecture. It is a single encoder-based model where exercise ids are used as queries and interaction ids are used as keys and values. • SAINT is the first Transformer-based knowledge tracing model which leverages an encoderdecoder structure to process information of question and student response separately. The encoder takes a sequence of question embeddings and the decoder gets a sequence of encoder outputs and response embeddings to compute the final output.
We use the accuracy (ACC) and the area under the receiver operating characteristic curve (AUC) as the performance metric. We pick the weight with the best validation AUC and evaluate them on the test set. For SAINT+ and SAINT, we use Adam optimizer with = 0.001, 1 = 0.9, 2 = 0.999 and = 1 −8, and set warmup steps to 4000. The window size, number of layers, dimension of the model, dropout rate and batch size is set to 100, 4, 512, 0.0 and 64, respectively. For other benchmark models, both embedding and hidden dimensions of DKT, DKVMN and SAKT are searched over [50, 100, 150, 200, 256, 512] , and the best results are reported on the test dataset. Also, we set the number of latent concepts as 64 for DKVMN. Table 2 shows the performance comparison of SAINT+ with the benchmark knowledge tracing models. Compared to the benchmark models, SAINT+ achieves increases of ACC and AUC maximally up to 2.72% and 3.61%, respectively. Also, SAINT+ improves SAINT with 1.03% and 1.25% gain in ACC and AUC, respectively, demonstrating the effectiveness of integrating the temporal features for knowledge tracing.
5.5.1 Temporal Feature Embedding: Continuous vs. Categorical. We compare different approaches for embedding temporal features: continuous and categorical. Modeling elapsed time in continuous (resp. categorical) fashion assumes that the relationship between a student's knowledge status and the difficulty of a question for the student is a smooth (resp. stepwise) function of time. Similarly, for lag time, continuous (resp. categorical) modeling addresses various aspects in a students' learning process including forgetting, re-organizing concepts and improvement change smoothly (resp. Table 3 show that the best result is obtained when using continuous embedding for elapsed time and categorical embedding for lag time. Table 4 . When used alone, lag time increases performance more than elapsed time. Moreover, regardless of the temporal features used, utilizing only one feature is not good as using both features together (SAINT+), while certain improvements are obtained compared to SAINT. Figure 2 . Since both elapsed time and lag time arise as a result of student response, this approach is naturally aligned with the core idea of SAINT that providing exercise information to the encoder and response information to the decoder is appropriate for knowledge tracing. We compare SAINT+ (decoder only) with other two variants: feeding the temporal features to 1) the encoder only, and 2) both the encoder and the decoder. Table 5 summarizes the results. As expected, SAINT+ shows the best performance among the variants. Also, SAINT+ and the variants show better results than SAINT, demonstrating that the temporal features provide useful information for estimating knowledge status. 
In this paper, we proposed SAINT+, a Transformer based knowledge tracing model that processes exercise information and student response information separately, and integrates two temporal feature embeddings into the response embeddings: elapsed time and lag time. Experiments conducted on EdNet dataset show that SAINT+ improves SAINT, the former state-of-the-art knowledge tracing model, in both ACC and AUC. Furthermore, the best result was obtained by incorporating the temporal features into the decoder input, verifying the hypothesis that separately processing exercise information and student response information is appropriate for knowledge tracing. Avenues of future work include 1) modeling not only students' problem-solving records, but also various learning activities, such as watching lectures and studying explanations for each exercise, 2) exploring architectures for knowledge tracing models other than Transformer based encoder-decoder model that separately processes exercise information and student response information.