NLI:Non-uniform Linear Interpolation Approximation of Nonlinear Operations for Efficient LLMs Inference
Jiangyong Yu, Xiaomeng Han, Xing Hu, Chen Xu, Zhe Jiang, Dawei Yang
TL;DR
The paper addresses the heavy cost of nonlinear operations in LLM inference by introducing Non-uniform Linear Interpolation (NLI), a calibration-free framework that replaces nonlinear evaluations with a FP16 LUT generated via a dynamic-programming search. NLI splits into a software component that computes globally optimal cutpoints with complexity $O(MN^2)$ and a hardware engine that implements two-level address translation and pipelined interpolation for high throughput. The key contributions are the calibration-free DP-based LUT design that yields 259 cutpoints across 10 macro-intervals, the NLI Engine hardware that reduces comparators and power while boosting efficiency, and extensive software and hardware evaluations showing negligible accuracy loss and substantial speedups over state-of-the-art nonlinear units. The approach demonstrates strong generality across LLMs and even vision models, offering a practical path to efficient edge deployment of large models on resource-constrained hardware.
Abstract
Large Language Models (LLMs) have demonstrated remarkable performance across a wide range of tasks, but their deployment is often constrained by substantial memory footprints and computational costs. While prior work has achieved significant progress in compressing and accelerating linear layers, nonlinear layers-such as SiLU, RMSNorm, and Softmax-still heavily depend on high-precision floating-point operations. In this paper, we propose a calibration-free, dynamic-programming-optimal, and hardware-friendly framework called Non-uniform Linear Interpolation (NLI). NLI is capable of efficiently approximating a variety of nonlinear functions, enabling seamless integration into LLMs and other deep neural networks with almost no loss in accuracy. NLI ingeniously recasts cutpoint selection as a dynamic-programming problem, achieving the globally minimal interpolation error in O(MxN2) time via Bellman's optimality principle. Based on the NLI algorithm, we also design and implement a plug-and-play universal nonlinear computation unit. Hardware experiments demonstrate that the NLI Engine achieves more than 4x improvement in computational efficiency compared to the state-of-the-art designs.
