特徴の疎性による注意のスケーリング

arXiv cs.AI / 2026/3/25

💬 オピニオンIdeas & Deep AnalysisModels & Research

要点

  • 本論文は、クエリ/キーを「特徴の疎性」軸に沿った k-疎なコードとして表現することで、Transformer の自己注意コストを削減する Sparse Feature Attention(SFA)を提案する。これは、一般的な系列軸での疎化手法とは異なる。
  • SFA により、注意の計算複雑性を Θ(n^2 d) から Θ(n^2 k^2/d) に削減できると見積もりつつ、精度に必要な表現力の維持を目指す。
  • 大規模に効率よく実行するため、著者らは FlashAttention を拡張した IO-aware カーネルである FlashSFA を提案し、密なスコア行列を構築せずに疎な重なり部分に対して直接注意計算を行う。
  • GPT-2 および Qwen3 の事前学習に対する実験では、最大 2.5× の高速化、ならびに FLOPs および KV キャッシュ使用量のほぼ 50% 削減を報告しており、長文コンテキストでの検索性能は維持または向上している。
  • ベンチマークでは、SFA が長いコンテキストに対する頑健性を維持し、短い埋め込みベースラインよりも優れていることが示されており、特徴レベルの疎性が、品質劣化を最小限にしつつ長文コンテキストのスケーリングを補完するアプローチとして位置付けられる。

Abstract

Scaling Transformers to ultra-long contexts is bottlenecked by the O(n^2 d) cost of self-attention. Existing methods reduce this cost along the sequence axis through local windows, kernel approximations, or token-level sparsity, but these approaches consistently degrade accuracy. In this paper, we instead explore an orthogonal axis: feature sparsity. We propose Sparse Feature Attention (SFA), where queries and keys are represented as k-sparse codes that preserve high-dimensional expressivity while reducing the cost of attention from \Theta(n^2 d) to \Theta(n^2 k^2/d). To make this efficient at scale, we introduce FlashSFA, an IO-aware kernel that extends FlashAttention to operate directly on sparse overlaps without materializing dense score matrices. Across GPT-2 and Qwen3 pretraining, SFA matches dense baselines while improving speed by up to 2.5\times and reducing FLOPs and KV-cache by nearly 50\%. On synthetic and downstream benchmarks, SFA preserves retrieval accuracy and robustness at long contexts, outperforming short-embedding baselines that collapse feature diversity. These results establish feature-level sparsity as a complementary and underexplored axis for efficient attention, enabling Transformers to scale to orders-of-magnitude longer contexts with minimal quality loss. Code is available at https://github.com/YannX1e/Sparse-Feature-Attention.