Manuscript Offprint

arXiv:2608.21165

Distilling Black-Box Machine Learning into a Small, Self-Explaining Language Model for Learning Analytics

Chenguang Pan, Airui Meng, Youmi Suk

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Learning analytics increasingly relies on flexible machine learning (ML), but the model opacity and the burden of deployment prevent these tools from reaching educational practice. We propose a two-stage fine-tuning pipeline that distills a fitted black-box estimator and its post hoc interpretation (the mentor) into a small, open-weight large language model (LLM; the mentee) that returns an individual-level estimate and explains in natural language. The design is estimator-agnostic and paired with a faithfulness-first evaluation framework that audits every narration against the attribution it claims to describe. We design a simulation study that separates distillation loss from estimator loss by comparing an oracle mentor with a realistic ML mentor. Given an oracle signal, distillation with a two-billion-parameter LLM model is nearly lossless in recovering the effect surface (r > .90), perfectly ranking the important variables, and citing no spurious covariate. Under a realistic estimator, almost all remaining error originates upstream. We find that fluency is no evidence of correctness since narration quality is independent of signal quality, and decision quality collapses toward the majority action in severely imbalanced settings. Applied to a nationally representative dataset, the pipeline recovers the finding that advanced mathematics coursework benefits students least likely to enroll in four-year college the most, with 98.8% of narrations passing the audit and no fabricated quantities. The result is a single fine-tuned LLM that predicts and explains offline on a commodity laptop, so student records never leave the machine.

Keywords: knowledge distillation, large language models, explainable artificial intelligence, educational decision support, learning analytics

1 Introduction

Learning analytics and educational data mining increasingly rely on flexible Machine Learning (ML) models to study students' learning behaviors, enhance academic performance, and assist stakeholders in educational decision-making (Hilbert et al., 2021; Ifenthaler, 2017; Pan & Zhang, 2024; Romero & Ventura, 2020). Models such as random forests, gradient-boosted trees, and neural networks estimate parameters accurately without the distributional

*Corresponding author: Chenguang Pan. Email: cp3280@tc.columbia.edu.

assumptions imposed by parametric methods, such as normally distributed errors in linear regression. However, the estimation process is often treated as a black box because the reasoning behind a fitted result is buried in thousands of trees or numerous neurons, which weakens the transparency and trustworthiness of what the model produces (Khosravi et al., 2022; Lipton, 2018; Rudin, 2019). For example, an unexplained predicted math achievement score is difficult to trust or to use for a parent weighing a course choice, a student deciding whether to persist, or a counselor allocating limited support. Learning analytics ultimately has to serve human sense-making, not merely optimize a metric.

Two obstacles compound this transparency gap. The first is interpretation. Even though the Explainable AI (XAI) community has proposed various post hoc explanation tools, their outputs, such as feature-importance bars, partial-dependence curves (Friedman, 2001), and Shapley-value attributions (SHAP value; Lundberg & Lee, 2017), are themselves specialized artifacts that presuppose statistical literacy. The second obstacle comes from model deployment. Running a tree ensemble or a neural network, maintaining its data preprocessing pipeline, and retrieving its post hoc explanations require hardware and expertise that classroom- and family-level stakeholders do not have (Ifenthaler, 2017; Tsai & Gasevic, 2017). Therefore, the opacity and operational burden could make a seemingly insightful learning analytics system the least able to engage with it.

Recent work suggests a different interface. Large language models (LLMs) have been demonstrated to act as predictive models for regression and classification tasks and can express their predictions in fluent natural language (Dinh et al., 2022; Hegselmann et al., 2023; Song et al., 2025), which raises the possibility of a single model that both predicts and narrates. Besides, post hoc interpretation tools like SHAP value attributions and functional ANOVA (fANOVA; Hooker, 2004, 2007) decompositions provide an individual-level account of any upstream model's output, and express it as a baseline (a grand mean) plus additive contributions from each covariate. A narration grounded in a prediction and its decomposition can tell a stakeholder not only the extent to which a student can benefit or be harmed by this educational intervention, but also which of that student's characteristics account for the difference, all in natural human language rather than in pure numbers.

Building on these, we propose a two-stage fine-tuning pipeline that distills a black-box ML estimator and its post hoc interpretations into a small, open-weight LLM that produces the estimate, the decisions, and the explanation in natural language. The fine-tuned LLM runs smoothly at inference time on local commodity hardware with no upstream dependencies. For example, a fine-tuned Gemma 4 model (Abd et al., 2026) at effective 2-billion parameter size (E2B) with 4-bit precision occupies roughly 3.6 GB on disk and peaks near 4.1 GB of memory during inference. Prior distillation work transfers a larger model's labels and free-form rationales (Hinton et al., 2015; Ho et al., 2023; Hsieh et al., 2023; Magister et al., 2023; Shridhar et al., 2023), and evaluates the results in terms of task accuracy. What has not been done, to our knowledge, is to distill a fitted statistical estimator together with the decomposition that explains it, and then to audit the distilled model's narrations against that estimator rather than trusting that fluent text is accurate text.

Evaluating such a pipeline requires a ground truth against which to compare, which real data cannot provide. We therefore begin with a simulation study in which the true results are known by construction and cross-test upstream signals from both the oracle estimate and a realistic black-box estimator. The oracle condition establishes a ceiling and isolates what the distillation step loses from what the estimator loses. We then apply the pipeline to a causal ML task as a case study and estimate the effect of advanced mathematics coursework (Advanced Placement/International Baccalaureate; AP/IB) on four-year college enrollment. The pipeline itself is not specific to causal inference and accepts any fitted model that returns an individual-level estimate.

We make three contributions. First, we develop a faithfulness-first evaluation framework for self-explaining predictive LLMs, which audits every narration against the decomposition it claims to describe, checks whether the cited covariates are truly influential, and scores decisions against the accuracy of a trivial rule that always recommends the most common action. Second, the simulation study identifies where the proposed pipeline can be trusted. The key findings are that the distillation step itself is nearly lossless. What breaks trust is not the fine-tuned LLM but a noisy upstream estimator, whose errors the distilled model reproduces in confident and fluent prose. Third, we apply the proposed pipeline on a nationally representative dataset, the High School Longitudinal Study 2009 (HSLS:09; Ingels et al., 2011), and recover an established finding, that advanced mathematics coursework mostly benefits the students who are least likely to attend college (Byun et al., 2015), and delivers it as audited, individualized explanations with a zero rate of fabricated statistics through the fine-tuned LLM.

The remainder of this paper proceeds as follows. The next section briefly reviews the three background areas: post hoc interpretation tools, LLM fine-tuning and distillation, and the estimation of heterogeneous treatment effects. The Method section introduces how we integrate all these methods into a proposed distillation pipeline. We then design a Monte Carlo simulation study to evaluate the estimation performance, fidelity, and faithfulness. The following empirical analysis demonstrates the pipeline's performance in a real-world setting. The last two sections talk about the advantages, lessons, limitations, and conclusions of the proposed method.

References (75)