arrow
返回

Hardware-oriented algorithms for softmax and layer normalization of large language models

delete2024-09-12
delete0
PRE
AI
W
Wenjie Li
D
Dongxu Lyu
G
Gang Wang
A
Aokun Hu
N
Ningyi Xu
G
G. He *
DOI:10.1007/s11432-024-4137-4delete
delete原文链接
delete原文求助
delete分享
delete收藏
摘要

摘要

En 中文
While large language models (LLMs) have sparked a new revolution in the field of natural language processing (NLP), their hardware accelerators have garnered tremendous attention. However, softmax and layer normalization which are the most common non-linear operations in LLMs are frequently overlooked. This paper presents hardware-oriented algorithms for both softmax and layer normalization of LLMs. We propose an approximate approach to implementing division in softmax and extend it for simultaneously computing square root and performing division in layer normalization. It replaces the original computation by multiplication and shifting. For softmax, we further approximate the exponential function by truncating its exponent and then reuse the involved subtraction. For layer normalization, we additionally simplify the computation of denominator by directly removing the term regarding the square of the mean. Furthermore, hardware architectures are developed for the proposed algorithms of softmax and layer normalization. They can work as plug-and-play units for LLM accelerators, requiring no fine-tuning and introducing negligible performance loss. Compared with the state-of-the-art designs, the proposed softmax architecture can save up to 23.45% area cost and 17.39% power consumption, while the proposed layer normalization architecture can save up to 32.70% area cost and 14.29% power consumption.
Keyword:
large language model
softmax
layer normalization
hardware architecture
Transformer

期刊

Science China Information Sciences 封面图
Science China Information Sciences
IF:
7.6
论文数:
4.9K
被引数:
8.9K

机构

S
shanghai jiao tong university
学者数:
15.7W
论文数: 11.7W
被引数: 159
引用论文

引用论文

err分享
err收藏
Allomaternal interactions in the Bolivian squirrel monkey (Saimiri boliviensis boliviensis)
err2005-06-02
err0
PREAI
errLawrence Williams; Susan Gibson; Margaret McDaniel; Judson Bazzel; Sue Barnes; Christian Abee
err分享
err收藏
Beyond the veil: Kaupapa Māori gaze on the non-Māori subject
err2019-12-25
err0
PREAI
errBelinda Borell (Ngāti Ranginui, Ngāi Te Rangi, Whakatōhea); Kura Te Waru Rewiri (Ngāti Kahu, Ngāpuhi, Ngāti Kauwhata, Ngāti Rang; Helen Moewaka Barnes (Te Kapotai, Ngāpuhi-nui-tonu); Tim McCreanor (Ngāti Pākehā)
err分享
err收藏
GQNA: Generic Quantized DNN Accelerator With Weight-Repetition-Aware Activation Aggregating
err2022-10-01
err12
PREAI
errYang, Jianxun; Tu, Fengbin; Li, Yixuan; Wang, Yiqi; Liu, Leibo; Wei, Shaojun; Yin, Shouyi
err分享
err收藏
Comparative study of bio-inspired algorithms applied to the optimization of type-1 and type-2 fuzzy controllers for an autonomous mobile robot
err2012-06-01
err0
PREAI
errOscar Castillo; Ricardo Martínez-Marroquín; Patricia Melin; Fevrier Valdez; José Soria
err分享
err收藏
Kinetics and mechanism of carborane formation
err2002-05-01
err0
PREAI
errW. E. Hill; F. A. Johnson; R. W. Novak
err分享
err收藏
err分享
err收藏
err分享
err收藏
学者 查看更多内容