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.
Glossary
Distillation for Generalized Additive Models

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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Core concepts that form the technical foundation for distilling complex models into inherently interpretable Generalized Additive Models.
Soft Targets
The probability distributions over classes produced by a teacher model, typically smoothed by a high temperature parameter. Unlike hard labels (e.g., [0,1,0]), soft targets (e.g., [0.1,0.8,0.1]) reveal the teacher's dark knowledge about class similarities. When distilling into a GAM, these rich signals guide the shape functions to learn nuanced feature contributions that mirror the teacher's internal representations.
Temperature Scaling
A hyperparameter applied to the softmax function during distillation that controls the softness of the output probability distribution. Higher temperatures produce softer distributions, exposing more of the teacher's dark knowledge. The formula is:
q_i = exp(z_i / T) / Σ_j exp(z_j / T)T=1: standard softmaxT>1: softer, reveals class similaritiesT→∞: uniform distribution
Distillation Loss
A composite objective function that combines two components:
- KL Divergence between teacher and student soft targets (soft loss)
- Cross-entropy against ground-truth labels (hard loss)
The total loss is typically:
L = α * L_soft + (1-α) * L_hard, where α balances the influence of the teacher's dark knowledge against the true labels. For GAM distillation, this loss guides each feature's shape function to faithfully reproduce the teacher's decision boundary.
Fidelity-Evaluated Student
A student model whose quality is measured by its fidelity—the degree to which its predictions match those of the teacher model on unseen data. Key metrics include:
- Fidelity: Percentage of test samples where student and teacher agree
- R² between logits: How well student logits predict teacher logits
- Shape function correlation: How closely each GAM shape function reflects the teacher's marginal feature behavior Fidelity, not just accuracy, is the primary success criterion in distillation.

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us