Table of Contents
Fetching ...

Kolmogorov-Arnold Transformer

Xingyi Yang, Xinchao Wang

TL;DR

KAT reframes transformer channel-mixing by replacing MLPs with Group-Rational Kolmogorov–Arnol d Networks, addressing scalability through rational base activations, group-wise parameter sharing, and variance-preserving initialization. The approach enables large-scale training and yields superior ImageNet-1K accuracy while maintaining comparable compute to ViT-like models, with additional gains in object detection and semantic segmentation. Empirical results, ablations, and CUDA-based implementations support the claim that GR-KAN can replace MLPs effectively in vision transformers. The work also identifies practical trade-offs (inference speed vs. accuracy) and outlines future directions towards broader applicability and alternative base functions.

Abstract

Transformers stand as the cornerstone of mordern deep learning. Traditionally, these models rely on multi-layer perceptron (MLP) layers to mix the information between channels. In this paper, we introduce the Kolmogorov-Arnold Transformer (KAT), a novel architecture that replaces MLP layers with Kolmogorov-Arnold Network (KAN) layers to enhance the expressiveness and performance of the model. Integrating KANs into transformers, however, is no easy feat, especially when scaled up. Specifically, we identify three key challenges: (C1) Base function. The standard B-spline function used in KANs is not optimized for parallel computing on modern hardware, resulting in slower inference speeds. (C2) Parameter and Computation Inefficiency. KAN requires a unique function for each input-output pair, making the computation extremely large. (C3) Weight initialization. The initialization of weights in KANs is particularly challenging due to their learnable activation functions, which are critical for achieving convergence in deep neural networks. To overcome the aforementioned challenges, we propose three key solutions: (S1) Rational basis. We replace B-spline functions with rational functions to improve compatibility with modern GPUs. By implementing this in CUDA, we achieve faster computations. (S2) Group KAN. We share the activation weights through a group of neurons, to reduce the computational load without sacrificing performance. (S3) Variance-preserving initialization. We carefully initialize the activation weights to make sure that the activation variance is maintained across layers. With these designs, KAT scales effectively and readily outperforms traditional MLP-based transformers.

Kolmogorov-Arnold Transformer

TL;DR

KAT reframes transformer channel-mixing by replacing MLPs with Group-Rational Kolmogorov–Arnol d Networks, addressing scalability through rational base activations, group-wise parameter sharing, and variance-preserving initialization. The approach enables large-scale training and yields superior ImageNet-1K accuracy while maintaining comparable compute to ViT-like models, with additional gains in object detection and semantic segmentation. Empirical results, ablations, and CUDA-based implementations support the claim that GR-KAN can replace MLPs effectively in vision transformers. The work also identifies practical trade-offs (inference speed vs. accuracy) and outlines future directions towards broader applicability and alternative base functions.

Abstract

Transformers stand as the cornerstone of mordern deep learning. Traditionally, these models rely on multi-layer perceptron (MLP) layers to mix the information between channels. In this paper, we introduce the Kolmogorov-Arnold Transformer (KAT), a novel architecture that replaces MLP layers with Kolmogorov-Arnold Network (KAN) layers to enhance the expressiveness and performance of the model. Integrating KANs into transformers, however, is no easy feat, especially when scaled up. Specifically, we identify three key challenges: (C1) Base function. The standard B-spline function used in KANs is not optimized for parallel computing on modern hardware, resulting in slower inference speeds. (C2) Parameter and Computation Inefficiency. KAN requires a unique function for each input-output pair, making the computation extremely large. (C3) Weight initialization. The initialization of weights in KANs is particularly challenging due to their learnable activation functions, which are critical for achieving convergence in deep neural networks. To overcome the aforementioned challenges, we propose three key solutions: (S1) Rational basis. We replace B-spline functions with rational functions to improve compatibility with modern GPUs. By implementing this in CUDA, we achieve faster computations. (S2) Group KAN. We share the activation weights through a group of neurons, to reduce the computational load without sacrificing performance. (S3) Variance-preserving initialization. We carefully initialize the activation weights to make sure that the activation variance is maintained across layers. With these designs, KAT scales effectively and readily outperforms traditional MLP-based transformers.
Paper Structure (23 sections, 21 equations, 7 figures, 11 tables)

This paper contains 23 sections, 21 equations, 7 figures, 11 tables.

Figures (7)

  • Figure 1: (Left) Architecture of standard transformer (e.g. ViT), ViT+KAN which substitutes the MLP with a KAN, and our KAT model. In KAT, the MLP layers in transformers are replaced with GR-KAN layers. (Right) Performance on the ImageNet dataset. KAT$^*$ indicates that the model was initialized using a pre-trained ViT. Generally, KAT outperforms both the ViT and DeiT models. ViT+KAN performs poorly on ImageNet-level training.
  • Figure 2: Comparing our Group KAN with vanilla KAN and MLPs. While KAN has unique function on each input-output pairs, Group KAN share these functions at with a groups of edges.
  • Figure 3: Example of fitted functions with rational form.
  • Figure 4: One-to-one weight mapping between trained MLP in ViT and GR-KAN in KAT.
  • Figure 5: Comparison of Throughput and Peak Memory for Different Methods and Group Sizes. Input size is fixed to $[64, 1000, 512]$.
  • ...and 2 more figures