Opening the AI Black Box: Distilling Machine-Learned Algorithms into Code
Open Access
Abstract
Can we turn AI black boxes into code? Although this mission sounds extremely challenging, we show that it is not entirely impossible by presenting a proof-of-concept method, MIPS, that can synthesize programs based on the automated mechanistic interpretability of neural networks trained to perform the desired task, auto-distilling the learned algorithm into Python code. We test MIPS on a benchmark of 62 algorithmic tasks that can be learned by an RNN and find it highly complementary to GPT-4: MIPS solves 32 of them, including 13 that are not solved by GPT-4 (which also solves 30). MIPS uses an integer autoencoder to convert the RNN into a finite state machine, then applies Boolean or integer symbolic regression to capture the learned algorithm. As opposed to large language models, this program synthesis technique makes no use of (and is therefore not limited by) human training data such as algorithms and code from GitHub. We discuss opportunities and challenges for scaling up this approach to make machine-learned models more interpretable and trustworthy.Keywords
Funding Information
- National Science Foundation (2141064, PHY-2019786)
- National Science Foundation (2141064, PHY-2019786)
This publication has 14 references indexed in Scilit:
- Programming by Example Made EasyACM Transactions on Software Engineering and Methodology, 2023
- Acquisition of chess knowledge in AlphaZeroProceedings of the National Academy of Sciences of the United States of America, 2022
- Evolving symbolic density functionalsScience Advances, 2022
- Multimodal Neurons in Artificial Neural NetworksDistill, 2021
- Curve DetectorsDistill, 2020
- Zoom In: An Introduction to CircuitsDistill, 2020
- On the Interpretation of Recurrent Neural Networks as Finite State Machines2019
- An Empirical Evaluation of Rule Extraction from Recurrent Neural NetworksNeural Computation, 2018
- LSTMVis: A Tool for Visual Analysis of Hidden State Dynamics in Recurrent Neural NetworksIEEE Transactions on Visualization and Computer Graphics, 2017
- Learning a class of large finite state machines with a recurrent neural networkNeural Networks, 1995