1 Software Center of Bank of China (Xi’an), Xi’an 710038, China
2 College of Artificial Intelligence, Nankai University, Tianjin 300350, China
3 Institute of Automation, Chinese Academy of Sciences, Beijing 100190, China
Show less
文章历史+
Received
Published
Revised
2025-05-22
2026-07-08
2026-01-07
Online Date
2026-08-06
PDF (6220K)
摘要
针对现代人工神经网络中大量存在的门控神经单元未能充分压缩权重参数导致推理计算效率不高的问题,提出一种矩阵的分层对称奇异值分解(hierarchical symmetric singular value decomposition, HSSVD)方法,并面向循环神经网络(recurrent neural network, RNN)和Transformer提出门控神经单元并联压缩与加速方法。首先,对大规模权重矩阵的常规奇异值分解(singular value decomposition, SVD)所得到的两个因子矩阵,分别将其线性无关列向量和行向量折叠后再作SVD,得到该矩阵的HSSVD形式,进而提出绝对误差约束下的HSSVD秩选择算法;其次,提出一般性门控神经单元并联压缩方法,面向RNN和Transformer的具体门控神经单元给出相应的加速算法;最后,针对金融类软件工程中常见的自然语言转换结构化查询语言(structured query language, SQL)语句的需求,给出所提方法在实际工程应用中的效果。实验结果表明:与现有典型张量分解方法相比,HSSVD面向RNN和Transformer可同时获取良好的权重参数压缩与推理计算加速效果;在典型视频识别数据集UCF11和YCF上,HSSVD可在RNN总参数量维持在8 400的前提下,分别达到88.1%和88.9%的识别准确率,推理用时分别仅为13.9 ms和14.1 ms;在标准图像识别数据集ImageNet上,HSSVD可在视觉Transformer总参数量维持在11.9×106的前提下,取得最高82.9%的识别准确率,推理效率达每秒3 195.9幅图像;面向自然语言转SQL语句的工程应用,HSSVD在无损轻量化前提下可带来89.3%的存储节约和41.6%的生成效率优化。
Abstract
To address the issue of inefficient inference computation of modern artificial neural networks caused by abundant gated neural units within, where the weight parameters are not adequately compressed, a method termed as hierarchical symmetric singular value decomposition (HSSVD) of matrices was proposed. Further, parallel compression and acceleration method for gated neural units was proposed for recurrent neural network (RNN) and Transformer. Firstly, based on the two factor matrices achieved by the normal singular value decomposition (SVD) for large-scale weight matrix, their linearly independent column vectors and row vectors were separately folded and split again by SVD to construct the HSSVD format of the weight matrix, then the optimal rank selection algorithm of HSSVD under the constraint of absolute error was proposed. Secondly, the parallel compression method for general gated neural units was proposed, and the corresponding acceleration algorithms orienting to the specialized gated neural units in RNN and Transformer were also proposed. Lastly, to deal with the requirement of translating natural sentences to structured query language (SQL) language, which was familiar in financial software engineering, the effect of the proposed method in practical engineering application was given. The experimental results demonstrate that, compared with existing typical tensor decomposition methods, HSSVD can achieve satisfactory effects of weight parameters compression and inference computation acceleration for both RNN and Transformer at the same time. On the typical video recognition datasets UCF11 and YCF, under the precondition of the total number of parameters of RNN is about 8 400, HSSVD can gain 88.1% and 88.9% recognition accuracy, and the time consumptions of inference are just 13.9 ms and 14.1 ms, respectively. On the benchmark image recognition dataset ImageNet, under the precondition of the total number of parameters of Transformer is about 11.9×106, HSSVD can obtain the highest 82.9% recognition accuracy, and the inference efficiency can reach 3 195.9 images per second. For the engineering application of translating natural sentences to SQL language, HSSVD can bring 89.3% memory economy and 41.6% generating efficiency optimization under the condition of lossless lightweight.
HE Cong-cong, ZHANG Jing, QI Meng-meng, YAO Man.
Hierarchical Symmetric Singular Value Decomposition of Matrices and Parallel Compression and Acceleration Method for Gated Neural Units[J].
Science Technology and Engineering, 2026, 26(19): 8262-8274 DOI:10.12404/j.issn.1671-1815.2503830
门控神经单元是现代人工神经网络中常用的一类架构,通常令同一个特征输入与多个并联的权重及激活函数进行计算,从而得到多路特征,并对这些特征互相组合以获取各种高级特征[1]。例如,循环神经网络(recurrent neural network,RNN)中的长短时记忆(long short term memory,LSTM)模型采用4路门控神经单元输出的特征数据互相组合,实现长期与短期记忆的博弈[2],Transformer中的自注意力机制实际上由3路门控神经单元输出的特征数据组合而得[3]。美中不足的是,门控神经单元显然存在权重参数量大、计算负担高的短板,导致大量具有可观性能的神经网络模型难以在工程实践中充分应用。为此,大量学者致力于面向门控神经单元开展压缩、加速等轻量化改造方面的研究[4]。其中,张量分解方法在多维矩阵运算角度与门控神经单元的数据结构具有一定相关性,权重压缩效果突出,近年受到越来越多的关注[5]。
Yang等[6]首次成功将张量串分解(tensor train decomposition,TTD)用于RNN的压缩,对LSTM和门控循环单元(gated recurrent unit,GRU)的各路权重矩阵取得了上万倍压缩比,且准确率能够得到提升。随后,Ye等[7]和Pan等[8]分别使用块项分解(block term decomposition,BTD)和张量环分解(tensor ring decomposition,TRD)进一步提升了RNN各路权重矩阵的压缩比与理论推理计算效率。Wang等[9]引入具有细粒度特点的克罗内克规范多项式分解(Kronecker canonical polyadic decomposition,KCPD)对LSTM、GRU等RNN变体的权重进行压缩,并与其他张量分解方法横向对比,在理论和实践两方面证实了KCPD兼顾高效压缩与加速的能力。Lü等[10]进一步挖掘了KCPD拓扑结构的灵活性,提出了避免大量存储交换的免转置推理算法,结合硬件验证了实际计算效率。Yin等[11]首次将LSTM的4路门控神经单元的权重全部并联起来视作一个大型权重矩阵,并使用分层Tucker分解(hierarchical Tucker decomposition,HTD)进行压缩,取得了6万余倍的权重参数压缩比。王鼎衡等[12]提出了一种新的KCPD因子矩阵合并方式,使其在2阶张量(矩阵)的视角即可取得比其他4阶张量分解更优的推理效率;王志航等[13]将其推广至点云匹配网络中存在的大量1×1卷积,有效提升了点云配准效率;Qi等[14]采用了改进的微调训练方法实现了无损的卷积网络轻量化;但这些工作均未考虑奇异值向因子矩阵均匀分配的问题,导致压缩率较高时容易出现精度损失。
具体的自然语言转SQL语句的智能模型参考了文献[30],采用Transformer特征提取[具体选择BERT(bidirectional encoder representations from Transformers)模型]和双向LSTM梳理词序相结合的架构,如图9所示。图9中,右下角表格为自然语言对应的数据库表结构(表名cus_table);对每个输入的自然语言Q,按照预先定义的关系型数据库模式S=<T,C>,分割数据库表名T和字段名C,并分别在T和C之前加特殊标记字符[T]和[C],同时在S之前加特殊标记字符[SEP],最后将Q、S、T和C拼接为正式输入X;将X输入BERT模型进行编码,随后经过一层双向LSTM获得序列的初始编码表示hX。hX中的问题片段(来自Q)继续通过一层额外的双向LSTM获得Q的最终编码hQ;hX中的其他片段经过一个额外的全连接网络获得字段特征(含主键fprimary,外键fforeign,类型ftype),问题编码和字段特征编码拼接组合后即为自然语言Q对应的SQL语句输出。
GuoChaopeng, WangXinxin, ZhongZhaojin, et al. Research advance on neural network lightweight for energy optimization[J]. Chinese Journal of Computers, 2023, 46(1): 85-102.
[3]
GreffK, SrivastavaR K, KoutnikJ, et al. LSTM: a search space odyssey[J]. IEEE Transactions on Neural Networks and Learning Systems, 2017, 28(10): 2222-2232.
[4]
VaswaniA, ShazeerN, ParmarN, et al. Attention is all you need[C]// International Conference on Neural Information Processing Systems (NIPS). Long Beach: MIT Press, 2017: 5999-6009.
[5]
WuY, WangD H, LuX T, et al. Efficient visual recognition: a survey on recent advances and brain-inspired methodologies[J]. Machine Intelligence Research, 2022, 19(5): 366-411.
[6]
WangM L, PanY, YangX L, et al. Tensor networks meet neural networks: a survey[EB/OL]. (2023-01-22) [2023-07-01]. https://arxiv.org/abs/2302.09019.
[7]
YangY C, KrompassD, TrespV. Tensor-train recurrent neural networks for video classification[C]// International Conference on Machine Learning (ICML). Sydney: ACM, 2017: 5929-5938.
[8]
YeJ M, WangL N, Li GuangX, et al. Learning compact recurrent neural networks with block-term tensor decomposition[C]// IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). Salt Lake City: IEEE, 2018: 9378-9387.
[9]
PanY, XuJ, WangM L, et al. Compressing recurrent neural networks with tensor ring for action recognition[C]// AAAI Conference on Artificial Intelligence. Honolulu: AAAI, 2019: 4683-4690.
[10]
WangD H, WuB J, ZhaoG S, et al. Kronecker CP decomposition with fast multiplication for compressing RNNs[J]. IEEE Transactions on Neural Networks and Learning Systems, 2023, 34(5): 2205-2219.
[11]
LüR, WangD H, ZhengJ B, et al. Realistic acceleration of neural networks with fine-grained tensor decomposition[J]. Neurocomputing, 2022, 512: 52-68.
[12]
YinM, LiaoS Y, LiuX Y, et al. Towards extremely compact RNNs for video recognition with fully decomposed hierarchical tucker structure[C]// IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). Nashville: IEEE, 2021: 12080-12089.
WangZhihang, YangHuashi, YangWei, et al. HKRNet: lightweight framework for high-realtime point cloud registration[J]. Science Technology and Engineering, 2025, 25(11): 4629-4637.
[17]
QiM M, WangD H, YangW, et al. Fine-grained hierarchical singular value decomposition for convolutional neural networks compression and acceleration[J]. Neurocomputing, 2025, 636: 129966.
[18]
MaX D, ZhangP, ZhangS, et al. A tensorized transformer for language modeling[C]// International Conference on Neural Information Processing Systems (NIPS). Vancouver: MIT Press, 2019: 2232-2242.
LiTianyang, ZhangFan, WangSong, et al. FPGA-based unified accelerator for convolutional neural network and vision transformer[J]. Journal of Electronics & Information Technology, 2024, 46(6): 2663-2672.
LiuWeirong, ZhangZhiqiang, ZhangNing, et al. A TT-Tucker decomposition-based LC convolutional neural network compression method without pre-training[J]. Journal of South China University of Technology (Natural Science Edition), 2024, 52(7): 29-38.
[28]
LiuZ, LinY T, CaoY, et al. Swin Transformer: hierarchical vision Transformer using shifted windows[C]// IEEE International Conference on Computer Vision (ICCV). Montreal: IEEE, 2021: 10012-10022.
[29]
YuanL, ChenY P, WangT, et al. Tokens-to-Token ViT: training vision Transformers from scratch on ImageNet[C]// IEEE International Conference on Computer Vision (ICCV). Montreal: IEEE, 2021: 558-567.
[30]
YuW H, SiC Y, ZhouP, et al. MetaFormer baselines for vision[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2024, 46(2): 896-912.
[31]
XiaoT T, SinghM, MintunE, et al. Early convolutions help transformers see better[C]// International Conference on Neural Information Processing Systems (NIPS). Sydney: MIT Press, 2021: 30392-30400.
[32]
ZhangZ Z, ZhangH, ZhaoL, et al. Nested hierarchical Transformer: towards accurate, data-efficient and interpretable visual understanding[C]// AAAI Conference on Artificial Intelligence. Vancouve: AAAI, 2022: 3417-3425.
[33]
GuoJ Y, HanK, WuH, et al. CMT: convolutional neural networks meet vision Transformers[C]// IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). New Orleans: IEEE, 2022: 12165-12175.
[34]
LiuX Y, PengH W, ZhengN X, et al. EfficientViT: memory efficient vision Transformer with cascaded group attention[C]// IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). Vancouver: IEEE, 2023: 14420-14430.
[35]
HatamizadehA, KautzJ. MambaVision: a hybrid mamba-Transformer vision backbone[C]// IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). Nashville: IEEE, 2025: 25261-25270.
[36]
LinX, SocherR, XiongC. Bridging textual and tabular data for cross-domain text-to-SQL semantic parsing[C]// Conference on Empirical Methods in Natural Language Processing (EMNLP). Online: ACL, 2020: 4870-4888.