1 Introduction
A core task for many practical educational systems is student modeling, i.e., estimating students’ mastery level on a set of skills or knowledge components (KC) [vanlehn1988student, chrysafiadi2013student]. Such estimates allow indepth understanding of students’ learning status and form the foundation for automatic, intelligent learning interventions. For example, intelligent tutoring systems (ITSs) [shute1994intelligent, pls1, anderson1995cognitive, nye2014autotutor, heffernan2014assistments, rafferty2015inferring] rely on knowing the students’ skill levels in order to effectively recommend individualized learning curriculum and improve students’ learning outcomes. In the big data era, student modeling is usually formulated as an educational data mining (EDM) problem [romero2010educational, baker2009state, merceron2005educational]
where an underlying machine learning (ML) model estimates students’ skill mastery levels from students’ learning records, i.e., their answers to assessment questions.
Many student modeling methods have been proposed in prior literature. A fruitful line of research for student modeling follows the factor analysis (FA) approach. FA models usually assume that an unknown, potentially multidimensional student parameter, in which each dimension is associated with a certain skill, explains how a student answers questions and is to be estimated. Popular and successful FA models include item response theory (IRT) [irt], multidimensional IRT [mirt], learning factor analysis (LFA) [LFA], performance factor analysis (PFA) [PFA], DASH (short for difficulty, ability, and student history) [lindsey2014improving, mozer2016predicting], DAS3H (short for difficulty, ability, skill and student skill history) [das3h], knowledge tracing machines (KTM) [vie2019knowledge]
, and so on. Recently, more complex student models based on deep neural networks (DNN) have also been proposed
[DKT, zhang2017dynamic, minn2018deep]. Nevertheless, thanks to their simplicity, effectiveness and robustness, FA models remain widely adopted and investigated for practical EDM tasks. Moreover, there is evidence that simple FA models could even outperform DNN models for student modeling in terms of predicting students’ answers [irtbest]. Because of FA models’ competitive performance and its elegant mathematical form, we focus on FAbased student models in this paper.Most of the aforementioned FA models compute a single point estimate of skill levels for each student. Often, however, it is not enough to obtain mere point estimates of students’ skill levels; knowing the model’s uncertainty in its estimation is crucial because it potentially helps improve the model’s performance and improve both students’ and instructors’ experience with educational systems. For example, in ITS, an underlying model can use the uncertainty information in its estimation of students’ skill level to automatically decide that its recommendations based on highly uncertain estimations are unreliable and instead notify a human instructor to evaluate the students’ performance. This enables collaboration between ITS and instructors to create a more effective learning environment. In adaptive testing systems [chang2009nonlinear, yan2016computerized], knowing the uncertainty in model’s estimation could help the model intelligently pick the next test items to most effectively reduce its uncertainty about estimated students’ skill levels. This will help to potentially reduce the number of items needed to have a confident, accurate estimation of the students’ skill mastery level, saving time for both students to take the test and instructors to have a good assessment of the student’s skills.
All the above applications require the model to “know what it does not know,” i.e., to quantify the uncertainty of its estimation. Achieving this does not necessary changes the model. rather, we need a different inference algorithm for inferring not only a point estimate of student’s skill level from observed data (i.e., students’ answer records to questions) but also uncertainty in the estimations.
Fortunately, there exist methods that both compute point estimates of students’ skill levels and quantifies the uncertainty of those estimates. These methods usually follow the Bayesian inference paradigm, where each student’s unknown skill levels are treated as random variables drawn from a
posterior distribution. Thus, one can use the credible intervalto quantify the model’s uncertainty on the student’s estimated skill level. A classical method for Bayesian inference is Monte Carlo Markov Chain (MCMC) sampling
[gelman2013bayesian] which has been widely used in many other disciplines [gilks1995markov] other than EDM. In the context of student modeling with FA models, existing works such as [lan14a, fox2010bayesian, pardos2010using, merkle2011comparison]have applied MCMC methods to obtain credible intervals.
Unfortunately, classic Bayesian inference methods suffer from extensive computational complexity. For example, each computation step in MCMC involves a timeconsuming evaluation of the posterior distribution. Making matters worse, MCMC typically takes many more steps to converge than nonBayesian inference methods. As a concrete illustration, in [lan14a]
, the Bayesian inference method (10 minutes) is about 100 times slower than the other nonBayesian inference method based on stochastic gradient descent (6 seconds). The high computational cost prevents Bayesian inference methods from massdeployment in largescale, realtime educational systems where timely feedback is critical for learning
[driscoll1994psychology] and tens of thousands of data points need to be processed in seconds or less instead of minutes or hours. It is thus highly desirable to accelerate Bayesian inference so that one can quantify model’s uncertainty in its estimation as efficiently as nonBayesian inference methods.Contributions
In this work, we propose VarFA, a novel framework based on variational inference (VI) to perform efficient, scalable Bayesian inference for FA models. The key idea is to approximate the true posterior distribution, whose costly computation slows down Bayesian inference, with a variational distribution. We will see in Section 3 that, with this approximation, we turn Bayesian inference into an optimization problem where we can use the same efficient inference algorithms as in nonBayesian inference methods. Moreover, the variational distribution is very flexible and we have full control specifying it, allowing us to freely use the latest development in machine learning, e.g., deep neural networks (DNNs), to design the variational distribution that closely approximates the true posterior. Thus, we also regard our work as a first step in applying DNNs to FA models for student modeling, achieving efficient Bayesian inference (enabled by DNNs) without losing interpretability (brough by FA models). We demonstrate the efficacy of our framework on both synthetic and real data sets, showcasing that VarFA substantially accelerates classic Bayesian inference for FA models with no compromise on performance.
The remainder of this paper is organized as follows. Section 2 introduces the problem setup in FA and reviews the important FA models and their inference methods, in particular Bayesian inference. Section 3 explains our VarFA framework in detail. Section 4 presents extensive experimental results that substantiate the claimed advantages of our framework. Section 5 concludes this paper and discusses possible extensions to VarFA.
2 Background and Related Work
We first set up the problem and review related work. Assume we have a data set organized in matrix format where is the total number of students and is the number of questions. This is a binary students’ answer record matrix where each entry represents whether student correctly answered question . Usually, not all students answer all questions. Thus, contains missing values. We use to denote entries in , i.e., the th student’s answer record to the th question, that are observed.
We are interested in models capable of inferring each th student’s skill mastery level that can accurately predict the student’s answers given the above data. These models are often evaluated on the prediction accuracy and whether the inferred student skill mastery levels are easily interpretable and educationally meaningful. We now review factor analysis models (FA), one of the most widely adopted and successful methodologies for the student modeling task.
2.1 Factor Analysis For Student Modeling
One of the earliest FA model for student modeling is based on the item response theory (IRT) [irt]. It usually has the following form
(1) 
which assumes that each student’s answer
is independently Bernoulli distributed. The above formula says that the students’ answers can be explained by an unknown scalar student skill level factor
for each student and an unknown scalar question difficulty level factor for each question .is a Sigmoid activation function, i.e.,
. The multidimensional IRT model (MIRT) [mirt]extends IRT by using a multidimensional vector to represent the student skill levels. More recently,
[lan14a] proposed sparse factor analysis model (SPARFA) which extends MIRT by imposing additional assumptions, resulting in improved interpretations of the inferred factors.Other FA models seek to improve student modeling performance by cleverly incorporate additional auxiliary information. For example, the additive factor model (AFM) [LFA] incorporates students’ accumulative correct answers for a question and the skill tags associated with each question:
(2) 
where is the total number of skills in the data, is the th student’s total number of correct answers for skill and indicates whether the skill is associated with question . In particular, ’s form matrix which is commonly known as the Qmatrix in literature [qmatrix]. The unknown, tobeinferred factors are , a scalar difficulty factor for each skill , and , a scalar learning rate of skill . The performance factor model (PFM) [PFA] builds upon AFM that additionally incorporate the total number of a student’s incorrect answers to questions associated with a skill. The instructor factor model (IFM) [chi2011instructional] further builds on PFM to incorporate the prior knowledge of whether a student has already mastered a skill. More recently, [vie2019knowledge] introduces knowledge tracing machines (KTM) that could flexibly incorporate a number of auxiliary information mentioned above, thus generalizing AFM, PFM and IFM.
Another way to improve student modeling performance is to utilize the socalled memory, i.e., using students’ historic action data over time. For example, [lindsey2014improving, mozer2016predicting] proposed DASH (short for difficulty, ability, and student history) that incorporates a student’s total number of correct answers and total number of attempts for a question in a given time window
(3) 
where is the length of the time windows (e.g., number of days), and are the th student’s total number of correct answers and total number of attempts for question at time , respectively. ’s are parameters that captures the effect of correct answers and total attempts. More recently, DAS3H [das3h] extends DASH to further include skill tags associated with each question which essentially amounts to adding, within the last summation term in Eq. 3, another summation over the number of skills.
2.1.1 A general formulation for FA models
Although the above FA models differ in their formulae, modeling assumptions and the available auxiliary data used, we argue that the aforementioned FA models can be unified into a canonical formulation below
(4) 
where , and are factors whose dimension, interpretations and subscript indices depend on the specific instantiations of the FA model. To illustrate that Eq. 4 subsumes the FA models mentioned above, we demonstrate, as examples, how to turn SPARFA and AFM into the form in Eq. 4 and how to reinterpret the parameters in the reformulation. The equivalence between Eq. 4 and the original SPARFA formula is immediate and we can interpret the parameters in Eq. 4 as follows to recover SPARFA: is the number of latent skills that group the actual skill tags in the data set into meaningful coarse clusters; represents the th student’s skill level on the latent skills; represents the strength of association of the th question with the latent skills which is assumed to be nonnegative and sparse for improved interpretation; and represents the difficulty of question . All three factors in SPARFA are assumed to be unknown.
Similarly, for AFM, we can perform the following change of variables and indices to obtain Eq. 4. We first change the indices to and to , and remove the index in to . Then, we simply set , and to obtain Eq. 4. We can interpret the parameters in the reformulation as follows to recover AFM: is the total number of skill tags in the data; represents the unknown skill information including skill difficulty and learning rate; summarizes known auxiliary information for the th student and th question; represents the unknown th student’s skill mastery level. Tthe other FA models can be cast into Eq. 4 in a similar fashion. Note that, if the observed data is not binary but rather continuous or categorical, we can simply use a Gaussian or categorical distribution for the observed data and change the Sigmoid activation to some other activation functions accordingly. In this way, we still retain the general FA model in Eq. 4. We will use this canonical form to facilitate discussions in the rest of this paper.
2.2 Inference Methods for FA Models
We first introduce the inference objective and briefly review maximum log likelihood estimation method. Then, we review existing works that uses Bayesian inference for FA and highlight their high computational complexity, paving the way to VarFA, our proposed efficient Bayesian inference framework based on variational inference.
The factors in Eq. 4 may contain known factors that need no inference. Therefore, for convenience of notation, let be a partition of the factors , and where contains the unknown students’ skill level factors to be estimated, contains the remaining unknown factors and contains the known factors. For example, for AFM, , and . For SPARFA, , and . Further, let the subscripts for these partitions indicate the corresponding latent factors in FA; i.e., for SPARFA, and . Since summarizes known factors, we will omit it from the mathematical expositions in the remainder of the paper.
The inference objective in FA is then to obtain a good estimate of the unknown factors, represented by and
, with respect to some loss function
, usually the marginal data log likelihood. There are two ways to infer the unknown factors.2.2.1 Maximum Likelihood Estimation
The first way is through the maximum likelihood estimate (MLE) which obtains a point estimate of the unknown factors
(5) 
Recall that indicates which student has provided an answer to question . is a regularization term, e.g., regularization on the factors and is a hyperparameter that controls the strength of the regularization. Most of the works in FA use this method of inference [LFA, PFA, chi2011instructional, vie2019knowledge, das3h, lindsey2014improving, mozer2016predicting]. The advantage of MLE is that the above optimization objective allows the use of fast inference algorithms, in particular stochastic gradient descent (SGD) and its many variants, making the inference highly efficient.
2.2.2 Maximum A Posteriori Estimation
The second way is through maximum a posteriori (MAP) estimation through Bayesian inference. This is the focus of our paper. Recall that we wish to obtain not only a point estimate but also credible interval, which MAP allows while MLE does not.
Bayesian inference methods treat the unknown parameters and as random variables drawn from some distribution. We are thus interested in inferring the posterior distribution of and . Using the Bayes rule, we have that
(6)  
(7) 
We can similarly derive the posterior for the other unknown factor , although in this paper we focus on Bayesian inference for the unknown student skill level parameter . In Eq. 6 to Eq. 7 we have applied standard Bayes rule. Note that, because contains known factors and thus does not enter the Bayes rule equation, we have omitted it from the above equations. Once we estimate the posterior distribution for
from data, we can obtain both point estimates and credible intervals by respectively taking the mean and the standard deviation of the posterior distributions. A number of prior works have proposed to use Bayesian inference for factor analysis, mostly developed for the IRT model
[fox2001bayesian, mislevy1986bayes]. More recently, Bayesian methods are developed for more complex models. For example, [lan14a] proposed SPARFAB, a specialized MCMC algorithm that accounts for SPARFA’s sparsity and nonnegativity assumptions.However, Bayesian inference suffers from high computational cost despite its desired capability to quantify uncertainty. The challenge stems from the difficulty to evaluate the denominator in the posterior distribution in Eq. 6 and 7 which involves an integration over a potentially multidimensional variable. This term usually cannot be computed in close form, thus we usually cannot get an analytical formula for the posterior distribution. Monte Carlo Markov Chain (MCMC) method gets around this difficulty by using analytically tractable proposal distributions to approximate the true posterior and sequentially updating the proposal distribution in a manner reminiscent of gradient descent. MCMC methods also enjoy the theoretical advantage that, when left running for long enough, the proposal distribution is guaranteed to converge to the true posterior distribution [gelman2013bayesian]. However, in practice, it might take very long time for MCMC to converge to the point that running MCMC is no longer practical when data set is very large. The high computational complexity of MCMC is apparently impractical for educational applications where timely feedback is of critical importance [driscoll1994psychology].
3 VarFA: A Variational Inference Factor Analysis Framework
We are ready to introduce VarFA, our variational inference (VI) factor analysis framework for efficient Bayesian learning analytics. The core idea follows the variational principle, i.e., we use a parametric variational distribution to approximate the true posterior distribution. VarFA is highly flexible and efficient, making it suitable for large scale Bayesian inference for FA models in the context of educational data mining.
In this current work, we focus on obtaining credible interval for the student skill mastery factor as a first step of VarFA because, recall from Section 1, this factor is often of more practical interest than the other unknown factors. Therefore, currently VarFA is a hybrid MAP and MLE inference method: we perform VI on the unknown student factor and MLE on all other unknown factors . We consider this hybrid nature of VarFA in its current formulation as a novel feature because classic MLE or MAP estimation are not capable of performing Bayesian inference on a subset of the unknown factors. Extension to VarFA to full Bayesian inference for all unknown factors is part of an ongoing research; see 5 for more discussions.
3.1 VarFA Details
Now, we explain in detail how to apply variational inference for FA models for efficient Bayesian inference. Because the posterior distribution is intractable to compute (recall Eq. 6 and 7 and the related discussion), we approximate the true posterior distribution for with a parametric variational distribution
(8) 
where is a collection of learnable parameters that parametrize the variational distribution and is all the answer records by student . Notably, we have removed the dependency of the variational distribution on and so that the variational distribution is solely controlled by the variational parameter . Thus, the design of the variational distribution is highly flexible. All we need to do is to specify a class of distributions and design a function parametrized by to output the parameters of . Common in prior literature is to use a Gaussian with diagonal covariance for :
(9) 
where its mean and variance
. We can use arbitrarily complex functions such as a deep neural network for as long as they are differentiable; more details in Section 3.2. With the above approximation, Bayesian inference turns into an optimization problem under the variational principle, where we now optimize a lower bound, known as the evidence lower bound (ELBO) [bishop2006pattern], of the marginal data log likelihood. We derive a novel ELBO objective for variational inference applied to FA models in the EDM setting, summarized in the proposition below.Proposition 1.
In VarFA, the ELBO objective for an FA model in the form of Eq. 4 is
(10) 
where is the Kullback–Leibler (KL) divergence [mackay2003information] between two distributions.
Proof.
We start with the marginal data log likelihood which is the objective we want to maximize and introduce the random variables ’s:
where step (i) follows from Jensen’s inequality [jensen1906fonctions]. ∎∎
The ELBO objective differs from those used in existing literature in that, in our case, because the data matrix is only partially observed, the summation is only over , i.e., the observed entries in the data matrix. In contrast, in prior literature, the summation in the ELBO objective is over all all entries in the data matrix.
We form the following optimization objective to estimate and :
(11) 
where is a regularization term. That is, we perform VI on the student factor and MLE inference on the remaining factors . More explicitly, to perform VI on , we simply compute the mean and standard deviation of using with the learnt variational parameters .
3.2 Why is VarFA efficient?
VarFA supports efficient stochastic optimization
By formulating Bayesian inference as an optimization problem via the ELBO objective, VarFA allows efficient optimization algorithms such as SGD, with a few additional tricks. In particular, we require all terms in to be differentiable with respect to and which enable gradient computation necessary for SGD. This requirement is easily satisfied with a few moderate assumptions. Specifically, we let the variational distribution and the prior distribution for each to be Gaussian (See Eq. 9; we use a standard Gaussian for the prior distribution , i.e., ) following existing literature [kingma2013auto, rezende2014stochastic]. These two assumptions are not particularly limiting especially given the vast number of successful applications of VI that rely on the same assumptions [infovae, dd, siddharth2017learning, fairvae, betatcvae, betavae, factorvae]. Thanks to the Gaussian assumption, for the first term in , we can easily compute the KL divergence term analytically in closed form. For the second term in , we can use the socalled reparametrization trick, i.e., , where , which allows a low variance estimation of the gradient of the second term in with respect to . See Section 2.3 in [kingma2013auto], Section 2.3 in [kingma2019introduction] and Section 3 in [rezende2014stochastic]
for more details on stochastic gradient computation in VI. As a result, our framework can be efficiently implemented using a number of open source, automatic differentiation packages such as Tensorflow
[tensorflow2015whitepaper]and PyTorch
[NEURIPS2019_9015].VarFA supports amortized inference
Classic Bayesian inference methods such as MCMC infer each parameter for each student. As the number of students increases, the number of parameters that MCMC needs to infer also increases, which may not be scalable in largescale data settings. In contrast, unlike classic Bayesian inference methods, VI is amortized. It does not infer each parameter . Rather, it estimates a single set of variational parameter responsible for inferring all ’s. In this way, once we have trained FA models using VarFA and obtain the variational parameter , we can easily infer by simply computing , even for new students, without invoking any additional optimization or inference procedures.
3.3 Dealing with missing entries
Note from Eq. 10 that the variational distribution for each is conditioned on , i.e., an entire row in . However, in practice, the data matrix is often only partially observed, i.e., some students only answer a subset of questions. Then,
’s will likely contain missing values which computation cannot be performed on. To work around this issue, we use “zero imputation”, a simple strategy that transforms the missing values to 0, following prior work on applying VI in the context of recommender systems
[liang2018variational, salakhutdinov2007restricted, sedhain2015autorec, nazabal2018handling] that demonstrated the effectiveness of this strategy despite its simplicity. We note that there exist more elaborate ways to deal with missing entries, such as designing specialized function for the variational distribution [ma2018eddi, gong2019icebreaker, ma2018partial]. We leave the investigation of more effectively dealing with missing entries to future work.3.4 Remarks
Applicability of VarFA
The VarFA framework is general and flexible and can be applied to a wide array of FA models. The recipe for applying VarFA to an FA model of choice is as follows: 1) formulate the FA model into the canonical formulation as in Eq. 4; 2) partition the factors into student factor , the remaining unknown factors and known factors ; 3) perform VI on and MLE estimation on , following Section. 3.1.
Relation to variational autoencoders
Our proposed framework can be regarded as a standard variational autoencoder (VAE) but with the decoder implemented not as a neural network but by the FA model. Because the decoder is constraint to a FA model, it is more interpretable than a neural network.
Relation to other efficient Bayesian factor analysis methods
We acknowledge that VI applied to general FA models have been proposed in existing literature [ghahramani2000variational, zhao2009note]. However, to our knowledge, little prior work have applied VI to educational FA models nor investigated its effectiveness. One concurrent work applied VI to IRT [wu2020variational]. Our VarFA framework applies generally to a number of other FA models by following the recipe in the preceding paragraph, including IRT. Thus, our work complements existing literature in providing promising results in applying VI for FA models in the context of educational data mining.
4 Experiments
We demonstrate the efficacy of VarFA variational inference framework using the sparse factor analysis model (SPARFA) as the underlying FA model. This choice of SPARFA as the FA model to investigate is motivated by its mathematical generality: it assumes no auxiliary information is available and all three factors ’s, ’s and ’s need to be estimated, which makes the inference problem more challenging. [lan14a] provides two inference algorithms including SPARFAM (based on MLE) and SPARFAB (based on MAP).
We conduct experiments on both synthetic and real data sets. Using synthetic data sets, we compare VarFA to both SPARFAM and SPARFAB. We demonstrate that 1) VarFA predicts students’ answers as accurately as SPARFAM and SPARFAB; 2) VarFA is almost 100 faster than SPARFAB. Using real data sets, we compare VarFA to SPARFAM. We demonstrate that 1) VarFA predicts students’ answers more accurately than SPARFAM; 2) VarFA can output the same insights as SPARFAM, including point estimate of students’ skill levels and questions’ associations with skill tags; 3) VarFA can additionally output meaningful uncertainty quantification for student skill levels, which SPARFAM is incapable of, without sacrifice to computational efficiency. Note that SPARFAB can also compute uncertainty for small data sets but fails for large data sets due to scalability issues and thus we do not compare to SPARFAB for real data sets.
Specifically for SPARFA, using the notation convention in Section 2.2, the questionskill association factors ’s and the question difficulty factors are collected in . The student skill level factors ’s are collected in . Because the factors ’s are unknown, the “skills” in SPARFA are latent (referred to as “latent skills” in subsequent discussions) and are not attached to any specific interpretation. However, as we will see in Section 4.2.4, assuming the skill tags are available as auxiliary information, we can associate the estimated latent skills with the provided skills tags using the same approach proposed in [lan14a]. For the regularization term in Eq. 11, because the factors ’s are assumed to be sparse and nonnegative, we use regularization for ’s. When performing MLE for ’s, we use the proximal gradient algorithm for optimization problem with nonnegative and sparsity requirements; see Section 3.2 in [lan14a] for more details. For the other unknown factor ’s in , we apply standard regularization. The code along with instructions to reproduce our experiments can be downloaded from https://tinyurl.com/tvm4332.
4.1 Synthetic Data Experiments
4.1.1 Setup
Data set generation
We generate data set according to the canonical FA model specified in Eq. 4, taking into consideration the additional sparsity and nonnegativity assumptions in SPARFA. Specifically, We sample the factors ’s and
’s from i.i.d. standard isotropic Gaussian distributions with variance
(or identity matrix for
’s) and mean sampled from a uniform distribution in range
. To simulate sparse and nonnegative factors ’s, we first sample an auxiliary variable , where controls the sparsity, and then sample when or setting when for each and . In all synthetic data experiments, we use and set the true number of latent skills to .Experimental settings
We vary the size of the data set and use 5 different data matrix sizes: 10050, 30050, 50050, 70050 and 90050. We select a data missing rate of 50%, i.e., we randomly choose 50% of all entries in the data matrix as training set and the rest as test set. Experimental results for each of the above data sizes are averaged over 5 runs where we randomize over the train/test data split. We train SPARFA with both SPARFAM and VarFA using the Adam optimizer [kingma2014adam] with learning rate
for 100 epochs. Regularization hyperparameters are chosen by grid search for each experiment. For VarFA, we use a simple 3layer neural network for the function
in the variational distribution. We use the hyperparameter settings for SPARFAB following Section 4.2 in [lan14a].data set  #students  #questions  %observed 

