Skip to main content
Back

University of Malaga's DualFlexKAN Slashes AI Parameter Count by 70x

DualFlexKAN fixes KAN's parameter explosion with a dual-stage architecture that cuts parameters by up to 100x while beating both MLPs and classic KANs on physics tasks

Pro

  • DualFlexKAN (DFKAN) introduces a dual-stage architecture that independently controls pre-linear input transformations and post-linear output activations, bridging MLPs and KANs.
  • DFKAN achieves 1-2 orders of magnitude fewer parameters than vanilla KANs by using configurable function-sharing strategies (global, per-dimension, or per-connection) instead of always using per-edge functions.
  • On physics-informed benchmarks (Feynman equations, Friedman datasets), DFKAN outperforms both MLPs and classic KANs in accuracy, convergence speed, and gradient fidelity.
  • On real-world tabular data, well-tuned MLPs still win on raw accuracy; DFKAN's advantages are strongest when the data has underlying mathematical structure.
  • DFKAN supports 9+ basis function families (Legendre, Chebyshev, B-splines, RBFs, wavelets, etc.) and configurable dropout/batch-norm placement -- features missing from standard KANs.
  • The open-source DFKAN library is pip-installable; the paper is on arXiv.

Kolmogorov-Arnold Networks arrived with a bold promise: replace the fixed activation functions baked into every MLP with learnable ones, letting the network discover the right nonlinearities instead of forcing the data to conform to ReLU or tanh. The original KAN paper showed impressive results on small scientific tasks, and the community took notice. But a year of practical experience has revealed a painful tradeoff -- KANs are expensive, brittle, and hard to regularize. A new paper from the University of Malaga introduces DualFlexKAN (DFKAN), a redesigned architecture that keeps the expressiveness of KANs while slashing their parameter count by one to two orders of magnitude.

Why classic KANs are hard to use in practice

To understand what DFKAN fixes, it helps to understand what makes standard KANs expensive. In an MLP, each layer applies a fixed nonlinearity (like ReLU) after a matrix multiply -- the weights are the only learnable things. In KANs, activation functions live on the edges between neurons rather than on the nodes, and every weight parameter is replaced by a learnable 1D function, typically a spline. This is elegant in theory, but it creates a combinatorial problem in practice.

The parameter count for a KAN layer with n_in inputs, n_out outputs, and m basis functions per edge scales as O(n_in * n_out * m) -- that's one learned function per connection, not per neuron. For a layer with 64 inputs and 64 outputs using 8 spline coefficients, that's already 32,768 parameters for a single layer. Scale up and the numbers become prohibitive. Beyond the parameter count, KANs have higher per-parameter evaluation costs due to spline or polynomial basis computation, sensitivity to hyperparameters, and difficulties modeling highly discontinuous or topologically complex targets. Standard regularization techniques like dropout and batch normalization also don't slot in cleanly because there are no traditional weight matrices to regularize around.

The dual-stage idea

DFKAN's core insight is to decouple the nonlinear transformations in a KAN layer into two independent stages: a pre-linear input transformation and a post-linear output activation. Between them sits a standard linear weight matrix. The forward pass through a DFKAN layer computes: first, a learnable input transformation T applied to the previous layer's output; then a standard linear projection W*T(z) + b; then a learnable output activation Psi; and finally an optional regularization operator R.

The key innovation is that each of these two stages can be configured independently with different "function sharing strategies," ranging from no transformation at all, up to a unique learned function per connection. This creates a spectrum of architectures:

  • Strategy 0 (None): Pass inputs through unchanged. Zero extra parameters.
  • Strategy 1 (Fixed): Apply a non-learnable function like ReLU or tanh. Zero extra parameters. This recovers a standard MLP.
  • Strategy 2 (Global shared): One learnable function shared across all dimensions. Only m extra parameters (where m is the number of basis coefficients).
  • Strategy 3 (Per-dimension): One learnable function per input feature. n * m extra parameters.
  • Strategy 4 (Per-connection, input only): One unique function per input-output pair. This is the classic KAN formulation, costing n_in * n_out * m parameters.

A typical high-performing DFKAN hybrid might use Strategy 4 (per-connection) in the first layer to capture feature-specific nonlinearities, then switch to Strategy 2 (global shared) in later layers for efficiency. This mirrors how the brain processes information -- early sensory regions need diverse, plastic receptive fields, while higher-order regions use more stereotyped integration mechanisms.

Bar chart comparing parameter counts across MLP, KAN, and DualFlexKAN on 14 datasets

A menu of basis functions

DFKAN doesn't lock you into B-splines. Each stage can use a different basis function family, and the choice can vary per layer. The supported families include:

  • Orthogonal polynomials: Legendre, Chebyshev, Gegenbauer, Jacobi -- each with different approximation properties and domain assumptions. Legendre polynomials, for instance, form a global orthogonal basis that handles high-frequency oscillations more efficiently than piecewise ReLUs.
  • B-splines: The original KAN choice, offering local support and adaptive grid refinement.
  • Radial basis functions (Gaussian): Gaussian bumps with learnable centers and widths.
  • Sine/spectral: Learnable amplitudes, frequencies, and phases -- useful for periodic phenomena.
  • Wavelets and rational functions: For specialized approximation needs.

Orthogonal polynomial bases offer numerical stability and efficient gradient computation, while B-splines provide local support and adaptive grid refinement capabilities. The flexibility to mix and match across layers is a genuine differentiator from all prior KAN variants.

Regularization that actually works

One of the most practical contributions is DFKAN's configurable regularization framework. Standard KANs are notoriously hard to regularize because dropout and batch normalization weren't designed for edge-centric architectures. DFKAN solves this by letting you place regularization operators at four positions: before the output activation, after it, at both, or nowhere. The ordering of dropout and batch normalization within those positions is also configurable.

