Inferensys

Glossary

Post-Hoc Distillation

A model distillation paradigm where an inherently interpretable student model is trained to mimic a fully trained, opaque teacher model after the teacher's training is complete, providing explanations without modifying the original system.
ML engineer managing model training cluster on laptop, GPU utilization visible, technical deep learning setup.
INTERPRETABILITY TECHNIQUE

What is Post-Hoc Distillation?

Post-hoc distillation is the standard paradigm for training an interpretable student model to explain a pre-existing, fully trained black-box teacher model after the teacher's training is complete.

Post-hoc distillation is a model interpretability technique where an inherently transparent surrogate model (the student) is trained to mimic the predictions of a frozen, opaque black-box model (the teacher). Unlike standard knowledge distillation for model compression, the primary goal is not to deploy the student but to use its structural transparency—such as a decision tree or linear model—as a high-fidelity, human-readable explanation of the teacher's complex decision logic.

This process operates strictly after the teacher's training is finalized, requiring no access to the teacher's internal weights or gradients. The student is trained on an input-output dataset generated by querying the teacher, optimizing for fidelity—the degree to which the student's predictions match the teacher's. This approach decouples explanation from model architecture, allowing any black-box system to be audited by a globally or locally faithful surrogate.

CORE MECHANISMS

Key Characteristics of Post-Hoc Distillation

Post-hoc distillation is the standard paradigm for creating interpretable models from pre-existing black boxes. The following characteristics define its operational structure and constraints.

01

Frozen Teacher Model

The teacher model's weights are completely frozen after its initial training. No further gradient updates or fine-tuning occur during the distillation phase. This ensures the student is explaining a static, fixed decision boundary rather than a moving target, which is critical for audit reproducibility.

02

Surrogate Model Training

The student is trained solely on the input-output pairs generated by querying the teacher. Key surrogate architectures include:

  • Decision Trees: For rule extraction and flowchart logic
  • Logistic Regression: For linear feature importance
  • Explainable Boosting Machines (EBMs): For glass-box additive models
  • Rule Lists (e.g., SIRUS): For sparse if-then explanations
03

Fidelity as the Primary Metric

Unlike standard model training, the student's success is measured by fidelity—how closely its predictions match the teacher's outputs on unseen data—rather than accuracy against ground-truth labels. A high-fidelity student faithfully reproduces the teacher's logic, including its biases and blind spots, making them visible for audit.

04

Decoupled Architecture Selection

The teacher and student architectures are completely independent. A deep transformer teacher can be distilled into a shallow decision tree, or a convolutional ensemble into a linear model. This decoupling allows engineers to select the student architecture that best matches the interpretability requirements of the target audience—regulators, developers, or end-users.

05

Global vs. Local Scope

Post-hoc distillation operates at two distinct scopes:

  • Global Surrogates: A single interpretable model trained to approximate the teacher's entire decision boundary across the full input space
  • Local Surrogates: Instance-specific models (like LIME) trained only on perturbations around a single prediction to explain that specific output
06

No Access to Teacher Internals Required

Post-hoc distillation is a black-box technique that requires only query access to the teacher model's predictions. It does not need gradients, attention weights, or intermediate activations. This makes it applicable to proprietary APIs, legacy systems, and third-party models where internal architecture details are unavailable.

DISTILLATION PARADIGM COMPARISON

Post-Hoc Distillation vs. Standard Knowledge Distillation

Key architectural and objective differences between distilling a pre-trained teacher for interpretability versus compressing a model for deployment efficiency.

FeaturePost-Hoc DistillationStandard Knowledge Distillation

Primary Objective

Interpretability and explanation of a black-box teacher

Model compression and inference speedup

Teacher Model State

Frozen and fully pre-trained

May be co-trained or fine-tuned

Student Model Type

Inherently interpretable (decision tree, GAM, rule list)

Compact neural network with identical output space

Training Trigger

After teacher deployment, for auditing purposes

Before student deployment, for resource optimization

Loss Function Focus

Fidelity to teacher predictions plus interpretability regularization

KL divergence from teacher soft targets plus ground-truth cross-entropy

Output Artifact

Human-readable surrogate (rules, feature shapes, decision paths)

Deployable compressed model file (ONNX, TensorRT)

Temperature Scaling Use

Often low or T=1 to preserve crisp decision boundaries for extraction

High temperature (T>1) to reveal dark knowledge about class similarities

Evaluation Metric

Fidelity score and explanation quality

Accuracy retention and latency reduction

POST-HOC DISTILLATION

Frequently Asked Questions

Clear, technical answers to the most common questions about training interpretable student models to explain fully trained black-box teachers.

Post-hoc distillation is the process of training an inherently interpretable student model to mimic a pre-existing, fully trained black-box teacher model after the teacher's training is complete. Unlike standard knowledge distillation, which primarily targets model compression for deployment efficiency, post-hoc distillation explicitly prioritizes interpretability as the primary objective. The teacher model is frozen and treated as an oracle; the student—often a decision tree, linear model, or Generalized Additive Model (GAM)—is trained solely on the teacher's input-output pairs or soft targets. The key distinction is temporal and teleological: the distillation occurs post hoc (after the fact) and serves explanation, not speed. This allows organizations to deploy high-performance opaque models while maintaining a faithful, auditable surrogate for compliance and debugging.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.