Table of Contents
Fetching ...

Towards Sampling Data Structures for Tensor Products in Turnstile Streams

Zhao Song, Shenghao Xie, Samson Zhou

TL;DR

This work tackles the computational bottleneck of attention in large-scale models by introducing attention samplers that identify and sample the most informative coordinates in the attention computation. It formalizes an attention sampler based on a generalized distribution over coordinates, connects linear attention to a tensor-product formulation via $A = A_1 \otimes A_2$ and $x = \operatorname{vec}(X)$, and develops streaming algorithms with space/update guarantees. The paper establishes a hardness result for softmax attention via an $\Omega(n)$ space lower bound and provides upper bounds for $\ell_2$-based samplers under various streaming update scenarios, including the tensor-version problem with $A_1 \otimes A_2$. Together, these results offer a principled, scalable framework for efficient streaming attention and sparse-attention schemes with potential applications in streaming LLMs and real-time inference. The findings advance practical subquadratic attention methods by balancing accuracy, space, and update-efficiency while connecting to rich streams of sketching and sampling literature.

Abstract

This paper studies the computational challenges of large-scale attention-based models in artificial intelligence by utilizing importance sampling methods in the streaming setting. Inspired by the classical definition of the $\ell_2$ sampler and the recent progress of the attention scheme in Large Language Models (LLMs), we propose the definition of the attention sampler. Our approach significantly reduces the computational burden of traditional attention mechanisms. We analyze the effectiveness of the attention sampler from a theoretical perspective, including space and update time. Additionally, our framework exhibits scalability and broad applicability across various model architectures and domains.

Towards Sampling Data Structures for Tensor Products in Turnstile Streams

TL;DR

This work tackles the computational bottleneck of attention in large-scale models by introducing attention samplers that identify and sample the most informative coordinates in the attention computation. It formalizes an attention sampler based on a generalized distribution over coordinates, connects linear attention to a tensor-product formulation via and , and develops streaming algorithms with space/update guarantees. The paper establishes a hardness result for softmax attention via an space lower bound and provides upper bounds for -based samplers under various streaming update scenarios, including the tensor-version problem with . Together, these results offer a principled, scalable framework for efficient streaming attention and sparse-attention schemes with potential applications in streaming LLMs and real-time inference. The findings advance practical subquadratic attention methods by balancing accuracy, space, and update-efficiency while connecting to rich streams of sketching and sampling literature.

Abstract

This paper studies the computational challenges of large-scale attention-based models in artificial intelligence by utilizing importance sampling methods in the streaming setting. Inspired by the classical definition of the sampler and the recent progress of the attention scheme in Large Language Models (LLMs), we propose the definition of the attention sampler. Our approach significantly reduces the computational burden of traditional attention mechanisms. We analyze the effectiveness of the attention sampler from a theoretical perspective, including space and update time. Additionally, our framework exhibits scalability and broad applicability across various model architectures and domains.

Paper Structure

This paper contains 23 sections, 12 theorems, 11 equations, 2 algorithms.

Key Result

Theorem 4.3

Any protocol that solves the set-disjointness problem $\mathsf{SetDisj}_n$ with probability at least $\frac{3}{4}$ requires $\Omega(n)$ bits of total communication.

Theorems & Definitions (31)

  • Definition 1.1: Attention sampler
  • Definition 3.1: TensorSparse, see Definition 7.6 in sxz22
  • Definition 4.1: Exponential sampler
  • Definition 4.2
  • Theorem 4.3: KalyanasundaramS92Razborov92Bar-YossefJKS04
  • Theorem 4.4
  • proof
  • Definition 5.1
  • Definition 5.2: Updating $A$ and fixed $x$
  • Theorem 5.3
  • ...and 21 more