Skip to main content
QUICK REVIEW

[Paper Review] SymTorch: A Framework for Symbolic Distillation of Deep Neural Networks

Elizabeth S. Z. Tan, Adil Soubki|arXiv (Cornell University)|Feb 24, 2026
Machine Learning in Materials ScienceMaterials Science0 citations
TL;DR

SymTorch automates symbolic distillation of neural network components into closed-form expressions, enabling interpretable surrogates and hybrid neural-symbolic models with case studies across GNNs, PINNs, and LLMs.

ABSTRACT

Symbolic distillation replaces neural networks, or components thereof, with interpretable, closed-form mathematical expressions. This approach has shown promise in discovering physical laws and mathematical relationships directly from trained deep learning models, yet adoption remains limited due to the engineering barrier of integrating symbolic regression into deep learning workflows. We introduce SymTorch, a library that automates this distillation by wrapping neural network components, collecting their input-output behavior, and approximating them with human-readable equations via PySR. SymTorch handles the engineering challenges that have hindered adoption: GPU-CPU data transfer, input-output caching, model serialization, and seamless switching between neural and symbolic forward passes. We demonstrate SymTorch across diverse architectures including GNNs, PINNs and transformer models. Finally, we present a proof-of-concept for accelerating LLM inference by replacing MLP layers with symbolic surrogates, achieving an 8.3\% throughput improvement with moderate performance degradation.

Motivation & Objective

  • Provide an open-source framework to automate symbolic distillation of neural network components.
  • Lower engineering barriers by handling GPU-CPU data transfer, caching, serialization, and forward-pass switching.
  • Demonstrate applicability across architectures (GNNs, PINNs, Transformers) and show potential LLM inference speedups.
  • Illustrate how symbolic surrogates recover known physical laws and reveal LLM arithmetic biases.

Proposed method

  • Wrap NN components as SymbolicModel blocks to collect input-output data during forward passes.
  • Run symbolic regression on collected I/O using PySR to obtain closed-form expressions per output dimension.
  • Replace selected neural blocks with Pareto-front symbolic equations to create hybrid models.
  • Cache activations and support seamless switching between neural and symbolic computations during forward passes.
  • Provide SLIME-style local explanations by fitting symbolic surrogates to neighborhoods around a point of interest.
Figure 1 : A cartoon depicting how SymTorch is used to perform symbolic distillation on model components. For a trained PyTorch model, SymTorch wraps around any NN component in the model. The user passes in sample data and in the forward pass, the inputs and outputs (I/O) of the component are collec
Figure 1 : A cartoon depicting how SymTorch is used to perform symbolic distillation on model components. For a trained PyTorch model, SymTorch wraps around any NN component in the model. The user passes in sample data and in the forward pass, the inputs and outputs (I/O) of the component are collec

Experimental results

Research questions

  • RQ1Can symbolic regression faithfully approximate the input-output mappings of neural network components across diverse architectures?
  • RQ2What are the practical gains and tradeoffs (accuracy vs. speed) when replacing neural blocks with symbolic surrogates in transformers/LLMs?
  • RQ3To what extent can symbolic distillation recover known physical laws or reveal learned arithmetic biases in LLMs?
  • RQ4How does SLIME-style symbolic explanations fare for local interpretability in black-box models?

Key findings

  • SymTorch enables symbolic distillation across GNNs, PINNs, and transformer blocks.
  • Replacing 3 of 28 transformer MLP layers with symbolic surrogates yields an 8.3% throughput increase with a modest perplexity rise (3.14 vs 10.62 baseline).
  • Symbolic surrogates in the PCA-reduced subspace capture MLP behavior with comparable perplexity degradation to PCA alone.
  • PINN-based PDE solutions can be recovered as closed-form expressions after symbolic distillation.
  • GNN-based symbolic distillation recovers true interaction laws, aligning with prior inductive-bias findings.
Figure 2 : Approximating local model behavior with SLIME. For a complex non-linear model, we choose the point of interest $\mathbf{x}^{*}$ . We sample points around this region and fit a symbolic model to these points.
Figure 2 : Approximating local model behavior with SLIME. For a complex non-linear model, we choose the point of interest $\mathbf{x}^{*}$ . We sample points around this region and fit a symbolic model to these points.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.