assistment  392  747  12.93% 
algebra  697  782  13.02% 
bridge  913  1242  11.42% 
Evaluation metrics
We evaluate the inference algorithms on their ability to recover (predict) the missing entries in the data matrix given the observed entries. We term this criterion “student answer prediction”. Since our data matrix is binary, using prediction accuracy (ACC) alone does not accurately reflect the performance of the inference algorithms under comparison. Thus, we use area under the receiver operating characteristic curve (AUC) and F1 score in addition to ACC, as standard in evaluating binary predictions
[hastie2009elements].4.1.2 Results
Fig. 1
shows bar plots that compare the student answer prediction performance of VarFA with SPARFAM and SPARFAB on all three evaluation metrics. We can observe that all three methods perform similarly and that SPARFAM and SPARFAB show no statistically significant advantage over VarFA. We further showcase VarFA’s scalability by comparing its training runtime with SPARFAM and SPARFAB. The results are shown in Fig.
2. VarFA is significantly faster than SPARFAB and is almost as fast as SPARFAM.In summary, with VarFA, we obtain posteriors that allow uncertainty quantification with roughly the same computation complexity of computing point estimates and without compromising prediction performance.



4.2 Real Data Experiments
4.2.1 Setup
Data sets and preprocessing steps
We perform experiments on three largescale, publicly available, real educational data sets including ASSISTments 20092010 (Assistment) [assistment], Algebra I 20062007 (algebra) [Algebra] and Bridge to Algebra 20062007 (bridge) [bridge, Stamper2016The2K]. The details of the data sets, including data format and data collection procedure can be found in the preceding references. We remove students and questions that have too few answer records from the data sets to reduce the sparsity of the data sets. Specifically, we keep students and questions that have no less than 30, 35 and 40 answer records for Assistment, Algebra and Bridge data sets, respectively. In each data set, each student may provide more than one answer record for each question. Therefore, we also remove studentquestion answer records except for the first one. Table 1 presents the summary statistics of the resulting preprocessed data matrix for each data set.
Experimental settings and evaluation metrics
Optimizer, learning rate, number of epochs, neural network architecture and evaluation metrics are the same as in synthetic data experiments. For real data sets, we use 8 latent skills instead of 5. Other choices of the number of latent skills might result in better performance. However, since we are comparing different inference algorithms for the same model, it is a fair to compare the inference algorithms on the same model with the same number of latent dimensions. We use a 80:20 data split, i.e., we randomly sample 80% and 20% of the observed entries in each data set, without replacement, as training and test sets, respectively. Regularization hyperparameters are selected by grid search and are different for each data set. We only compare VarFA with SPARFAM because SPARFAB does not scale to such large data sets.
4.2.2 Results: Performance Comparison
Table 2 shows the average performance on the test set of each data set comparing VarFA and SPARFAM for all three data sets and additionally run time. We can see that VarFA achieves slightly better student answer prediction on most data sets and on most metrics. Interestingly, recall that, in the preceding synthetic data set experiment, SPARFAM performed better than VarFA most of the time. A possible explanation is that, for synthetic data sets, the underlying data generation process matches the SPARFA model, whereas for real data sets, the underlying data generation process is unknown. VarFA’s better performance than SPARFAM for real data sets implies that VarFA is more robust to the unknown underlying data generation process. As a result, VarFA may be more applicable than SPARFAM in realworld situations.
Table 2 also shows the run time comparison between VarFA and SPARFAM; see the last row in each subtable. We see that both inference algorithms have very similar run time, showing that VarFA is applicable for very large data sets. Notably, VarFA achieves this efficiency while also performing Bayesian inference on the student knowledge level factor.
4.2.3 Results: Bayesian Inference With VarFA
We now illustrate VarFA’s capability of outputting credible intervals using the Assistment data set. Fig. 3 presents violin plots that show the sampled student latent skill levels for a random subset of 10 students. Plots 2(a), 2(b) and 2(c) shows the inferred students ability for the 3rd, 4th and 7th latent skill dimension. In each plot, the bottom axis shows the student ID and the top axis shows the total number of questions answered by the corresponding student. For each student, the horizontal width of the violin represents the density of the samples; the skinnier the violin, the more widespread the samples are, implying the model’s less certainty on its estimations.
Latent Skill 1  Latent Skill 3  