This matters because the optimal placement depends on the training dynamics. Pre-activation batch normalization stabilizes the inputs to learnable functions, while post-activation dropout controls the final layer representations. The framework allows practitioners to position dropout and batch normalization at strategic points within the computational graph, either immediately before, immediately after, or both with respect to activations.

What the benchmarks show

The authors evaluated DFKAN across three categories of tasks: physics-informed benchmarks (Feynman equations, Friedman datasets), compositional and high-frequency synthetic functions, and real-world tabular regression from UCI datasets. The comparison is against optimized MLPs and vanilla KANs.

The parameter efficiency story is stark. DualFlexKAN achieves the highest structural efficiency with a median of approximately 93 effective parameters, consistently requiring roughly 3x fewer parameters than Classic KAN and nearly 70x fewer than MLPs. The "effective parameter count" here is defined as the minimum number of active parameters needed to maintain 90% of baseline accuracy under magnitude-based pruning -- a meaningful measure of how much of the model is actually doing useful work.

Box plot comparing effective parameter counts across MLP, Classic KAN, and DFKAN on log scale

On physics-informed tasks, DFKAN consistently outperforms both baselines. The Feynman equations (governing electromagnetic force, potential, torque) and Friedman datasets (involving square roots, division, and multiplicative interactions) are exactly the kind of structured mathematical functions where learnable basis functions shine. For instance, approximating the 1/r^2 dependence in Feynman II.6.11 or the square root function in Friedman #2 with ReLU-based MLPs necessitates a large number of piecewise linear segments, whereas DualFlexKAN, by leveraging orthogonal polynomial bases within its learnable functions, can approximate these smooth manifolds more intrinsically and efficiently.

The gradient fidelity results are particularly compelling for anyone working on physics-informed neural networks (PINNs). On the 2D manifold z = sin(2x)cos(2y), DFKAN achieves an MSE of 2.9e-4, compared to 2.5e-1 for classic KAN (which fails to converge) and a blurry approximation from MLP. While the MLP produces a gradient map with reduced sharpness due to spectral bias, DFKAN maintains high-frequency transitions accurately, though the gradient map exhibits slight geometric artifacts reflecting the footprint of the underlying basis functions.

On real-world tabular data (Yacht, Servo, Boston Housing, Auto MPG, Diabetes), the picture is more nuanced. On heterogeneous real-world regression datasets, the MLP baseline frequently achieved the lowest MSE and highest R^2 scores, setting a formidable benchmark for raw predictive accuracy. DFKAN consistently beats vanilla KAN on these tasks while using far fewer parameters, but well-tuned MLPs remain hard to beat on noisy tabular data -- a known finding in the literature.

Comparison of ground truth function Z, MLP, Classic KAN, and DFKAN predictions with gradient magnitudes

Built-in interpretability

A major selling point of KAN-style architectures is that you can actually look at what the network learned. DFKAN preserves this. When trained on a synthetic signal y = e^(-x^2) + 0.5*sin(3x), the internal neurons evolve into specific waveforms -- sinusoids and Gaussian envelopes -- that visually decompose the target signal. Domain experts can inspect whether the model is learning physics-consistent components.

DFKAN also provides intrinsic feature attribution through learned attention weights, eliminating the need for post-hoc explainers like SHAP. On the Friedman #1 benchmark (10 features, only 5 relevant), the model automatically assigns high importance to the correct interaction features. And on a symbolic regression task with noisy observations of y = 2x^2 - x + 0.5, DFKAN recovers the clean quadratic law while vanilla KAN overfits the noise -- acting, as the authors put it, as an "Occam's Razor."

Where it falls short

The architectural flexibility -- encompassing independent strategy selection, basis function choice, and regularization positioning -- introduces extra hyperparameters, and training dynamics exhibit sensitivity to initialization and hyperparameter settings due to the coupled optimization of linear weights and basis function coefficients. This is a real cost: DFKAN has more knobs than either an MLP or a vanilla KAN, and finding the right configuration requires experimentation.

The authors are also honest that DFKAN's advantages are domain-specific. Empirical results reveal that on heterogeneous real-world tabular datasets, well-tuned MLPs frequently achieve superior predictive accuracy, suggesting that DualFlexKAN's advantages are most pronounced on tasks with underlying mathematical structure rather than arbitrary non-linear patterns. If you're working on standard tabular ML problems, an MLP is probably still your best bet.

Who should use this

DFKAN is most compelling for:

  • Physics-informed neural networks (PINNs): Where gradient fidelity matters as much as function values, and the underlying equations have smooth mathematical structure.
  • Scientific discovery / symbolic regression: Where you want to recover interpretable formulas from noisy data, not just fit a black box.
  • Low-data regimes: Where KAN-style expressiveness is valuable but vanilla KAN's parameter explosion causes overfitting.
  • Edge AI / TinyML: The 70-100x parameter reduction over MLPs (in effective parameters) and the dramatic reduction versus vanilla KANs opens the door to deploying expressive, interpretable networks on constrained hardware.

The DFKAN library is freely available on GitHub and installable as a Python package. The architecture unifies MLPs and KANs as special cases of its configuration space, so you can start from a familiar MLP baseline and gradually introduce learnable basis functions where they help most.

The real breakthrough here isn't a single algorithmic trick -- it's the recognition that the MLP vs. KAN debate is a false binary. By treating function sharing as a configurable axis rather than an all-or-nothing choice, DFKAN opens up a principled design space between the two extremes. For scientific ML practitioners who've been watching KANs from the sidelines, this is the architecture that makes them practical.