Inferensys

Glossary

Distillation for Generalized Additive Models

The process of training an inherently interpretable Generalized Additive Model (GAM) student to mimic a complex teacher model, resulting in a transparent system where each feature's contribution is visualized via shape functions.
ML engineer managing model training cluster on laptop, GPU utilization visible, technical deep learning setup.
INTERPRETABLE STUDENT TRAINING

What is Distillation for Generalized Additive Models?

A specialized knowledge distillation process where an inherently interpretable Generalized Additive Model (GAM) student is trained to mimic a complex black-box teacher, yielding a transparent model with directly visualizable feature shape functions.

Distillation for Generalized Additive Models is the process of training an inherently interpretable GAM student to replicate the predictive behavior of a complex teacher model by learning from its softened output probabilities. The resulting student model decomposes predictions into additive contributions from individual features, each represented by a shape function that can be directly plotted and inspected.

This technique preserves the fidelity of the teacher's decision boundary while enforcing the structural constraint that the learned relationship is a sum of univariate functions. The distilled GAM provides a globally interpretable surrogate where the exact contribution of each feature to any prediction is transparent, enabling rigorous auditing without sacrificing the performance gains of the original opaque model.

DISTILLATION FOR GENERALIZED ADDITIVE MODELS

Key Characteristics

Distilling a complex teacher model into a Generalized Additive Model (GAM) student produces a glass-box model where the contribution of each feature is isolated, visualized, and audited via shape functions.

01

Additive Structure

The GAM student learns an equation of the form g(E[Y]) = f_1(x_1) + f_2(x_2) + ... + f_p(x_p). Each shape function f_i captures the univariate relationship between a single feature and the target, making the model transparent-by-design. Unlike a black-box teacher, there are no cross-feature interactions unless explicitly added, ensuring that the marginal effect of changing one input can be inspected in complete isolation.

02

Shape Function Visualization

The primary interpretability mechanism. After distillation, each feature's learned shape function is plotted as a curve, showing exactly how the model's prediction changes as that feature varies. For example, a shape function for 'age' might reveal a U-shaped risk curve, while 'income' might show a logarithmic saturation. These plots are the definitive audit artifact, allowing a compliance officer to verify that the model has learned sensible, monotonic, or domain-expected relationships from the teacher.

03

Distillation Loss with Smoothing

The student GAM is trained to minimize a composite loss: L = α * KL(softmax(z_T/T) || softmax(z_S/T)) + (1-α) * CrossEntropy(y, softmax(z_S)). The temperature parameter T softens the teacher's output distribution, exposing dark knowledge about inter-class similarities. The Kullback-Leibler divergence term forces the GAM's additive score to match the teacher's rich probability landscape, transferring knowledge that hard labels alone cannot convey.

04

Feature-Level Fidelity

Fidelity is measured by how closely the GAM student's predictions match the teacher's on unseen data. A high-fidelity distilled GAM achieves global surrogate status, meaning its additive decomposition faithfully approximates the teacher's full decision boundary. This is quantified using R-squared for regression or AUC agreement for classification. A drop in fidelity signals that important feature interactions captured by the teacher are being lost and may need to be added as explicit two-way terms in the GAM.

05

Explainable Boosting Machine (EBM) as Student

An Explainable Boosting Machine is a modern, high-performance GAM that serves as an ideal student. It uses bagging and gradient boosting to learn each shape function as a set of piecewise-constant bins. EBMs also include a fast, cyclical algorithm to automatically detect and rank pairwise interaction terms. When distilling a deep neural network teacher, the EBM student can optionally include the top-k interactions to boost fidelity while maintaining full transparency for every additive component.

06

Regulatory-Grade Audit Trail

A distilled GAM provides a complete audit trail for model decisions. For any single prediction, the final logit is decomposed as: Prediction = Intercept + f_1(x_1_value) + f_2(x_2_value) + .... Each term is a scalar lookup from its shape function. This satisfies right to explanation requirements under regulations like GDPR and the EU AI Act, as the exact numerical contribution of each feature to a denied loan application or a flagged transaction can be presented to a human reviewer without ambiguity.

DISTILLATION FOR GAMS

Frequently Asked Questions

Core questions about distilling complex black-box models into transparent Generalized Additive Models for high-stakes interpretability.

Distillation for Generalized Additive Models (GAMs) is a post-hoc interpretability technique where an inherently transparent GAM student is trained to mimic the predictions of a complex, high-performance black-box teacher model. The goal is to transfer the teacher's predictive knowledge into a glass-box structure where the contribution of each feature can be independently visualized and audited via shape functions. Unlike surrogate models that only approximate local behavior, a distilled GAM provides a globally interpretable additive function g(E[y]) = f_1(x_1) + f_2(x_2) + ... + f_p(x_p). The training process uses the teacher's soft targets—probability distributions smoothed by a high temperature parameter—to capture the rich inter-class similarity structure known as dark knowledge. This results in a student model that achieves higher fidelity to the teacher than one trained on hard labels alone, while maintaining the strict interpretability guarantees of the GAM architecture. The final model allows auditors to inspect exactly how each feature influences the prediction through one-dimensional plots, satisfying regulatory requirements in finance and healthcare.

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.