paper-with-me

홈 › Papers

Conv-Basis: A New Paradigm for Efficient Attention Inference and Gradient Computation in Transformers

2024-05-08 · YIngyu Liang, Heshan Liu, Zhenmei Shi, Zhao Song, Zhuoyan Xu, Junze Yin

The self-attention mechanism is the key to the success of transformers in recent Large Language Models (LLMs). However, the quadratic computational cost $O(n^2)$ in the input sequence length $n$ is a notorious obstacle for further improvement and scalability in longer contexts. In this work, we leverage the convolution-like structure of attention matrices to develop an efficient approximation method for attention computation using convolution matrices. We propose a $\mathsf{conv}$ basis system, analogous to the rank basis, and show that any lower triangular matrix can always be decomposed as a sum of structured convolution matrices in this basis. We then design a fast algorithm to approximate the attention matrix via a sum of such $k$ convolution matrices. This allows us to compute the attention {\it inference} via Fast Fourier Transforms (FFT) in $O(knd \log n)$ time, where $d$ is the hidden dimension, and thus achieve almost linear time $n^{1+o(1)}$ in the practical scenario where $kd = n^{o(1)}$. Furthermore, the attention {\it training forward} and {\it backward gradient} can be computed in $n^{1+o(1)}$ as well. We provide theoretical guarantees on the run time and approximation error and conduct preliminary experiments to evaluate its effectiveness. We hope our new paradigm for accelerating attention computation in transformer models can help their application to longer contexts.

📄 PDF Abstract BibTeX arXiv:2405.05219

Code (0)

등록된 구현이 없습니다.

Methods 이 논문이 사용한 방법론

Convolution A convolution is a type of matrix operation, consisting of a kernel, a small matrix of weights, that slides over input data performing element-wise multiplication with the…

Similar Papers 제목 키워드 기반

STGBD-Net: Spatio-temporal Gradient Basis Decomposition Network for Infrared Small Target Detection

2025-12-03 · Chen Hu, Mingyu Zhou, Shuai Yuan, Hongbo Hu 외 arxiv

A key challenge in infrared small target detection (IRSTD) is that weak target signal responses are easily obscured by strong background clutter, frequently resulting in missed detections. While traditional gradient-base…

Computational Efficiency

Behind the Scenes of Gradient Descent: A Trajectory Analysis via Basis Function Decomposition

2022-10-01 · Jianhao Ma, Lingjun Guo, Salar Fattahi

This work analyzes the solution trajectory of gradient-based algorithms via a novel basis function decomposition. We show that, although solution trajectories of gradient-based algorithms may vary depending on the learni…

Tensor Decomposition

DSBD: Dual-Aligned Structural Basis Distillation for Graph Domain Adaptation

2026-04-03 · Yingxu Wang, Kunyu Zhang, Jiaxin Huang, Mengzhu Wang 외 arxiv

Graph domain adaptation (GDA) aims to transfer knowledge from a labeled source graph to an unlabeled target graph under distribution shifts. However, existing methods are largely feature-centric and overlook structural d…

GRAPH DOMAIN ADAPTATION

PR-NeuS: A Prior-based Residual Learning Paradigm for Fast Multi-view Neural Surface Reconstruction

2023-12-18 · Jianyao Xu, Qingshan Xu, Xinyao Liao, Wanjuan Su 외

Neural surfaces learning has shown impressive performance in multi-view surface reconstruction. However, most existing methods use large multilayer perceptrons (MLPs) to train their models from scratch, resulting in hour…

Surface Reconstruction

A stochastic gradient descent algorithm with random search directions

2025-03-25 · Eméric Gbaguidi

Stochastic coordinate descent algorithms are efficient methods in which each iterate is obtained by fixing most coordinates at their values from the current iteration, and approximately minimizing the objective with resp…