ChatPaper.aiChatPaper

SSA: Spars Sparse Attention durch Ausrichtung der Ausgaben von vollständiger und sparser Attention im Merkmalsraum

SSA: Sparse Sparse Attention by Aligning Full and Sparse Attention Outputs in Feature Space

November 25, 2025
papers.authors: Zhenyi Shen, Junru Lu, Lin Gui, Jiazheng Li, Yulan He, Di Yin, Xing Sun
cs.AI

papers.abstract

Die quadratische Komplexität von Full-Attention begrenzt die effiziente Verarbeitung langer Kontexte in großen Sprachmodellen (LLMs). Sparse-Attention reduziert diese Kosten, indem jede Query nur auf eine Teilmenge vorheriger Token zugreifen kann; jedoch führen trainingsfreie Ansätze oft zu erheblichen Leistungseinbußen. Native Sparse-Attention-Methoden (z.B. NSA, MoBA) mildern dieses Problem, weisen jedoch ein kritisches Paradoxon auf: Sie erzeugen eine geringere Attention-Sparsity als Full-Attention-Modelle, obwohl sie darauf abzielen, Full Attention anzunähern, was ihre Wirksamkeit einschränken könnte. Wir führen dieses Paradoxon auf einen Gradient-Update-Defekt zurück: Niedrigrangige Key-Value-Paare, die während des Sparse-Trainings ausgeschlossen werden, erhalten weder einen Vorwärtsbeitrag noch Rückwärtsgradienten und lernen daher nie eine angemessene Unterdrückung. Um diese Einschränkung zu überwinden, schlagen wir SSA (Sparse Sparse Attention) vor, einen einheitlichen Trainingsrahmen, der sowohl sparse als auch full Attention berücksichtigt und eine bidirektionale Anpassung auf jeder Ebene erzwingt. Dieses Design erhält den Gradientenfluss zu allen Token, während es gleichzeitig explizit fördert, dass die Sparse-Attention-Ausgaben mit ihren Full-Attention-Pendants übereinstimmen, wodurch eine stärkere Sparsity gefördert wird. Infolgedessen erzielt SSA state-of-the-art Leistung unter sowohl sparse als auch full Attention Inference über mehrere Commonsense-Benchmarks hinweg. Darüber hinaus ermöglicht SSA Modellen, sich flexibel an verschiedene Sparsity-Budgets anzupassen; die Leistung verbessert sich konsistent, wenn mehr Token zugreifen dürfen, was flexible Kompromisse zwischen Rechenaufwand und Leistung zur Inferenzzeit unterstützt. Schließlich zeigen wir, dass natives Sparse-Attention-Training überraschenderweise die Langzeitkontext-Extrapolation verbessert, indem es die Überallokation von Attention-Werten in Sink-Bereichen reduziert, wobei SSA die stärkste Extrapolationsfähigkeit demonstriert.
English
The quadratic complexity of full attention limits efficient long-context processing in large language models (LLMs). Sparse attention mitigates this cost by restricting each query to attend to a subset of previous tokens; however, training-free approaches often lead to severe performance degradation. Native sparse-attention methods (e.g., NSA, MoBA) alleviate this issue, yet exhibit a critical paradox: they produce lower attention sparsity than full-attention models, despite aiming to approximate full attention, which may constrain their effectiveness. We attribute this paradox to gradient update deficiency: low-ranked key-value pairs excluded during sparse training receive neither forward contribution nor backward gradients, and thus never learn proper suppression. To overcome this limitation, we propose SSA (Sparse Sparse Attention), a unified training framework that considers both sparse and full attention and enforces bidirectional alignment at every layer. This design preserves gradient flow to all tokens while explicitly encouraging sparse-attention outputs to align with their full-attention counterparts, thereby promoting stronger sparsity. As a result, SSA achieves state-of-the-art performance under both sparse and full attention inference across multiple commonsense benchmarks. Furthermore, SSA enables models to adapt smoothly to varying sparsity budgets; performance improves consistently as more tokens are allowed to attend, supporting flexible compute-performance trade-offs at inference time. Finally, we show that native sparse-attention training surprisingly improves long-context extrapolation by mitigating the over-allocation of attention values in sink areas, with SSA demonstrating the strongest extrapolation capability.
PDF253December 1, 2025