DL0189 KAN vs MLP: Kolmogorov-Arnold Networks

How does a KAN (Kolmogorov-Arnold Network) differ from a traditional MLP in its use of learnable splines on edges instead of fixed activations on nodes, and what are the trade-offs in expressivity, interpretability, and scaling?

Answer

An MLP puts learnable scalars on the edges and a fixed nonlinearity on the nodes: every edge is one number in a weight matrix, and every hidden unit applies the same hand-chosen \sigma. A KAN swaps those two roles. Every edge carries its own learnable univariate function \phi_{l,j,i}, implemented as a B-spline of grid size G and order k plus a SiLU residual branch, and every node does nothing but sum its incoming edge outputs. Both families are universal approximators, so the difference is not what can be represented but where the capacity sits and what that placement costs. Moving capacity onto the edges buys a per-edge object you can plot, sparsify, prune, and even snap to a symbolic formula, and it buys a fast spline approximation rate on smooth low-dimensional targets. It costs a factor of about (G+k) in parameters at the same layer shape, roughly an order of magnitude in wall-clock training time because per-edge splines do not collapse into one dense GEMM, and a new hyperparameter (the spline grid) that must cover the actual range of the activations.

(1) Role Swap, Not A New Theorem: the Kolmogorov-Arnold representation theorem motivates the design, but the depth-2 form it guarantees can require pathological inner functions, so KANs generalize it to arbitrary depth and width and rely on smoothness of the target, not on the theorem, for their advantage.
(2) Edge Function Is Spline Plus Residual: each \phi is a learned combination of G+k basis functions added to a scaled SiLU, so a KAN is not activation-free; the fixed nonlinearity survives as a residual path that keeps gradients alive outside the grid.
(3) Nodes Are Pure Summation: no elementwise nonlinearity between layers, which is exactly why the univariate curves are individually meaningful.
(4) Parameter Cost Multiplies: a 64 \times 64 layer holds 4,160 parameters as an MLP and about 32,768 spline coefficients as a KAN with G=5, k=3.
(5) Interpretability Is A Workflow: L1 plus entropy regularization on the edge functions, pruning of dead edges, then symbolic snapping of each surviving curve to a candidate like \sin, \exp, or x^2.
(6) Scaling Is The Weak Point: per-edge spline evaluation is memory-bound and GEMM-unfriendly, and at matched parameters and FLOPs an MLP still wins on vision, language, and audio benchmarks.

Side-by-side diagram of the same two-input toy layer. On the left an MLP sends two inputs through scalar weights w1 and w2 into a node containing a fixed sigma, then to the output y. On the right a KAN sends each input through a box containing a learnable spline curve drawn over knot ticks, and both spline outputs feed a node that only sums, producing y.

Figure 1: The role swap in its smallest form. In the MLP the edge is a single learnable number and the nonlinearity is a fixed \sigma baked into the node; in the KAN the edge is a learnable spline over a knot grid and the node only adds. Capacity moves from a matrix of scalars to a grid of spline coefficients, which is why the same layer shape costs about (G+k) times more parameters.

Expressivity behaves differently in the two regimes that matter in practice. On smooth, low-dimensional, compositional targets (symbolic regression, ODE and PDE solution operators, small physical laws) the spline basis is close to the right basis, so error falls quickly with parameters and grid extension lets you refine an already trained model by re-fitting a finer grid instead of restarting. On high-dimensional perception data the picture inverts: a controlled comparison at matched parameters and FLOPs found MLPs ahead on machine-vision, language, and audio tasks, with KANs winning only on symbolic formula representation, and KANs forgetting more than MLPs in a standard class-incremental setting. Interpretability is the more robust claim. Because a node only sums, each edge curve is a genuine one-dimensional function of one variable, so you can plot all of them, drive most toward zero with sparsity penalties, prune the graph down to a handful of edges, and read off a formula. That workflow is what made KANs useful as a scientific assistant rather than as a general drop-in replacement for a dense layer.

Mathematical Formulation:
\mathrm{MLP}(x) = W_L \sigma(W_{L-1} \cdots \sigma(W_1 x))
f(x) = \sum_{q=1}^{2n+1} \Phi_q \left( \sum_{p=1}^{n} \phi_{q,p}(x_p) \right)
x_j^{(l+1)} = \sum_{i=1}^{n_l} \phi_{l,j,i}\left(x_i^{(l)}\right)
\phi(x) = w_b \, \mathrm{silu}(x) + w_s \sum_{m=1}^{G+k} c_m B_m(x)
P_{\mathrm{MLP}} = O(L n^2)
P_{\mathrm{KAN}} = O(L n^2 (G+k))
\ell \propto N^{-4}

Where:

  • x is the input vector and x_j^{(l+1)} the j-th activation of layer l+1, obtained by summation only in a KAN.
  • W_l and \sigma are the MLP’s learnable weight matrices and its fixed elementwise nonlinearity.
  • \phi_{q,p} and \Phi_q are the inner and outer univariate functions of the Kolmogorov-Arnold representation, with n the input dimension; \phi_{l,j,i} is the learnable edge function from unit i of layer l to unit j of layer l+1.
  • B_m are B-spline basis functions with local support over the knot grid, c_m their learned coefficients, and w_b, w_s the scales of the SiLU residual and the spline branch.
  • G is the number of grid intervals and k the spline order, so each edge holds G+k coefficients; typical values are G=5, k=3.
  • L is depth, n the layer width, and P the parameter count, so the KAN pays the extra factor (G+k) at identical layer shape.
  • \ell is test error against parameter count N; the N^{-4} rate is the cubic-spline approximation rate and holds only when the target is smooth and effectively low-dimensional.
Two-panel chart. Left panel: grouped bars comparing an MLP baseline at one times against a KAN, showing eight times the parameters at the same layer shape and about ten times the training time per epoch at the same parameter count. Right panel: log-log plot of test error against parameter count, with a steep KAN curve following an N to the minus four rate marked by grid-extension points at G equals 3, 5, 10 and 20, and a much shallower dashed MLP curve following an N to the minus one rate.

Figure 2: Cost against payoff. At matched layer shape a KAN with G=5, k=3 carries about 8x the parameters, and at matched parameter count it trains roughly 10x slower because each edge evaluates its own spline instead of joining one dense matmul. The right panel shows the regime where that price buys something: on a smooth low-dimensional target, grid extension (3 → 5 → 10 → 20) walks the same trained model down a steep spline-approximation curve that an equally sized MLP does not follow.

PropertyMLPKAN
Nonlinearity locationFixed sigma on every nodeLearnable phi on every edge; nodes only sum
Learnable object per edgeOne scalar weightG+k spline coefficients plus base and spline scales
Params for a 64 to 64 layer4,160About 32,768 at G=5, k=3 (about 41k with the two scales)
Hardware behaviourOne dense GEMM, cuBLAS and tensor-core friendlyPer-edge basis evaluation, memory-bound, about 10x slower at matched params
Input domain requirementNone; sigma is defined on all of RKnot grid must cover the activation range, so grid updates or normalization are mandatory
Interpretability routeInspect weights or use post-hoc attribution; features stay entangledPlot each curve, sparsify, prune, snap to a symbolic form
Where it winsVision, language, audio at matched params and FLOPs; anything throughput-boundSymbolic regression, small smooth scientific targets, operator learning
Main failure modeActivation choice is a fixed prior; little internal structure to readGrid hyperparameters, slow training, and worse forgetting on class-incremental benchmarks

Login to view more content


Log in to track your progress

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *