MBS: A High-Precision Approximation Method for Softmax and Efficient Hardware Implementation

IF 5.2 1区 工程技术 Q1 ENGINEERING, ELECTRICAL & ELECTRONIC
Yuanchen Wu;Zhiheng Xie;Hongbing Pan;Yuxuan Wang
{"title":"MBS: A High-Precision Approximation Method for Softmax and Efficient Hardware Implementation","authors":"Yuanchen Wu;Zhiheng Xie;Hongbing Pan;Yuxuan Wang","doi":"10.1109/TCSI.2025.3559069","DOIUrl":null,"url":null,"abstract":"The softmax function needs to be frequently used in the multi-head attention layer of Transformer networks. Compared to DNNs and other networks, Transformers have higher computational complexity, requiring higher accuracy and hardware performance for softmax function calculations. Therefore, we propose mixed-base softmax (MBS) for the first time for the approximation of the softmax function. This method combines exponential functions with bases of 2 and 4, which is advantageous for hardware implementation. MBS has a high similarity to the softmax function and demonstrates advanced performance during inference in Transformer network. Through algorithm transformation and hardware optimization, we have designed a low-complexity and highly parallel hardware architecture, which only occupies few additional hardware resources compared to base-2 softmax but achieves higher accuracy. Experimental results show that, under TSMC 90nm CMOS technology at the frequency of 0.5 GHz, our design can achieve the efficiency of 236.18 Gps/(mm<inline-formula> <tex-math>${^{{2}}} \\cdot $ </tex-math></inline-formula>mW) with the area of <inline-formula> <tex-math>$4234~\\mu $ </tex-math></inline-formula>m2. Furthermore, MBS exhibits higher computational accuracy and inference precision compared with base-2 softmax.","PeriodicalId":13039,"journal":{"name":"IEEE Transactions on Circuits and Systems I: Regular Papers","volume":"72 7","pages":"3366-3375"},"PeriodicalIF":5.2000,"publicationDate":"2025-04-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"IEEE Transactions on Circuits and Systems I: Regular Papers","FirstCategoryId":"5","ListUrlMain":"https://ieeexplore.ieee.org/document/10966265/","RegionNum":1,"RegionCategory":"工程技术","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"ENGINEERING, ELECTRICAL & ELECTRONIC","Score":null,"Total":0}
引用次数: 0

Abstract

The softmax function needs to be frequently used in the multi-head attention layer of Transformer networks. Compared to DNNs and other networks, Transformers have higher computational complexity, requiring higher accuracy and hardware performance for softmax function calculations. Therefore, we propose mixed-base softmax (MBS) for the first time for the approximation of the softmax function. This method combines exponential functions with bases of 2 and 4, which is advantageous for hardware implementation. MBS has a high similarity to the softmax function and demonstrates advanced performance during inference in Transformer network. Through algorithm transformation and hardware optimization, we have designed a low-complexity and highly parallel hardware architecture, which only occupies few additional hardware resources compared to base-2 softmax but achieves higher accuracy. Experimental results show that, under TSMC 90nm CMOS technology at the frequency of 0.5 GHz, our design can achieve the efficiency of 236.18 Gps/(mm ${^{{2}}} \cdot $ mW) with the area of $4234~\mu $ m2. Furthermore, MBS exhibits higher computational accuracy and inference precision compared with base-2 softmax.
MBS:一种高精度的Softmax逼近方法和高效的硬件实现
在变压器网络的多头关注层中,需要频繁使用softmax功能。与dnn和其他网络相比,transformer具有更高的计算复杂度,对softmax函数计算的精度和硬件性能要求更高。因此,我们首次提出混合基softmax (MBS)来逼近softmax函数。该方法将指数函数与以2和4为基底的函数相结合,有利于硬件实现。MBS与softmax函数相似度高,在变压器网络推理中表现出先进的性能。通过算法转换和硬件优化,我们设计了一种低复杂度和高度并行的硬件架构,与base-2 softmax相比,它只占用了很少的额外硬件资源,但却达到了更高的精度。实验结果表明,在频率为0.5 GHz的TSMC 90nm CMOS技术下,我们的设计可以实现236.18 Gps/(mm ${^{{2}}} \cdot $ mW)的效率,面积为$4234~\mu $ m2。此外,与base-2 softmax相比,MBS具有更高的计算精度和推理精度。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
IEEE Transactions on Circuits and Systems I: Regular Papers
IEEE Transactions on Circuits and Systems I: Regular Papers 工程技术-工程:电子与电气
CiteScore
9.80
自引率
11.80%
发文量
441
审稿时长
2 months
期刊介绍: TCAS I publishes regular papers in the field specified by the theory, analysis, design, and practical implementations of circuits, and the application of circuit techniques to systems and to signal processing. Included is the whole spectrum from basic scientific theory to industrial applications. The field of interest covered includes: - Circuits: Analog, Digital and Mixed Signal Circuits and Systems - Nonlinear Circuits and Systems, Integrated Sensors, MEMS and Systems on Chip, Nanoscale Circuits and Systems, Optoelectronic - Circuits and Systems, Power Electronics and Systems - Software for Analog-and-Logic Circuits and Systems - Control aspects of Circuits and Systems.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信