Source-linked AI summary

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

Chenguang Pan, Airui Meng, Youmi Suk

arXiv:2608.21165v1cs.HCcs.CY

TL;DR

Flexible ML in learning analytics is difficult to trust and deploy because its predictions and explanations are opaque. The paper distills an estimator and its decomposition into a small open-weight LLM, then audits the resulting narrations. Distillation is nearly lossless with an oracle mentor, while realistic-estimator errors are primarily inherited upstream.

  • Problem

    Flexible ML offers useful learning-analytics estimates, but opaque predictions, specialized explanations, and deployment burdens limit practical educational use.

  • Method

    A two-stage pipeline converts fitted ML estimates and ALE-fANOVA interpretations into validated mentor traces, then fine-tunes a small open-weight LLM with LoRA.

  • Results

    Under an oracle mentor, distillation is nearly lossless for effect-surface recovery, important-variable ranking, and spurious-covariate avoidance; realistic-mentor errors are primarily upstream.

  • Takeaways & Limitations

    The resulting mentee predicts and explains offline on commodity hardware, while faithfulness audits are needed because fluent narration does not establish correctness.

  • Takeaways & Limitations

    The evidence is limited by five simulation replications, one dataset, one treatment, and one outcome, and the mentee compresses point-estimate magnitudes.

Abstract

from arXiv · show

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.

1 Introduction

The paper addresses the opacity and deployment burden of flexible ML in learning analytics by distilling fitted estimators and their interpretations into a small self-explaining LLM. It evaluates whether the mentee preserves predictive and explanatory behavior, separating distillation loss from upstream estimator loss.

  • Motivation: Flexible ML models improve estimation without strong distributional assumptions but conceal the reasoning behind predictions.This opacity weakens transparency and trustworthiness in educational decision-making.
  • Motivation: Interpretation tools and deployment requirements create separate obstacles to using black-box ML in educational practice.Post hoc artifacts require statistical literacy, while operating estimators, preprocessing, and explanations requires substantial infrastructure.
  • Contribution: The proposed pipeline distills a black-box estimator and its post hoc interpretation into a small open-weight LLM that produces estimates, decisions, and natural-language explanations.The model can run locally on commodity hardware without upstream dependencies.
  • Evaluation design: The simulation compares oracle and realistic mentors to distinguish losses caused by distillation from losses caused by the upstream estimator.The oracle condition establishes a ceiling for the distillation stage, while the realistic condition reflects ordinary estimator error.
  • Evaluation design: A faithfulness-first framework audits narrations against their claimed decompositions rather than treating fluent text as evidence of accuracy.The framework checks cited covariates, narration faithfulness, and decisions against a majority-action baseline.

2 Background

The background develops ALE-fANOVA as an individual-level explanation of black-box estimates and introduces LoRA-based distillation into a compact mentee model. It also situates the approach within heterogeneous treatment-effect estimation and educational decision support.

  • Interpretation tools: Partial dependence can mislead with correlated covariates because it evaluates models in sparsely observed regions.ALE instead uses local finite differences within conditional windows near observed data.
  • Interpretation tools: ALE decomposes an individual estimate into a grand mean, first-order covariate terms, pairwise interactions, and a residual.The residual contains whatever the retained terms do not reproduce.
  • Interpretation tools: fANOVA assigns variance-based importance shares to covariates, interactions, and leftover variation, while correlated components make these relative rather than exact variance partitions.Each ALE term is evaluated at observed individual values before its across-sample variance is calculated.
  • LoRA fine-tuning and distillation: LoRA freezes pretrained weights and trains low-rank adapters, reducing trainable parameters from the full layer matrix to r(d + k) entries.With d = k = 2,048 and r = 16, the adapter has about 1.6% as many parameters as the modified layer.
  • LoRA fine-tuning and distillation: The paper distills mentor traces into a smaller LLM by optimizing token-level cross-entropy while updating only the adapters.The adapters can later be folded into the base weights without extra inference parameters or cost.
  • Heterogeneous treatment effects: CATE summarizes treatment-effect heterogeneity for students sharing a given set of characteristics, unlike a single average treatment effect.The causal interpretation requires consistency, conditional ignorability, and positivity.

3 Methods