Latent Skill 4  Latent Skill 7  


Results in Fig. 3 confirms our intuition that the more questions a student answers, the more certain the model is about its estimation. For example, students with ID 106, 110 and 389 answered 222, 181 and 149 questions, respectively, and the credible intervals of their ability estimation is quite small. In contrast, students with ID 27, 49 and 65 answered far less questions and the credible intervals of their ability estimation is quite large. This result implies that VarFA outputs sensible and interpretable credible intervals. As mentioned in Section 1
, such uncertainty quantification may benefit a number of educational applications such as improving adaptive testing algorithms. Note that VarFA is able to compute such credible interval as fast as SPARFAM, making VarFA potentially useful for even realtime educational systems. In contrast, SPARFAM is not capable of computing credible intervals. Although we may still obtain confidence interval as uncertainty quantification with SPARFAM via bootstrapping, i.e., train with SPARFAM multiple times with random subsets of the data set and then use the point estimates from different random runs to compute confidence intervals. However, this method suffers from two immediate drawbacks: 1) it is slow because we need to run the model multiple times and 2) different runs result in permutation in the estimated factors and thus the averaged estimations loss meaning. Given that VarFA is as efficient as SPARFAM and the previous drawbacks of SPARFAM, we recommend VarFA over bootstrapping with SPARFAM for quantifying model’s uncertainty in practice.
4.2.4 Results: PostProcessing for Improved Interpretability
SPARFA assumes that each student factor identifies a multidimensional skill level on a number of “latent” skills (recall that we use 8 latent skills in our experiments). As mentioned earlier, these latent skills are not interpretable without the aid of additional information. To improve interpretability, [lan14a] proposed that, when the skill tags for each question is available in the data set, we can associate each latent skill with skill tags via a simple matrix factorization. Then, we can compute each students’ mastery levels on the actual skill tags. We refer readers to Sections 5.1 and 5.2 in [lan14a] for more technical details. Although the above method to improve interpretability has already been proposed, [lan14a] only presented results on private data sets, whereas here we presents results on publicly available data set with code, making our results more transparent and reproducible.
We again use the Assistment data set for illustration. We compute the association of skill tags in the data set with each of the latent skills and show 4 of the latent skills with their top 3 most strongly associated skill tags. We can see that each latent skill roughly identify the same group of skill tags. For example, latent skill 4 clusters skill tags on statistics and probability while latent skill 7 clusters skill tags on geometry. Thus, by simple postprocessing, we obtain an interpretation of the latent skills by associating them with known skill tags in the data.
We can similarly obtain VarFA’s estimations of the students’ mastery levels on each skill tags through the above process. In Fig. 4, we compare the predicted mastery level for each skill tag (only for the questions this student answered) with the percent of correct answers for that skill tag. Blue curve shows the empirical student’s mastery level on a skill tag by computing the percentage of correctly answered questions belonging to a particular skill tag. Orange curve shows VarFA’s estimated student mastery level on a skill tag, normalized to range . We can see that, when the student gave more correct answers to questions of a particular skill tag, such as skill tag ID 2, 10, 14 and 30, VarFA also predicts a higher ability score for these skill tags. When the student gave more incorrect answers to questions of a particular skill tag, such as skill tag ID 0, 4 and 27, VarFA also predicts a lower ability score for those skill tags. Although the correspondence is not perfect, VarFA’s predicted student’s mastery levels match our intuition about student’s abilities (using the observed correct answer ratio as an empirical estimate) reasonably well. Thus, by postprocessing, we can interpret VarFA’s estimated students’ latent skill mastery levels using the easily understandable skill tags.
5 Conclusions and Future Work
We have presented VarFA, a variational inference factor analysis framework to perform efficient Bayesian inference for learning analytics. VarFA is general and can be applied to a wide array of FA models. We have demonstrated the effectiveness of our VarFA using the sparse factor analysis (SPARFA) model as a case study. We have shown that VarFA can very efficiently output interpretable, educationally meaningful information, in particular credible intervals, much faster than classic Bayesian inference methods. Thus, VarFA has potential application in many educational data mining scenarios where efficient credible interval computation is desired, i.e., in adaptive testing and adaptive learning systems. We have also provided opensource code to reproduce our results and facilitate further research efforts.
We outline three possible future research directions and extensions. First, VarFA currently performs Bayesian inference on the student skill mastery level factor. We are working on extending the framework to perform full Bayesian inference for all unknown factors. Extensions to some models such as IRT is straightforward, as studied in [wu2020variational], because all factors can be reasonably assumed to be Gaussian. However, some other models involve additional modeling assumptions, making it challenging to design distributions that satisfy these assumptions. For example, in SPARFA, one of the factors is assumed to be nonnegative and sparse [lan14a]. No standard distribution fulfill these requirements. We are exploring mixture distributions, in particular spike and slab models [ishwaran2005spike] for Bayesian variable selection, and methods to combine them with variational inference, following [titsias2011spike, enlighten191553].
Second, other methods exist that accelerate classic Bayesian inference. Recent works in largescale Bayesian inference proposed approximate MCMC methods that scale to large data sets [zhang2020csgmcmc, ma2015complete, song2017nice]. Some of these methods apply variational inference to perform the approximation [de2001variational, habib2018auxiliary]. We are investigating extending VarFA to support approximate MCMC methods.
Finally, the goal of VarFA is to improve realworld educational systems and ultimately improve learning. Therefore, it is necessary to evaluate VarFA beyond synthetic and benchmark data sets. We plan to integrate VarFA into an existing educational system and conduct a case study where students interact with the system in realtime to understand the VarFA’s educational implications in the wild.
Comments
There are no comments yet.