# Calibrated Q-Matrix-Enhanced Deep Knowledge Tracing with Relational Attention Mechanism
## 4 Methods
### Relation Attention Knowledge Tracing Model
#### 4.1.1 Exercise Matrix and Relation Modeling Layer  
* **Exercise matrix**: In order to obtain better semantic representations of exercises from the textual information, a word embedding technique was designed to learn the exercise representation. The word embedding matrix of the exercise \(i\) is the input in this part. Then, each representation of exercise E\({}_{i}\) is obtained by taking a weighted combination of the embedding of all words. The exercise matrix \(\textbf{B}\in\mathbb{R}^{n\times n}\) was designed to reveal the relationship between different exercises. B\({}_{ij}\) can be calculated based on the Phi coefficient: \(\phi_{ij}\) and the similarity score of two exercises: \(Simi_{i,j}\). In order to obtain B\({}_{ij}\), there exist three steps. The first step is to obtain the Phi coefficient. A contingency Table 2 needs to be extracted from previous students' interactions. Based on Table 2, the Phi coefficient is computed as a measurement for the relationship between exercise \(i\) and exercise \(j\), and the computation of the Phi coefficient can be seen in the following Formula (1). \[\phi_{ij}=\frac{n_{11}n_{00}-n_{01}n_{10}}{\sqrt{n_{1*}n_{0*}n_{*1}n_{*0}}}\] (1) As the formula of the Phi coefficient shows, this coefficient lies between \(-1\) and \(1\). The high coefficient parameter indicates that exercises \(i\) and exercise \(j\) has highly related knowledge concepts. The second step is to obtain the similarity score: \(Simi_{i,j}\) \begin{table}
\begin{tabular}{c c} \hline \hline
**Notations** & **Descriptions** \\ \hline n & The total number of exercises \\ d & The dimension of latent variables \\ s\({}_{i}\) & \(i\)th interaction of a student \\ e & An exercise solved by a student \\ k & The maximum absolute value \\ k\({}_{n}\) & The total number of knowledge concepts \\ RE & Exercise relation matrix \\ RF & Forget behavior matrix \\ RS & Slip and guess matrix \\ B & Exercise matrix \\ E & Exercise embedding matrix \\ S & Interaction sequence of a student \\ Q & The expert labeled Q-matrix \\ Q & The calibrated Q-matrix \\ X\({}^{\circ}\) & The input exercise sequence \\ Sta(K) & The Stability rate of the model: K \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The important mathematical notations. of exercises \(i\) and \(j\). \(Simi_{i,j}\) is calculated based on the word embedding of exercises \(i\) and \(j\): \(E_{i}\) and \(E_{j}\), and the formula of \(Simi_{i,j}\) can be given as follows (2):  
\[Simi_{i,j}=\frac{E_{i}E_{j}}{\left\|E_{i}\right\|\left\|E_{j}\right\|} \tag{2}\]  
The last step is to compute B\({}_{ij}\) by the following formula:  
\[B_{i,j}=\left\{ \begin{array}{ll}\phi_{i,j}+simi_{i,j}&\phi_{i,j}+simi_{i,j} >\theta\\ 0,&otherwise\end{array} \right. \tag{3}\]
* **Relation modeling**: In this part, the relational coefficient is calculated on the basis of the results of the relation modeling to predict the performance of the student in the next interaction. Specifically, exercise relation modeling, time-order forgetting behavior modeling, and student behavior modeling are described in detail. _Exercise relation modeling_: This part involves the relationship between two different exercises. Given an exercise sequence (e\({}_{1}\), e\({}_{2}\), e\({}_{3}...e_{n}\)) for a student, the goal is to predict the performance of the student in the next interaction e\({}_{n+1}\). To achieve this goal, the exercise relation matrix is computed as RE = (B\({}_{e_{n+1},e_{1}}\), B\({}_{e_{n+1},e_{2}}...\)B\({}_{e_{n+1},e_{n}}\)) based on the previous exercise matrix B. _Time-order forgetting behavior modeling_: Learning theory shows that students will forget knowledge points after a while. This theory is called the _forgetting curve theory_, which has been applied in many fields of cognitive diagnosis. If a student forgets some concepts of knowledge after the interaction \(i\), the relevance of the interaction \(i\) should be diminished when predicting the next student's interaction performance.