arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2311.08756cs.CL
收藏

加速Toeplitz神经网络,实现恒定推理复杂度

Accelerating Toeplitz Neural Network with Constant-time Inference Complexity

OpenNLPLab, Shanghai Artificial Intelligence Laboratory(上海人工智能实验室 OpenNLPLab)

Zhen Qin, Yiran Zhong

AI总结:

本文提出一种将Toeplitz神经网络在推理时转换为状态空间模型的闭式方法,利用离散傅里叶变换求解Vandermonde系统,无需训练且数值稳定,使TNNs获得恒定推理复杂度,在语言建模任务上验证了有效性。

摘要:

Toeplitz神经网络(TNNs)在各种序列建模任务中表现出色。它们优于常用的基于Transformer的模型,同时享有对数线性空间-时间复杂度。另一方面,状态空间模型(SSMs)在语言建模中性能低于TNNs,但具有恒定推理复杂度的优势。在本文中,我们旨在通过将TNNs在推理时转换为SSMs,结合TNNs和SSMs的优势,从而使TNNs达到与SSMs相同的恒定推理复杂度。为此,我们将转换过程表述为一个优化问题,并提供闭式解。我们展示了如何将目标方程转化为Vandermonde线性系统问题,该问题可使用离散傅里叶变换(DFT)高效求解。值得注意的是,我们的方法无需训练,且保持数值稳定性。它也可应用于任何基于LongConv的模型。为评估其有效性,我们在各种设置下的语言建模任务上进行了广泛实验。此外,我们将我们的方法与其它梯度下降解决方案进行比较,突出我们方法优越的数值稳定性。源代码可在https://github.com/OpenNLPLab/ETSC-Exact-Toeplitz-to-SSM-Conversion获取。

英文摘要:

Toeplitz Neural Networks (TNNs) have exhibited outstanding performance in various sequence modeling tasks. They outperform commonly used Transformer-based models while benefiting from log-linear space-time complexities. On the other hand, State Space Models (SSMs) achieve lower performance than TNNs in language modeling but offer the advantage of constant inference complexity. In this paper, we aim to combine the strengths of TNNs and SSMs by converting TNNs to SSMs during inference, thereby enabling TNNs to achieve the same constant inference complexities as SSMs. To accomplish this, we formulate the conversion process as an optimization problem and provide a closed-form solution. We demonstrate how to transform the target equation into a Vandermonde linear system problem, which can be efficiently solved using the Discrete Fourier Transform (DFT). Notably, our method requires no training and maintains numerical stability. It can be also applied to any LongConv-based model. To assess its effectiveness, we conduct extensive experiments on language modeling tasks across various settings. Additionally, we compare our method to other gradient-descent solutions, highlighting the superior numerical stability of our approach. The source code is available at https://github.com/OpenNLPLab/ETSC-Exact-Toeplitz-to-SSM-Conversion.

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

↑