The methods construct validated mentor traces from flexible ML estimates and ALE-fANOVA decompositions, then fine-tune a small LLM with LoRA to reproduce estimates, explanations, and decisions. Selection rules, phrase constraints, and faithfulness audits are designed to keep generated narrations grounded.

  • Mentor construction: The mentor stage fits a flexible ML model, decomposes each estimate with ALE-fANOVA, derives a decision, and renders the assets as a structured trace.The mentee stage fine-tunes a small open-weight LLM on accepted traces.
  • Decomposition: The interaction screen retains the pair explaining the most residual variance after first-order terms.In the empirical application, first-order terms explain 67.7% of estimated-effect variance, the interaction adds 6.6%, and 25.7% remains uncaptured.
  • Narration controls: Each student’s estimate is reconstructed from the grand mean, cited contributions, and a residual, with eligibility and contribution thresholds limiting which covariates can be narrated.Within a student, terms are cited by descending absolute contribution until they explain 90% of total attribution, capped at five terms.
  • Narration controls: The mentor narration reports the student’s estimate relative to the grand mean, observed covariate values, signed contributions, and the recommended decision.The empirical example’s ledger closes exactly at 0.2150 after summing the displayed components.
  • Narration controls: The phrase pool supplies estimator-derived directional language, and categorical drivers receive no interpretive clause.Phrases may attach only to terms already cited by the ledger.
  • Implementation: The implementation fine-tunes a Gemma E2B model with rank-16 adapters injected into the top 16 transformer blocks.The configuration has about 13.6 million trainable parameters, approximately 0.7% of the base model.
  • Faithfulness audit: Validators accept mentor traces only when their narrations are faithful, while evaluation audits mentee outputs without repairing them.The first audit layer checks arithmetic closure of the stated decomposition.

4 Simulation Study

The simulation separates distillation loss from estimator loss by comparing an oracle mentor with an X-learner and tests prediction, attribution, decision safety, and narration faithfulness against known ground truth. Distillation is nearly lossless with an oracle signal, whereas realistic-estimator errors largely originate upstream.

  • Data-generating process: The simulation uses 21 covariates, including true moderators {X1, X2, X3}, confounders {X1, X2, X5}, outcome predictor X4, and noise variables.X4 and X5 are decoys for testing whether the pipeline distinguishes non-moderators from true moderators.
  • Experimental design: The study compares an oracle mentor providing the true CATE surface with an X-learner realistic mentor to isolate distillation loss from estimator loss.The mentee produces point estimates, cited terms, and decisions for each test individual.
  • Oracle-mentor results: 0.969 decomposition closure results when the narrated interaction is added to first-order terms, confirming recovery of the interaction structure under the oracle mentor.First-order terms alone close ρ2_add = 0.496 of true-CATE variance, while the narrated X1 × X3 interaction raises closure to ρ2_dec = 0.969.
  • Oracle-mentor results: AUC = 1.000 and FalseCite = 0.000 show that the oracle-trained mentee ranks all true moderators above decoys and noise without spurious citations.The mentee cites the X1 × X3 interaction for about 79% of test students, versus 80% for the mentor.
  • Realistic-mentor results: About 0.72 correlation and about 0.50 slope under the X-learner show that realistic-estimator error primarily reflects upstream finite-sample compression.Interaction recovery falls to 0.599 and 0.634, FalseCite rises to 0.263, while moderator ranking remains AUC ≥0.989; every mentee–mentor gap is at most 0.074.
  • Decision safety and faithfulness: 1.000 UnsafeTreat under severe imbalance with the X-learner shows that decision safety can fail when the upstream estimator already recommends treatment for nearly everyone.The mentor recommends treatment for 0.926 of such students, while the mentee recommends it for every one; under the oracle mentor, the mentee misrecommends 28.9% of the harmed subgroup.
  • Decision safety and faithfulness: Narration-faithfulness metrics close to 1 indicate that the mentee learns arithmetically closed, non-hallucinated decompositions.The evaluation checks numerical and categorical grounding, self-closure, and uniqueness of narrations.

5 Empirical Analysis

