arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2310.02041cs.LG
收藏

The Inhibitor:面向环面全同态加密下高效Transformer的基于ReLU与加法的注意力机制

The Inhibitor: ReLU and Addition-Based Attention for Efficient Transformers under Fully Homomorphic Encryption on the Torus

Rickard Brännvall, Andrei Stoian

AI总结:

该研究提出基于ReLU与加法的注意力机制替代传统点积Softmax注意力,提升量化Transformer效率,在四项基准任务上性能相当,且明文与加密场景下均显著节省计算量,有望支撑同态加密下的隐私保护AI应用。

摘要:

为提升量化Transformer的计算效率,我们用仅涉及加法与ReLU激活的替代机制,替换了基于点积与Softmax的注意力。该机制规避了矩阵乘法常需的双精度扩展,省去了成本高昂的Softmax计算,同时保留了传统点积注意力的大部分核心功能。它可实现更高效的执行,能在资源受限硬件或同态加密等另类算术系统上支持更大规模的量化Transformer模型。在四项常见基准任务上的训练实验显示,其测试集预测得分与采用点积注意力的传统Transformer相当。我们的缩放实验还表明,无论在明文还是加密状态下,该机制都能显著节省计算量。我们尤其认为,本文研究的基于ReLU与加法的注意力机制,可通过避免加密变量的高成本乘法,支撑同态加密下的隐私保护AI应用。

英文摘要:

To enhance the computational efficiency of quantized Transformers, we replace the dot-product and Softmax-based attention with an alternative mechanism involving addition and ReLU activation only. This side-steps the expansion to double precision often required by matrix multiplication and avoids costly Softmax evaluations but maintains much of the core functionality of conventional dot-product attention. It can enable more efficient execution and support larger quantized Transformer models on resource-constrained hardware or alternative arithmetic systems like homomorphic encryption. Training experiments on four common benchmark tasks show test set prediction scores comparable to those of conventional Transformers with dot-product attention. Our scaling experiments also suggest significant computational savings, both in plaintext and under encryption. In particular, we believe that the ReLU and addition-based attention mechanism examined in this paper may enable privacy-preserving AI applications operating under homomorphic encryption by avoiding the costly multiplication of encrypted variables.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