# ContextKT: A Context-Based Method for Knowledge Tracing
## 3 Problem Formulation  
In this section, we give the definitions of basic concepts and symbols used in the knowledge tracing.  
**Knowledge tracing.** Knowledge tracing aims to predict a student's mastery of knowledge based on their previous behaviors in a time interval. Generally, we use the student's performance on the question at a specific time to represent their mastery of knowledge at that time, that is, whether they can give a response to the question correctly. In addition, the previous behaviors are represented by a historical practice log, including the questions with one or more knowledge concepts and corresponding responses. Then, we can formalize the definition of knowledge tracing.  
Given a history log of student \(i\) on time interval \([0,t]\), and his/her historical practice log contains a study sequence \(S^{i}=\{(q_{1}^{i},r_{1}^{i}),(q_{2}^{i},r_{2}^{i}),\ldots,(q_{t}^{i},r_{t}^{ i})\}\) and information of questions such as the marked knowledge concepts, where \(q_{t}^{i}\) is the question that a student \(i\) answers at time \(t\) and \(r_{t}^{i}\) is the corresponding response at time \(t\). knowledge tracing aims to predict his/her response \(r_{t+1}^{i}\) on question \(q_{t+1}^{i}\) based on his/her study responses during time interval \([0,t]\) to acquire the student \(i\)'s mastery of knowledge.  
Based on this definition, the purpose of our knowledge tracing task is to predict the accuracy of the student's response to the next question \(q_{t+1}^{i}\). Let \(F\) denote students' performance model. Then the response accuracy \(p(r_{t+1}\mid q_{t+1})\) can be calculated as \(p(r_{t+1}^{i}\mid q_{t+1}^{i})=F(\Theta;S;E)\), where \(\Theta\) is the parameter of model, \(S\) is the history response set of questions and \(E\) is the set of relevance data on questions such as marked knowledge concepts and texts of questions.  
The basic idea of the knowledge tracing model is to construct an effective model on students' responses to trace their knowledge state and predict their performance on the specific question at the next moment.  
**Q-matrix** is a mapping matrix between questions and knowledge concepts. As a question may contain multiple knowledge concepts, Q-matrix represents the relationship between a question and its knowledge concepts. Consider a dataset with \(N\) questions and \(M\) knowledge concepts. A Q-matrix is constructed with \(N\) rows and \(M\) columns, in which each column represents a knowledge concept, and the row vector represents the concept information contained in a question. The Q-matrix is a binary matrix; considering an element at the \(i\)-th row \(k\)-th column, it represents whether the \(i\)-th question contains \(j\)-th knowledge concepts. If it contains these concepts, the element is 1. Otherwise, it is 0.  
The mathematical notations used in this paper are summarized in Table 1.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Parameters** & **Descriptions** \\ \hline \(F\) & the predict model for students’ performance \\ \(E\) & the set of relevance data on questions \\ \(S\) & the set of interaction sequences between students and questions \\ \(\Theta\) & the parameter set of the model \\ \(P\) & the set of questions \\ \(s^{i}\) & the interaction sequence between student \(i\) and questions \\ \(q_{t}^{i}\) & the question that student \(i\) responses at time \(t\) \\ \(r_{t}^{i}\) & the response from student \(i\) on the question at time \(t\) \\ \(e_{\langle q_{t},r_{t}\rangle}\) & the embedding of exercise interaction \(\langle q_{t},r_{t}\rangle\) \\ \hline \hline \end{tabular}
\end{table}
Table 1: Notations.