The empirical analysis applies the pipeline to estimate heterogeneous effects of AP/IB mathematics coursework on four-year college enrollment and evaluates mentor–mentee fidelity. The mentee largely preserves the mentor’s explanations and narration faithfulness, but compresses effects and recommends treatment broadly in an imbalanced setting.

  • Application: The HSLS:09 application uses 9,167 students to estimate AP/IB mathematics effects on four-year college enrollment with a fine-tuned Gemma E2B mentee.The treatment indicates whether a student passed an AP/IB mathematics exam at least once; the analysis includes 21 covariates after dummy encoding.
  • Mentor estimates: An ATE of 0.230 and positive conditional effects for 98.3% of students accompany declining effects across quartiles of prior mathematics achievement and socioeconomic status.The leading moderators account for 17% and 13% of fANOVA variance, respectively, followed by educational expectations and school climate.
  • Mentor estimates: First-order ALE terms explain 0.68 of mentor-estimate variance, while one retained interaction raises decomposition closure to 0.74.The selected interaction is prior mathematics achievement × school climate; the second strongest pair adds only 2.3%.
  • Mentee fidelity: On 1,834 held-out students, mentee and mentor CATEs correlate at r = 0.71 with a regression slope of 0.55, while the mentee truncates the mentor’s negative tail.The mentor recommends treatment for 1,800 of 1,834 students, whereas the mentee recommends treatment for all students.

6 Discussion

The discussion attributes most performance degradation to construction of the upstream mentor rather than to distillation. It also emphasizes that fluent explanations can remain unsafe or incorrect when signals are noisy or decisions are severely imbalanced.

  • Interpretation: Across comparisons, degradation is primarily caused by mentor construction and is faithfully transmitted to the mentee.With an oracle signal, distillation is nearly lossless; with an X-learner, the mentee inherits shrinkage toward the mean and greater apparent additivity.
  • Interpretation: The pipeline’s explanations preserve unrepresented structure as residual rather than fabricating substitutes from noise variables.Under the realistic estimator, the mentee’s first-order variance share is R2 of 0.73 against 0.50 for the oracle.
  • Caveats: Fluent, confident narrations are not evidence of correctness: in severely imbalanced settings, they can recommend harmful treatment to almost all harmed students.This danger is detectable in simulation because the ground truth is known by construction.
  • Deployment: The pipeline supports local privacy-preserving deployment and natural-language interaction without requiring stakeholders to use the estimator, interpretation tool, or rigid input format.Student records remain on the machine, while mentor construction can also run locally on sufficiently capable open-weight models.
  • Limitations: The evidence is bounded by five simulation replications and one empirical dataset, treatment, and outcome, while the mentee compresses effect magnitudes in every condition.Changing mentee size and precision does not remove the compression issue.
  • Limitations: The fANOVA decomposition describes statistical association within the fitted surface, not a causal pathway through which one covariate operates through another.A narrated interaction should therefore not be interpreted as a mechanism.

7 Conclusions

The paper concludes that a small open-weight language model can distill an estimator and its fANOVA interpretation into offline predictions and natural-language explanations. Its main safeguards are to scrutinize the upstream mentor, audit narration faithfulness, and treat imbalanced decisions cautiously.

  • Conclusion: The two-stage pipeline distills an ML estimator and fANOVA interpretation into a small open-weight language model that predicts and explains offline on commodity hardware.The mentee reproduces the oracle mentor nearly exactly and inherits realistic-mentor flaws without fabricating information.
  • Conclusion: Fluency cannot establish correctness, and severely imbalanced decisions can collapse toward an overwhelmingly common recommendation.The paper recommends comparing decision accuracy with the majority baseline and not relying on estimate confidence intervals alone for decisions.

Appendix A Causal Assumptions and Identification

The appendix defines the CATE target and states the assumptions needed to identify it from observed student data. Under consistency, conditional ignorability, and positivity, the conditional effect becomes a contrast of observable conditional outcome means.

  • Target parameter: The CATE is τ(x) = E[Y*(1) − Y*(0) | X = x], the expected individual-level treatment effect conditional on covariates.Because each student receives only one treatment condition, the individual potential-outcome difference is never directly observed.
  • Assumptions: Conditional ignorability requires potential outcomes to be independent of treatment assignment given covariates.This is assumption (A2).
  • Assumptions: Positivity requires 0 < Pr(A = 1 | X = x) < 1 for every covariate value.This is assumption (A3), ensuring treated and untreated conditioning events occur with positive probability.
  • Assumptions: Consistency assumes the observed outcome equals the potential outcome under the treatment received, with no interference and one well-specified treatment version.Here, AP and IB mathematics courses count as the same intervention, and one student’s enrollment does not depend on classmates’ treatment.
  • Identification: Under assumptions A1–A3, τ(x) equals E[Y | A = 1, X = x] − E[Y | A = 0, X = x], which estimators approximate from observed data.Averaging τ(x) over the covariate distribution yields the ATE.

Evaluate the causal assumptions in empirical analysis

