arXiv:2601.03332cs.LG2026-01

用查表法加速KAN模型推理,保持精度同时大幅降低延迟。

LUT-KAN: Segment-wise LUT Quantization for Fast KAN Inference

  • 将KAN每条边的函数转为分段查表,配合int8/uint8量化与线性插值
  • 在NumPy和Numba后端下分别实现12倍和10倍推理加速,F1下降不足0.0002
  • 提供可复现的评估基准,支持真实场景如入侵检测模型部署

Kolmogorov--Arnold Networks (KAN) 用可学习的一元函数替代标量权重,通常以B样条实现。这种设计虽准确且可解释,但导致CPU推理代价高,因每层需多次样条计算,标准量化工具难以适用。本文提出LUT-KAN,一种针对PyKAN风格KAN层的分段查表(LUT)编译与量化方法。将每个边函数转换为分段LUT,采用仿射int8/uint8量化和线性插值。方法提供明确可复现的推理合约,包括边界约定和越界(OOB)处理策略。提出“诚实基线”评估方法:在相同后端优化(NumPy vs NumPy,Numba vs Numba)下比较样条与查表性能,分离表示优势与向量化、JIT效应。实验涵盖分辨率L=16,32,64,128及对称int8、非对称uint8两种量化方案,报告了多种子下的准确率、速度与内存均值与标准差。通过两两组合的越界鲁棒性矩阵评估不同边界模式与越界策略下的行为。案例研究中,将训练好的KAN模型应用于DoS攻击检测(CICIDS2017流程),编译为LUT产物。模型保留分类质量(F1下降<0.0002),在NumPy和Numba后端下稳态推理延迟分别降低12倍和10倍,内存开销约10倍(当L=64时)。所有代码与产物均公开,带固定版本标签确保可复现。

原文摘要 · Abstract (English)

Kolmogorov--Arnold Networks (KAN) replace scalar weights by learnable univariate functions, often implemented with B-splines. This design can be accurate and interpretable, but it makes inference expensive on CPU because each layer requires many spline evaluations. Standard quantization toolchains are also hard to apply because the main computation is not a matrix multiply but repeated spline basis evaluation. This paper introduces LUT-KAN, a segment-wise lookup-table (LUT) compilation and quantization method for PyKAN-style KAN layers. LUT-KAN converts each edge function into a per-segment LUT with affine int8/uint8 quantization and linear interpolation. The method provides an explicit and reproducible inference contract, including boundary conventions and out-of-bounds (OOB) policies. We propose an ``honest baseline'' methodology for speed evaluation: B-spline evaluation and LUT evaluation are compared under the same backend optimization (NumPy vs NumPy and Numba vs Numba), which separates representation gains from vectorization and JIT effects. Experiments include controlled sweeps over LUT resolution L in 16, 32, 64, 128 and two quantization schemes (symmetric int8 and asymmetric uint8). We report accuracy, speed, and memory metrics with mean and standard deviation across multiple seeds. A two-by-two OOB robustness matrix evaluates behavior under different boundary modes and OOB policies. In a case study, we compile a trained KAN model for DoS attack detection (CICIDS2017 pipeline) into LUT artifacts. The compiled model preserves classification quality (F1 drop below 0.0002) while reducing steady-state CPU inference latency by 12x under NumPy and 10x under Numba backends (honest baseline). The memory overhead is approximately 10x at L=64. All code and artifacts are publicly available with fixed release tags for reproducibility.

KAN量化推理加速查表法

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。