Distilling Interpretable Models into Human-Readable Code

Walker Ravina, Ethan Sterling, Olexiy Oryeshko, Nathan Bell, Honglei Zhuang +3 more
1/21/2021
cs.LG
distillation

Official code: google/pwlfit (43 stars, Jupyter Notebook, Apache-2.0, last commit 2026-07-15).

Abstract

The goal of model distillation is to faithfully transfer teacher model knowledge to a model which is faster, more generalizable, more interpretable, or possesses other desirable characteristics. Human-readability is an important and desirable standard for machine-learned model interpretability.

Show full abstract

Readable models are transparent and can be reviewed, manipulated, and deployed like traditional source code. As a result, such models can be improved outside the context of machine learning and manually edited if desired. Given that directly training such models is difficult, we propose to train interpretable models using conventional methods, and then distill them into concise, human-readable code. The proposed distillation methodology approximates a model's univariate numerical functions with piecewise-linear curves in a localized manner. The resulting curve model representations are accurate, concise, human-readable, and well-regularized by construction. We describe a piecewise-linear curve-fitting algorithm that produces high-quality results efficiently and reliably across a broad range of use cases. We demonstrate the effectiveness of the overall distillation technique and our curve-fitting algorithm using four datasets across the tasks of classification, regression, and ranking.

View on arXivView PDF

Code Implementations(1)

google/pwlfitOfficial100%
Apache-2.0
436Jupyter Notebook, PythonJan 31, 20204 months agoApache-2.0

Similar Papers

Cite this paper

@article{ravina2021distilling,
  title  = {Distilling Interpretable Models into Human-Readable Code},
  author = {Walker Ravina and Ethan Sterling and Olexiy Oryeshko and Nathan Bell and Honglei Zhuang and Xuanhui Wang and Yonghui Wu and Alexander Grushetsky},
  year   = {2021},
  eprint = {2101.08393},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2101.08393}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2101.08393.svg)](https://codeofpaper.com/paper/2101.08393)

Discussion