The empirical causal analysis relies on assumptions about treatment assignment, unmeasured confounding, and common support. These assumptions constrain the causal interpretation to the upstream X-learner rather than the mentee model.

  • Students within the same classroom or school may share features, and treatment choices may affect one another, so the treatment-assignment assumption holds only approximately.
  • The unmeasured-confounding assumption is untestable, although 17 student- and school-level covariates are included to reduce violation risk.A sensitivity analysis is identified as a natural extension but is not included because causal ML serves as a case study.
  • 1.2% of the sample, or 107 of 9,167 students, falls outside the shared propensity-score support [0.04, 0.87].The treated and control distributions share common support over the reported interval.
  • The causal assumptions attach to the X-learner, while the mentee performs no identification and is causal only when those assumptions and faithful mentor approximation hold.

Appendix B Worked Example: One Student Through Both Stages

The worked example follows one validation-split student through mentor trace construction and mentee training data, showing how covariates, decompositions, arithmetic, and narration are represented. The mentor and mentee outputs are organized around individual contributions to a predicted treatment effect.

  • Worked example: The example uses a validation-split student who contributed no LoRA gradient step, so the displayed mentee output is generated rather than memorized.
  • Narration: The narration describes the interaction as amplifying the benefit even though its attributed contribution is -0.0156 and the decomposition note says it carries the opposite sign.
  • Mentor trace: The mentor’s X-learner estimate is ˆτ = +0.2150 on the four-year college-enrollment probability scale, reconstructed from first- and second-order terms plus a residual.
  • Mentee input: The covariate block is the only student-specific text reaching the mentee and contains no estimate, decomposition, or decision.
  • Decomposition: The cited drivers include school control, mathematics score, socioeconomic status, student expectations, and a mathematics-score-by-school-climate interaction.
  • Mentor trace: The mentor trace combines a baseline, five listed contributions, a residual, a predicted effect of +0.2150, confidence, and a treatment decision.

Stage 2: Mentee Deployment

At deployment, the mentee receives only a fixed system prompt and a student’s covariates, then produces an estimate and explanation in one forward pass. Its prompt requires individualized drivers, contributions, comparison with the average effect, interactions, confidence, and a decision.

  • Deployment: The mentee has no access to the estimator or decomposition; everything it emits is produced in a single forward pass from covariates alone.
  • Deployment: The fixed prompt asks for a probability-risk-difference estimate of AP/IB mathematics coursework on four-year college enrollment and a faithful JSON explanation.
  • Generated output: +0.3292 is notably higher than the average effect of +0.2289 across all students in the generated example.
  • Generated output: The output attributes the largest increase to a mathematics-score-by-school-climate interaction of +0.0731 and ends with an enrollment recommendation.

What Transfers and What Does Not

The comparison shows that the mentee can reproduce output structure and some mentor-selected information, but transfer remains imperfect. In the example, its numerical estimate and attribution signs diverge materially from the mentor’s decomposition.

  • Three of the mentor’s five cited terms are reproduced to within 0.0001, while the mentee also identifies the same interacting pair selected upstream.
  • The mentee estimate is +0.1142 above the mentor’s, and it reverses the interaction sign, reporting roughly 4.7 times the magnitude.
  • The mentee drops mathematics achievement, the mentor’s second-strongest driver, and substitutes student sex, which the mentor did not cite for this student.

Appendix C Does the mentee’s size or precision remove magnitude compression?

Across Gemma sizes and precisions, magnitude compression persists under the realistic X-learner, so enlarging or increasing precision does not remove it. The compression is attributed mainly to the upstream estimator, while the smallest 4-bit model offers the practical deployment advantage.

  • Results: Magnitude compression occurs across all tested Gemma variants under the realistic X-learner.The difference between variants is described as trivial under the realistic estimator.
  • Results: A larger, higher-precision Gemma model cannot remedy magnitude compression.The sweep compares estimate compression, disk usage, peak memory, and inference speed across E2B to 26B models at 4-bit and BF16 precision.
  • Interpretation: The X-learner accounts for most magnitude compression, which distillation honestly inherits from the realistic mentor.Comparison with the oracle mentor separates upstream estimator effects from distillation effects.
  • Deployment: The E2B Gemma with 4-bit precision occupies 3.6 GB on disk and peaks near 4.1 GB of memory.Because variants perform similarly under the realistic learner, this is identified as the cheapest optimal choice and fits comfortably inside a consumer laptop.
Loading 2608.21165v1…