arXiv:2609.01956cs.LGSep 2026

Manuscript Offprint

arXiv:2609.01956

FlashKAN: B-Spline KANs via Truncated Power Form

Naveen Mysore

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Kolmogorov-Arnold Networks (KANs) place learnable B-spline activations on network edges rather than fixed activations on nodes. The standard Cox-de Boor recursion evaluates these activations through kk sequential passes for degree-kk splines, consuming over 90% of forward-pass time.

FlashKAN replaces this recursion with the truncated power form, a classical result from approximation theory that expresses each uniform cubic B-spline as five (x)3(x)^3 terms at shifted knot positions. This paper makes three contributions: (1) a torch.compile-fused implementation that collapses these operations into a single GPU kernel, eliminating all recursion, span lookup, and scatter-gather operations; (2) a bounded-coordinate stabilization that clamps the normalized input to [0,k+1][0, k+1], preventing the catastrophic cancellation that historically motivated the Cox-de Boor recursion; and (3) a production-ready, open-source package (pip install flashkan) that serves as a drop-in replacement for existing KAN layers.

1 INTRODUCTION

The Kolmogorov-Arnold representation theorem (Kolmogorov, 1957) guarantees that any multivariate continuous function decomposes into univariate functions and addition. KANs (Liu et al., 2024) operationalize this result by placing a learnable activation on every edge. Each activation is a weighted sum of B-spline basis functions, which can be inspected, plotted, and in favorable cases symbolically recovered.

This interpretability carries a cost. The Cox-de Boor recursion (Cox, 1972; de Boor, 1971) evaluates B-spline basis functions through kk sequential passes for degree kk. For cubic splines (k=3k=3), three passes are needed, each depending on the output of the previous. Profiling shows that basis computation alone accounts for 91% of a KAN layer's forward-pass time (Table 1).

The recursion itself was not always the standard. In the 1940s, Schoenberg introduced splines as piecewise polynomials while smoothing ballistics data at Aberdeen Proving Ground (Schoenberg, 1946). His representation used truncated power functions max⁡(0,x)k\max(0, x)^k as the foundational building block, and Curry and Schoenberg formalized B-splines through this basis (Curry & Schoenberg, 1947). The truncated power form is mathematically elegant: proofs of compact support, partition of unity, and smoothness follow directly. But early implementations on 1960s hardware suffered from numerical cancellation in the alternating sum of large powers, and the truncated power basis matrix is poorly conditioned (de Boor, 2001; Schumaker, 2007). Cox and de Boor independently developed the recursive algorithm (Cox, 1972; de Boor, 1971) as a numerically stable alternative, and de Boor's textbook (de Boor, 2001) established the recursion as the standard for the next five decades.

Prior work has pursued three strategies to reduce the cost of B-spline evaluation in KANs. Restructuring the Cox-de Boor recursion (Blealtan, 2024) reduces constant factors but preserves the sequential dependency. Precomputing per-span matrices (Coffman & Chen, 2025) eliminates the recursion but introduces data-dependent gather operations that fragment GPU memory access. Gaussian radial basis functions (Li, 2024) replace B-splines entirely with a single exp⁡()\exp() call, gaining speed but sacrificing compact support and automatic partition of unity (Gaussians are non-negative and C∞C^\infty, so smoothness is not the trade-off).

Most recently, Southworth et al. (2026) established a formal algebraic equivalence between spline KAN layers and multichannel MLPs with power-ReLU activations through a change-of-basis matrix. For uniform knots, this matrix is Toeplitz with entries matching the classical truncated power coefficients. Their work exploits this equivalence primarily for multilevel training: the spline basis enables complementary relaxation dynamics across refinement levels, yielding orders-of-magnitude improvements in PINN accuracy. They note that the non-recursive formulation is faster by a factor equal to the spline degree, but do not pursue compiler-level optimization, numerical stabilization, or a deployable implementation.

FlashKAN bridges the gap between algebraic equivalence and practical deployment. The contributions are:

  1. Compiler-fused evaluation. For uniform cubic B-splines, the truncated power form reduces to five max⁡(0,⋅)3\max(0,\cdot)^3 terms with fixed coefficients. torch.compile fuses all elementwise operations into a single GPU kernel, eliminating recursion, span lookup, and data-dependent memory access.

  2. Bounded-coordinate stabilization. The raw truncated power sum suffers from catastrophic cancellation when the normalized input uu lies far outside the basis support [0,k+1][0, k+1]. Clamping uu to this interval before evaluation bounds all intermediate terms and eliminates the cancellation, with no change to the mathematically correct output (since the B-spline is exactly zero outside its support). This addresses the numerical concern that historically motivated the Cox-de Boor recursion (de Boor, 2001).

  3. Drop-in package. FlashKAN is available as an open-source Python package (pip install flashkan, MIT license) with identical API to standard KAN layers. Replacing Cox-de Boor evaluation requires changing one import.