Skip to main content
QUICK REVIEW

[Paper Review] NN-LUT: Neural Approximation of Non-Linear Operations for Efficient Transformer Inference

Joonsang Yu, Junki Park|arXiv (Cornell University)|Dec 3, 2021
Neural Networks and ApplicationsComputer Science5 citations
TL;DR

This paper proposes NN-LUT, a hardware-efficient framework that replaces non-linear operations like GELU, Softmax, and LayerNorm in BERT-based models using a neural network transformed into a look-up table (LUT) for low-latency, low-power inference. It achieves up to 26% system speedup and 36.4× lower power consumption compared to state-of-the-art integer-based approximations, with negligible accuracy degradation on GLUE and SQuAD benchmarks.

ABSTRACT

Non-linear operations such as GELU, Layer normalization, and Softmax are essential yet costly building blocks of Transformer models. Several prior works simplified these operations with look-up tables or integer computations, but such approximations suffer inferior accuracy or considerable hardware cost with long latency. This paper proposes an accurate and hardware-friendly approximation framework for efficient Transformer inference. Our framework employs a simple neural network as a universal approximator with its structure equivalently transformed into a LUT. The proposed framework called NN-LUT can accurately replace all the non-linear operations in popular BERT models with significant reductions in area, power consumption, and latency.

Motivation & Objective

  • To address the high hardware cost and latency of non-linear operations (GELU, Softmax, LayerNorm) in Transformer models during inference.
  • To develop a general, hardware-friendly approximation framework that avoids complex data paths and high-precision arithmetic.
  • To enable drop-in replacement of non-linear operations in pre-trained BERT models without requiring retraining or fine-tuning.
  • To reduce area, power, and latency in neural processing units (NPUs) while maintaining model accuracy.
  • To demonstrate system-level performance gains through integration into an existing NPU architecture.

Proposed method

  • A one-hidden-layer ReLU neural network is trained as a universal approximator for non-linear functions and then mathematically transformed into an equivalent LUT-based implementation.
  • The LUT is updated per operation (e.g., GELU, Softmax) without changing the hardware, enabling reuse across different non-linear functions.
  • A general training strategy is applied to minimize approximation error across diverse input ranges.
  • Input scaling is used to extend the dynamic range of the LUT approximation, improving accuracy over wide input domains.
  • A dataset-free calibration method is introduced to fine-tune the LUT without requiring labeled data or retraining the full model.
  • Hardware synthesis is performed using 7-nm technology to compare area, power, and delay against state-of-the-art integer-only implementations.

Experimental results

Research questions

  • RQ1Can a neural network be effectively transformed into a LUT-based approximation for non-linear operations in Transformers without accuracy loss?
  • RQ2How does the proposed NN-LUT framework compare in hardware efficiency (area, power, latency) to existing integer-based approximation methods?
  • RQ3Can NN-LUT be used as a drop-in replacement for GELU, Softmax, and LayerNorm in BERT and MobileBERT models with minimal accuracy degradation?
  • RQ4What system-level performance gains can be achieved by integrating NN-LUT into an existing NPU architecture?
  • RQ5Can the LUT-based approximation be calibrated without labeled datasets or full-model fine-tuning?

Key findings

  • NN-LUT achieves a 2.63× reduction in area and 36.4× reduction in power consumption compared to the state-of-the-art integer-based approximation (I-BERT) for non-linear operations.
  • NN-LUT reduces critical path delay by 3.93× compared to I-BERT, demonstrating significantly lower latency.
  • The framework enables up to 26% system-level speedup in RoBERTa inference on an integrated NPU, primarily due to optimized non-linear operation execution.
  • On GLUE and SQuAD benchmarks, NN-LUT maintains near-identical model accuracy to the original models, with negligible degradation.
  • The dataset-free calibration method effectively improves LUT accuracy without requiring labeled data or retraining the full model.
  • Hardware synthesis confirms that NN-LUT’s LUT-based design is highly efficient and compatible with existing NPU architectures that already include LUTs.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.