Accuracy-preserving Layer Normalization Approximations for Efficient Transformer Hardware Accelerators
Transformers have emerged as leading models for solving natural language processing (NLP) problems. Layer normalization (LN) has been found to be a throughput and latency bottleneck for Transformer networks. The LN datapath involves sequential processing that is dependent on the input data, and GPU and CPU unfriendly nonlinear square root and reciprocal operations. These make pipelining and hardware simplification challenging without compromising the accuracy of pretrained models. In this paper, we propose a hardware-efficient and accuracy-preserving design for LN approximation. The LN core can be directly plugged into pretrained Transformer networks to accelerate NLP tasks without fine tuning. The FPGA implementation of our design outperforms the state-of-the-art FPGA implementation of LN, with 3.5 × higher throughput per LUT and 1.3 × higher throughput per DSP. Our approximation introduces negligible average and worst-case accuracy drops of only 0.28% and 1.09%, respectively on the main language benchmark tasks. Additionally, a better pipelined design with pairwise variance calculation is proposed to reduce the number of iterations for LN, resulting in a further 27% reduction in latency with a slight increase in hardware resource requirement.
Authors
- Nazim Altar Koca
- Chip-Hong Chang (ORCID: https://orcid.org/0000-0002-8897-6176)
- Anh Tuan (ORCID: https://orcid.org/0000-0002-8320-6818)
Institutions
- Agency for Science, Technology and Research (SG)
- Nanyang Technological University (SG)
- Institute of Microelectronics (SG)
Publication Details
- Published
- 2025-05-25
- DOI
- https://doi.org/10.1109/iscas56072.2025.11044257
- Primary Topic
- Magnetic Properties and Applications
- Type
- article
- Field-Weighted Citation Impact
- 0.00