SpikingMamba: 通过从Mamba知识蒸馏实现能量高效的大型语言模型
SpikingMamba: Towards Energy-Efficient Large Language Models via Knowledge Distillation from Mamba
AI总结:
SpikingMamba通过知识蒸馏从Mamba模型中实现高效能的Spiking神经网络大型语言模型,结合SI-LIF神经元和SGC路径,在保持精度的同时显著降低能耗。
摘要:
大型语言模型(LLMs)在各种任务上表现出色,但因其密集矩阵运算而能耗高。Spiking神经网络(SNNs)通过将密集矩阵乘法替换为稀疏累积来提高能效。其稀疏脉冲活动使LLMs能够在边缘设备上高效部署。然而,先前基于SNN的LLMs通常为了效率牺牲性能,恢复准确性通常需要完整的预训练,这成本高且不切实际。为此,我们提出了SpikingMamba,一种通过从Mamba模型蒸馏得到的高效能SNN-based LLMs,通过最小的精度牺牲提高能效。SpikingMamba集成了两个关键组件:(a)SI-LIF,一种带符号整数脉冲神经元,通过带符号多级脉冲表示保留语义极性。(b)一种训练专用的平滑梯度补偿(SGC)路径,通过减少量化损失同时保持脉冲驱动的效率。我们采用单阶段蒸馏策略将预训练Mamba的零样本能力转移,并通过强化学习(RL)进一步增强。实验显示,SpikingMamba-1.3B在能耗上获得4.76倍的提升,与原始Mamba相比仅存在4.78%的零样本精度差距。在RL后,模型进一步提高2.55%的精度,将性能差距从4.78%缩小到2.23%。代码可在:https://github.com/HuuYuLong/SpikingMamba 获取。
英文摘要:
Large Language Models (LLMs) have achieved remarkable performance across tasks but remain energy-intensive due to dense matrix operations. Spiking neural networks (SNNs) improve energy efficiency by replacing dense matrix multiplications with sparse accumulations. Their sparse spike activity enables efficient LLMs deployment on edge devices. However, prior SNN-based LLMs often sacrifice performance for efficiency, and recovering accuracy typically requires full pretraining, which is costly and impractical. To address this, we propose SpikingMamba, an energy-efficient SNN-based LLMs distilled from Mamba that improves energy efficiency with minimal accuracy sacrifice. SpikingMamba integrates two key components: (a) SI-LIF, a signed-integer spiking neuron that preserves semantic polarity through signed multi-level spike representations. (b) A training-exclusive Smoothed Gradient Compensation (SGC) path mitigating quantization loss while preserving spike-driven efficiency. We employ a single-stage distillation strategy to transfer the zero-shot ability of pretrained Mamba and further enhance it via reinforcement learning (RL). Experiments show that SpikingMamba-1.3B achieves a 4.76$\times$ energy benefit, with only a 4.78\% zero-shot accuracy gap compared to the original Mamba. The model achieves a further 2.55\% accuracy improvement after RL, narrowing the performance gap from 4.78\% to 2.23\%. Code is available at: https://github.com/HuuYuLong/SpikingMamba .
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。