← Blog/blog/kan-edge-splines

The neural net that puts a curve on every edge—and runs 10× slower

A normal neural network sends a number across each connection: multiply by a weight, add the results, then apply the same activation function at a neuron. A Kolmogorov–Arnold Network, or KAN, sends the number through a different learnable curve on every connection. The receiving neuron only adds.

That swap sounds cosmetic. It is not. A single KAN edge can bend into a square, sine, logarithm, or other one-variable shape. The network can expose those curves to a scientist instead of hiding everything inside a matrix of scalar weights.

01

Replace one weight with a tiny function

A spline is a curve assembled from low-degree polynomial pieces. Its grid points are called knots. Changing one coefficient changes the curve locally, which makes splines accurate and inspectable for one-dimensional relationships.

The paper uses cubic B-splines plus a residual SiLU path. Our reconstruction uses the simplest degree-one spline so every operation is visible: locate the two surrounding knots and interpolate their learned coefficients. The TypeScript version below is the logic used by the live study; Python and C++ are faithful translations.

def linear_spline(x, knots, coeffs):
    if x <= knots[0]:
        return coeffs[0]
    if x >= knots[-1]:
        return coeffs[-1]
    i = 0
    while x > knots[i + 1]:
        i += 1
    t = (x - knots[i]) / (knots[i + 1] - knots[i])
    return (1 - t) * coeffs[i] + t * coeffs[i + 1]

For output node j, a KAN layer computes x′ⱼ = Σᵢ φⱼᵢ(xᵢ). Each φⱼᵢ is its own spline. Compare that with an MLP's x′ = activation(Wx + b): the MLP learns the numbers in W, while the KAN learns the shapes on the edges.

02

Three edge curves rebuild a two-variable function

The paper's clean toy is f(x,y) = exp(sin(πx) + y²). Its structure is exactly what a small KAN wants: learn sin(πx) and on two incoming edges, add them at one hidden node, then learn exp(z) on the final edge.

To isolate representation from optimization, this reconstruction gives the model that decomposition and fits each one-dimensional spline by least squares. It is oracle-decomposed, deterministic, and illustrative; it does not claim that gradient descent discovered the structure unaided.

exact targetspline KAN
A slice through y=0.35 of the paper’s toy function. Three fitted edge splines with eight intervals closely track the exact target; every plotted value comes from the tested core module.
Held-out RMSE on a 41×41 grid as every edge receives a finer piecewise-linear grid. This is the seeded-free reconstruction, not a number reported by the paper.
Paper modelShapeTest MSEParameters
KAN2 layers, width 1010⁻⁷~10²
MLP4 layers, width 10010⁻⁵~10⁴
The paper’s PDE example, reported in its introduction. These figures belong to that task and setup; the small browser reconstruction above does not reproduce the PDE experiment.
03

The grid is the hidden bill

An MLP connection stores one weight. A cubic KAN connection with G grid intervals stores roughly G + 3 spline coefficients. For equal layer widths, the paper counts KAN parameters as O(N²LG), versus O(N²L) for an MLP. Refining the curve therefore charges every edge.

KAN spline coefficientsMLP weights + biases
Exact coefficient counts for equally shaped [8,8,8] networks using the paper’s G+k spline count with cubic order k=3. The MLP includes weights and biases; KAN residual scales are omitted, so the KAN count is conservative.

Smaller KAN widths can still win the total trade-off, as the PDE example shows. But “fewer parameters” and “less compute” are not synonyms. Grid resolution, edge count, implementation, and the minimum width needed for the task all matter.

04

The theorem is inspiration, not a free guarantee

The Kolmogorov–Arnold representation theorem says a continuous multivariable function on a bounded domain can be composed from one-variable functions and addition. The awkward part is that those one-variable functions may be non-smooth or even fractal—terrible targets for a modest spline grid.

The paper's fast scaling argument therefore assumes a smooth KAN representation exists. Its experiments establish the favorable scaling on synthetic functions chosen to have that structure. The authors explicitly leave open whether comparable representations exist, and can be found by training, for tasks such as language modeling.

05

What I would probe next

  • Compare wall-clock time and energy at matched test error, not only parameter count.
  • Hide the toy decomposition and measure how often training recovers the three true edge functions across seeds.
  • Stress the grid with discontinuities, noise, and inputs outside the training range, where local spline accuracy is least reassuring.

To compare the ordinary weight-and-activation design directly, poke at the site's neural-network page. The familiar MLP is not as inspectable edge by edge, but its dense matrix operations are exactly why it trains so efficiently.

References

  1. Ziming Liu, Yixuan Wang, Sachin Vaidya, Fabian Ruehle, James Halverson, Marin Soljačić, Thomas Y. Hou, Max Tegmark (2025). KAN: Kolmogorov-Arnold Networks. International Conference on Learning Representations
  2. Johannes Schmidt-Hieber (2021). The Kolmogorov-Arnold representation theorem revisited. Neural Networks 137