用全息缩减表示重构自注意力
Recasting Self-Attention with Holographic Reduced Representations
AI总结:
本文提出 Hrrformer,利用全息缩减表示重构自注意力,将复杂度降至近线性,在恶意软件长序列分类上首次实现可行 Transformer 训练,并在 LRA 基准上以更少轮数达到接近最先进精度。
摘要:
近年来,自注意力已成为多个领域中序列建模的主导范式。然而,在序列长度非常长的领域中,$\mathcal{O}(T^2)$ 的内存和 $\mathcal{O}(T^2 H)$ 的计算成本可能使 Transformer 无法使用。受恶意软件检测问题的驱动——其中 $T \geq 100,000$ 的序列长度是深度学习的障碍——我们使用全息缩减表示(Holographic Reduced Representations, HRR)的神经符号方法重构自注意力。通过这样做,我们执行与标准自注意力相同的高层策略:一组查询与一组键进行匹配,并为每个键返回值的加权响应。以“Hrrformer”的形式实现后,我们获得了多项优势,包括 $\mathcal{O}(T H \log H)$ 的时间复杂度、$\mathcal{O}(T H)$ 的空间复杂度,以及少 $10\times$ 的训练轮数即可收敛。尽管如此,Hrrformer 在 LRA 基准上达到了接近最先进的准确率,并且我们能够仅用单层进行学习。综合来看,这些优势使我们的 Hrrformer 成为首个适用于此类长恶意软件分类序列的可行 Transformer,并且在 Long Range Arena 基准上的训练速度最高可快 $280\times$。代码可在 \url{https://github.com/NeuromorphicComputationResearchProgram/Hrrformer} 获取。
英文摘要:
In recent years, self-attention has become the dominant paradigm for sequence modeling in a variety of domains. However, in domains with very long sequence lengths the $\mathcal{O}(T^2)$ memory and $\mathcal{O}(T^2 H)$ compute costs can make using transformers infeasible. Motivated by problems in malware detection, where sequence lengths of $T \geq 100,000$ are a roadblock to deep learning, we re-cast self-attention using the neuro-symbolic approach of Holographic Reduced Representations (HRR). In doing so we perform the same high-level strategy of the standard self-attention: a set of queries matching against a set of keys, and returning a weighted response of the values for each key. Implemented as a ``Hrrformer'' we obtain several benefits including $\mathcal{O}(T H \log H)$ time complexity, $\mathcal{O}(T H)$ space complexity, and convergence in $10\times$ fewer epochs. Nevertheless, the Hrrformer achieves near state-of-the-art accuracy on LRA benchmarks and we are able to learn with just a single layer. Combined, these benefits make our Hrrformer the first viable Transformer for such long malware classification sequences and up to $280\times$ faster to train on the Long Range Arena benchmark. Code is available at \url{https://github.com/NeuromorphicComputationResearchProgram/Hrrformer}
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。