Accelerating Toeplitz Neural Network with Constant-time Inference Complexity

Zhen Qin, Yiran Zhong


Abstract
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.
Anthology ID:
2023.emnlp-main.750
Volume:
Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing
Month:
December
Year:
2023
Address:
Singapore
Editors:
Houda Bouamor, Juan Pino, Kalika Bali
Venue:
EMNLP
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
12206–12215
Language:
URL:
https://aclanthology.org/2023.emnlp-main.750
DOI:
10.18653/v1/2023.emnlp-main.750
Bibkey:
Cite (ACL):
Zhen Qin and Yiran Zhong. 2023. Accelerating Toeplitz Neural Network with Constant-time Inference Complexity. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pages 12206–12215, Singapore. Association for Computational Linguistics.
Cite (Informal):
Accelerating Toeplitz Neural Network with Constant-time Inference Complexity (Qin & Zhong, EMNLP 2023)
Copy Citation:
PDF:
https://aclanthology.org/2023.emnlp-main.750.pdf
Video:
 https://aclanthology.org/2023.emnlp-main.750.mp4