SKI to go Faster: Accelerating Toeplitz Neural Networks via Asymmetric Kernels
Abstract: Toeplitz Neural Networks (TNNs) (Qin et. al. 2023) are a recent sequence model with impressive results. They require O(n log n) computational complexity and O(n) relative positional encoder (RPE) multi-layer perceptron (MLP) and decay bias calls. We aim to reduce both. We first note that the RPE is a non-SPD (symmetric positive definite) kernel and the Toeplitz matrices are pseudo-Gram matrices. Further 1) the learned kernels display spiky behavior near the main diagonals with otherwise smooth behavior; 2) the RPE MLP is slow. For bidirectional models, this motivates a sparse plus low-rank Toeplitz matrix decomposition. For the sparse component's action, we do a small 1D convolution. For the low rank component, we replace the RPE MLP with linear interpolation and use asymmetric Structured Kernel Interpolation (SKI) (Wilson et. al. 2015) for O(n) complexity: we provide rigorous error analysis. For causal models, "fast" causal masking (Katharopoulos et. al. 2020) negates SKI's benefits. Working in the frequency domain, we avoid an explicit decay bias. To enforce causality, we represent the kernel via the real part of its frequency response using the RPE and compute the imaginary part via a Hilbert transform. This maintains O(n log n) complexity but achieves an absolute speedup. Modeling the frequency response directly is also competitive for bidirectional training, using one fewer FFT. We set a speed state of the art on Long Range Arena (Tay et. al. 2020) with minimal score degradation.
- Christopher TH Baker. The numerical treatment of integral equations. Oxford University Press, 1977.
- Language models are few-shot learners. Advances in neural information processing systems, 33:1877–1901, 2020.
- Matrix completion with noise. Proceedings of the IEEE, 98(6):925–936, 2010.
- Rank-sparsity incoherence for matrix decomposition. SIAM Journal on Optimization, 21(2):572–596, 2011.
- Latent variable graphical model selection via convex optimization. Ann. Stat., 40:1935–1967, 8 2012. ISSN 0090-5364. doi: 10.1214/11-AOS949. URL http://projecteuclid.org/euclid.aos/1351602527.
- Skyformer: Remodel self-attention with gaussian kernel and nyström method. Advances in Neural Information Processing Systems, 34:2122–2135, 2021.
- Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509, 2019.
- Rethinking Attention with Performers. In International Conference on Learning Representations, 2021.
- Electra: Pre-training text encoders as discriminators rather than generators. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=r1xMH1BtvB.
- Hungry hungry hippos: Towards language modeling with state space models. arXiv preprint arXiv:2212.14052, 2022.
- Simple hardware-efficient long convolutions for sequence modeling. arXiv preprint arXiv:2302.06646, 2023.
- Efficiently modeling long sequences with structured state spaces. In International Conference on Learning Representations, 2022.
- Christopher Heil. Introduction to Real Analysis, volume 280. Springer, 2019.
- An empirical analysis of compute-optimal large language model training. In Alice H. Oh, Alekh Agarwal, Danielle Belgrave, and Kyunghyun Cho, editors, Advances in Neural Information Processing Systems, 2022. URL https://openreview.net/forum?id=iBBcRUlOAPR.
- Mhenni Benghorbal (https://math.stackexchange.com/users/35472/mhenni benghorbal). How to prove error function erf is entire (i.e., analytic everywhere)? Mathematics Stack Exchange, 2017. URL https://math.stackexchange.com/q/203920. URL:https://math.stackexchange.com/q/203920 (version: 2017-04-13).
- Transformers are RNNs: Fast autoregressive transformers with linear attention. In International Conference on Machine Learning, pages 5156–5165. PMLR, 2020.
- Chordmixer: A scalable neural attention model for sequences with different length. In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=E8mzu3JbdR.
- Stable, fast and accurate: Kernelized attention with relative positional encoding. Advances in Neural Information Processing Systems, 34:22795–22807, 2021.
- Mega: Moving average equipped gated attention. In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=qNLe3iq2El.
- Jonathan Mei and José M F Moura. SILVar: Single Index Latent Variable Models. IEEE Transactions on Signal Processing, 66:2790 – 2803, 3 2018.
- Pointer Sentinel Mixture Models. In International Conference on Learning Representations, 2016.
- Matrix compression using the Nyström method. Intelligent Data Analysis, 20(5):997–1019, 2016.
- Evert J Nyström. Über die praktische auflösung von integralgleichungen mit anwendungen auf randwertaufgaben. Acta Mathematica, 54(1):185–204, 1930.
- Discrete Time Signal Processing. Prentice-Hall, 2010.
- Pytorch: An imperative style, high-performance deep learning library. Advances in neural information processing systems, 32, 2019.
- Random Feature Attention. In International Conference on Learning Representations, 2021.
- Hyena Hierarchy: Towards Larger Convolutional Language Models. arXiv preprint arXiv:2302.10866, 2023.
- Introduction to digital signal processing. Prentice Hall Professional Technical Reference, 1988.
- Toeplitz neural network for sequence modeling. In The Eleventh International Conference on Learning Representations, 2023.
- Random features for large-scale kernel machines. Advances in neural information processing systems, 20:1177–1184, 2007.
- Guaranteed minimum-rank solutions of linear matrix equations via nuclear norm minimization. SIAM review, 52(3):471–501, 2010.
- Ckconv: Continuous kernel convolution for sequential data. In International Conference on Learning Representations, 2022.
- Noam Shazeer. Glu variants improve transformer. arXiv preprint arXiv:2002.05202, 2020.
- Simplified state space layers for sequence modeling. In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=Ai8Hw3AXqks.
- Long Range Arena: A Benchmark for Efficient Transformers. In International Conference on Learning Representations, 2020.
- Efficient transformers: A survey. ACM Computing Surveys, 55(6):1–28, 2022.
- Attention is all you need. Advances in neural information processing systems, 30, 2017.
- Glue: A multi-task benchmark and analysis platform for natural language understanding. In International Conference on Learning Representations, 2019.
- Kernel interpolation for scalable structured Gaussian processes (KISS-GP). In International conference on machine learning, pages 1775–1784. PMLR, 2015.
- Jeffrey Wong. Math 563 lecture notes, polynomial interpolation: the fundamentals, 2020. URL:https://services.math.duke.edu/Â jtwong/math563-2020/lectures/Lec1-polyinterp.pdf.
- Nyströmformer: A nyström-based algorithm for approximating self-attention. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 14138–14148, 2021.
- Big Bird: Transformers for Longer Sequences. Advances in neural information processing systems, 33:17283–17297, 2020.
- Teng Zhang and Yi Yang. Robust PCA by manifold optimization. The Journal of Machine Learning Research, 19(1):3101–3139, 2018.
- Godec: Randomized low-rank & sparse matrix decomposition in noisy case. In Proceedings of the 28th International Conference on Machine Learning, 2011.
Paper Prompts
Sign up for free to create and run prompts on this paper using GPT-5.
Top Community Prompts
Collections
Sign up for free to add this paper to one or more collections.