用门控机制替代传统激活函数,实现同等性能且更利于硬件部署。
Rethinking Neural Nonlinearity as Gating
- 将激活函数统一为输入相关的阈值门控,形成新通用范式。
- 转换预训练模型后性能不变,支持从零训练并提升压缩率与效率。
- 特别适合模拟存内计算硬件,可减少模数转换开销。
激活函数通常被视为神经网络非线性的基础组件,使网络具备通用逼近能力。本文提出,输入条件化的阈值门控(Threshold Gating, TG)同样可作为实现非线性的通用原语。我们证明,标准激活函数——无论是分段线性(ReLU、PReLU、Hardtanh)还是平滑型(SiLU、Sigmoid、Tanh、GELU)——均可视为单一TG原语的特例。对于Softmax,我们通过其等价的逐元素Sigmoid形式实现了精确的TG转换。进一步验证表明,将预训练的CNN、Transformer及循环网络中的激活替换为TG后,无需重新训练即可保持模型性能。此外,基于TG的训练方法在模型压缩、性能和训练时长上均取得提升。我们还提出了‘最小分支定理’,关联了该原语所需最小分支数与深层网络可训练性的关系。在硬件层面,TG在模拟存内计算系统中可映射为统一实现,有效缓解了模拟-数字转换器(ADC/DAC)带来的功耗与面积瓶颈。
原文摘要 · Abstract (English)
Activation functions are considered an essential primitive for neural nonlinearity, i.e., they enable neural networks to serve as universal approximators. In this paper, we show that this nonlinearity can also be achieved by input-conditioned threshold gating through branches as a universal primitive. We demonstrate that standard activations -- whether piecewise-linear (ReLU, PReLU, Hardtanh) or smooth (SiLU, Sigmoid, Tanh, GELU) -- are in fact instances of a single Threshold Gating (TG) primitive. For softmax, we show that it admits an exact TG conversion via its equivalent per-element Sigmoid form. We then validate these equivalences by converting pretrained networks across CNNs, transformer-based models, and recurrent architectures, preserving model performance without requiring retraining. Threshold Gating also enables training from scratch that goes beyond replacing existing activations, enabling gains in model compression, performance, and shorter training. We also propose a 'Minimal Branch Theorem' which relates the minimum number of required branches in our primitive to the trainability of general deep neural networks. In terms of hardware implementation, TG maps to a unified implementation in the case of analog in-memory systems, addressing the bottleneck of analog-to-digital and digital-to-analog converters (ADC/DAC) that is known to significantly impact power consumption and on-chip area.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。