Inferensys

Glossary

Distillation for Logistic Regression

The process of using a complex model's soft targets to train a logistic regression student, yielding a globally interpretable linear model with calibrated probability estimates.
ML engineer working on model compression and quantization, laptop showing performance benchmarks, technical workspace.
GLOBAL INTERPRETABILITY

What is Distillation for Logistic Regression?

A technique for creating a globally interpretable linear model by training a logistic regression student on the soft probabilistic outputs of a complex black-box teacher model.

Distillation for logistic regression is the process of training an inherently interpretable logistic regression model to mimic the predictive behavior of a complex, high-performance teacher model. Instead of learning from hard ground-truth labels, the student is trained on the teacher's soft targets—a probability distribution over classes that encodes rich inter-class similarity information known as dark knowledge.

The resulting student model is a globally transparent linear classifier whose learned weights directly quantify the contribution of each input feature to the prediction. By matching the teacher's calibrated probability estimates using a composite loss function, often combining Kullback-Leibler divergence with cross-entropy, the logistic regression student achieves higher fidelity and better-calibrated probabilities than one trained solely on the original dataset.

Distillation for Logistic Regression

Key Characteristics

Distilling a complex model into a logistic regression student creates a globally interpretable linear model that retains calibrated probability estimates from the teacher's dark knowledge.

01

Global Linear Surrogate

The logistic regression student serves as a global surrogate model, approximating the teacher's entire decision boundary with a single linear equation. Unlike local explanation methods that explain one prediction at a time, this approach provides a complete, transparent model that can be inspected, validated, and deployed independently.

  • Each feature receives a single coefficient representing its global importance
  • The decision boundary is a simple hyperplane in the feature space
  • Perfect for regulated industries requiring fully auditable models
  • Can be expressed as a simple scorecard or formula
02

Soft Target Training

Instead of training on hard binary labels, the logistic regression student learns from the teacher's soft targets—probability distributions over classes. These softened outputs, controlled by a temperature parameter in the teacher's softmax, encode rich information about class similarities and decision boundary confidence.

  • Soft targets reveal which classes the teacher considers plausible alternatives
  • A high temperature smooths the distribution, exposing more dark knowledge
  • The student learns not just what the teacher predicts, but how confidently
  • Results in better-calibrated probability estimates than direct training on labels
03

Distillation Loss Function

The training objective combines two components: the Kullback-Leibler (KL) divergence between teacher and student soft targets, and the standard cross-entropy loss against ground-truth labels. A weighting parameter α balances these two signals.

  • KL divergence term: Aligns student probabilities with teacher soft targets
  • Cross-entropy term: Ensures the student remains grounded in actual labels
  • Typical α values range from 0.1 to 0.5, favoring the distillation signal
  • The combined loss produces students that often outperform those trained on labels alone
04

Calibrated Probability Outputs

A key advantage of distillation to logistic regression is the production of well-calibrated probability estimates. The soft targets from the teacher encode uncertainty information that helps the linear student avoid overconfident predictions on ambiguous inputs.

  • Student probabilities better reflect true empirical likelihoods
  • Reduces the need for post-hoc calibration like Platt scaling
  • Critical for risk-sensitive applications in finance and healthcare
  • Maintains interpretability while improving reliability of confidence scores
05

Feature Importance Extraction

Once trained, the logistic regression coefficients provide direct, quantitative feature importance scores. Each coefficient represents the change in log-odds for a unit increase in the corresponding feature, making the model's reasoning completely transparent.

  • Positive coefficients indicate features that increase the predicted probability
  • Negative coefficients indicate features that decrease it
  • Coefficient magnitudes reflect relative importance after standardization
  • Can be directly presented to regulators or used in adverse action notices
06

Fidelity-Evaluated Performance

The student model is evaluated primarily on fidelity—how closely its predictions match the teacher's—rather than accuracy against ground truth alone. A high-fidelity logistic regression student successfully captures the teacher's learned decision logic in a transparent form.

  • Fidelity measured by agreement rate or KL divergence on held-out data
  • High fidelity indicates the teacher's behavior is largely linear in the feature space
  • Low fidelity suggests the teacher relies on non-linear interactions the student cannot capture
  • Guides decisions about whether a linear explanation is sufficient for the use case
DISTILLATION FOR LOGISTIC REGRESSION

Frequently Asked Questions

Answers to the most common technical questions about using knowledge distillation to train a globally interpretable logistic regression student model that mimics a complex black-box teacher.

Distillation for logistic regression is a post-hoc interpretability technique where a complex, black-box teacher model's soft targets are used to train a transparent logistic regression student. The process works by first passing training data through the teacher to generate a probability distribution over classes for each instance, typically softened using a high temperature scaling parameter. These soft targets encode rich dark knowledge about inter-class similarities that hard labels lack. The logistic regression student is then trained to minimize the Kullback-Leibler divergence between its own output probabilities and the teacher's soft targets, rather than fitting the original ground-truth labels directly. The result is a globally interpretable linear model whose coefficients directly quantify each feature's average influence on the prediction, while retaining calibrated probability estimates that closely approximate the teacher's decision boundary.

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.