Introduction
Multi-Layer Perceptrons (MLPs) have long served as the backbone of deep learning. Recently, Kolmogorov-Arnold Networks (KANs) have emerged as a promising alternative, particularly for scientific computing. Unlike traditional MLPs that apply fixed activation functions to nodes, KANs utilize trainable activation functions on the "edges" (connections) between nodes. While KANs offer significant potential for interpretability and accuracy in solving differential equations, the existing software landscape has been fragmented. The original pykan implementation is PyTorch-based and primarily restricted to B-spline functions.
jaxKAN addresses this gap by providing a unified, high-performance, JAX-native library for KANs. By leveraging the JAX ecosystem—specifically Flax’s NNX for model construction and Optax for optimization—jaxKAN offers a flexible and extensible framework for researchers to experiment with diverse KAN architectures without the need to rebuild core components from scratch.
Methodology
The core of jaxKAN is its modular design, which supports multiple basis functions and advanced training techniques designed for high-performance computing environments.
Unified Layer Interface
The library integrates five distinct layer types into a single, cohesive interface:
- Original B-splines
- Efficient spline variants
- Chebyshev polynomials
- Modified Chebyshev polynomials
- Fourier series
This variety allows researchers to select the mathematical "language" best suited for their specific data or physical system.
Adaptive Grid Updates
A defining feature of KANs is the ability to refine basis functions during the training process. jaxKAN implements an update_grids method that allows for dynamic adjustments, such as increasing polynomial degrees or adding terms to a Fourier sum on the fly. To ensure these updates are computationally efficient, the authors developed a custom parallel batched least-squares solver, an operation not natively supported by standard JAX libraries but essential for maintaining KAN performance at scale.
Physics-Informed Utilities
For scientific applications, jaxKAN includes specialized high-level utilities like train_PIKAN. These functions facilitate the training of Physics-Informed Kolmogorov-Arnold Networks (PIKANs), which are designed to solve partial differential equations (PDEs) by embedding physical constraints directly into the neural network's loss function.
Case Study: The Allen-Cahn Equation
To evaluate the framework, the authors applied jaxKAN to the Allen-Cahn equation, a (1+1)D PDE describing phase separation in multi-component alloy systems. This equation lacks a simple analytical solution and presents complex dynamics that serve as a rigorous benchmark for testing the adaptive capabilities of KANs. The performance was measured against a high-fidelity reference solution from established literature.
Results and Discussion
The evaluation compared "Vanilla" KANs (using static grids) against the "Adaptive" KANs supported by jaxKAN. The results demonstrated that adaptive training is crucial for capturing the fine-grained evolution of the Allen-Cahn system, particularly in later time steps ($t \ge 0.3$) where static models typically fail.
As shown in the solution plot above, the Adaptive PIKAN successfully models the phase separation dynamics. Quantitatively, the adaptive routines significantly reduced residual errors compared to non-adaptive methods.
The absolute error remains remarkably low throughout the simulation domain. Furthermore, the JAX-based implementation provides substantial performance gains over the original PyTorch-based pykan, benefiting from Just-In-Time (JIT) compilation and hardware acceleration on GPUs and TPUs.
Conclusion
jaxKAN provides a robust and efficient foundation for exploring Kolmogorov-Arnold Networks within the JAX ecosystem. By unifying multiple basis functions and providing high-level utilities for physics-informed modeling, it lowers the barrier for researchers in scientific machine learning. Future developments will focus on expanding the library's support for new KAN variants and integrating utilities for a broader range of deep learning tasks, including computer vision and natural language processing.
Summary updated