Skip to main content
QUICK REVIEW

[Paper Review] SAC: Accelerating and Structuring Self-Attention via Sparse Adaptive Connection

Xiaoya Li, Yuxian Meng|arXiv (Cornell University)|Jan 1, 2020
Advanced Graph Neural NetworksComputer Science1 citations
TL;DR

SAC introduces a sparse, learnable attention mechanism that models input sequences as dynamic graphs, where attention is computed only between learned, salient node pairs. By adaptively constructing attention edges, SAC reduces quadratic complexity to linear or sublinear cost, achieving state-of-the-art performance across NLP, graph learning, and vision tasks with significantly reduced memory usage.

ABSTRACT

While the self-attention mechanism has been widely used in a wide variety of tasks, it has the unfortunate property of a quadratic cost with respect to the input length, which makes it difficult to deal with long inputs. In this paper, we present a method for accelerating and structuring self-attentions: Sparse Adaptive Connection (SAC). In SAC, we regard the input sequence as a graph and attention operations are performed between linked nodes. In contrast with previous self-attention models with pre-defined structures (edges), the model learns to construct attention edges to improve task-specific performances. In this way, the model is able to select the most salient nodes and reduce the quadratic complexity regardless of the sequence length. Based on SAC, we show that previous variants of self-attention models are its special cases. Through extensive experiments on neural machine translation, language modeling, graph representation learning and image classification, we demonstrate SAC is competitive with state-of-the-art models while significantly reducing memory cost.

Motivation & Objective

  • To address the quadratic computational and memory cost of standard self-attention with respect to input length.
  • To improve model efficiency without sacrificing performance on long sequences.
  • To enable task-specific, dynamic attention structure learning instead of relying on fixed or predefined attention patterns.
  • To unify existing self-attention variants as special cases of a more general, learnable sparse attention framework.
  • To reduce memory cost significantly while maintaining competitive performance across diverse tasks.

Proposed method

  • Treat the input sequence as a graph where tokens are nodes and attention is computed only between connected (linked) nodes.
  • Learn attention edges end-to-end during training using a differentiable mechanism, allowing the model to select salient node pairs dynamically.
  • Apply sparse connectivity by restricting attention computation to only the most relevant node pairs, reducing FLOPs and memory usage.
  • Formulate the attention mechanism such that the adjacency matrix of the graph is a differentiable, trainable parameter.
  • Integrate the sparse graph attention into transformer-like architectures, enabling efficient inference on long sequences.
  • Demonstrate that standard self-attention and other sparse variants are special cases of SAC under specific edge configurations.

Experimental results

Research questions

  • RQ1Can a learnable, sparse attention mechanism reduce the quadratic complexity of self-attention while maintaining or improving performance?
  • RQ2How does the performance of SAC compare to standard and sparse self-attention baselines across diverse tasks?
  • RQ3To what extent can SAC reduce memory and FLOP consumption without sacrificing model accuracy?
  • RQ4Can SAC be interpreted as a generalization of existing self-attention mechanisms, including sparse and structured variants?
  • RQ5Does the dynamic edge learning in SAC lead to more interpretable or meaningful attention patterns?

Key findings

  • SAC reduces the computational and memory cost of self-attention from quadratic to sublinear or linear complexity, regardless of input length.
  • The model achieves competitive performance compared to state-of-the-art models on neural machine translation, language modeling, graph representation learning, and image classification.
  • SAC significantly reduces memory consumption, enabling efficient training and inference on long sequences.
  • Previous self-attention variants, including standard and sparse attention, are shown to be special cases of SAC under fixed or predefined edge structures.
  • The learned attention edges in SAC are task-specific and adaptively select the most relevant tokens, improving efficiency and performance.
  • Extensive experiments confirm that SAC maintains strong generalization across diverse machine learning tasks while scaling efficiently.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.